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,

         You've thought of an interesting and fun application!  To my knowledge there's no one block for this, yet SigmaStudio allows us to build complex functions with its basic blocks.  The project shown and attached below appears to work with its built-in test signal -- you'll need to test and perfect it with a guitar input.

         The Peak Envelope1 block finds the level of the incoming signal.  Next, the coefficient table inside filter FIR1 has been set up as a Hamming differentiator (Lyons, Understanding Digital Signal Processing, Third Edition, Section 7.1.2).  A rising signal produces a positive output, a decaying level causes its output to go negative.  Striking a guitar string produces a peak higher than the the level at the A input of comparator ABCD1, causing its output to go high.  This triggers OneShotR1, which produces a 1 millisecond pulse (set by Timer1).  SlewVol2 is set for a quick rise time and a slower fall time.  Adjust its fall setting for the desired "banjo" decay.  You'll find a table of rise and fall times corresponding to these settings at this link.

         The test signal has adjustable "strumming" rate and tone pitch.  It works over a reasonable range of these as well as with a range of input level.  Of course I'm curious about the results you get with a real-world input -- let us know!

    4137.Guitar-Banjo.dspproj

         Best regards,

         Bob

         

  • Hi Bob,

    Thank you again for creating and sharing this project. I think I have identified the main reason why the effect behaves differently with a real guitar signal than with the built-in test source.

    The main issue is not simply noise. What I hear is a repeated re-triggering during the natural decay of a guitar note, which causes the volume to repeatedly open up again, creating a "pumping" or "reappearing" decay instead of a smooth banjo-like fade.

    After investigating the guitar signal, I realized that the amplitude envelope of a plucked string is often not a smooth exponential decay. The signal level can rise and fall multiple times during the note's sustain. I believe there are at least two physical reasons for this:

    1. Interference caused by neck and instrument resonances, where energy is exchanged between the string and the instrument structure.
    2. Magnetic string pull from the pickup, which can also modulate the vibration amplitude.

    The amount of this amplitude fluctuation is not constant. It varies significantly from string to string and even from fret to fret on the same string. Some notes behave almost perfectly, while others show strong envelope fluctuations.

    Because your detector is based on:

    Peak Envelope -> Differentiator -> Comparator -> OneShot

    I suspect that these natural envelope increases are interpreted as new attacks, causing repeated triggering of the OneShot and reopening of the Slew Volume stage.

    So far I only had time for a quick test and confirmation that the project works with a real guitar signal. I have not yet had enough time to systematically experiment with settings.

    Some ideas we discussed for future testing are:

    • Increasing the Peak Envelope hold time to smooth the envelope.
    • Raising the comparator threshold to ignore smaller envelope fluctuations.
    • Experimenting with longer OneShot times.
    • Adjusting the Slew Volume decay settings.

    Another idea that came up is using two envelopes instead of a differentiator:

    Fast Envelope - Slow Envelope

    which appears similar to the "Differential Envelope Technology" used in products such as the SPL Transient Designer. The idea is that a true attack would produce a large difference between the fast and slow envelopes, while slower amplitude fluctuations during sustain might be ignored.

    Since I am not a DSP expert, I should mention that this entire project was built with the help of ChatGPT. Most of my previous SigmaStudio work has focused on guitar tone shaping, EQs, preset switching, and multi-channel processing rather than transient detection.

    I will continue testing and report my findings when I have more time to experiment. In the meantime, I would be very interested in hearing your thoughts on the envelope fluctuation issue and whether you have any suggestions for improving the attack detector or making it less sensitive to these natural sustain variations.

    Thank you again for your help and for sharing the project.

Reply
  • Hi Bob,

    Thank you again for creating and sharing this project. I think I have identified the main reason why the effect behaves differently with a real guitar signal than with the built-in test source.

    The main issue is not simply noise. What I hear is a repeated re-triggering during the natural decay of a guitar note, which causes the volume to repeatedly open up again, creating a "pumping" or "reappearing" decay instead of a smooth banjo-like fade.

    After investigating the guitar signal, I realized that the amplitude envelope of a plucked string is often not a smooth exponential decay. The signal level can rise and fall multiple times during the note's sustain. I believe there are at least two physical reasons for this:

    1. Interference caused by neck and instrument resonances, where energy is exchanged between the string and the instrument structure.
    2. Magnetic string pull from the pickup, which can also modulate the vibration amplitude.

    The amount of this amplitude fluctuation is not constant. It varies significantly from string to string and even from fret to fret on the same string. Some notes behave almost perfectly, while others show strong envelope fluctuations.

    Because your detector is based on:

    Peak Envelope -> Differentiator -> Comparator -> OneShot

    I suspect that these natural envelope increases are interpreted as new attacks, causing repeated triggering of the OneShot and reopening of the Slew Volume stage.

    So far I only had time for a quick test and confirmation that the project works with a real guitar signal. I have not yet had enough time to systematically experiment with settings.

    Some ideas we discussed for future testing are:

    • Increasing the Peak Envelope hold time to smooth the envelope.
    • Raising the comparator threshold to ignore smaller envelope fluctuations.
    • Experimenting with longer OneShot times.
    • Adjusting the Slew Volume decay settings.

    Another idea that came up is using two envelopes instead of a differentiator:

    Fast Envelope - Slow Envelope

    which appears similar to the "Differential Envelope Technology" used in products such as the SPL Transient Designer. The idea is that a true attack would produce a large difference between the fast and slow envelopes, while slower amplitude fluctuations during sustain might be ignored.

    Since I am not a DSP expert, I should mention that this entire project was built with the help of ChatGPT. Most of my previous SigmaStudio work has focused on guitar tone shaping, EQs, preset switching, and multi-channel processing rather than transient detection.

    I will continue testing and report my findings when I have more time to experiment. In the meantime, I would be very interested in hearing your thoughts on the envelope fluctuation issue and whether you have any suggestions for improving the attack detector or making it less sensitive to these natural sustain variations.

    Thank you again for your help and for sharing the project.

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.