Forums > MaxMSP

How to divide multislider in UNequal, non-integer increments

January 5, 2010 | 12:31 am

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

– Pasted Max Patch, click to expand. –

January 5, 2010 | 1:20 am

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.

lh

– Pasted Max Patch, click to expand. –

January 6, 2010 | 7:04 pm

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.

– Pasted Max Patch, click to expand. –

January 6, 2010 | 7:11 pm

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

lh


January 6, 2010 | 7:32 pm

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


January 6, 2010 | 8:08 pm

Try this.

lh

– Pasted Max Patch, click to expand. –

January 6, 2010 | 9:51 pm

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.


January 7, 2010 | 4:38 am

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


January 7, 2010 | 4:48 am

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


January 7, 2010 | 4:59 am

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


February 10, 2010 | 4:05 am

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:

– Pasted Max Patch, click to expand. –

Thanks again!


February 10, 2010 | 9:30 am

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


February 10, 2010 | 10:26 pm

My man, thanks!

jeremy


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