variable audio rate metronome

dondelion's icon

Hello,

I would like to output single sample 'clicks' at a variable rate where the delay times between each click are stored in a buffer. The idea is to input a click and it steps through the buffer delaying the click by the stored time before sending another click. It's dead easy using scheduler rate objects but I think it's the feedback loop that is causing problems when running at audio rate. I've tried using delay and tapin/tapout but I just can't quite get it...any ideas?

Thanks in advance!

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

Patch to demonstrate -

Eric Lyon's icon

This would work with my dmach~ object. The downside is that data entry is cumbersome because the object is designed to do a lot more than what you described. But it would reproduce your sequence of click, with sample-accurate timing. I've shown how to do this with the first four durations in your sequence.

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

Eric

dondelion's icon

Eric,

I did check out dmach~ and have looked at your patch but can't get my head around how to store a pattern of arbitrary times...

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

I've now changed the value I'm storing to the absolute time value rather than the delta time value. The input signal is compared to the first stored value in the buffer and when they match a counter increments and the signal is compared to the next sample. It's all done at audio rate and it appears to be sample accurate.