MIDI LFOs and Env

Jul 18, 2006 at 4:06pm

MIDI LFOs and Env

This should be an easy one, and I’ve tried numerous things, but I just can’t seem to get it. I’d like to have various waveforms at my disposal to send via ctlout (to an MIDI/CV converter): sine, tri, rectangle, saw, etc., and a bonus would be to be able to draw my own waveforms.
In addition, I’ve been trying to figure out how to use line with the function editor and send arbitrarily complex envelopes out of ctlout, as well.
My problem is: I can’t figure out how to get basic waveshapes in Max without resorting to MSP, and when I do, there’s the problem of ‘translating’ them to MIDI. I gather I need to scale any signal I intend to send out of ctlout to 0-127.
Any help or tips would be much appreciated,
Thanks!

#26845
Jul 18, 2006 at 4:35pm

You can use line in conjunction with a table to draw your own waveforms. Here is an example:

#P window setfont “Sans Serif” 9.;
#P number 407 229 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 407 262 54 196617 ctlout 1 1;
#P message 87 161 30 196617 open;
#P newex 285 95 60 196617 loadmess 1;
#P toggle 217 141 15 0;
#P newex 217 175 47 196617 gate 1 1;
#P comment 28 191 132 196617 1: Draw Waveform in table;
#P user multiSlider 162 238 199 73 0. 127. 1 3177 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;
#N vtable 128 30 89 240 256 0 128;
#P newobj 162 190 32 196617 table;
#P message 162 92 62 196617 0 , 127 500;
#P newex 162 146 40 196617 line;
#P comment 72 94 87 196617 2: Click to start:;
#P comment 234 142 64 196617 Loop On/Off;
#P connect 4 0 5 0;
#P fasten 4 0 12 0 167 218 412 218;
#P fasten 9 0 8 0 290 126 222 126;
#P connect 8 0 7 0;
#P fasten 7 0 3 0 222 214 370 214 370 79 167 79;
#P fasten 2 1 7 1 197 169 259 169;
#P connect 2 0 4 0;
#P connect 3 0 2 0;
#P fasten 10 0 4 0 92 183 167 183;
#P window clipboard copycount 13;

#80703
Jul 18, 2006 at 4:55pm

Also, here is a patch someone posted on the forums a long time ago. I found this when trying to approach a similar idea. I don’t know who made it, but its invaluable! It generates a number of different curves in tables, which you can cycle up and down with line to make waveforms.

