groove~ and buffer~ bang when finished playing audio

Mar 19, 2006 at 4:20am

groove~ and buffer~ bang when finished playing audio

I am using groove~ and buffer~ in conjunction with the folder object and I need a bang when an audio file is done being played as in sfplay~. Any ideas?
Jeff

#24955
Mar 19, 2006 at 8:11am

something like this maybe.

max v2;
#N vpatcher 151 442 557 948;
#P origin -88 0;
#P window setfont “Sans Serif” 9.;
#P user number~ 178 281 217 296 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221
221 221 222 222 222 0 0 0;
#P newex 190 429 45 196617 onebang;
#P button 190 453 15 0;
#P message 157 78 43 196617 replace;
#P newex 238 386 115 196617 if $f1 == $f2 then bang;
#P button 169 131 15 0;
#P flonum 124 131 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 114 168 15 0;
#P message 93 168 19 196617 -1;
#P newex 114 207 29 196617 sig~;
#P flonum 238 356 77 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 114 324 31 196617 dac~;
#P message 87 289 27 196617 stop;
#P message 20 289 65 196617 startwindow;
#P newex 238 326 35 196617 * 1.;
#P newex 114 239 74 196617 groove~ thang;
#P flonum 263 175 76 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 185 131 105 196617 info~ thang;
#P message 124 78 30 196617 read;
#P newex 124 102 71 196617 buffer~ thang;
#P connect 12 0 10 0;
#P connect 11 0 10 0;
#P connect 10 0 4 0;
#P fasten 4 0 8 0 119 290 119 290;
#P fasten 7 0 8 0 92 314 119 314;
#P fasten 6 0 8 0 25 314 119 314;
#P fasten 16 0 0 0 162 97 129 97;
#P connect 1 0 0 0;
#P connect 0 0 13 0;
#P fasten 4 0 8 1 119 290 140 290;
#P connect 0 1 14 0;
#P connect 4 1 19 0;
#P connect 0 1 2 0;
#P fasten 15 0 18 0 243 416 195 416;
#P connect 18 0 17 0;
#P fasten 12 0 18 1 119 196 230 196;
#P connect 19 1 5 0;
#P connect 5 0 9 0;
#P connect 9 0 15 0;
#P connect 2 6 3 0;
#P connect 3 0 5 1;
#P connect 3 0 15 1;
#P pop;

Jonathan Segel 4014 Brookdale Ave. Oakland, CA 94619
jsegel@magneticmotorworks.com < -----> magsatellite@yahoo.com

#72847
Mar 19, 2006 at 10:05am

acdcvc wrote:
> I am using groove~ and buffer~ in conjunction with the folder object
> and I need a bang when an audio file is done being played as in
> sfplay~. Any ideas? Jeff

This is the most save and clear way I know…

Stefan

#P button 218 310 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 178 286 50 196617 edge~;
#P newex 178 265 50 196617 >~ 0.5;
#P toggle 114 168 15 0;
#P newex 114 207 29 196617 sig~;
#P newex 114 239 74 196617 groove~ thang;
#P connect 4 1 5 0;
#P connect 3 0 4 0;
#P connect 0 1 3 0;
#P connect 2 0 1 0;
#P connect 1 0 0 0;
#P window clipboard copycount 6;

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72848
Mar 19, 2006 at 1:16pm

both of these responses are very helpful but only if all of the files are the same length. i currently have the buffer~ size set at 40000 to play short and long files of varying lengths. is there anyway to dynamically set the buffer~ size for each file that is loaded in from a folder object so there will be a bang at the end of each unique file? or is there another way to do it?
thanks much.
jeff

#72849
Mar 19, 2006 at 1:47pm

the “replace” message resizes the buffer to the new sample length.
extensively covered in the help-file.
minimum reading-skills required though ;-)

h
hans w. koch
im krahnenhof 11
d-50668 koeln
+49-221-554902
http://www.hans-w-koch.net

#72850
Mar 19, 2006 at 3:42pm

all of the above works great for a while then i start to get bangs ahead of the actual playing time of the audio file.
jeff

#72851
Mar 20, 2006 at 2:46am

it is much easier than my suggested mess (admittedly taken out of
context from somewhere where i needed to know where we were in the
sample) but it only works if the loop flag on groove~ is set, yeah?
otherwise it won’t loop back to zero for edge~.

