## Non-signal cycles

Jan 21, 2007 at 7:24am

# Non-signal cycles

I’d like to generate a number that cycles between -1 and 1, 0 and 1, whatever. The output doesn’t matter, I’ll just map with zmap. Is there a better, less system resource-intensive way of doing it than this?:

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 60 60 40 196617 cycle~;
#P connect 0 0 1 0;
#P connect 1 1 2 0;
#P pop;

Thanks,
BB

#29840
Jan 21, 2007 at 6:24pm

#P button 54 95 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 54 201 21 196617 sin;
#P message 54 142 74 196617 0. , 6.28 1000;
#P newex 54 176 40 196617 line 0.;
#P user multiSlider 53 231 125 84 -1. 1. 1 3449 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 comment 38 72 100 196617 BANG! means go;
#P connect 4 0 1 0;
#P connect 5 0 3 0;
#P connect 2 1 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;

On 1/21/07, Brennon wrote:
>
> I’d like to generate a number that cycles between -1 and 1, 0 and 1, whatever. The output doesn’t matter, I’ll just map with zmap. Is there a better, less system resource-intensive way of doing it than this?:
>
> max v2;
> #N vpatcher 10 59 610 459;
> #P window setfont “Sans Serif” 9.;
> #P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P newex 60 60 40 196617 cycle~;
> #P connect 0 0 1 0;
> #P connect 1 1 2 0;
> #P pop;
>
> Thanks,
> BB
>

#93948
Jan 22, 2007 at 2:29am

Hey, that’s a nice example. I took it several steps further if you’re interested. That scrolling multislider is great for viewing all kinds of math waveform-like functions, and for sampling the data that’s going through them.

This version has additional functions (tan, sin^x) and range / speed settings, a secondary sampler of the data, and an example of scaling the data (note that scale offers more possibilities than zmap). Also, the secondary sampler allows lower sample rates–”chunkier” output of data based on a time grain. You could also apply this beforehand, in the line object, but this way gives you both “raw” and “sampled” data to work with.

-C

——————–

