Forums > MaxMSP

samples with loops

November 14, 2006 | 9:22 pm

what is a simple way to play a sample with a loop ? not looping from the start, the loop is at the end.
i cant find a good way to do it


November 14, 2006 | 11:00 pm

with [groove~] probably

Selon bin ray :

>
> what is a simple way to play a sample with a loop ? not looping from the
> start, the loop is at the end.
> i cant find a good way to do it
>
>


November 14, 2006 | 11:14 pm

groove takes 2 arguments. i need 3 arguments. start, startloop, endloop


November 14, 2006 | 11:26 pm

>with [groove~] probably
>
>Selon bin ray :
>
>>
>> what is a simple way to play a sample with a loop ? not looping from the
>> start, the loop is at the end.
> > i cant find a good way to do it
>>

he is right – groove

take a look at the help file

best
kasper

Kasper T. Toeplitz
noise, composition, bass, computer

http://www.sleazeArt.com


November 15, 2006 | 12:21 am

just use the inlets for the loop start and end points. You can use sfinfo~ when you load the file in at first to get the total length in ms. The same button to load a file can get the info and fill the buffer~. then it’s all about groove~.

you might want to check out some ways of using a line editor or some other function to create a rfast amp down and up at the endpoints to avoid clicks. There’s a lot of ways to do this relatively essential element of loop playing. Check out sequencing-looping in the examples folder, plus lots of posts on this forum address it.

-CJ


November 15, 2006 | 12:36 am

groove~ will loop from point X to point Y in a sound file. i want to play from point X then loop between points Y and Z. something like this…but better

max v2;
#N vpatcher 177 75 1131 705;
#N vpreset 3;
#X append 1 2 4 208 448 flonum float 92. ; 5 216 115 flonum float 0.74 ; 6 209 355 flonum float 738. ; 9 215 223 flonum float 276. ;;
#X append 2 2 4 208 448 flonum float 155. ; 5 216 115 flonum float 1.28 ; 6 209 355 flonum float 2000. ; 9 215 223 flonum float 629. ;;
#X append 3 2 4 208 448 flonum float 92. ; 5 216 115 flonum float 0.74 ; 6 209 355 flonum float 738. ; 9 215 223 flonum float 276. ;;
#P preset 323 90 130 47;
#P window setfont "Sans Serif" 9.;
#P comment 445 189 53 196617 looplength;
#P comment 352 190 53 196617 loopstart;
#P comment 222 195 53 196617 start;
#P flonum 223 215 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 31 211 51 196617 startloop;
#N vpatcher 368 152 1233 771;
#P window setfont "Sans Serif" 9.;
#P newex 272 396 38 196617 sig~ 1;
#P newex 249 426 62 196617 selector~ 2;
#P newex 223 92 46 196617 / 1000.;
#P inlet 184 51 15 0;
#P newex 35 163 27 196617 f;
#P window linecount 0;
#P message 38 188 39 196617 set $1;
#P inlet 78 54 15 0;
#P window linecount 1;
#P newex 283 92 46 196617 / 1000.;
#P flonum 164 97 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P inlet 30 52 15 0;
#P newex 23 129 20 196617 t b;
#P newex 28 106 78 196617 route startloop;
#P newex 164 183 29 196617 sig~;
#P newex 167 150 52 196617 / 44100.;
#P flonum 298 190 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 291 162 46 196617 / 1000.;
#P newex 107 459 27 196617 *~;
#P newex 285 352 113 196617 trapezoid~ 0.01 0.99;
#P newex 257 298 27 196617 /~;
#P newex 107 389 50 196617 *~ 1000;
#P newex 189 314 27 196617 +~;
#P newex 109 285 40 196617 sah~ 0;
#P newex 116 341 62 196617 selector~ 2;
#P newex 56 286 31 196617 +~ 1;
#P newex 73 248 27 196617 >~;
#P newex 212 249 63 196617 pong~ 1 0 1;
#P newex 166 224 26 196617 +=~;
#P newex 106 419 44 196617 play~ x;
#P inlet 290 50 15 0;
#P inlet 380 42 15 0;
#P outlet 107 481 15 0;
#P connect 19 0 20 0;
#P connect 21 0 19 0;
#P connect 20 0 26 0;
#P connect 26 0 25 0;
#P connect 28 0 26 1;
#P connect 6 0 7 0;
#P connect 4 0 6 0;
#P connect 23 0 6 1;
#P connect 11 0 3 0;
#P connect 8 0 11 0;
#P connect 3 0 14 0;
#P connect 14 0 0 0;
#P connect 4 0 9 0;
#P connect 7 0 8 0;
#P connect 29 0 14 1;
#P connect 6 0 9 1;
#P connect 4 0 8 1;
#P connect 24 0 22 0;
#P connect 17 0 18 0;
#P connect 25 0 4 0;
#P connect 18 0 4 0;
#P connect 22 0 17 0;
#P connect 10 0 8 2;
#P connect 9 0 10 0;
#P connect 5 0 10 1;
#P connect 4 0 5 0;
#P connect 27 0 28 0;
#P connect 7 0 29 0;
#P connect 5 0 12 0;
#P connect 16 0 5 2;
#P connect 16 0 12 1;
#P connect 30 0 29 1;
#P connect 2 0 23 0;
#P connect 12 0 13 0;
#P connect 1 0 15 0;
#P connect 15 0 16 0;
#P connect 13 0 29 2;
#P pop;
#P newobj 157 360 142 196617 p play+loop;
#P flonum 355 209 63 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 115 216 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 448 208 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 152 542 196 575 0;
#P message 438 322 30 196617 read;
#P newex 413 358 86 196617 buffer~ x 10000;
#P comment 114 197 53 196617 pitch;
#P connect 7 0 3 0;
#P connect 8 0 7 0;
#P connect 7 0 3 1;
#P connect 5 0 7 1;
#P connect 9 0 7 2;
#P connect 6 0 7 3;
#P connect 4 0 7 4;
#P connect 2 0 1 0;
#P pop;


