shift operators in max…

Sep 28, 2008 at 7:24pm

shift operators in max…

hi

for many plug-ins (but not only for plugins) I used to use the
“shift” operators in order to
a) have a bigger/better resolution
b) have a”coarse” and “fine-tune” control

(I guess this is what is called 8-bits versus XX-bits , don’t know
how many, in any case with this method I have 1144 values instead of
128)

Now I am switching to a new controller, sending OSC values between
0.-1. (it is touchOSC on an iPod Touch) – so teh number of
points/values are “infinite” (or at least more than 128, I don’t know
how many actually) but I would like to keep the same Coarse/fine-tune
system

I came with a patch which replicates what “shift operators” does
(but in floats), but stil I am wondering if, in this case, I should
not think of a very different method…. (I guess the < < 3 is very
MIDI-related, so instead of using * 8. I could do * 9. – the total
range would be a more human-friendly 0-10, etc…)

any advice welcome

here is the small patch , in max4.6

many thanks

kasper

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 341 266 81 196617 + 0.;
#P newex 393 188 29 196617 t b f;
#P user multiSlider 393 97 36 80 0. 1. 1 2681 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P flonum 341 300 69 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 341 234 29 196617 * 8.;
#P user multiSlider 341 96 36 80 0. 1. 1 2681 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P number 170 290 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user uslider 226 96 42 70 128 1 0 0;
#P user uslider 170 96 42 70 128 1 0 0;
#P newex 170 214 27 196617 i 0;
#P newex 226 187 27 196617 t b i;
#P newex 170 256 83 196617 +;
#P newex 170 235 29 196617 < < 3;
#P comment 204 215 45 196617 0-1143;
#P connect 8 0 9 0;
#P connect 12 0 9 0;
#P connect 9 0 13 0;
#P connect 12 1 13 1;
#P connect 13 0 10 0;
#P connect 11 0 12 0;
#P connect 2 0 7 0;
#P connect 6 0 3 0;
#P connect 5 0 4 0;
#P fasten 3 0 4 0 231 210 175 210;
#P connect 4 0 1 0;
#P connect 1 0 2 0;
#P connect 3 1 2 1;
#P window clipboard copycount 14;

#40047
Sep 28, 2008 at 9:29pm

I also really like the TouchOsc. Cool stuff!

Maybe if you use pairs of sliders (like using 4 as 2 sets of 2 in the Simple Mode), then one could be for Coarse and one for Fine. Just scale the 0. 1. range to an appropriate Coarse range (maybe 40-2000 for frequency?) and the second one to something like -20. 20., then add the results? Alternatively, the Fine one could be (say) 0.9 to 1.1, then you multiply the Coarse by this. Then the values would always scale to the same percentage regardless of the range of the Coarse. I’d probably go that route.

(scale 0. 1. 40 2000) (scale 0. 1. 0.9 1.0) etc. applied to the incoming slider or XY data. No bit-shifting needed.

–CJ

#141379
Sep 29, 2008 at 7:26am

>
>Maybe if you use pairs of sliders (like using 4 as 2 sets of 2 in
>the Simple Mode), then one could be for Coarse and one for Fine.
>Just scale the 0. 1. range to an appropriate Coarse range (maybe
>40-2000 for frequency?) and the second one to something like -20.
>20., then add the results? Alternatively, the Fine one could be
>(say) 0.9 to 1.1, then you multiply the Coarse by this. Then the
>values would always scale to the same percentage regardless of the
>range of the Coarse. I’d probably go that route.
>
>(scale 0. 1. 40 2000) (scale 0. 1. 0.9 1.0) etc. applied to the
>incoming slider or XY data. No bit-shifting needed.

hi

this is certainly quite close to the patch i did send – however there
is more in the “bitshift” system than only a coarse/fine:

the nice thing with this bitshift system is that you have ALL values
between 0 and 1144 – with the sytem of 40-2000, on an iPod (which is
a small surface) I doubt if you can have ALL frequencies, even with
-20/+20

of course one has to wonder what could “all frequencies” mean – once
we talk in frequencies (not notes) andin floats

What I do for the moment is to multiply by 9. the first slider, and
leaving the second one in the 0-1 resolution, it gives me the range
0.-10. (in floats) and what i feel is a good resolution. And “all
values” are covered

but if someone has a better idea, I would be very willing to hear about it

best

kasper

#141380
Sep 29, 2008 at 9:35am

Kasper T Toeplitz schrieb:
> of course one has to wonder what could “all frequencies” mean – once we
> talk in frequencies (not notes) andin floats

If you deal with frequencies, I’d always want a relative resolution,
that is actually notes and cent. You will always have a resolution
restriction to the number of pixels involved. That will be true for Max
or any pixel based display. I’d interpret the sliders as notes/cent and
then translate them to frequencies with mtof. That way you always have a
resolution which corresponds to the ear…

Btw. a shift by 3 is exactly the same as a multiplication by 8…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#141381
Sep 29, 2008 at 4:38pm

>
>
>Btw. a shift by 3 is exactly the same as a multiplication by 8…
>

yeah, I know ( or learned) – that’s why on my included patch i did *
8. – but on the iPOD (or osc) * 9. seemed more logical

thanks

kasper

#141382

You must be logged in to reply to this topic.