max v2;
#N vpatcher 100 100 993 780;
#P origin 0 18;
#P window setfont “Sans Serif” 9.;
#P hidden newex 376 84 40 9109513 pipe 100;
#P window linecount 2;
#P comment 235 87 100 9109513 Range of function , time for each cycle;
#P window setfont “Sans Serif” 12.;
#P number 267 208 57 12 1 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P comment 149 606 302 9109516 Take the generated data and have your way with it!;
#P user multiSlider 499 502 79 140 -999. 0. 1 2921 15 0 4 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 677 501 52 12 1. 1.3 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 18.;
#P number 591 553 69 18 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P newex 590 529 143 9109513 scale -1. 1. 0 -999 1.;
#P window linecount 3;
#P comment 591 583 172 9109513 Also consider using scale instead of zmap–allows inverted mapping and an exponent;
#P window setfont “Sans Serif” 18.;
#P number 758 531 57 18 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
#P user multiSlider 745 278 79 211 0. 99. 1 2921 15 0 4 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 window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 739 501 99 9109513 zmap -1. 1. 0 99;
#P window linecount 2;
#P comment 565 206 161 9109513 Use lower values for smooth , higher for “chunky” sampled output;
#P window linecount 1;
#P comment 310 233 149 9109513 Exponent for sine-to-power;
#P newex 186 209 21 9109513 sin;
#P window setfont “Sans Serif” 14.;
#P user umenu 38 237 119 9109563 1 64 257 1;
#P window setfont “Sans Serif” 9.;
#P newex 186 233 99 9109513 expr pow(\$f1\,\$f2);
#P newex 50 213 96 9109513 switch 3 1;
#P window linecount 2;
#P comment 244 538 100 9109513 Data straight from the functions;
#P window linecount 3;
#P comment 11 537 139 9109513 Sampled Data (run through multislider and accessed every N ms of metro);
#P comment 537 56 161 9109513 Sample the output each N milliseconds , report it at single slider at left and other sliders;
#P hidden button 168 22 15 0;
#P window setfont “Sans Serif” 12.;
#P window linecount 1;
#P hidden message 433 55 50 9109516 20;
#P hidden message 356 55 66 9109516 1;
#P hidden message 281 55 66 9109516 2000;
#P hidden message 197 55 66 9109516 6.28;
#P window setfont “Sans Serif” 9.;
#P hidden newex 197 26 74 9109513 loadbang;
#P window setfont “Sans Serif” 20.;
#P flonum 245 504 95 20 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
#P user multiSlider 10 277 79 211 -1. 1. 1 2937 15 0 4 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 window setfont “Sans Serif” 12.;
#P number 601 123 57 12 1 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 537 112 30 0;
#P window setfont “Sans Serif” 9.;
#P newex 537 150 74 9109513 metro 100;
#P window setfont “Sans Serif” 20.;
#P flonum 12 502 95 20 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P message 537 179 74 9109513 fetch \$1;
#P button 101 157 15 0;
#P toggle 219 134 38 0;
#P window setfont “Sans Serif” 12.;
#P flonum 105 85 52 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P newex 143 118 40 9109513 pak 0. 0;
#P newex 88 183 21 9109513 tan;
#P window setfont “Sans Serif” 12.;
#P number 168 85 57 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 54 77 36 0;
#P window setfont “Sans Serif” 9.;
#P newex 54 183 21 9109513 sin;
#P message 54 124 74 9109513 0. , \$1 \$2;
#P newex 54 158 40 9109513 line 0.;
#P user multiSlider 99 277 614 212 -1. 1. 1 3449 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 window linecount 2;
#P comment 277 139 143 9109513 Turns on/off looping (click button at top left to restart);
#P window linecount 1;
#P hidden newex 91 231 37 9109513 + 1;
#P window setfont “Sans Serif” 12.;
#P hidden newex 219 162 50 9109516 gate;
#P hidden connect 15 0 19 0;
#P hidden connect 3 1 15 0;
#P hidden connect 1 0 30 0;
#P hidden connect 0 0 5 0;
#P hidden connect 10 0 5 0;
#P hidden connect 7 0 5 0;
#P hidden connect 5 0 4 0;
#P hidden connect 4 0 6 0;
#P hidden connect 6 0 30 1;
#P hidden connect 4 0 9 0;
#P hidden connect 32 0 1 0;
#P hidden connect 30 0 3 0;
#P hidden fasten 14 0 3 0 542 260 104 260;
#P hidden connect 4 1 13 0;
#P hidden connect 22 0 11 0;
#P hidden connect 9 0 30 2;
#P hidden connect 31 0 30 3;
#P hidden connect 11 0 10 0;
#P hidden connect 23 0 8 0;
#P hidden connect 8 0 10 1;
#P hidden connect 4 0 33 0;
#P hidden connect 33 0 31 0;
#P hidden connect 26 0 21 0;
#P hidden connect 21 0 22 0;
#P hidden connect 47 0 12 0;
#P hidden connect 12 0 0 0;
#P hidden connect 30 0 20 0;
#P hidden connect 13 0 0 1;
#P hidden connect 24 0 45 0;
#P hidden connect 45 0 31 1;
#P lcolor 3;
#P hidden connect 21 0 23 0;
#P hidden connect 21 0 24 0;
#P hidden connect 24 0 47 0;
#P hidden connect 21 0 25 0;
#P hidden connect 40 0 43 0;
#P lcolor 3;
#P hidden connect 47 0 17 0;
#P hidden connect 17 0 16 0;
#P hidden connect 16 0 14 0;
#P hidden connect 3 1 40 0;
#P lcolor 3;
#P hidden connect 40 0 41 0;
#P lcolor 3;
#P hidden connect 25 0 18 0;
#P hidden connect 18 0 16 1;
#P hidden connect 42 0 40 5;
#P lcolor 3;
#P hidden connect 3 1 36 0;
#P hidden connect 36 0 37 0;
#P hidden connect 36 0 38 0;
#P lcolor 3;
#P pop;

#93949
Jan 22, 2007 at 2:43am

Nice!