#P window setfont “Fixedwidth Serif” 12.;
#P window linecount 1;
#P newex 61 168 92 1441804 s TABfertig!;
#B color 12;
#P button 61 146 15 12;
#P newex 104 651 78 1441804 split 0 63;
#N vtable 128 363 552 573 719 5 128 exp^.t;
#P newobj 7 731 107 1441804 table exp^.t;
#P newex 104 703 390 1441804 expr 127-pow((63-$i1) / 63. \, 1/$f2) * 127.;
#P newex 172 677 314 1441804 expr 127-pow(($i1-63) / 63. \, 1/$f2) * 127.;
#P message 7 99 78 1441804 0 , 127 127;
#N vtable 128 226 626 436 793 5 128 exp8.t;
#P newobj 22 617 92 1441804 table exp8.t;
#P newex 104 592 356 1441804 expr 127-pow((127-$i1) / 127. \, 1/$f2) * 127.;
#N vtable 128 226 431 436 598 5 128 exp7.t;
#P newobj 22 562 92 1441804 table exp7.t;
#P newex 104 537 343 1441804 expr pow((127-$i1) / 127. \, 1/$f2) * 127.;
#N vtable 128 226 236 436 403 5 128 exp6.t;
#P newobj 22 507 92 1441804 table exp6.t;
#P newex 104 482 329 1441804 expr 127-pow((127-$i1) / 127. \, $f2) * 127.;
#N vtable 128 226 41 436 208 5 128 exp5.t;
#P newobj 22 452 92 1441804 table exp5.t;
#P newex 104 427 315 1441804 expr pow((127-$i1) / 127. \, $f2) * 127.;
#N vtable 128 5 626 215 793 5 128 exp4.t;
#P newobj 22 397 92 1441804 table exp4.t;
#P newex 104 372 301 1441804 expr 127-pow($i1 / 127. \, 1/$f2) * 127.;
#N vtable 128 4 431 214 598 5 128 exp3.t;
#P newobj 22 343 92 1441804 table exp3.t;
#P newex 104 318 288 1441804 expr pow($i1 / 127. \, 1/$f2) * 127.;
#N vtable 128 4 236 214 403 5 128 exp2.t;
#P newobj 22 290 92 1441804 table exp2.t;
#P newex 104 265 274 1441804 expr 127-pow($i1 / 127. \, $f2) * 127.;
#N vtable 128 4 41 214 208 5 128 exp1.t;
#P newobj 22 238 92 1441804 table exp1.t;
#P newex 104 213 244 1441804 expr pow($i1 / 127. \, $f2) * 127.;
#P newex 7 121 64 1441804 line 0 1;
#P newex 338 43 54 1441804 * 0.001;
#P number 338 22 55 12 1 10000 71 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 77 42 15 1441804 1;
#P newex 77 22 64 1441804 loadbang;
#N vpreset 1;
#X append 1 2 4 66 338 flonum float 2.5 ; 11 22 338 number int 2500 ;;
#P preset 77 61 47 27;
#P window setfont “Lucida Grande” 10.;
#P comment 194 41 141 67108874 >1 >>> exponentiell acc.;
#P comment 194 70 137 67108874 <1 >>> exponentiell rit.;
#P comment 194 56 117 67108874 = 1. 0 >>> linear auf;
#P window setfont “Sans Serif” 10.;
#P flonum 338 66 54 10 0. 10. 163 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Fixedwidth Serif” 12.;
#P comment 167 213 15 1441804 B;
#P comment 205 22 134 1441804 output on mouse up;
#P comment 151 346 211 1441804 12.Wurzel aus 2 = 2 hoch 1/12;
#P window linecount 3;
#P comment 81 129 197 1441804 folgende Prozesse eventuell erst starten , wennn Tabelle fertig geschrieben!;
#P fasten 4 0 30 0 343 93 12 93;
#P connect 4 0 14 1;
#P fasten 4 0 16 1 343 134 373 134;
#P fasten 4 0 18 1 343 128 387 128;
#P fasten 4 0 20 1 343 122 400 122;
#P fasten 4 0 22 1 343 116 414 116;
#P fasten 4 0 24 1 343 110 428 110;
#P fasten 4 0 26 1 343 104 442 104;
#P fasten 4 0 28 1 343 98 455 98;
#P fasten 4 0 31 1 343 90 481 90;
#P fasten 4 0 32 1 343 88 489 88;
#P connect 12 0 4 0;
#P connect 11 0 12 0;
#P connect 34 1 31 0;
#P connect 31 0 33 1;
#P connect 32 0 33 1;
#P connect 34 0 32 0;
#P connect 13 0 33 0;
#P fasten 13 0 15 0 12 233 27 233;
#P fasten 13 0 17 0 12 285 27 285;
#P fasten 13 0 19 0 12 338 27 338;
#P fasten 13 0 21 0 12 391 27 391;
#P fasten 13 0 23 0 12 446 27 446;
#P fasten 13 0 25 0 12 501 27 501;
#P fasten 13 0 27 0 12 556 27 556;
#P fasten 13 0 29 0 12 609 27 609;
#P fasten 13 0 14 0 12 208 109 208;
#P fasten 13 0 16 0 12 260 109 260;
#P fasten 13 0 18 0 12 312 109 312;
#P fasten 13 0 20 0 12 365 109 365;
#P fasten 13 0 22 0 12 420 109 420;
#P fasten 13 0 24 0 12 475 109 475;
#P fasten 13 0 26 0 12 530 109 530;
#P fasten 13 0 28 0 12 585 109 585;
#P fasten 13 0 34 0 12 643 109 643;
#P connect 28 0 29 1;
#P connect 26 0 27 1;
#P connect 24 0 25 1;
#P connect 22 0 23 1;
#P connect 20 0 21 1;
#P connect 18 0 19 1;
#P connect 16 0 17 1;
#P connect 14 0 15 1;
#P connect 10 0 8 0;
#P connect 9 0 10 0;
#P connect 35 0 36 0;
#P connect 13 1 35 0;
#P connect 30 0 13 0;
#P window clipboard copycount 37;

Also note that this number box in the upper right will adjust the curves. You can then just save the data into a text file for quick loading.

#80704
Jul 18, 2006 at 8:51pm

These are fantastic aids. Many thanks!

If anyone has any further suggestions re: the Function editor with line and creating basic waveforms with pre-existing objects, please chime in…

#80705
Jul 18, 2006 at 10:52pm

Is there a way to change the line’s ramp time dynamically while it’s in such a loop as that in the first patch?

#80706
Jul 18, 2006 at 10:53pm

On 18-Jul-2006, at 22:51, matt wrote:
> If anyone has any further suggestions re: the Function editor with
> line and creating basic waveforms with pre-existing objects, please
> chime in…

