Forums > MaxMSP

dial problem, please help

Jul 21 2009 | 9:44 am

I am trying to get a dial to control volume rather than the gain slider. I am using a basic float linear dial + smoothing ramp + *~ and it is giving HF crackling.

Here’s the gist of the problem – I can’t find anything of it’s like in the forum. Not the end of the world but hope you can help.

— Pasted Max Patch, click to expand. —
Jul 21 2009 | 12:57 pm

If you change [line 0.] to [line~] i will get rid of the crackling.

Also, if you want the dial to have the same smoothing as a default gain object, you would use [$1 10] in the message box, although that still leaves some irregularities if you move the dial quickly.

If you check out the help file on gain~ it states that a value of 128 is equal to multiplying by 1. using [*~].

Jul 21 2009 | 2:17 pm

Ahhh, yes of course! thanks a lot

– I have found with using the scale object as well I can get what I’m after.

BTW – could you, or anyone else please recommend any good books/sources about maths for MAX? Specifically signal manipulation, as I could really do with a better understanding of exponentials and parabolas etc.

Thanks Tim,

(Here’s the useful little badger if anyone wants it.)

— Pasted Max Patch, click to expand. —
Jul 21 2009 | 6:00 pm

If you’re after the exact same scaling as the [gain~] object then try replacing your [scale] object with this:

[expr pow(10.,((($i1-128)*0.6)/20.))]

The maths is all shown in the [gain~] help file. The only thing you want to be careful with is that this method never reaches zero so you might want to put a [sel 0] to trigger absolute silence.


Jul 21 2009 | 7:04 pm

Thanks, this is useful – I’ll try a/b testing them.

How is the sel connected to trigger 0 when it never gets to 0?

Jul 21 2009 | 9:39 pm

Trigger it from the [dial] output rather than the [expr] output, remember to send it through the [line] object too. Here’s a patch to demonstrate. Also remember that sending the [gain~] object a value of 128 will output a gain of 1, to show this I’ve made the [slider] range 0 to 128 rather than 0 – 127.


— Pasted Max Patch, click to expand. —
Jul 22 2009 | 9:05 am

that’s superb, it’s always really useful to see patching examples of best practice – thanks again.


Viewing 7 posts - 1 through 7 (of 7 total)

Forums > MaxMSP