On 1/21/07, Seejay James wrote:
>
> Hey, that’s a nice example. I took it several steps further if you’re interested. That scrolling multislider is great for viewing all kinds of math waveform-like functions, and for sampling the data that’s going through them.
>
> This version has additional functions (tan, sin^x) and range / speed settings, a secondary sampler of the data, and an example of scaling the data (note that scale offers more possibilities than zmap). Also, the secondary sampler allows lower sample rates–”chunkier” output of data based on a time grain. You could also apply this beforehand, in the line object, but this way gives you both “raw” and “sampled” data to work with.
>
>
> -C
>
>
> ——————–
>
>
> max v2;
> #N vpatcher 100 100 993 780;
> #P origin 0 18;
> #P window setfont “Sans Serif” 9.;
> #P hidden newex 376 84 40 9109513 pipe 100;
> #P window linecount 2;
> #P comment 235 87 100 9109513 Range of function , time for each cycle;
> #P window setfont “Sans Serif” 12.;
> #P number 267 208 57 12 1 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P comment 149 606 302 9109516 Take the generated data and have your way with it!;
> #P user multiSlider 499 502 79 140 -999. 0. 1 2921 15 0 4 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 677 501 52 12 1. 1.3 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window setfont “Sans Serif” 18.;
> #P number 591 553 69 18 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
> #P window setfont “Sans Serif” 9.;
> #P newex 590 529 143 9109513 scale -1. 1. 0 -999 1.;
> #P window linecount 3;
> #P comment 591 583 172 9109513 Also consider using scale instead of zmap–allows inverted mapping and an exponent;
> #P window setfont “Sans Serif” 18.;
> #P number 758 531 57 18 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
> #P user multiSlider 745 278 79 211 0. 99. 1 2921 15 0 4 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 window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 739 501 99 9109513 zmap -1. 1. 0 99;
> #P window linecount 2;
> #P comment 565 206 161 9109513 Use lower values for smooth , higher for “chunky” sampled output;
> #P window linecount 1;
> #P comment 310 233 149 9109513 Exponent for sine-to-power;
> #P newex 186 209 21 9109513 sin;
> #P window setfont “Sans Serif” 14.;
> #P user umenu 38 237 119 9109563 1 64 257 1;
> #X add sine to power;
> #P window setfont “Sans Serif” 9.;
> #P newex 186 233 99 9109513 expr pow(\$f1\,\$f2);
> #P newex 50 213 96 9109513 switch 3 1;
> #P window linecount 2;
> #P comment 244 538 100 9109513 Data straight from the functions;
> #P window linecount 3;
> #P comment 11 537 139 9109513 Sampled Data (run through multislider and accessed every N ms of metro);
> #P comment 537 56 161 9109513 Sample the output each N milliseconds , report it at single slider at left and other sliders;
> #P hidden button 168 22 15 0;
> #P window setfont “Sans Serif” 12.;
> #P window linecount 1;
> #P hidden message 433 55 50 9109516 20;
> #P hidden message 356 55 66 9109516 1;
> #P hidden message 281 55 66 9109516 2000;
> #P hidden message 197 55 66 9109516 6.28;
> #P window setfont “Sans Serif” 9.;
> #P hidden newex 197 26 74 9109513 loadbang;
> #P window setfont “Sans Serif” 20.;
> #P flonum 245 504 95 20 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
> #P user multiSlider 10 277 79 211 -1. 1. 1 2937 15 0 4 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 window setfont “Sans Serif” 12.;
> #P number 601 123 57 12 1 0 1 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 537 112 30 0;
> #P window setfont “Sans Serif” 9.;
> #P newex 537 150 74 9109513 metro 100;
> #P window setfont “Sans Serif” 20.;
> #P flonum 12 502 95 20 0 0 0 139 0 0 0 255 9 9 222 222 222 0 0 0;
> #P window setfont “Sans Serif” 9.;
> #P message 537 179 74 9109513 fetch \$1;
> #P button 101 157 15 0;
> #P toggle 219 134 38 0;
> #P window setfont “Sans Serif” 12.;
> #P flonum 105 85 52 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window setfont “Sans Serif” 9.;
> #P newex 143 118 40 9109513 pak 0. 0;
> #P newex 88 183 21 9109513 tan;
> #P window setfont “Sans Serif” 12.;
> #P number 168 85 57 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
> #P button 54 77 36 0;
> #P window setfont “Sans Serif” 9.;
> #P newex 54 183 21 9109513 sin;
> #P message 54 124 74 9109513 0. , \$1 \$2;
> #P newex 54 158 40 9109513 line 0.;
> #P user multiSlider 99 277 614 212 -1. 1. 1 3449 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 window linecount 2;
> #P comment 277 139 143 9109513 Turns on/off looping (click button at top left to restart);
> #P window linecount 1;
> #P hidden newex 91 231 37 9109513 + 1;
> #P window setfont “Sans Serif” 12.;
> #P hidden newex 219 162 50 9109516 gate;
> #P hidden connect 15 0 19 0;
> #P hidden connect 3 1 15 0;
> #P hidden connect 1 0 30 0;
> #P hidden connect 0 0 5 0;
> #P hidden connect 10 0 5 0;
> #P hidden connect 7 0 5 0;
> #P hidden connect 5 0 4 0;
> #P hidden connect 4 0 6 0;
> #P hidden connect 6 0 30 1;
> #P hidden connect 4 0 9 0;
> #P hidden connect 32 0 1 0;
> #P hidden connect 30 0 3 0;
> #P hidden fasten 14 0 3 0 542 260 104 260;
> #P hidden connect 4 1 13 0;
> #P hidden connect 22 0 11 0;
> #P hidden connect 9 0 30 2;
> #P hidden connect 31 0 30 3;
> #P hidden connect 11 0 10 0;
> #P hidden connect 23 0 8 0;
> #P hidden connect 8 0 10 1;
> #P hidden connect 4 0 33 0;
> #P hidden connect 33 0 31 0;
> #P hidden connect 26 0 21 0;
> #P hidden connect 21 0 22 0;
> #P hidden connect 47 0 12 0;
> #P hidden connect 12 0 0 0;
> #P hidden connect 30 0 20 0;
> #P hidden connect 13 0 0 1;
> #P hidden connect 24 0 45 0;
> #P hidden connect 45 0 31 1;
> #P lcolor 3;
> #P hidden connect 21 0 23 0;
> #P hidden connect 21 0 24 0;
> #P hidden connect 24 0 47 0;
> #P hidden connect 21 0 25 0;
> #P hidden connect 40 0 43 0;
> #P lcolor 3;
> #P hidden connect 47 0 17 0;
> #P hidden connect 17 0 16 0;
> #P hidden connect 16 0 14 0;
> #P hidden connect 3 1 40 0;
> #P lcolor 3;
> #P hidden connect 40 0 41 0;
> #P lcolor 3;
> #P hidden connect 25 0 18 0;
> #P hidden connect 18 0 16 1;
> #P hidden connect 42 0 40 5;
> #P lcolor 3;
> #P hidden connect 3 1 36 0;
> #P hidden connect 36 0 37 0;
> #P hidden connect 36 0 38 0;
> #P lcolor 3;
> #P pop;
>
>