I do this sort of stuff with lp.scampi.

Check out lp.scampi.help and the patcher newStuff.

URL below.

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80707
Jul 18, 2006 at 11:31pm

Yes! And I own a license for Litter Pro, too… Sometimes the best solutions are right under our noses.

#80708
Jul 18, 2006 at 11:56pm

lp.scampi does not handle negative floats/ints, it seems, right? i still cannot, for e.g., use a low frequency cycle~ to control a VCO via MIDI/CV…

#80709
Jul 19, 2006 at 8:42am

On 19-Jul-2006, at 1:56, matt wrote:
> lp.scampi does not handle negative floats/ints, it seems, right? i
> still cannot, for e.g., use a low frequency cycle~ to control a VCO
> via MIDI/CV…

Scampi will handle any numbers you ask it to.

The default input range is 0..1, but you can write explicit arguments
in the object box for a different range, or send messages to the 2nd
& 3rd inlets.

The default output range is 0..127, but you can change that, too.

You can change everything else in scampi’s behavior (symmetry, curve/
kink, handling of out-of-bounds input).

Hope this helps,
Peter

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80710
Jul 19, 2006 at 11:06am

I’ve always been a big fan of Panaiotis’ autocount
object for creating non-audio rate LFO’s, because it’s
an easy one-stop object for creating all the usual
LFO wave shapes but very flexible too.
And another worthy curve builder is Tristan Jehan’s
mapper object.
I’m not sure if either ever got ported to Windows, but
you should be able find them via maxobjects.com,
cheers
Roger

— matt wrote:

>
> These are fantastic aids. Many thanks!
>
> If anyone has any further suggestions re: the
> Function editor with line and creating basic
> waveforms with pre-existing objects, please chime
> in…
>
>

#80711
Jul 19, 2006 at 1:42pm

Thanks, everyone… No, those two objects haven’t been ported… yet. That’s ok, I think I can still make-do with what I have right now. I’m just surprised there isn’t some REALLY easy way to do this. I thought a cycle~ to snapshot~ or number~ to lp.scampi or scale would’ve done the trick but it doesn’t…

#80712
Jul 19, 2006 at 2:11pm

this may have been suggested already… but how about a for-loop, and a
formula. or maybe a for loop and a lookup table or lots of lookup
tables… i mean you could just build stuff that works the same way as
your favorite audio tools, but at lower and slower resolution…

if you know math and/or digital signal theory it should take you around
38 minutes to do what you want using javascript or java or rtcmix~ or
47 minutes using traditional max objects…

on/off or bang

for-loop or [counter]

formula or table

additional formula or table

output of LFO curves of your design at event rate…

> Thanks, everyone… No, those two objects haven’t been ported…
> yet. That’s ok, I think I can still make-do with what I have right
> now. I’m just surprised there isn’t some REALLY easy way to do
> this. I thought a cycle~ to snapshot~ or number~ to lp.scampi or
> scale would’ve done the trick but it doesn’t…

#80713
Jul 19, 2006 at 8:23pm

this is about as far as I’ve gotten. try a tri~, too… i haven’t gotten it quite right…

you need lp.scampi

max v2;
#N vpatcher 302 150 824 644;
#P user multiSlider 36 373 196 92 0. 128. 1 3177 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 user uslider 15 370 15 85 128 1 0 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden message 406 59 16 9109513 -1;
#P newex 107 339 52 9109513 ctlout 12 1;
#P hidden message 492 59 14 9109513 2;
#P hidden message 465 59 23 9109513 128;
#P hidden message 447 59 14 9109513 0;
#P hidden message 426 59 14 9109513 1;
#P hidden newex 426 32 45 9109513 loadbang;
#P newex 75 339 26 9109513 print;
#P hidden newex 21 254 35 9109513 r sLim;
#P number 299 278 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 192 280 102 9109513 New range maximum:;
#P number 299 251 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 191 253 102 9109513 New range minimum:;
#P window linecount 3;
#P comment 191 211 186 9109513 The default output range is 0 x 128. This can be changed with messages to the fourth and fifth inlets.;
#P user umenu 127 212 60 9109543 1 64 228 1;
#X add clip;
#X add wrap;
#X add reflect;
#X add stet;
#P number 64 305 35 9 0 0 160 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 64 282 81 9109513 lp.scampi;
#P message 314 332 27 9109513 stop;
#P message 243 332 65 9109513 startwindow;
#P newex 243 365 30 9109513 dac~;
#P comment 243 318 65 9109513 • start audio;
#P user panel 225 312 123 43;
#X brgb 255 255 255;
#X frgb 100 202 30;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P flonum 64 75 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 269 112 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 269 130 50 9109513 offset $1;
#P toggle 140 124 15 0;
#P message 396 87 26 9109513 100;
#P message 371 87 20 9109513 20;
#P message 193 124 27 9109513 stop;
#P message 158 124 31 9109513 start;
#P number 371 108 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 64 102 36 9109513 cycle~;
#P newex 64 160 317 9109513 snapshot~;
#B color 5;
#P comment 72 134 45 9109513 signal in;
#P comment 380 144 132 9109513 interval (for self-clocking);
#P window linecount 4;
#P comment 138 59 98 9109513 turn clock on/off (by default , the clock will be on if a non-zero interval is supplied);
#P window linecount 6;
#P comment 245 31 113 9109513 change offset within vector of sample output. range is from 0 (least recent , default) to the signal vector size – 1 (most recent);
#P fasten 21 0 37 0 69 329 20 329;
#P hidden connect 37 0 38 0;
#P hidden connect 31 0 14 0;
#P connect 14 0 5 0;
#P connect 5 0 4 0;
#P connect 11 0 4 0;
#P connect 8 0 4 0;
#P connect 7 0 4 0;
#P connect 12 0 4 0;
#P fasten 4 0 20 0 69 275 69 275;
#P fasten 22 1 20 0 182 273 69 273;
#P hidden fasten 28 0 20 0 26 273 69 273;
#P connect 20 0 21 0;
#P fasten 25 0 20 3 304 276 111 276;
#P fasten 27 0 20 4 304 299 150 299 150 278 125 278;
#P hidden connect 34 0 22 0;
#P connect 18 0 17 0;
#P fasten 19 0 17 0 319 359 248 359;
#P hidden connect 36 0 13 0;
#P connect 13 0 12 0;
#P hidden connect 32 0 25 0;
#P hidden connect 33 0 27 0;
#P connect 9 0 6 0;
#P connect 10 0 6 0;
#P hidden connect 31 0 6 0;
#P connect 6 0 4 1;
#P hidden connect 30 0 36 0;
#P hidden connect 30 0 31 0;
#P hidden connect 30 0 32 0;
#P hidden fasten 30 0 33 0 431 56 470 56;
#P hidden connect 30 0 34 0;
#P pop;

#80714
Jul 19, 2006 at 9:39pm

On 19-Jul-2006, at 22:23, matt wrote:
> this is about as far as I’ve gotten. try a tri~, too… i haven’t
> gotten it quite right…

Make that an ‘lp.scampi map -1 1′.

The map symbol puts scampi in map mode. In map mode the first two
numeric arguments set the input range. The default output range,
0-127, is fine so no need for any more arguments. As long as the
input values are in range, there’s no need for the reflect/wrap/etc.
popup menu.

Somewhere along the line some of your patcher was HTML-ized, causing
some problems with “New from Clipboard.” This should iron out those
issues:

