How to divide multislider in UNequal, non-integer increments

Jan 5, 2010 at 12:31am

How to divide multislider in UNequal, non-integer increments

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. –
#47497
Jan 5, 2010 at 1:20am

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. –
#170891
Jan 6, 2010 at 7:04pm

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. –
#170892
Jan 6, 2010 at 7:11pm

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

lh

#170893
Jan 6, 2010 at 7:32pm

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

#170894
Jan 6, 2010 at 8:08pm

Try this.

lh

– Pasted Max Patch, click to expand. –
#170895
Jan 6, 2010 at 9:51pm

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.

#170896
Jan 7, 2010 at 4:38am

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

#170897
Jan 7, 2010 at 4:48am

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

#170898
Jan 7, 2010 at 4:59am

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

#170899
Feb 10, 2010 at 4:05am

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!

#170900
Feb 10, 2010 at 9:30am

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

#170901
Feb 10, 2010 at 10:26pm

My man, thanks!

jeremy

#170902

You must be logged in to reply to this topic.