#93950
Jan 22, 2007 at 2:55am

Apologies for my lack of maths chops, but where does the 6.28 value in
the line come from?

s.

keith manlove wrote:
> #P button 54 95 15 0;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 54 201 21 196617 sin;
> #P message 54 142 74 196617 0. , 6.28 1000;
> #P newex 54 176 40 196617 line 0.;
> #P user multiSlider 53 231 125 84 -1. 1. 1 3449 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 comment 38 72 100 196617 BANG! means go;
> #P connect 4 0 1 0;
> #P connect 5 0 3 0;
> #P connect 2 1 3 0;
> #P connect 3 0 2 0;
> #P connect 2 0 4 0;
>
> On 1/21/07, Brennon wrote:
>>
>> I’d like to generate a number that cycles between -1 and 1, 0 and 1,
>> whatever. The output doesn’t matter, I’ll just map with zmap. Is
>> there a better, less system resource-intensive way of doing it than
>> this?:
>>
>> max v2;
>> #N vpatcher 10 59 610 459;
>> #P window setfont “Sans Serif” 9.;
>> #P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221
>> 221 222 222 222 0 0 0;
>> #P window linecount 1;
>> #P newex 60 60 40 196617 cycle~;
>> #P connect 0 0 1 0;
>> #P connect 1 1 2 0;
>> #P pop;
>>
>> Thanks,
>> BB
>>
>

#93951
Jan 22, 2007 at 3:07am

2 * pi ( 3.14)

On Jan 21, 2007, at 9:55 PM, scott mc laughlin wrote:

>
> Apologies for my lack of maths chops, but where does the 6.28 value
> in the line come from?
>
> s.
>
>
>
> keith manlove wrote:
>> #P button 54 95 15 0;
>> #P window setfont “Sans Serif” 9.;
>> #P window linecount 1;
>> #P newex 54 201 21 196617 sin;
>> #P message 54 142 74 196617 0. , 6.28 1000;
>> #P newex 54 176 40 196617 line 0.;
>> #P user multiSlider 53 231 125 84 -1. 1. 1 3449 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 comment 38 72 100 196617 BANG! means go;
>> #P connect 4 0 1 0;
>> #P connect 5 0 3 0;
>> #P connect 2 1 3 0;
>> #P connect 3 0 2 0;
>> #P connect 2 0 4 0;
>>
>> On 1/21/07, Brennon wrote:
>>>
>>> I’d like to generate a number that cycles between -1 and 1, 0 and
>>> 1, whatever. The output doesn’t matter, I’ll just map with
>>> zmap. Is there a better, less system resource-intensive way of
>>> doing it than this?:
>>>
>>> max v2;
>>> #N vpatcher 10 59 610 459;
>>> #P window setfont “Sans Serif” 9.;
>>> #P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>>> #P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221
>>> 221 221 222 222 222 0 0 0;
>>> #P window linecount 1;
>>> #P newex 60 60 40 196617 cycle~;
>>> #P connect 0 0 1 0;
>>> #P connect 1 1 2 0;
>>> #P pop;
>>>
>>> Thanks,
>>> BB
>>>
>>
>

