[Sharing] Drum trigger (audio) to onset/velocity

Rodrigo's icon

Here's my drum trigger patch that uses just native objects, locks out each trigger (so they don't trigger each other), does velocity, etc....
With velocity there's a tiny bit of latency (180 samples), but it's better than a hardware unit I think.

It's tuned for 'on drum' piezos, so it may not work well with drum mic input, but I've not tested that.

I used the DDrum triggers, physically on my drums, but it should work for any similar/piezo/head trigger.

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

The volume differential bit is based on Peter McCullough's envelope follower.

5453.test.wav
wav
Rodrigo's icon

Attached is audio from my actual triggers (no eq/gain modification) to test it with.

5454.test.wav
wav
ullrich's icon

very nice idea, thanks a lot for sharing!

deligut's icon

Thanks a lof for sharing. I tried you patch together with your sound file. There is quite a bit of latency/delay between the sound file and the trigger. I would guess about a second. Is this normal or am I doing anything wrong? The delay is also between the audio (sound file) and the numbers appearing in the boxes. Therefore, I don't think it is related to my soundcard.

Rodrigo's icon

There's something going on. It's a few ms latency on all the systems I've tried.

Are you hearing MIDI piano along with each drum hit?

deligut's icon

I do hear MIDI Piano but with 1 sec delay. It is probably specific to my computer (windows 7, 32 bit).

Rodrigo's icon

That could be because of the MIDI driver stuff. You said you also get a 1sec delay before you even see numbers too? The rightmost number out of each bit of it should come out pretty much instantly. If not, I'm kind of stumped because all the guts are audio rate. It gets converted into a max message at the very end of the process, but that most definitely shouldn't take 1 second.

deligut's icon

I connected a click~ to your onset_velocity patcher and I got an immediate response. That suggests to me that your patch works perfectly well.

deligut's icon

This is what I get. It is similar on my Laptop. I have never heard that Midi drivers are an issue. I have an ASIO audio driver with fairly low latency. Again, it is the changing of the numbers in the patch that is delayed and consequently the Midi Output is also delayed.

5497.Attack.mp3
mp3
Rodrigo's icon

Wow, that's really slow.... weird that click~ works. Have you tried sending it other audio, or using adc~ input?

KllyShhn's icon

thanks for sharing, Rodrigo! Did you connect your DDrum triggers into an audio interface (something like a Focusrite Scarlet) or did you need a drum trigger interface?

Rodrigo's icon

Man, an old thread/bump!

Yeah, I was sending it into a "normal" soundcard. The whole idea was to bypass the need for a trigger interface/brain.

felipe vaz's icon

Hi Rodrigo, thanks for sharing this! I saw you used those ddrum triggers with it -- were you using regular drumheads or mesh ones? I saw somewhere that it is easy to get double triggers if not using mesh heads, and I don't know if your patch solved this already, or if mesh heads are needed anyway.

Rodrigo's icon

I was using regular heads for this. If I remember right I built in a 'lockout' to avoid double triggers in the patch above.

felipe vaz's icon

thanks again! :)