Forums > MaxMSP

groove~ time index

February 19, 2007 | 2:00 pm

Is it possible to get groove~ to output a time index, in other words the current playback position within the sample, mapped between 0. and 1. and regardless of loop points? I need an hslider to accurately report the playback position within the entire sample, even when I adjust the loop points.

Thanks!


February 19, 2007 | 6:17 pm

Quote: Aluxxes wrote on Mon, 19 February 2007 06:00
—————————————————-
> Is it possible to get groove~ to output a time index, in other words the current playback position within the sample, mapped between 0. and 1. and regardless of loop points? I need an hslider to accurately report the playback position within the entire sample, even when I adjust the loop points.
>
> Thanks!
—————————————————-

It already outputs a sig~ from 0 to 1 via the right outlet. You can change that to a float with number~ or snapshop~. Then you just have to do the math to map that number properly to your hslider as you change the loop points.


February 19, 2007 | 10:52 pm

Jack Rosete wrote:
> Is it possible to get groove~ to output a time index, in other words
> the current playback position within the sample, mapped between 0.
> and 1. and regardless of loop points? I need an hslider to
> accurately report the playback position within the entire sample,
> even when I adjust the loop points.

You could create the loop other than with the loop functionality of
groove~, just readjust the position according to the position outlet…

Stefan


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


February 19, 2007 | 11:37 pm

On Feb 19, 2007, at 6:01 AM, Jack Rosete wrote:
>
> Is it possible to get groove~ to output a time index, in other
> words the current playback position within the sample, mapped
> between 0. and 1. and regardless of loop points? I need an hslider
> to accurately report the playback position within the entire
> sample, even when I adjust the loop points.
>
> Thanks!

Like this? (pardon the mess, just whipped this up)

_Mark

max v2;
#N vpatcher 285 243 1142 867;
#P window setfont "Sans Serif" 9.;
#P newex 141 320 31 196617 dac~;
#P message 404 71 53 196617 0 -1 0 -1;
#P newex 119 232 29 196617 sig~;
#P flonum 239 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 152 233 43 196617 loop $1;
#P newex 289 448 87 196617 zmap 0. 1. 0 127;
#P newex 483 158 105 196617 info~ testbuffer;
#P newex 301 411 27 196617 / 1.;
#P newex 237 285 70 196617 snapshot~ 20;
#P user hslider 69 173 18 374 128 1 0 0;
#P newex 301 340 81 196617 zmap 0. 1. 0. 1.;
#P toggle 81 199 15 0;
#P message 477 35 43 196617 replace;
#P message 70 71 73 196617 set testbuffer;
#P newex 477 58 107 196617 buffer~ testbuffer -1;
#P user waveform~ 70 96 389 74 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P newex 151 261 96 196617 groove~ testbuffer;
#P comment 451 373 100 196617 total buffer size;
#P window linecount 2;
#P comment 526 32 100 196617 click replace to load a new sample;
#P window linecount 1;
#P comment 98 200 100 196617 click to play;
#P fasten 14 0 10 0 294 479 51 479 51 174;
#P connect 5 1 6 0;
#P connect 6 0 4 0;
#P connect 8 0 17 0;
#P connect 3 0 19 0;
#P connect 8 0 19 0;
#P connect 15 0 3 0;
#P connect 17 0 3 0;
#P connect 8 0 15 0;
#P connect 3 0 19 1;
#P fasten 4 2 3 1 225 215 199 215;
#P fasten 4 3 3 2 300 206 242 206;
#P connect 3 1 11 0;
#P connect 11 0 16 0;
#P connect 12 0 14 0;
#P fasten 11 0 9 0 242 321 306 321;
#P connect 9 0 12 0;
#P fasten 13 6 12 1 566 389 323 389;
#P fasten 4 2 9 3 225 215 357 215;
#P fasten 4 3 9 4 300 206 374 206;
#P connect 5 1 18 0;
#P connect 18 0 4 4;
#P connect 7 0 5 0;
#P connect 5 1 13 0;
#P pop;


February 20, 2007 | 12:01 am

That is a great solution Mark, I think that will solve my problem, thanks…


February 20, 2007 | 6:20 am

Mark Pauley wrote:
>> Is it possible to get groove~ to output a time index, in other words
>> the current playback position within the sample, mapped between 0.
>> and 1.

A snapshot~ in polling mode is evil, it will eat you scheduler cycles
for breakfast. An edge~ version below without built-in looping to get
the correct report for position…

#P window setfont "Sans Serif" 9.;
#P user number~ 202 356 241 371 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221
221 222 222 222 0 0 0;
#P button 487 115 15 0;
#P flonum 318 270 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 71 218 50 196617 t i 0;
#P message 220 233 70 196617 2801.9729;
#P newex 220 208 68 196617 prepend set;
#P button 237 332 15 0;
#P newex 237 306 45 196617 edge~;
#P user ezdac~ 141 320 185 353 0;
#P message 446 94 53 196617 0 -1 0 -1;
#P newex 71 240 29 196617 sig~;
#P newex 483 158 105 196617 info~ testbuffer;
#P newex 318 243 81 196617 zmap 0. 1. 0. 1.;
#P toggle 71 199 15 0;
#P message 477 35 43 196617 replace;
#P message 70 93 73 196617 set testbuffer;
#P newex 477 58 107 196617 buffer~ testbuffer -1;
#P user waveform~ 70 118 389 74 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P newex 151 261 96 196617 groove~ testbuffer;
#P window linecount 2;
#P comment 526 32 100 196617 click replace to load a new sample;
#P window linecount 1;
#P comment 98 200 100 196617 click to play;
#P newex 237 285 45 196617 >~ 0.98;
#P fasten 5 1 6 0 579 79 75 79;
#P connect 5 1 12 0;
#P connect 5 1 10 0;
#P connect 3 1 21 0;
#P connect 3 1 0 0;
#P fasten 14 0 17 0 242 327 292 327 292 228 225 228;
#P connect 14 0 15 0;
#P connect 20 0 10 0;
#P connect 9 0 0 1;
#P connect 9 0 19 0;
#P fasten 10 6 9 2 566 219 357 219;
#P connect 4 3 9 0;
#P connect 0 0 14 0;
#P connect 18 1 3 0;
#P connect 18 0 11 0;
#P connect 8 0 18 0;
#P connect 3 0 13 1;
#P connect 3 0 13 0;
#P connect 17 0 3 0;
#P connect 16 0 17 0;
#P connect 4 2 16 0;
#P connect 7 0 5 0;
#P connect 12 0 4 4;
#P connect 11 0 3 0;
#P connect 6 0 4 0;
#P window clipboard copycount 22;


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


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