v a d e //

#93952
Jan 22, 2007 at 3:15am

http://en.wikipedia.org/wiki/Sine_wave

http://mathworld.wolfram.com/Sine.html

It takes pi to go from 0 to 1 to 0, and 2*pi (6.28) to go from 0 to -1
to 0. If you want more reasons than that, I think it has something to
do with the circle picture on the Wolfram site. I unfortunately can’t
tell you more than that.

Keith

On 1/21/07, scott mc laughlin wrote:
>
> Apologies for my lack of maths chops, but where does the 6.28 value in
> the line come from?
>
> s.
>
>
>
> keith manlove wrote:
> > #P button 54 95 15 0;
> > #P window setfont “Sans Serif” 9.;
> > #P window linecount 1;
> > #P newex 54 201 21 196617 sin;
> > #P message 54 142 74 196617 0. , 6.28 1000;
> > #P newex 54 176 40 196617 line 0.;
> > #P user multiSlider 53 231 125 84 -1. 1. 1 3449 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 comment 38 72 100 196617 BANG! means go;
> > #P connect 4 0 1 0;
> > #P connect 5 0 3 0;
> > #P connect 2 1 3 0;
> > #P connect 3 0 2 0;
> > #P connect 2 0 4 0;
> >
> > On 1/21/07, Brennon wrote:
> >>
> >> I’d like to generate a number that cycles between -1 and 1, 0 and 1,
> >> whatever. The output doesn’t matter, I’ll just map with zmap. Is
> >> there a better, less system resource-intensive way of doing it than
> >> this?:
> >>
> >> max v2;
> >> #N vpatcher 10 59 610 459;
> >> #P window setfont “Sans Serif” 9.;
> >> #P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> >> #P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221
> >> 221 222 222 222 0 0 0;
> >> #P window linecount 1;
> >> #P newex 60 60 40 196617 cycle~;
> >> #P connect 0 0 1 0;
> >> #P connect 1 1 2 0;
> >> #P pop;
> >>
> >> Thanks,
> >> BB
> >>
> >
>
>

#93953
Jan 22, 2007 at 3:47am

*sighs*

how did I not see that, thank you both: must engage brain before fingers
next time :)
s.

scott mc laughlin wrote:
>
> Apologies for my lack of maths chops, but where does the 6.28 value in
> the line come from?
>
> s.
>
>
>
> keith manlove wrote:
>> #P button 54 95 15 0;
>> #P window setfont “Sans Serif” 9.;
>> #P window linecount 1;
>> #P newex 54 201 21 196617 sin;
>> #P message 54 142 74 196617 0. , 6.28 1000;
>> #P newex 54 176 40 196617 line 0.;
>> #P user multiSlider 53 231 125 84 -1. 1. 1 3449 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 comment 38 72 100 196617 BANG! means go;
>> #P connect 4 0 1 0;
>> #P connect 5 0 3 0;
>> #P connect 2 1 3 0;
>> #P connect 3 0 2 0;
>> #P connect 2 0 4 0;
>>
>> On 1/21/07, Brennon wrote:
>>>
>>> I’d like to generate a number that cycles between -1 and 1, 0 and 1,
>>> whatever. The output doesn’t matter, I’ll just map with zmap. Is
>>> there a better, less system resource-intensive way of doing it than
>>> this?:
>>>
>>> max v2;
>>> #N vpatcher 10 59 610 459;
>>> #P window setfont “Sans Serif” 9.;
>>> #P flonum 89 109 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>>> #P user number~ 60 84 99 99 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221
>>> 221 222 222 222 0 0 0;
>>> #P window linecount 1;
>>> #P newex 60 60 40 196617 cycle~;
>>> #P connect 0 0 1 0;
>>> #P connect 1 1 2 0;
>>> #P pop;
>>>
>>> Thanks,
>>> BB
>>>
>>
>
>

#93954
Jan 22, 2007 at 7:06am

Thanks! CPU load is greatly decreased now. I appreciate the help.

–BB

#93955

You must be logged in to reply to this topic.