#P user multiSlider 96 363 196 92 0. 128. 1 3177 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 user uslider 75 360 15 85 128 1 0 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden message 466 49 16 196617 -1;
#P newex 167 329 66 196617 ctlout 12 1;
#P hidden message 552 49 14 196617 2;
#P hidden message 525 49 23 196617 128;
#P hidden message 507 49 14 196617 0;
#P hidden message 486 49 14 196617 1;
#P hidden newex 486 22 45 196617 loadbang;
#P newex 135 329 40 196617 print;
#P hidden newex 81 244 35 196617 r sLim;
#P number 359 268 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 252 270 102 196617 New range maximum:;
#P number 359 241 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 251 243 102 196617 New range minimum:;
#P window linecount 2;
#P comment 251 201 250 196617 The default output range is 0 < = x <
128. This can be changed with messages to the fourth and fifth inlets.;
#P number 124 295 35 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 124 272 96 196617 lp.scampi map -1 1;
#P message 374 322 27 196617 stop;
#P message 303 322 65 196617 startwindow;
#P newex 303 355 30 196617 dac~;
#P comment 303 308 65 196617 start audio;
#P user panel 285 302 123 43;
#X brgb 255 255 255;
#X frgb 100 202 30;
#X border 2;
#X rounded 0;
#X shadow 0;
#X done;
#P flonum 124 65 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 329 102 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 329 120 50 196617 offset $1;
#P toggle 200 114 15 0;
#P message 456 77 26 196617 100;
#P message 431 77 20 196617 20;
#P message 253 114 27 196617 stop;
#P message 218 114 31 196617 start;
#P number 431 98 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 124 92 36 196617 cycle~;
#P newex 124 150 317 196617 snapshot~;
#B color 5;
#P comment 132 124 45 196617 signal in;
#P comment 440 134 132 196617 interval (for self-clocking);
#P window linecount 4;
#P comment 198 49 112 196617 turn clock on/off (by default , the
clock will be on if a non-zero interval is supplied);
#P window linecount 6;
#P comment 305 21 113 196617 change offset within vector of sample
output. range is from 0 (least recent , default) to the signal
vector size – 1 (most recent);
#P fasten 26 0 20 4 364 289 224 289 224 268 197 268;
#P fasten 24 0 20 3 364 266 180 266;
#P connect 20 0 21 0;
#P hidden fasten 27 0 20 0 86 263 129 263;
#P fasten 4 0 20 0 129 265 129 265;
#P fasten 21 0 36 0 129 319 80 319;
#P hidden connect 29 0 9 0;
#P hidden connect 29 0 35 0;
#P hidden connect 29 0 30 0;
#P hidden connect 29 0 31 0;
#P hidden fasten 29 0 32 0 491 46 530 46;
#P hidden connect 29 0 33 0;
#P hidden connect 36 0 37 0;
#P connect 14 0 5 0;
#P connect 5 0 4 0;
#P connect 11 0 4 0;
#P connect 8 0 4 0;
#P connect 7 0 4 0;
#P connect 12 0 4 0;
#P connect 18 0 17 0;
#P fasten 19 0 17 0 379 349 308 349;
#P hidden connect 35 0 13 0;
#P connect 13 0 12 0;
#P hidden connect 31 0 24 0;
#P hidden connect 32 0 26 0;
#P connect 9 0 6 0;
#P connect 10 0 6 0;
#P hidden connect 30 0 6 0;
#P hidden connect 30 0 14 0;
#P connect 6 0 4 1;
#P window clipboard copycount 38;

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80715
Jul 19, 2006 at 10:59pm

fantastic. that solidifies it for me, thanks.

#80716
Jul 20, 2006 at 8:48am

matt wrote:
> Any help or tips would be much appreciated, Thanks!

The right inlets are for frequency in Herz, if you want to have the
timing more exact, you need to syncronize them instead of self triggering.
This should give you enough ideas to go on…

