Forums > MaxMSP

Playback speeds using count~ and index~

July 19, 2006 | 9:42 pm

I know that you can use sfplay~ to determine the speeds that a file could get played, but I’m trying to use count~ going into an index~ and they are getting thier start and end points from a wavform display. A bang hits a message box that contains the minpoint for count to start at. I’m trying to find out if there is a way for counter~ or index~ to have a way to control the speed that the file plays back at. I hope that had some semblance of clarity to it :P Thanks for any help.

Jhay


July 20, 2006 | 6:41 am

count~
|
*~ 0.5
|
index~

this would play it in half speed ?, but you’ll need to do a little work on the end point…

something like this :

end point in samples
|
| speed
| |
| [!/ 1.]
| |
[*~ 1.]
|
how high count should count~

———-

but why not use play~ or groove~, much easier ?


July 20, 2006 | 8:13 am

i have a patch based on that idea, the advantage being you can use a master phasor~ to control all kinds of stuff

you need to use the +=~ object if you are going to vary the playback speed, otherwise you will get jumps in the play position as you very the play speed (pitch)

another problem you may encounter is when you get very big numbers out of +=~ you might get bad audio quality from play~, in which case the hr.play~ and other hr objects will sort it out


July 20, 2006 | 11:28 am

Jhaysonn wrote:
> I’m trying to find out if there is a way for counter~ or index~ to
> have a way to control the speed that the file plays back at.

Just use a [*~] to change the speed…

[*~ 1.] is original speed, [*~ 0.5] is half speed…

(Math is usually way simpler than one might think it is…)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


July 20, 2006 | 12:21 pm

that wont work unless the pitch is a constant, because you get discontinuity in the audio when you change pitch. you got to use an accumulator

max v2;
#N vpatcher 100 100 700 500;
#P button 138 154 34 0;
#P user ezdac~ 212 273 256 306 0;
#P window setfont "Sans Serif" 9.;
#P flonum 204 116 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 202 142 29 196617 sig~;
#P message 284 137 43 196617 replace;
#P newex 283 159 80 196617 buffer~ x 5000;
#P newex 203 178 26 196617 +=~;
#P newex 208 223 49 196617 index~ x;
#P comment 123 191 55 196617 start play;
#P connect 6 0 5 0;
#P connect 8 0 2 0;
#P connect 5 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 7 0;
#P connect 1 0 7 1;
#P connect 4 0 3 0;
#P pop;


July 20, 2006 | 2:56 pm

thank you very much bin, that worked perfectly! Thanks for the help guys, really appreciate it


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