Automatic bangs

houghtond's icon

Sorry if this is a fairly stupid question, I've been through several tutorials, and I'm struggling to find what I want, so I figured it may just be infinitely easier to just ask on here:

I have a bang going to a groove that plays a sample, the number of times this sample is played is then counted (up to a maximum of 8). I would then like another sample to be played the same number of times in succession automatically after a certain length of time.

I figured the best way to do this would be to perhaps have a metro triggering the second sample, but the problem I'm having is getting max to determine how many times the sample should be played.

Anyway, sorry again if this is an obvious question, but as they say, the only silly questions are the ones that remain unasked!

Peiman's icon

so if I understand you correctly something like this?

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

On 16 Nov 2008, at 00:17, Daniel Houghton wrote:

>
> Sorry if this is a fairly stupid question, I've been through
> several tutorials, and I'm struggling to find what I want, so I
> figured it may just be infinitely easier to just ask on here:
>
> I have a bang going to a groove that plays a sample, the number of
> times this sample is played is then counted (up to a maximum of
> 8). I would then like another sample to be played the same number
> of times in succession automatically after a certain length of time.
>
> I figured the best way to do this would be to perhaps have a metro
> triggering the second sample, but the problem I'm having is getting
> max to determine how many times the sample should be played.
>
> Anyway, sorry again if this is an obvious question, but as they
> say, the only silly questions are the ones that remain unasked!

houghtond's icon

That's closer than I've gotten, but it's not quite there yet.

I'm not pro enough to know how to share my patch like you did then, but I've saved it as a .txt, so I'll upload it here.

In the main patcher, go into SAMPLES, WORKING. The left button adds one to the counter, the middle button moves this number into an accumulator and the right button resets the accumulator. (The accumulator can be ignored for now really)

The left button basically triggers an 808hi hat sample, and adds 1 to a counter every time it is clicked up to a maximum of 8 times. I then want the middle button to play a sample the same number of times the first button is clicked automatically (This middle button then adds the number to the accumulator, I've got that bit sorted though).

The metronome is there to reset the counter after 4 seconds - the idea being the user queues up these samples, then 'fires' them off with the second button, but if they take too long, the counter is reset.

I hope that's explained a little better than the first attempt :)

jayrope's icon

in max 5 use "copy compressed" to get a compressed version of the patch instead of the .txt version. saves a lot of space.

else you can use a [mean] object to determine the number of bangs it received in it's inlet, from it's right outlet.

here's an example patch:

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

jrp