November 15, 2006 | 5:33 am

some ideas :

-play~ + groove~ combo.

-play~ for playing from x to y, and groove~ for looping from y to z.

- two play~ objects.
- two groove~ objects the first one not being in loop mode…
- one groove~ , start at x with loopmode off , when Y is reached , set the loop mode to loop from Y to Z…
- play~ with two [line]s

- maybe a line~ phasor~ wave~ combo…

all depends on the precision+scheduling you need …

Quote: bin wrote on Tue, 14 November 2006 16:36
—————————————————-
> groove~ will loop from point X to point Y in a sound file. i want to play from point X then loop between points Y and Z. something like this…but better
>


November 15, 2006 | 7:38 am

On 15 Nov 2006, at 00:36, bin ray wrote:

>
> groove~ will loop from point X to point Y in a sound file. i want
> to play from point X then loop between points Y and Z. something
> like this…but better

groove~ can do that too, pretty easily.

volker.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 260 77 100 196617 Z – loopend;
#P comment 191 77 100 196617 Y – loopstart;
#P message 359 159 37 196617 loop 1;
#P newex 403 134 48 196617 loadbang;
#P message 403 159 29 196617 stop;
#P button 79 101 27 0;
#P flonum 136 101 45 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 119 169 27 196617 f 0.;
#P flonum 197 101 46 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 258 101 46 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 145 298 189 331 0;
#P newex 38 163 38 196617 sig~ 1;
#P message 401 52 43 196617 replace;
#P newex 401 74 97 196617 buffer~ samp 2000;
#P newex 163 207 78 196617 groove~ samp;
#P comment 116 77 100 196617 X – startpoint;
#P comment 80 77 100 196617 go;
#P connect 11 0 9 0;
#P connect 10 0 9 1;
#P connect 2 0 6 0;
#P fasten 14 0 2 0 364 190 168 190;
#P fasten 12 0 2 0 408 190 168 190;
#P connect 9 0 2 0;
#P fasten 5 0 2 0 43 201 168 201;
#P connect 2 0 6 1;
#P connect 8 0 2 1;
#P connect 7 0 2 2;
#P connect 13 0 14 0;
#P connect 4 0 3 0;
#P connect 13 0 12 0;
#P window clipboard copycount 17;


November 15, 2006 | 11:30 am

ah ok i never realised you could define the start point in the left inlet. thanks. its a shame it cant be a signal though…


November 18, 2006 | 8:14 am

bin ray wrote:
> ah ok i never realised you could define the start point in the left
> inlet. thanks. its a shame it cant be a signal though…

Groove~ is triggered, play~ and wave~ are position based. If you need a
signal to control it, use play~, but then you have to do your loop
yourself… (like you did already)
Triggers as signals are a pain, in a scheduler world its the natural way
of thinking.

Stefan


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


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