Forums > MaxMSP

trying to make a master phasor

May 13, 2006 | 7:09 pm

ok so ive been trying to make a patch that will allow me to load a loop and mess around with it (reverse it, stutter it, slow it down, cut it up etc.) and i cant for the life of me figure out how to make a master clock. why do i need a master clock you ask? because i want a ramp signal going from 0 to 1 at all times. example: say i had a loop looping along and i hit the button on my keyboard assigned to a stutter effect. i want to be able to hold down that stutter button for as long as i want and when i release it i want the sample to pick up from where it would be if i hadnt hit the button. does that make any sense? can anybody help me? thanks in advance.

-harlan


May 13, 2006 | 11:13 pm

when your app is not too complex and your computer
is a g4 or better, you can more or less count on
metro sending bangs to everywhere in the app.

when you think metro is unstable and useless
for "sequencing" or "clocking" (like i do) you
can use a little trick:
instead of a [metro 250], use a [metro 1000] and
3 [pipe] objects which are delaying the [metro]
clicks for 250, 500 and 750 miliseconds.

i have been using this method and the hated metro
object with success for sequencing music with up tp
32 bangs in paralell.

messages are never as exact as signal samples
are but more "compatible" with other objects
and systems (like groove~ has a sync output,
sfplay~ reports "stop" or objects taking bangs
only anyway)

-110


May 14, 2006 | 3:56 am


May 14, 2006 | 11:57 am

if you use wave~ for the playback you could probably do all the
processing you mention on the masterphasor~.
you could also check out 2d.wave~.
simple example patch below.
hope that helps.
/m

max v2;
#N vpatcher 10 59 610 459;
#P toggle 40 174 15 0;
#P window setfont "Sans Serif" 9.;
#P flonum 174 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 76 194 31 196617 dac~;
#P toggle 76 93 15 0;
#N vpatcher 20 74 620 474;
#P window setfont "Sans Serif" 9.;
#P newex 22 57 60 196617 loadmess 1;
#P newex 45 132 27 196617 + 1;
#P inlet 41 84 15 0;
#P newex 43 180 62 196617 selector~ 2;
#P window linecount 1;
#P newex 94 154 31 196617 abs~;
#P outlet 37 223 15 0;
#P inlet 69 83 15 0;
#P window linecount 0;
#P newex 95 131 33 196617 -~ 1.;
#P connect 4 0 2 0;
#P connect 7 0 4 0;
#P connect 6 0 4 0;
#P connect 5 0 6 0;
#P connect 1 0 4 1;
#P connect 0 0 3 0;
#P connect 1 0 0 0;
#P connect 3 0 4 2;
#P pop;
#P newobj 76 132 108 196617 p processing_reverse;
#P newex 174 103 58 196617 phasor~ 1.;
#P newex 76 161 84 196617 wave~ m 0. 0. 2;
#P message 241 107 43 196617 replace;
#P newex 240 133 91 196617 buffer~ m 1000 2;
#P comment 95 94 46 196617 reverse;
#P connect 6 0 5 0;
#P connect 5 0 3 0;
#P connect 9 0 7 0;
#P connect 3 0 7 0;
#P connect 3 1 7 1;
#P connect 8 0 4 0;
#P connect 4 0 5 1;
#P connect 2 0 1 0;
#P pop;


May 14, 2006 | 5:29 pm

why not make all the reversing, stuttering, and chopping a function of the master phasor~? thats what i do. then everything is signal rate and sample tight even at 7465bpm


May 15, 2006 | 7:33 am

Quote: bin wrote on Sun, 14 May 2006 13:29
—————————————————-
> why not make all the reversing, stuttering, and chopping a function of the master phasor~? thats what i do. then everything is signal rate and sample tight even at 7465bpm
>
—————————————————-

year, that is the best way to get proper sync for realtime beatmangling !

Keep it signal rate.

I just have one sync patch, which is opened along with max, all other synchronizing patches are then synched to that one.

here is some ideas, maybe ?

