Round Robin sample triggering using buffers? Appreciate any help!

Connor Haynes's icon

Hi everyone,

I have a question which i am having trouble with, as im pretty new to Max. Basically i am doing an installation which requires me to randomly trigger samples (around 30 different samples for 12 different triggers). I have made a patch where this is the case using a umenu and chained sfplay~ using a gate, so that multiple samples can play back upon simultaneous bangs. The only problem is this potentially could be too much on the disk drive to load as i may have 12 of these triggers going off at one time, which would be alot of samples for the hard drive to search for in real time! (30samples x 12triggers) So i was wondering if there is anyway i could modify the patch, and use buffers so the samples are reading off the RAM/Max instead, but still keeping the round robin cycle aspect ect. Using a play object which i can modulate the playback speed with the velocity would be a massive bonus too which i know sfplay~ and groove~ has, but to add, im not sure that the playback speed would sound good if the 2nd trigger pitched the both samples playing as the previous sample was playing out. Il include my patch up here so you can see what im doing, thank you very much for any input on this guys! Cheers!

Connor~

Round Robin Help Patch.maxpat
Max Patch

Source Audio's icon

I would instead preload all samples into 12 sfplayers, and recall samples by numbers.
That way one can switch between samples fast enough.
Look into sfplay help file

Connor Haynes's icon

Hi there,

Thank you for the reply! That makes sense, but Im looking into it now in the help file but im having trouble understanding how that would work. I sort of have an idea but I cant materialise it, please could you give me an idea of how that would chain together? Cheers!

Rodrigo's icon

I load everything into a polybuffer~ then use this poly~ to play individual samples.

Max Patch
Copy patch and select New From Clipboard in Max.

So for example, if you create a polybuffer~ named "drums" and then name the poly~ [poly~ {filename} 8 args drums] and then just send it numbers (i.e. "1", "2", "3", etc...) it will play back the corresponding buffer inside of the named polybuffer~.

(The reason it's inside a poly is so that each sample can play it's full duration if another sample is triggered before it completes. The "8" in the poly~ name is how manyn simultaneous samples you can have.)

Source Audio's icon

Advantage of polybuffer is that You don't need to learn how to preload sfplay
with samples, but if the samples are very long and many then it takes a time till buffers are loaded.
Then sfplay could be a better solution.
You have to decide upon that parameter and max number of polyphony needed,
and if all triggers share same amount of voices, or not.
Here is example how to preload samples into sfplay :

Max Patch
Copy patch and select New From Clipboard in Max.


Connor Haynes's icon

Guys, i cant thank you enough, really really appreciate it. Both work a charm! THANK YOU

Ivan Punal's icon

Hi! I've tried to create a poly sampler with a polybuffer object as described by Rodrigo, but I can only get one note at the same time ... My poly object has the patch by Rodrigo (saved as "drumpoly.maxpat") , and inside the box there is "poly~ drumpoly 6 @args cymbals". Here the name "cymbals" correspond to the name of the polybuffer~ object. The poly~ has on inlet with a number to change the sample. When I change the number a new sample plays, but as soon as the number is changed the old sample stops and the new one plays, so no real polyphony.

Any tips?

Rodrigo's icon

Silly question perhaps, but do you have `prepend note` before the `poly~`? That's what lets the `poly~` know to do the polyphonic thing.

Ivan Punal's icon

Thanks Rodrigo! I managed to get the polyphony working!