i’m actually discovering weirdness in my msp app looking at this,
checking the box or messaging a value to run sig~ isn’t working to
drive groove~ all the time. it seems to decide when to actually play
sometime later… if at all. eventually no playback, even the groove~
helpfile…

just installed pluggo 3.5.4 and reinstalled max 4.5.7
hmmm.
Jonathan Segel 4014 Brookdale Ave. Oakland, CA 94619
jsegel@magneticmotorworks.com < -----> magsatellite@yahoo.com

#72852
Mar 20, 2006 at 9:57am

i’ve had a similar problem,- when groove~ is trying to find his looppoints after the buffer~ is resized….. I have no idea why this is happening, but sending a ‘set’ message to the groove~ everytime the buffer~ is resized seems to fix the problem ??

#72853
Mar 20, 2006 at 11:34am

Jonathan Segel wrote:
> it is much easier than my suggested mess (admittedly taken out of
> context from somewhere where i needed to know where we were in the
> sample) but it only works if the loop flag on groove~ is set, yeah?
> otherwise it won’t loop back to zero for edge~.

yes, if you don’t loop, you just need to check for the end value, which
is 1. [>=~ 1]. In the loop contect you mostly miss the 1. and won’t get
a bang always.
Sometimes it seems even better to do the loop by waiting for the
position outlet reach 1. and then retrigger the groove~, but that would
create a loop which is not sample accurate… dependes on the context.

> i’m actually discovering weirdness in my msp app looking at this,
> checking the box or messaging a value to run sig~ isn’t working to
> drive groove~ all the time.

You have to reposition it, if you do not send a 0. (as float) to
groove~, it will remain with its play head at the end.

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72854
Mar 20, 2006 at 11:56am

I posted this issue not too long ago, if you switch on/off audio it also
gets the new info. I guess its a bug, its still calculating with the old
size.
Thanks for the tip with set, because switching on/off audio is never a
solution.

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72855
Mar 20, 2006 at 1:25pm

Thanks for all of the responses. I’ve noticed that it is buggy for files larger than say 5 seconds. Could there be a reason for this? Sending set to groove~ does nothing. Yes, turning off/on audio seems to rest it but of course this is very impractical.
jeff

#72856
Mar 20, 2006 at 1:36pm

are u sending ‘set buffername’ ?

#72857
Mar 20, 2006 at 2:05pm

sending ‘set buffername’ to groove~ each time brings everything to a halt…………
jeff

#72858
Mar 20, 2006 at 9:31pm

acdcvc wrote:
> Thanks for all of the responses. I’ve noticed that it is buggy for
> files larger than say 5 seconds. Could there be a reason for this?

Yes, a bug in your patch (if you want more details send in the patch).

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72859
Mar 21, 2006 at 12:32pm

#72860
Mar 21, 2006 at 6:13pm

#72861
Mar 23, 2006 at 7:58pm

Thanks for all of the above help. I appreciate all of your time very much. Unfortunately, I have not resolved the original problem. I am using groove~ and buffer~ along with the folder object and I need a bang when an audio file is finished being played as in sfplay~. The audio files are various lengths from approx. 3-60 seconds. My patch works for a while but then I start to get bangs before files are actually finished playing, especially for files over 5 seconds. I notice the same thing happens for Jonathan Segel’s patch offered here. Are there any more ideas or suggestions?
Jeffrey Krieger

#72862
Mar 26, 2006 at 10:52am

acdcvc wrote:
> Thanks for all of the above help. I appreciate all of your time very
> much. Unfortunately, I have not resolved the original problem. I am
> using groove~ and buffer~ along with the folder object and I need a
> bang when an audio file is finished being played as in sfplay~. The
> audio files are various lengths from approx. 3-60 seconds. My patch
> works for a while but then I start to get bangs before files are
> actually finished playing, especially for files over 5 seconds.

All working possibilities have been posted as far as I remember, not all
are necessarily appropriate. Now its time to understand how they work!
Its up to you, to do this part of the work (yes its work). Then you will
be able to solve your problems (This I can even promise… ;-)

sorry for being not more helpfull, but I just guess you still want to
patch it yourself…

Stefan

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—-
–_____———–|———–
–(_|_ —-|—–|—–()—-
– _|_)—-|—–()———–
———-()————x—–

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

#72863

You must be logged in to reply to this topic.