#P toggle 57 123 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 82 123 30 196617 gate;
#P button 34 123 15 0;
#P user hslider 166 257 19 63 128 1 0 0;
#P newex 166 232 50 196617 lines 0.;
#P user function 34 147 440 223 1 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0. 0;
#X add 659.898438 87.156868 0;
#X add 1065.989868 49.803925 0;
#X add 3020.304443 127.000008 0;
#X add 4670.050781 64.745102 0;
#X add 6802.030273 127.000008 0;
#X add 7411.16748 49.803925 0;
#X add 7969.542969 74.705887 0;
#X add 10000. 0. 0;
#X domain 10000.;
#X range 0. 127.;
#X done;
#N vpatcher 20 74 620 474;
#P window setfont “Sans Serif” 9.;
#P newex 133 75 50 196617 !/ 1000.;
#P newex 90 50 44 196617 sel 1 0;
#P newex 124 106 31 196617 float;
#N vtable 128 603 98 813 265 17 128;
#T set 0 -1 60 60 60 60 60 60 60 61 61 62 63 64 65 66 67 71 80 81 83 84
85 86 87 88 88 88 89 89 89 89 88 88 87 86 84 83 80 72 66 66 66 64 62 62
62 62 62 62 62 62 62 63 63 64 65 66 69 71 72 75 78 81 83 85 86 86 86 82
77 69 69 67 63 62 60 57 52 49 45 42 39 34 29 24 22 19 16 14 13 11 10 9 8
8 8 7 7 7 7 7 7 7 7 7 7 7 9 10 16 25 31 36 38 40 42 44 44 44 46 49 53 55
57 64 65 66 66;
#P newobj 50 177 30 196617 table;
#P newex 90 177 46 196617 * 127;
#P newex 90 74 35 196617 b;
#P newex 50 106 72 196617 pack 0. 1000.;
#P toggle 90 157 15 0;
#P newex 50 132 50 196617 line 0.;
#P inlet 133 29 15 0;
#P inlet 90 29 15 0;
#P outlet 50 223 15 0;
#P fasten 7 0 5 0 95 197 158 197 158 102 55 102;
#P connect 5 0 3 0;
#P fasten 9 0 3 0 129 127 55 127;
#P connect 3 0 8 0;
#P connect 8 0 0 0;
#P connect 1 0 10 0;
#P connect 10 0 6 0;
#P connect 3 1 4 0;
#P connect 6 0 4 0;
#P connect 4 0 7 0;
#P connect 11 0 5 1;
#P connect 10 2 9 0;
#P fasten 10 1 9 0 112 70 129 70;
#P connect 6 1 9 0;
#P connect 2 0 11 0;
#P fasten 3 0 9 1 55 153 150 153;
#P pop;
#P newobj 362 72 46 196617 p lftable;
#P flonum 398 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 362 95 19 63 128 1 0 0;
#P toggle 362 49 17 0;
#N vpatcher 20 74 346 402;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 48 124 35 196617 1000.;
#P window linecount 0;
#P message 48 147 59 196617 0 , 127 $1;
#P newex 131 93 50 196617 !/ 1000.;
#P newex 48 68 44 196617 sel 1 0;
#P newex 109 146 35 196617 float;
#P newex 48 92 35 196617 b;
#P newex 48 172 50 196617 line 0.;
#P inlet 131 47 15 0;
#P inlet 48 47 15 0;
#P outlet 48 241 15 0;
#P connect 1 0 6 0;
#P connect 6 0 4 0;
#P fasten 3 1 9 0 93 197 147 197 147 118 53 118;
#P fasten 7 0 9 0 136 118 53 118;
#P connect 4 0 9 0;
#P connect 9 0 8 0;
#P fasten 5 0 3 0 114 168 53 168;
#P connect 8 0 3 0;
#P connect 3 0 0 0;
#P fasten 6 1 5 0 70 88 114 88;
#P connect 6 2 5 0;
#P connect 2 0 7 0;
#P fasten 3 0 5 1 53 193 139 193;
#P pop;
#P newobj 280 72 42 196617 p lfsaw;
#P flonum 312 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 280 95 19 63 128 1 0 0;
#P toggle 280 49 17 0;
#N vpatcher 20 74 620 474;
#P toggle 90 123 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 90 143 50 196617 * 127;
#P newex 90 99 60 196617 metro 500;
#P inlet 140 52 15 0;
#P inlet 90 52 15 0;
#P outlet 90 167 15 0;
#P window linecount 1;
#P newex 140 75 50 196617 !/ 500.;
#P connect 2 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 1 0;
#P connect 3 0 0 0;
#P connect 0 0 4 1;
#P pop;
#P newobj 198 72 42 196617 p lfrect;
#P flonum 230 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 198 95 19 63 128 1 0 0;
#P toggle 198 49 17 0;
#N vpatcher 20 74 620 474;
#P window setfont “Sans Serif” 9.;
#P newex 133 75 50 196617 !/ 500.;
#P newex 90 50 44 196617 sel 1 0;
#P newex 124 106 31 196617 float;
#P newex 90 74 35 196617 b;
#P newex 50 106 72 196617 pack 0. 500.;
#P toggle 90 157 15 0;
#P newex 50 132 50 196617 line 0.;
#P inlet 133 29 15 0;
#P inlet 90 29 15 0;
#P outlet 50 223 15 0;
#P newex 90 177 65 196617 * 127.;
#P fasten 0 0 6 0 95 197 158 197 158 102 55 102;
#P connect 6 0 4 0;
#P fasten 8 0 4 0 129 127 55 127;
#P connect 4 0 1 0;
#P connect 2 0 9 0;
#P connect 9 0 7 0;
#P connect 4 1 5 0;
#P connect 7 0 5 0;
#P connect 5 0 0 0;
#P connect 10 0 6 1;
#P connect 9 2 8 0;
#P fasten 9 1 8 0 112 70 129 70;
#P connect 7 1 8 0;
#P connect 3 0 10 0;
#P fasten 4 0 8 1 55 153 150 153;
#P pop;
#P newobj 34 72 42 196617 p lftri;
#P flonum 66 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 34 95 19 63 128 1 0 0;
#P toggle 34 49 17 0;
#N vpatcher 20 74 620 474;
#P window setfont “Sans Serif” 9.;
#P newex 133 75 50 196617 !/ 1000.;
#P newex 90 50 44 196617 sel 1 0;
#P newex 124 106 31 196617 float;
#P newex 50 201 100 196617 scale -1. 1. 0 127;
#P newex 50 177 30 196617 cos;
#P newex 90 177 65 196617 * 6.283186;
#P newex 90 74 35 196617 b;
#P newex 50 106 72 196617 pack 0. 1000.;
#P toggle 90 157 15 0;
#P newex 50 132 50 196617 line 0.;
#P inlet 133 29 15 0;
#P inlet 90 29 15 0;
#P outlet 50 223 15 0;
#P fasten 7 0 5 0 95 197 158 197 158 102 55 102;
#P fasten 10 0 3 0 129 127 55 127;
#P connect 5 0 3 0;
#P connect 3 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 0 0;
#P connect 1 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 4 0;
#P connect 3 1 4 0;
#P connect 4 0 7 0;
#P connect 12 0 5 1;
#P connect 6 1 10 0;
#P fasten 11 1 10 0 112 70 129 70;
#P connect 11 2 10 0;
#P connect 2 0 12 0;
#P fasten 3 0 10 1 55 153 150 153;
#P pop;
#P newobj 116 72 42 196617 p lfcos;
#P flonum 148 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user hslider 116 95 19 63 128 1 0 0;
#P toggle 116 49 17 0;
#P window linecount 2;
#P comment 227 229 172 196617 I posted lines some days ago…. or you’ll
find it at the c74 share pages;
#P connect 5 0 8 0;
#P connect 8 0 6 0;
#P hidden connect 25 0 24 0;
#P connect 24 0 21 0;
#P connect 7 0 8 1;
#P hidden connect 26 0 25 0;
#P hidden connect 22 1 25 1;
#P connect 1 0 4 0;
#P connect 4 0 2 0;
#P connect 3 0 4 1;
#P connect 21 1 22 0;
#P connect 22 0 23 0;
#P connect 9 0 12 0;
#P connect 12 0 10 0;
#P connect 11 0 12 1;
#P connect 13 0 16 0;
#P connect 16 0 14 0;
#P connect 15 0 16 1;
#P connect 17 0 20 0;
#P connect 20 0 18 0;
#P connect 19 0 20 1;
#P window clipboard copycount 27;


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

