Note trigger algorithm?

I want to do guitar effects that start an ADSR on a note-on trigger. I have done it in the past (on an FV-1) by generating an envelope, delaying it 10 or 20ms, and comparing the dry and the delayed envelopes. I see if they are above a threshold (say 10mV), and their ratio is above another threshold (say 6dB). It is reasonably robust, but I was wondering if there is a more sophisticated approach that is better.

(Searching the forum, I am surprised that this hasn’t come up.)

I’m actually doing this right now, for various things.

I’ve tried two approaches that work, still haven’t decided which one to use.

  1. Envelope detector

My currently envelope is 6fb low pass->abs->leaky

Slightly different to your delay method - I calculate the gradient and height over 12 points and use that as the trigger.

  1. Spectrogram

Convert FFT to phase corrected frequencies, and trigger on lowest freq above a threshold.

Both are pretty good. Obviously Spectrogram has a intrinsic delay - but that can be lowered with a pitch shifter.

Have a look at this article here:

It’s also about using the BACF to detect onsets. He hasn’t release any code for it yet, but told me he would eventually. Anyhow you can rhyme out what he’s doing from the article. If we get the BACF running efficiently on the Daisy, this might be an option for you.

Yes, this is as interesting as his BACF pitch detection. Using frequency and phase discontinuities rather than envelope discontinuities is powerful.

It is too bad that he has decided to not open source these algorithms. Quite a loss for the Daisy community, but I guess the guy has to make a living. :disappointed: