## dial problem, please help

Jul 21, 2009 at 9:44am

# dial problem, please help

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. –
#44815
Jul 21, 2009 at 12:57pm

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 [*~].

#161321
Jul 21, 2009 at 2:17pm

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,
Tim

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

– Pasted Max Patch, click to expand. –
#161322
Jul 21, 2009 at 6:00pm

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.

lh

#161323
Jul 21, 2009 at 7:04pm

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?

#161324
Jul 21, 2009 at 9:39pm

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.

lh

– Pasted Max Patch, click to expand. –
#161325
Jul 22, 2009 at 9:05am

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

Tim

#161326

You must be logged in to reply to this topic.