#80717
Jul 20, 2006 at 1:28pm

Thank you VERY much, Stefan. I found lines, too.

#80718
Jul 21, 2006 at 9:40am

Peter Castine wrote:
> The default output range is 0..127, but you can change that, too.

unfortunately its still 0…128 (just checked again (with the hope that
it had changed in the mean time)), though I believe it would not break a
single patch if it would be changed to 0…127, as its pretty unlikely
that the default is ever used in a real patch…

Stefan


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

#80719
Jul 21, 2006 at 11:19am

On 21-Jul-2006, at 11:40, Stefan Tiedje wrote:
> unfortunately its still 0…128 (just checked again (with the hope
> that it had changed in the mean time)), though I believe it would
> not break a single patch if it would be changed to 0…127, as its
> pretty unlikely that the default is ever used in a real patch…

You’re quite right that lp.scampi’s default output range is 0 to 128.
And, as Klaus Wowereit says, it’s a good thing too. Let me explain.

The scampi/scampf pair were designed for mapping output from Litter
unit-range RNGs to MIDI and back. A careful look at the unit-range
random number generators reveals that they generate values in the
half-open range 0 < = x < 1. The default settings for scampi simply
multiply the input by 128 and truncate, giving integers in the range
0 < = x < 128. For integers this is just another way of saying 0 <= x
< = 127.

Note also that if the input values have a flat distribution, so do
the output values. This would not be the case if scampi used the more
naive approach of multiplying by 127. You can test this yourself by
editing the lp.scampi object in lp.shhh.help to ‘lp.scampi map 0 1 0
127′. Then bang Uzi a few times. How many 127s show up in the histogram?

As for breaking “real-world” patches: scampi was, as I said,
originally designed for scaling output of RNGs to the standard table
range, as exemplified in a dozen lp.*.help patches. Furthermore I’ve
used scampi with its default settings in many real-life projects.

Like right-to-left order, this is an example of where the most
obvious approach is not the best.

– Peter

#P button 15 67 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 15 130 39 196617 lp.shhh;
#P newex 15 87 49 196617 Uzi 1000;
#P newex 15 153 121 196617 lp.scampi map 0 1 0 127;
#P newex 15 178 36 196617 Histo;
#N vtable 128 442 65 667 237 5 128;
#P newobj 15 200 36 196617 table;
#P window setfont “Sans Serif” 14.;
#P window linecount 5;
#P comment 144 153 384 196622 This example modifies scampi’s default
values to use a more “obvious” mapping to MIDI. But the change
doesn’t work! Look carefully at the pixel in the bottom right corner
of the table display. That indicates that the value 127 is never
generated!;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 92 67 369 196617 Bang Uzi and watch the table window. (If
the window is hidden , double-click on the table object.);
#P window setfont “Sans Serif” 18.;
#P window linecount 1;
#P comment 215 125 237 196626 lp.scampi and it’s defaults;
#B frgb 0 100 17;
#P connect 8 0 6 0;
#P connect 6 0 7 0;
#P connect 4 0 3 0;
#P connect 4 1 3 1;
#P connect 5 0 4 0;
#P connect 7 0 5 0;
#P window clipboard copycount 9;

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80720
Jul 27, 2006 at 5:50am

