Forums > MaxMSP

groove~ sync mental challenge

April 4, 2007 | 2:14 am

Hi,
I have been searching for a solution to this insignificant problem and just can’t find it.
I looked into the list and manuals without success.

Here is the problem:
When groove~ is playing a loop, the last outlet will send a ramp going from 0 to 1 as a signal, what I want to do is generate a new set of coordinates (start & end points) when the signal reaches exactly 1.00. This is intended to be done many times per second and the loop changes need to be perfectly synced to avoid clicks.

Sorry if the question reveals that I am intellectually challenged, any help would nevertheless be appreciated.

By the way, I use Max/MSP 4.5.7.


April 4, 2007 | 2:47 am

Hello there,

You might want to try the following combination of change~ ==~ and edge~ which will bang when the right output from groove~ reaches the 1 to 0 transition. You can use this bang to trigger changes.Depending on how you have your looping set you might get clicks and may have to look at some kind of windowing solution.

BTW There is quite a bit of this kind of information in the forum archives.

best,

john.

#P button 172 245 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 172 221 50 196617 edge~;
#P newex 172 194 45 196617 ==~ 1;
#P newex 172 166 64 196617 change~;
#P number 171 96 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 135 96 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 246 64 43 196617 replace;
#P newex 241 92 89 196617 buffer~ one 1000;
#P user ezdac~ 96 235 140 268 0;
#P message 7 111 85 196617 loop 1 , startloop;
#P newex 117 59 41 196617 sig~ 1.;
#P newex 117 135 65 196617 groove~ one;
#P connect 0 1 8 0;
#P connect 10 0 11 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 0 0 3 0;
#P connect 0 0 3 1;
#P connect 1 0 0 0;
#P connect 7 0 0 2;
#P connect 6 0 0 1;
#P connect 5 0 4 0;
#P connect 2 0 0 0;
#P window clipboard copycount 12;


April 4, 2007 | 10:53 am

Hi there. I haven’t time to post a full reply, but I might be able to help a bit.

To keep everything in sync you will need to use all msp objects – as soon as you go to the max domain and back (as in the suggestion above) you’ll loose the sample accurate triggering you require to avoid clicks…..except if you choose new start/end points you’ll still get clicks unless your waveform always lineups between the old end point and the new start point….

My suggestions would be:

1 – sah~ is your friend and might the best way to get the very end of the loop, but you should proabably use the delat of the ramp signal so you can see exactly when the loop begins (the ramp changes direction.

2 – This might be easier to do with play~ and not groove because you’ll be looping between different points in the sample anyway, so the ease of groove looping is lost. OK you’ll have to calculate phasor~~ speeds or whatever which is a bit of a pain, but should work fine unless perhaps the loops are very long..

3 – You might need to crossfade (or just fade) your loop somehow in order to not get clicks. Crossfading is more complex, as you’ll need two play~s or something…

Hope this helps

Regards,

Alex


April 5, 2007 | 5:14 pm

Hi,
Thanks to you both!
I’ll investigate the second option as it seems to oriented more in the direction I’m heading.

I’ll post the patch when I will have a chance.


April 6, 2007 | 6:40 pm

Hi,
Here is my solution, I think it is a mix of both suggestion.

max v2;
#N vpatcher 78 141 1089 851;
#P window setfont "Sans Serif" 9.;
#P comment 488 26 44 196617 control the dac;
#P window linecount 1;
#P message 492 73 29 196617 stop;
#P message 492 55 67 196617 startwindow;
#P newex 370 375 49 196617 dac~ 1 2;
#P newex 427 76 27 196617 100;
#P newex 427 55 48 196617 loadbang;
#P number 322 55 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 388 329 35 196617 *~ 0.;
#P button 503 329 13 0;
#P message 468 308 50 196617 0 , $1 $2;
#P newex 468 286 48 196617 pack 0 0;
#P newex 468 329 32 196617 line~;
#P newex 468 352 72 196617 play~ window;
#P flonum 173 115 82 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 129 115 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 129 55 43 196617 replace;
#P newex 129 94 105 196617 info~ window;
#P newex 129 74 81 196617 buffer~ window;
#P toggle 266 55 44 0;
#P newex 260 134 52 196617 metro 50;
#P button 422 286 13 0;
#P newex 224 177 32 196617 sel 1;
#P newex 354 134 29 196617 gate;
#P newex 322 177 27 196617 int;
#P number 390 55 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 323 265 56 196617 $1 , $2 $3;
#P number 345 222 51 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 260 177 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 322 245 57 196617 pack 0 0 0;
#P newex 344 200 37 196617 + 200;
#P newex 260 157 77 196617 drunk 100 800;
#P newex 388 286 32 196617 line~;
#P message 10 55 43 196617 replace;
#P number 53 115 74 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 10 115 40 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 9 94 105 196617 info~ source;
#P newex 388 308 77 196617 play~ source 2;
#P newex 10 74 86 196617 buffer~ source 2;
#P window linecount 2;
#P comment 7 26 56 196617 load a source file;
#P comment 129 26 69 196617 load a winsow function;
#P comment 258 26 55 196617 start granulating;
#P comment 315 26 66 196617 sample index position (ms);
#P comment 389 26 67 196617 grain duration (ms);
#P connect 5 1 7 0;
#P connect 10 0 5 0;
#P connect 7 0 8 0;
#P connect 7 6 9 0;
#P connect 27 0 25 0;
#P connect 25 1 26 0;
#P connect 26 0 28 0;
#P connect 26 6 29 0;
#P connect 24 0 21 0;
#P connect 24 0 23 0;
#P connect 36 0 12 0;
#P connect 23 0 12 0;
#P connect 12 0 15 0;
#P connect 9 0 12 1;
#P connect 21 0 19 0;
#P connect 20 0 19 0;
#P connect 19 0 14 0;
#P connect 14 0 17 0;
#P connect 18 0 12 2;
#P connect 15 0 19 1;
#P connect 19 0 13 0;
#P connect 13 0 16 0;
#P connect 16 0 14 1;
#P connect 24 0 20 0;
#P connect 18 0 14 2;
#P connect 41 0 39 0;
#P connect 40 0 39 0;
#P connect 35 0 39 0;
#P connect 18 0 13 1;
#P connect 11 1 20 1;
#P connect 17 0 11 0;
#P connect 11 0 6 0;
#P connect 6 0 35 0;
#P connect 38 0 18 0;
#P connect 35 0 39 1;
#P connect 30 0 35 1;
#P connect 11 1 22 0;
#P connect 21 0 38 0;
#P connect 37 0 38 0;
#P connect 11 1 32 0;
#P connect 29 0 32 0;
#P connect 32 0 33 0;
#P connect 33 0 31 0;
#P connect 31 0 30 0;
#P connect 31 1 34 0;
#P connect 18 0 32 1;
#P pop;


April 7, 2007 | 12:40 pm

I’m at work at the moment so I can’t completely accurately post any info at the moment but I was intending to do a similar thing. I wanted the right outlet of groove to send a ’0′ back to the groove input to turn off the loop at the end of a sample. I used the ‘if’ object. if $i1 == 1 then set $ 1. That should send a signal out as soon as the ramp hits 1. obviously you’d need to adjust the milliseconds used but I think that’s a simliar thing. I’ll post my patch tonight when i get in from work!


April 7, 2007 | 8:40 pm

thinking about it, if the ramp value ever reaches 1, the if argument would continually bang. the if argument should be if $i1 < 0.9999 set $ 1. I think that would be better.


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