Forums > MaxMSP

Buffer~ and Groove~ resizing issue

July 27, 2006 | 9:53 pm

Hey everyone. I’m currently building a small patch that takes a trigger
from an on/off guitar footswitch and uses that to ‘freeze’ audio going
through the patch. The way that I’m doing that is I am constantly recording
audio to a buffer in the patch while routing the non-frozen audio into a
selector object. I then ‘freeze’ the audio by hitting the footswitch and
routing the recorded audio out of the selector~ object. The groove~ object
just plays the audio in the buffer repeatedly, and since the buffer is very
small, it sounds like it’s frozen.

All of this works fine, however the problem in the patch arises when I try
to resize the buffer by sending it a size $1 message followed by a clear
message. Assumedly after resizing and then clearing the buffer, the record~
object should just function as normal and it does, but the sound that comes
out of the groove~ object attached to the buffer is just a hum. If I double
click on the buffer~ and look at the waveform, everything looks like it
should. Somehow, after changing the size of the buffer~, that effectively
‘breaks’ the groove~ object and the patch doesnt work as it should. Does
anyone have any insight as to what’s wrong with the groove~ object in the
patch below?

thanks
nic

max v2;
#N vpatcher 102 44 926 664;
#P window setfont "Fixedwidth Serif" 9.;
#P window linecount 6;
#P comment 626 335 87 1441801 (the footswitch can be replaced with anything
as long as it triggers this toggle);
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P comment 628 309 87 196617 Footswitch On/Off;
#P window linecount 1;
#P newex 151 90 29 196617 t b i;
#P hidden message 50 45 14 196617 0;
#P message 186 273 33 196617 clear;
#P newex 716 290 50 196617 bangbang;
#P message 211 99 14 196617 1;
#P newex 410 406 62 196617 selector~ 2;
#P newex 716 326 27 196617 + 1;
#P toggle 716 309 15 0;
#P newex 352 384 62 196617 selector~ 2;
#P newex 403 341 77 196617 groove~ buff 2;
#P toggle 302 216 15 0;
#P newex 302 241 27 196617 sig~;
#P button 152 125 15 13;
#P toggle 109 122 15 0;
#P message 68 123 30 196617 open;
#P toggle 278 192 15 0;
#P number 151 73 35 9 1 1000 35 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N sfplay~ 2 120960 0 ;
#P newobj 74 150 53 196617 sfplay~ 2;
#P hidden message 35 45 14 196617 1;
#P hidden newex 13 23 48 196617 loadbang;
#P message 212 202 43 196617 loop $1;
#P newex 212 225 76 196617 record~ buff 2;
#P message 135 273 43 196617 size $1;
#P newex 135 299 95 196617 buffer~ buff 200 2;
#P button 716 273 15 13;
#P button 750 237 15 13;
#P hidden message 13 45 20 196617 10;
#P button 716 237 15 13;
#P newex 716 218 44 196617 sel 1;
#B color 13;
#P toggle 716 201 15 0;
#P newex 716 182 39 196617 >= 10.;
#B color 13;
#P user number~ 598 164 726 179 9 3 3 2 0. 0. 160 0. 20 0. 0 0 0 172 67 181
222 222 222 0 0 0;
#P newex 716 254 45 196617 onebang;
#B color 13;
#P newex 598 142 31 196617 abs~;
#B color 13;
#P newex 598 122 53 196617 *~ 3000.;
#B color 13;
#P hidden message 598 70 48 196617 set 1 $1;
#P hidden number 773 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user umenu 497 88 100 196647 1 64 104 0;
#X add Off;
#X add 1 input;
#X add 2 input;
#X add 3 input;
#X add 4 input;
#X add 5 input;
#X add 6 input;
#X add 7 input;
#X add 8 input;
#X add 9 input;
#X add 10 input;
#X add 11 input;
#X add 12 input;
#X add 13 input;
#X add 14 input;
#X add 15 input;
#X add 16 input;
#X add 17 input;
#X add 18 input;
#X add 19 input;
#X add 20 input;
#X add 21 input;
#X add 22 input;
#P hidden button 690 29 15 0;
#P hidden newex 690 51 80 196617 adstatus input 1;
#B color 5;
#P newex 598 88 40 196617 adc~ 1;
#P user gain~ 410 434 24 100 158 0 1.071519 7.94321 10.;
#P user gain~ 352 431 24 100 158 0 1.071519 7.94321 10.;
#P toggle 317 521 15 0;
#P newex 352 569 68 196617 dac~;
#P comment 255 521 61 196617 start audio;
#P comment 82 73 68 196617 freeze length;
#P window linecount 2;
#P comment 409 89 87 196617 Footswitch Port on Audiocard;
#P hidden connect 28 0 21 0;
#P hidden connect 28 0 29 0;
#P hidden connect 28 0 46 0;
#P connect 34 0 30 0;
#P connect 33 0 30 0;
#P connect 43 0 34 0;
#P connect 47 1 25 0;
#P connect 45 0 24 0;
#P connect 25 0 24 0;
#P connect 31 0 47 0;
#P connect 30 2 35 0;
#P connect 47 0 45 0;
#P connect 35 0 43 0;
#P hidden connect 29 0 27 0;
#P connect 27 0 26 0;
#P connect 30 0 26 0;
#P connect 32 0 26 0;
#P connect 30 1 26 1;
#P hidden connect 44 1 32 0;
#P hidden connect 29 0 32 0;
#P hidden connect 40 0 37 0;
#P connect 37 0 36 0;
#P hidden connect 41 0 39 0;
#P connect 39 0 5 0;
#P connect 4 0 3 0;
#P connect 5 0 3 0;
#P connect 30 0 39 1;
#P connect 27 0 38 0;
#P connect 36 0 38 0;
#P connect 38 0 39 2;
#P hidden connect 41 0 42 0;
#P connect 5 1 6 0;
#P connect 42 0 6 0;
#P connect 6 0 3 1;
#P connect 30 1 42 1;
#P connect 38 1 42 2;
#P hidden connect 8 0 10 0;
#P hidden connect 21 0 10 0;
#P lcolor 14;
#P hidden connect 10 0 12 0;
#P hidden connect 12 0 7 0;
#P connect 7 0 13 0;
#P connect 13 0 14 0;
#P lcolor 14;
#P connect 14 0 16 0;
#P lcolor 14;
#P hidden fasten 10 0 8 0 502 60 679 60 679 46 695 46;
#P hidden connect 9 0 8 0;
#P connect 16 1 17 0;
#P lcolor 14;
#P connect 17 0 18 0;
#P lcolor 14;
#P connect 18 0 19 0;
#P lcolor 14;
#P connect 19 0 20 0;
#P lcolor 14;
#P connect 20 0 15 0;
#P lcolor 14;
#P connect 15 0 23 0;
#P lcolor 14;
#P connect 23 0 44 0;
#P connect 44 0 40 0;
#P hidden connect 46 0 40 0;
#P connect 40 0 41 0;
#P connect 19 1 22 0;
#P lcolor 14;
#P connect 22 0 15 1;
#P lcolor 14;
#P hidden connect 8 1 11 0;
#P pop;