Peter Castine wrote:
> The scampi/scampf pair were designed for mapping output from Litter
> unit-range RNGs to MIDI and back. A careful look at the unit-range
> random number generators reveals that they generate values in the
> half-open range 0 < = x < 1. The default settings for scampi simply
> multiply the input by 128 and truncate, giving integers in the range 0
> < = x < 128. For integers this is just another way of saying 0 <= x <= 127.

Thanks for that clear and understandable explanation. I promise I’ll
never rumble about that ever again. Just to avoid wrong thinking for
other users, just put that explanation patch into your help file…

In general a bit more basic explanation about all your wonderful
distributions would be helpful aswell. I know its possible to search for
such in the web, but if you are patching, a little explanation within
the helpfile is just more convenient than searching the web for “what
the hell does mu or sigma mean…”

I am sure you could write a book about all these distributions and their
occurances in the real world…

And many thanks for your great work…

Stefan


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

#80721
Jul 27, 2006 at 3:41pm

On 27-Jul-2006, at 7:50, Stefan Tiedje wrote:
> In general a bit more basic explanation about all your wonderful
> distributions would be helpful aswell. I know its possible to
> search for such in the web, but if you are patching, a little
> explanation within the helpfile is just more convenient than
> searching the web for “what the hell does mu or sigma mean…”

Up to the current release of Litter, I followed the documentation
paradigm given by Opcode and Cycling: quick overview in the .help
file, details in the Reference Manual.

My experience in coaching and user support is that real people very
rarely crack open the book, even when the book is a .PDF file. Also,
some of the reasons for keeping .help files small that were valid in
the late 80s no longer hold. So I am in the process of moving all
documentation into the .help files.

The process won’t be completed in the next release, it’s really a
massive task. But you should find a lot more information immediately
available. I’ll try to include a note about mu and sigma.

> I am sure you could write a book about all these distributions and
> their occurances in the real world…

Yeah, that’s the problem. Who wants to read a book?

(Hint: read my Skype Mood Message)

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80722
Jul 28, 2006 at 11:12pm

Peter Castine wrote:
> The process won’t be completed in the next release, it’s really a
> massive task. But you should find a lot more information immediately
> available. I’ll try to include a note about mu and sigma.

Actually if you know of a possibility to use launchbrowser not only for
calling the manual, but also to jump to a specific chapter within the
PDF, let me know. (Preferably for Preview, as Acrobat Reader is way too
heavy for my taste.)
That might even do it as link within the help file…

Stefan


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

#80723
Oct 6, 2006 at 7:12pm

Oh yeah, of course! Sorry! Here’s a quote from one of her emails:

At 4:39 PM -0700 10/5/06, Lauren Pratt wrote:
>My CalArts email address has changed: it is now lpratt@calarts.edu. Please
>note this in your address book.
>
>Lauren Pratt, Associate Producer for Music
>REDCAT (Roy and Edna Disney/CalArts Theater)
>California Institute of the Arts, School of Music
>24700 McBean Parkway
>Valencia, CA 91355-2397
>661-799-0226, 1-888-277-1190 toll-free
>Fax: 661-670-0151
>lpratt@calarts.edu
>
>http://www.redcat.org

I’ll work on “stoned and in a dormroom”. Maybe that’s the answer to
all my problems of late…

p

Pamela Z
Composer/Performer

Contact info:

Telephone: 415.861.EARS (415.861.3277)
Mobile: 415.5PAMELA (415.572.6352)
FAX: 415.861.FAKS (415.861.3257)
(I forward my land line to my mobile phone when I’m travelling)

pamelaz@pamelaz.com

http://www.pamelaz.com

Skype: pamelazed AIM: pamelazdotcom

Snail Mail:
Pamela Z Productions
540 Alabama Street Studio 213
San Francisco, CA 94110, USA

shipping address (for packages larger than a 9″ x 12″ envelope):
Pamela Z 2440 Sixteenth Street PMB #171, San Francisco, CA 94103, USA

Pamela Z’s CD “A Delay is Better” on the Starkland label is now
available at http://www.amazon.com, http://www.starkland.com, and in
stores near you.
…………………………………………………………………………………………

#80724

You must be logged in to reply to this topic.