Post Go back to editing

ADAU1466:How can I retrigger GainEnvelope on every guitar pick attack?

Thread Summary

The user is working on an ADAU1466 SigmaStudio project to create a banjo-like decay for a hexaphonic guitar. The issue is that the GainEnvelope block does not retrigger on subsequent pick attacks while the string is still ringing. The solution involves using a Peak Envelope block, a Hamming differentiator, a comparator, and a OneShot to detect new attacks and retrigger the envelope. Adjusting the Peak Envelope hold time, comparator threshold, and OneShot duration helps mitigate false retriggers and ensures reliable attack detection, even with natural string amplitude fluctuations.
AI Generated Content
Category: Software
Software Version: SigmaStudio 4.7

Hello,

I am working on an ADAU1466 SigmaStudio project for a hexaphonic guitar.

My goal is to create a banjo-like decay characteristic, where the note decays much faster than a normal guitar while preserving the natural attack.

I am using a GainEnvelope block, but I have a problem:

The GainEnvelope starts correctly on the first pick attack. However, once triggered, it always completes its programmed cycle and cannot be retriggered by a new pick attack while the string is still ringing.
For example:

Pick a string
Let it decay to approximately -20 dB
Pick the same string again

Ideally, the second pick attack should restart the GainEnvelope from the beginning. Instead, the new note is affected by the remaining state of the previous envelope cycle, causing the second note to sound quieter than intended.

My question is:

What is the recommended SigmaStudio method for detecting every new guitar pick attack, including attacks that occur while the previous note is still sounding?

This is especially important for fast playing, where multiple notes may be picked before the previous note has fully decayed. The final goal is not note-on detection from silence, but reliable attack detection on an already ringing guitar string.

Is there a dedicated SigmaStudio block for this purpose, or is a custom transient/attack detector the recommended approach?

The platform is ADAU1466 running in SigmaStudio without an external MCU.

Any ADAU1466 / SigmaStudio specific suggestions would be greatly appreciated.

Thank you.

Thread Notes

Parents
  •      Hello,

         The issue you found reminds me of a '50s (?) song, Johnny B. Goode -- he could "play a guitar just like ringing a bell."  Bells are known for rhythmic waves of harmonics with varying amplitudes and phases.  To synthesize a bell sound you needed balanced modulators, which weren't cheap back in the 70s.   In the DSP world, a multiplier does it.  DSPs are multiply-and-add machines, so the chip you're working with has literally thousands of them!   I grew up with vacuum tubes, so what little I know about DSP is from reading a few books and playing with SigmaStudio.  You'll have fun doing the same.

         It's no surprise that a real-world input would cause issues, although I didn't expect this one.   I added modulation to my simulated "guitar" although having no idea of how much modulation (or, "ripple") in the guitar signal would be present:

    Then I made the incoming signal increasingly "difficult" for the project to handle until it just couldn't.  In the scope traces that follow, the top trace is the output at PeakEnv1, the bottom is the project's audio output.

         This first example is with no modulation and a strum rate of 10 Hz.  The stairstep in the decay is from the 10mS "hold" setting of PeakEnv1.  We set this to reject ripple from individual cycles of the input waveform -- thus we need more hold when lower audio frequencies are present.  Ten mS is enough to cover a 50 Hz input, which has a period of 20 mS and thus a time of 10 mS between peaks (all SigmaStudio level detectors are full-wave; in DSP this is merely "absolute value").  You can make this shorter if 50 Hz is never present, or longer for a holdoff against multiple triggering, as you have suggested.

         This one is with 5 Hz, -10dB (roughly 30%) modulation, with a low 1 Hz strum rate.  It works fine here.

         It gets difficult when the modulation rate and the strum rate are nearly equal -- here, 10 Hz and 8 Hz respectively.  Also the modulation has been increased to -6 dB (50%).  The project cannot make sense of this chaos.  It appears that banjo picking is often even faster, so it mayl be tough to separate the modulation from the picking.

         Presently, I don't know exactly how to fix this, yet it's something we can work on together.  You said your DSP experience is limited, but if you have analog EE experience this is quite helpful.  SigmaStudio is great for building analog-like circuits and you won't burn your fingers on a soldering iron!   There’s a few guitar enthusiasts on EZ who might jump in and help.

         Edit:  By the way, you can retrigger the Envelope block by interrupting its control input (that is, setting it to zero) for just one sample interval.  Yet, presently this isn't useful since we're having trouble with the basic idea.

         Best regards,

         Bob

  • Thank you for your new ideas!

    I really like your simulations, and in my opinion the second version is the closest to the decay of a real guitar note. However, I still haven't been able to fully characterize the amount of amplitude modulation. Based on my measurements so far, it seems to vary not only from string to string, but even from fret to fret.

    Your simulation gave me a new idea: generating the trigger signal from a separate high-frequency band.

    The reason I think this could be promising is that the highest harmonics seem to decay much faster than the lower frequency components, and they also appear to exhibit much less amplitude modulation during the decay. My idea is to generate the trigger from this high-frequency band, taken directly from the original full-band signal before any EQ processing. That way, the trigger would mainly respond to the initial attack while being much less affected by the later amplitude fluctuations that occur during the note's decay.

    So far I've only had the opportunity to think about this idea theoretically. Within the next few weeks I'll finally have time to build and test it properly, and I'll let you know the results.

    Best regards,
    Nicholas

Reply
  • Thank you for your new ideas!

    I really like your simulations, and in my opinion the second version is the closest to the decay of a real guitar note. However, I still haven't been able to fully characterize the amount of amplitude modulation. Based on my measurements so far, it seems to vary not only from string to string, but even from fret to fret.

    Your simulation gave me a new idea: generating the trigger signal from a separate high-frequency band.

    The reason I think this could be promising is that the highest harmonics seem to decay much faster than the lower frequency components, and they also appear to exhibit much less amplitude modulation during the decay. My idea is to generate the trigger from this high-frequency band, taken directly from the original full-band signal before any EQ processing. That way, the trigger would mainly respond to the initial attack while being much less affected by the later amplitude fluctuations that occur during the note's decay.

    So far I've only had the opportunity to think about this idea theoretically. Within the next few weeks I'll finally have time to build and test it properly, and I'll let you know the results.

    Best regards,
    Nicholas

Children
No Data

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.