July 27, 2006 | 10:50 pm


July 28, 2006 | 5:02 pm

I’ve tried the tapin~ tapout~ thing before but it just doesnt sound that
perfect to me. The thing about the buffer is that it seems like it is
‘made’ to do the stuff I need. It sounds great until I resize it. I would
try the two buffer approach but after I resize any buffer it stops the
function off the groove~ object entirely, until I reset the max patch.

Any other ideas? Anyone?

Nic


July 28, 2006 | 5:40 pm


July 28, 2006 | 5:45 pm

Why not just leave your buffer~ size alone… the beauty of groove~ is
that it lets you change the loop start and end points on the fly. if
you use a larger buffer than you need for each frozen-loop, you can
just change the loop points to a different sized loop, or when trying
to clear the sound, move the loop points to a silent portion of the
buffer.

I’ve tried the tapin~ tapout~ thing before but it just doesnt sound that
perfect to me. The thing about the buffer is that it seems like it is
‘made’ to do the stuff I need. It sounds great until I resize it. I would
try the two buffer approach but after I resize any buffer it stops the
function off the groove~ object entirely, until I reset the max patch.

Any other ideas? Anyone?

Nic


July 28, 2006 | 5:52 pm

hello

I think "resize" also clears the buffer. Moreover, resizing takes some time so
you should not send a "clear" message immediately after. Maybe, try to remove
the "clear". But "resize" itself is not suited to live music because you can’t
know how many time it takes.
For freezing sound I would perhaps use a fixed-size buffer (long enough) and
choose a "start point" and an "end point" inside [groove~] (set to loop mode).
You can change these points in realtime at signal rate if you want.

Other freeze solutions include freezing reverbs (see the Freeverb or Altiverb),
infinite reverb (well, it’s not really a freeze but it can sound similar) or
phase vocoder.

n z :



n z
July 28, 2006 | 9:19 pm

Thanks for all the ideas, everyone. What I ended up doing is just
re-assigning the buffer name to the groove object every time I resize the
buffer and that works pretty well.

Nic


July 29, 2006 | 11:40 am


July 29, 2006 | 3:17 pm

My apologies for all the quoted crap on the end of that one – it’s an easy trap to fall into when reading/replying via ‘mail
cheers
Roger


July 29, 2006 | 4:52 pm

No worries Roger – thanks for thinking of it. I’ve tidied the thread up a bit.

-A


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