#P window setfont "Sans Serif" 9.;
#P flonum 252 78 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 66 235 37 196617 r goto;
#P number 28 323 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 622 235 35 196617 r 32b;
#P newex 676 235 49 196617 !/ 3750.;
#P newex 622 265 64 196617 delay 31.25;
#P newex 622 350 35 196617 s 64b;
#P newex 122 350 29 196617 s 2b;
#P newex 523 235 35 196617 r 16b;
#P newex 571 235 49 196617 !/ 7500.;
#P newex 523 265 58 196617 delay 62.5;
#P newex 523 350 35 196617 s 32b;
#P newex 419 235 29 196617 r 8b;
#P newex 467 235 55 196617 !/ 15000.;
#P newex 419 265 58 196617 delay 125.;
#P newex 467 206 36 196617 r bpm;
#P newex 419 350 35 196617 s 16b;
#P newex 352 350 29 196617 s 8b;
#P newex 167 350 84 196617 send~ barphasor;
#P newex 390 158 88 196617 send~ beatphasor;
#P newex 321 235 41 196617 edge~;
#P newex 321 211 39 196617 < ~ 0.5;
#P newex 252 265 27 196617 + 1;
#P newex 28 350 63 196617 s bar_count;
#N counter;
#X flags 0 0;
#P newobj 28 268 66 196617 counter;
#P newex 28 235 36 196617 edge~;
#P newex 28 211 39 196617 < ~ 0.5;
#P newex 252 350 67 196617 s beat_count;
#P newex 252 235 40 196617 change;
#P newex 252 211 64 196617 snapshot~ 3;
#P newex 252 185 35 196617 *~ 4.;
#P newex 252 51 36 196617 r bpm;
#P newex 252 101 40 196617 sync~;
#P newex 321 350 29 196617 s 4b;
#P newex 252 152 68 196617 rate~ 4. lock;
#P newex 92 350 29 196617 s 1b;
#P number 252 323 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 16 0 3 0;
#P fasten 16 0 19 0 326 263 357 263;
#P lcolor 8;
#P fasten 2 0 10 0 257 180 33 180;
#P fasten 2 0 18 0 257 180 172 180;
#P fasten 2 0 6 0 257 180 257 180;
#P connect 21 0 23 0;
#P fasten 21 0 27 0 472 232 576 232;
#P fasten 21 0 32 0 472 229 681 229;
#P fasten 35 0 12 2 71 262 61 262;
#P connect 32 0 31 1;
#P connect 31 0 30 0;
#P connect 33 0 31 0;
#P fasten 33 0 30 0 627 262 619 262 619 284 627 284;
#P connect 27 0 26 1;
#P connect 26 0 25 0;
#P connect 28 0 26 0;
#P fasten 28 0 25 0 528 263 520 263 520 285 528 285;
#P connect 23 0 22 1;
#P connect 22 0 20 0;
#P connect 24 0 22 0;
#P fasten 24 0 20 0 424 263 416 263 416 285 424 285;
#P connect 4 0 2 0;
#P fasten 4 0 15 0 257 127 326 127;
#P fasten 4 0 17 0 257 127 395 127;
#P fasten 16 1 19 0 357 343 357 343;
#P lcolor 8;
#P connect 15 0 16 0;
#P connect 0 0 9 0;
#P connect 14 0 0 0;
#P connect 8 0 14 0;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 36 0 4 0;
#P connect 5 0 36 0;
#P connect 11 0 12 0;
#P fasten 11 0 1 0 33 258 97 258;
#P fasten 11 0 29 0 33 257 127 257;
#P fasten 11 1 29 0 59 257 127 257;
#P connect 34 0 13 0;
#P connect 12 0 34 0;
#P connect 10 0 11 0;
#P window clipboard copycount 37;


May 15, 2006 | 10:26 am

ok, but that doesnt do any chopping. use pong~ rate~ and round~ to change the master phasor~ into useful ramps. then send to a wave~ or a play~ object

if anyone has ideas how to chop a loop into uneven sections i’d be interested. i’ve always found that the most difficult to code. for instance, retriggering the first beat on the 1st , 2nd and 5th beat of an 8 beat loop, preferably using signals only.



VG
May 15, 2006 | 12:25 pm

the algorithm in did you have a look at modsquad exemple?
think you can easily adapt it to your need
an ergonomic interface to it would be the most difficult part maybe
vg


May 15, 2006 | 3:26 pm

phasor-> >~ X -> selector~
You split the phasor up into steps (one >~ for each step and you add all of
them to get the step number) and you the stepnumber to switch a
selector/gate (forget which) and then you have each output of the selector
go to the processing that you want for that step.

this will allow you to do anything special at any time during the loop.

using this setup + adsr~ is the basis for the step sequencer i’m building. i
use techno~ instead of phasor since it can vary the time between steps more
handily than by switching around the comparator values. That way, the
signal you pass through the gate/selector is the position output of techno~
minus the step number, so for each step you have a phasor going from 0 to 1.

this probably wasn’t entirely clear, but i hope it helps. I’d be happy to
elaborate…


May 17, 2006 | 2:30 pm

try metro with overdrive on and send it
message "62.5" ignoring it doesn t take floats.


Viewing 10 posts - 1 through 10 (of 10 total)