How to sync a gate sequencer with a noisy drum recording?

beat detection is a classically hard problem. In some cases an envelope follower can do an acceptable job. But all the literature going back at least 40 years starts there, and then tries to get better…

I haven’t read the literature but I’m sure you’re right. Has it succeeded in getting better though? Are there any tools in VCV that can do a better job than an envelope follower that has filters to narrow down the frequency response, hysteresis to give a ‘range’ around the threshold and hold off to prevent multi-triggering etc?

Pulling a beat from a recording of live drums/percussion where the timing is inconsistent that also has significant inconsistencies in level as well as lots of ambient noise is always going to be a challenge. It can be very hard to tell the difference between an off grid hit thrown in by the drummer and a random noise peak from the environment.

I imagine it’s something that AI could probably get very good at though.

2 Likes

Wow, this is a really interesting conversation! I have so many ideas to play with. For anyone interested in experimenting with this, here is my audio recording:

Feel free to do whatever you want with this recording. If anyone can get a good trigger for the underlying rhythm pattern, it would be super cool to see what you did.

I will keep devoting a little more time to this project every night also.

2 Likes

I’m starting to think what I really want is to just perform the rhythm manually myself. I just tried it using Count Modula’s Manual Gate. Is there a way I can record a series of triggers coming out of Manual Gate and play them back later? Ideally, some way I could save them along with my patch?

That’s sort of what I was thinking. Use Count Modula’s MAN CV to control the BPM input of, say, CLKD, which triggers a simple click noise. Keep playing it over and over, fine-tuning the BPM CV.

But - it’s 02:48 long, so there may be some drift.

The short description of VCV Library - Fehler Fabrik Fax sounds like it might be what you had in mind.

Again with tweaking a clock’s BPM, try VCV Library - Entrian CV .

For directly recording each beat, try VCV Library - Entrian Drummer - it has a “record” button (tap on MIDI Space bar?) but I’ve never tried to use it. It may be that you have to use a clock just to advance the record head, but I suppose it doesn’t have to be at the same tempo as the real drums on the audio recording. I’m not sure if it has some kind of temporal quantizing, or if it can be turned off.

[edit - It just occured to me that Entrian Drummer might only be good for adding percussive sounds, but on second thought, I see no reason why you couldn’t use the output as a clock signal to run a sequencer, if you want to add a melody.]

1 Like

This thread has inspired me to record (or find recordings) of natural rhythmic sounds (crickets, frogs, birds) and use them as a clock.:smiley:

. . It should be interesting. . .

3 Likes

I’ll bite. Here’s my simple demo patch. I took your drum circle sample and normalized it to a healthy level. If you want to use it with the original sample, you’ll have to tweak the gain and/or threshold. With the Hora Free Follower, Gain and Threshold both control when it derives a trigger from the audio. I usually end up setting the gain so that the peaks are in the top half of the level display, then tweak the threshold until it just catches bigger peaks.

I THINK that I’ve only used Free modules and done the ‘minimal demonstration’ version.

EnvelopeFollowerClock.vcv (8.5 KB)

1 Like

Not sure how detailed you want to get, but this was the result of a quick play with the general groove.

Not perfect by any means, but about as good as I might hope to play if I were in the drum circle haha.

6 Likes

That is much better than what I was able to do with ShapeMaster. Can you tell me more about what settings you used and any other tips?

Sure - first I normalised the file in Audacity (although I’m not sure that did much as it still seemed relatively quiet.

Then I used these settings in the side chain (loads of gain as you can see)

Also I did pick the best bit for my video haha - which was from around halfway to three-quarters the way through the audio file.

EDIT: One other tip - once you are reasonably close to what you want, use hysteresis as a kind of ‘fine tune’ control for more or less triggers.

4 Likes

OK check this. I ran with the envelope follower clock driving a synth voice, but then I thought why not drums? So there are stretches where the drums add up really well, and others where they hiccup in the most charmingly awkward way.

Chaircrusher-DrumFollower.vcv (15.6 KB)

3 Likes

I’m still working on this project, and I’m going down a tedious but interesting path. The first thing I did is take a shorter excerpt and used Audacity’s compressor to get a more consistent level. Here is the result:

Then, while still in Audacity, I went through every single 4-beat cycle, one by one, and entered the time offset of each beat into this spreadsheet:

It turned out there were 108 bars (a serendipity for any fellow yogis reading this).

The columns with a pink background are the raw data I entered: beat1 … beat4.

The column “calc1” contains a formula for a pair of linear functions that model the timing of beat1 to within plus or minus 50 milliseconds. It turns out we all sped up a little bit in the middle, then slowed down again toward the end.

Even though I’m still working on this, I’m publishing what I have so far, case anyone else wants to play with it. My next step is to write a C++ program that uses that calc1 formula to generate another WAV file containing triggers for beat1 that I can bring into my VCV Rack patch to drive other fun stuff to synchronize with the original audio. I will report back here when I get to that point.

I’m getting good results with generating a mono WAV file that contains a trigger that’s in sync with my recorded drum beat. But now I’m wondering if there is some VCV Rack module out there that makes it possible to load a data file to generate 4+ separate trigger signals from a text data file (perhaps CSV). Does anyone know of something like this? If not, I might create one myself.

And here is the result…

6 Likes