Line~ and play~ for playing slices of a buffer~

Aug 28, 2006 at 5:12pm

Line~ and play~ for playing slices of a buffer~

I’m a new Max/MSP user undertaking an educational project — specifically, a granular mash-up type instrument. To start off, I’m trying to load a wav into a buffer and trigger 1 beat at a time according to a metro. For now the patch assumes the wav will have 4 beats. I’m doing this by loading a wav into a buffer~ and then driving a play~ with a line~. I advance to the next beat by adjusting the line~’s parameters. It seems to work okay except the last beat always comes out wrong. I think when I tell it to jump to back to 0 ms in the buffer, it plays the previous 3 beats quickly in reverse. I’m sure I could get around this somehow, but I feel as though I’m wading into a sea of unelegant programming. Is there another easier way I could do this?

Here’s my patch so far:

http://web.njit.edu/~ams23/temp/psiker.mxb

Any suggestions or tips are greatly appreciated.

Thanks

#27357
Aug 29, 2006 at 9:59am

#82688
Aug 29, 2006 at 10:32am

Hi Adam,

a slightly different approach that might work well would be to use
groove~ instead of play~. If you combine this with sfinfo~ so that you
know the duration of the sample, and hence also can subdivide it into
sections in terms of ms., you could dynamically set end point, set “loop
0″ (no looping), set section start point and trigger playback using a
float to left inlet, and use sig~ 1 to drive it.

If you play around with the help patch for groove~, you will see that
more or less all you need is already in there.

Generally I would recommend that you walk through the help patches for
all of the buffer~- based MSP externals that are suggested by the “See
Also” in the help file to see what they do and how they differ from each
other. I still do that occasionally in order to decide which one will
best fit the task at hand.

Best,
Trond

adam wrote:
> I’m a new Max/MSP user undertaking an educational project — specifically, a granular mash-up type instrument. To start off, I’m trying to load a wav into a buffer and trigger 1 beat at a time according to a metro. For now the patch assumes the wav will have 4 beats. I’m doing this by loading a wav into a buffer~ and then driving a play~ with a line~. I advance to the next beat by adjusting the line~’s parameters. It seems to work okay except the last beat always comes out wrong. I think when I tell it to jump to back to 0 ms in the buffer, it plays the previous 3 beats quickly in reverse. I’m sure I could get around this somehow, but I feel as though I’m wading into a sea of unelegant programming. Is there another easier way I could do this?
>
> Here’s my patch so far:
>
> http://web.njit.edu/~ams23/temp/psiker.mxb
>
> Any suggestions or tips are greatly appreciated.
>

#82689
Aug 29, 2006 at 10:38am

>>> [quote]
I think when I tell it to jump to back to 0 ms in the buffer, it plays the previous 3 beats quickly in reverse. I’m sure I could get around this somehow, but I feel as though I’m wading into a sea of unelegant programming.
[/quote]

without looking at your patch, i would say that when you want
a thing to stop playing when you jump back, you have t
implement that yourself, should be simple – except that it
might click, but that could happen anyway and is not only
a result of using a message.

#82690

You must be logged in to reply to this topic.