How to divide multislider in UNequal, non-integer increments

Jiegel's icon

I want to use multislider to control a simple frequency sequencer. I prefer multislider for this so I can make a bunch of presets.

Anyway, I want there to be 12 sliders, ranging from 1 to 2. I also want each slider to have only 12 possible positions, which I'd like to define manually. Is this possible to do? Check this out...this shows a 12-slider multislider with a message sending it the 12 increments I would like. Please, if there is a way to make it so moving the sliders up and down will just move between these increments, please let me know!

Thanks,
Jeremy

Max Patch
Copy patch and select New From Clipboard in Max.

Luke Hall's icon

If you don't mind the visual effect of the [multislider] not quite matching up to the real values you could try setting them to integer values and using [vexpr] to do the conversion. Perhaps something like this example.

Max Patch
Copy patch and select New From Clipboard in Max.

lh

Jiegel's icon

Awesome that is a start. So I want to use the output of the multislider as a multiplier for another number (carrier freq) which will be in another number box...

The intervals contained in the message boxes there represent the intervals between notes in an equal tempered octave. Basically I want to make a little note sequencer/arppegiator with controls of carrier frequency (for FM), and tempo. I already have the rest of the machine built. I just want to be able to basically make any 12-note sequence I want, and have the output of the multislider be one of the interval ratios listed in the message box (that way it can be multiplied with the carrier frequency and the note arrangements will be "in key" regardless of what originating frequency the user chooses.

Thanks for any help!

so if you look here, i want the interval multiplier box to be receiving the numbers in the 1, 1.059...etc series.

Max Patch
Copy patch and select New From Clipboard in Max.

Luke Hall's icon

Use the equation in an [expr] rather than a [vexpr] so [expr (pow(2.,(($f1-1.)/12.)))] instead.

lh

Jiegel's icon

Ok...but taking the output of the exp object and inputting it to a flonum doesn't do anything...

Luke Hall's icon

Try this.

Max Patch
Copy patch and select New From Clipboard in Max.

lh

Jiegel's icon

That is better, thank you. So now the flonum moves with the numbers, but the multiplier isn't really doing anything...see? basically the number on the right input of the multiplier just goes through.

Jiegel's icon

Really can't figure out why the multiplier isn't doing anything. Sorry to be such a goon but this is my last question.

Luke Hall's icon

You need to give the [* ] object a float argument otherwise it will truncate everything it receives to an integer, basically ignoring everything after the decimal point. Try replacing it with [* 1.] and remember to use a [flonum] instead of a [number] afterwards.

lh

Jiegel's icon

Luke Hall, I owe thee a beverage. Many thanks.

Jiegel's icon

Hey Luke Hall! Got another quick question about this thing when you have a sec! I'm trying to increase the range to two octaves, so now i have a total of 25 notes instead of 12. Do I need to change anything with the code you gave me? I only ask because I tried just changing the message box to contain all 25 intervals, but it's not coming out right. It's basically just playing each interval twice in a row.

The new intervals I want are:

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks again!

Luke Hall's icon

In the [vexpr] objects you need to change the equation back to this: [vexpr (((log10($f1))/(log10(2.)))*12.)+1.] and [vexpr (pow(2.,(($f1-1.)/12.)))]. You had changed the "2" to a "3" which was causing problems. You probably also want to change your multislider back to integer mode.

lh

Jiegel's icon

My man, thanks!

jeremy