multislider wavetable osc

Jul 19, 2008 at 4:52pm

multislider wavetable osc

hey,

so i’m building a simple wavetable oscillator where you draw the wavetable
with a multislider. Right now i’m using cycle to read the buffer, but
multislider has a max number of sliders of 256, but cycle wants to oscillate
over 512 samples. The ideal solution for me would be a multislider with 512
sliders, but that’s not crucial.

possible solutions:
* just repeat the 256 multislider values to make 512 values for cycle to
read (and halve the nominal frequency)
* use wave~

the second option would be nice cuz i could use the interpolation options
for wave~, but i’m not sure how to make sample-accurate loop points for
wave~

here’s my current patch:

#P user scope~ 183 331 313 461 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135
135 0;
#P window setfont “Sans Serif” 9.;
#P flonum 232 138 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 213 176 82 9109513 cycle~ $0.oscBuf;
#P user ezdac~ 397 312 441 345 0;
#P newex 107 244 55 9109513 print ounter;
#P newex 74 178 27 9109513 t f b;
#N counter;
#X flags 0 0;
#P newobj 92 204 66 9109513 counter;
#P newex 138 161 19 9109513 t b;
#P newex 66 150 38 9109513 zl iter 1;
#P user multiSlider 56 44 150 77 -1. 1. 512 2681 15 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 newex 320 148 103 9109513 buffer~ $0.oscBuf 100;
#P newex 52 290 79 9109513 poke~ $0.oscBuf;
#P connect 6 0 0 0;
#P connect 2 0 3 0;
#P connect 3 0 6 0;
#P connect 5 0 0 1;
#P connect 6 1 5 0;
#P connect 5 0 7 0;
#P connect 4 0 5 3;
#P connect 2 0 4 0;
#P connect 9 0 11 0;
#P connect 10 0 9 0;
#P window clipboard copycount 12;

#38944
Jul 19, 2008 at 8:58pm

You could use waverform~ or even function (or ej.function.js with curves!).

The 256 limit is not due to multislider. In this case it is “zl iter 1″ with the limit. BTW “iter” would do in this case and I checked and this also has the historic 256 limit in Max 4.6 but NOT in Max 5 (“zl iter 1″ still has the 256 limit in Max 5 however).

Another way round it is to read the sliders one by one using the fetch message:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 71 203 27 196617 + 1;
#P message 71 225 48 196617 fetch $1;
#P newex 252 82 74 196617 t b 0;
#N counter;
#X flags 0 0;
#P newobj 252 142 138 196617 counter;
#P newex 252 111 44 196617 uzi 512;
#P user scope~ 352 463 482 593 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#P flonum 352 309 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 352 344 96 196617 cycle~ $0.oscBuf;
#P user ezdac~ 122 479 166 512 0;
#P user multiSlider 71 267 150 77 -1. 1. 512 2681 15 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 newex 351 233 123 196617 buffer~ $0.oscBuf 11.06;
#P newex 211 366 93 196617 poke~ $0.oscBuf;
#P fasten 2 0 9 0 76 353 52 353 52 56 257 56;
#P connect 8 0 11 0;
#P connect 8 0 0 1;
#P connect 9 0 7 0;
#P connect 9 1 8 2;
#P connect 2 1 0 0;
#P connect 11 0 10 0;
#P connect 10 0 2 0;
#P connect 7 0 8 0;
#P connect 5 0 4 0;
#P connect 4 0 6 0;
#P window clipboard copycount 12;

#136318
Jul 19, 2008 at 9:11pm

On 19 juil. 08, at 22:58, Martin Robinson wrote:

> You could use waverform~ or even function (or ej.function.js with
> curves!).
>
> The 256 limit is not due to multislider. In this case it is “zl iter
> 1″ with the limit. BTW “iter” would do in this case and I checked
> and this also has the historic 256 limit in Max 4.6 but NOT in Max 5
> (“zl iter 1″ still has the 256 limit in Max 5 however).

Nope. in Max 5 zl is limited to 32k items, you need to specify the
number of maximum items as first argument:

– Pasted Max Patch, click to expand. –

> Another way round it is to read the sliders one by one using the
> fetch message:

Another convenient way to store a list in a buffer is to use [mxj
ej.l2buffer].

ej

#136319
Jul 20, 2008 at 3:28pm

Quote: Emmanuel Jourdan wrote on Sat, 19 July 2008 22:11
—————————————————-
> Nope. in Max 5 zl is limited to 32k items, you need to specify the
> number of maximum items as first argument:

Ah. That’s an improvement in Max 5 I hadn’t noticed in the docs (and didn’t bother to check in zl help). I probably wasn’t paying attention. So are all list ops now based around a maximum of 32k items?

#136320
Jul 20, 2008 at 4:08pm

On 20 juil. 08, at 17:28, Martin Robinson wrote:

> Ah. That’s an improvement in Max 5 I hadn’t noticed in the docs (and
> didn’t bother to check in zl help). I probably wasn’t paying
> attention. So are all list ops now based around a maximum of 32k
> items?

in theory yes. A few objects like mtof/ftom/atob/dbtoa can also take a
list as intput now.

ej

#136321
Jul 20, 2008 at 4:32pm

Op 20-jul-08, om 18:08 heeft Emmanuel Jourdan het volgende geschreven:

> On 20 juil. 08, at 17:28, Martin Robinson wrote:
>
>> Ah. That’s an improvement in Max 5 I hadn’t noticed in the docs
>> (and didn’t bother to check in zl help). I probably wasn’t paying
>> attention. So are all list ops now based around a maximum of 32k
>> items?
>
> in theory yes. A few objects like mtof/ftom/atob/dbtoa can also take
> a list as intput now.
>
> ej
>

===========
Eddy Deruwe
Hopstraat 71
1000 Brussel

Tel: 02/5025670
GSM: 0495/466675
E-mail: eddy.deruwe@skynet.be
Skype: eddy.deruwe
=============================

#136322
Jul 21, 2008 at 3:10am

Not sure if Emmanuel supplied this in his Max5 patch earlier (haven’t checked), but here’s a very simple method using multislider –> listfunnel –> peek~. 512 elements is no problem this way. But you could always use the mxj equivalent to zl group [mxj list.Group] for larger lists.

best,
Zachary

max v2;
#N vpatcher 473 104 763 375;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 23 193 71 196617 peek~ wTable;
#P newex 23 218 109 196617 buffer~ wTable 11.61;
#P newex 23 165 52 196617 listfunnel;
#P user multiSlider 23 42 220 111 -1. 1. 513 2681 47 0 0 2 0 50 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 connect 0 0 1 0;
#P connect 1 0 3 0;
#P pop;

#136323

You must be logged in to reply to this topic.