I'm trying to work out how to identify (or predict) ADSR parameters (attack time, decay time, sustain level and release time) from envelope data of real signal (or 'raw' data, but I think getting it from envelope should be easier).
Here is example graph of envelope data that I need to get ADSR parameters for:

example graph

I'm thinking about two potential solutions:

1. Use some third-party python library
Then my question is whether there is library that could help me with that. I did some research (e.g. here) but I didn't find anything that could help me. When I happily hit upon something related to ADSR, it usually was some kind of generation of signal with given ADSR parameters which is opposite to thing I'm looking for.

2. Create machine learning model
Here I'm thinking about train some linear regression model trained with prepared data with known ADSR parameters.
If this is better solution, I should rather ask this question on Data Science Stack Exchange, but I think that in this case creation of model would be too resource hungry and would take very long to train it. Why?
I've already created a model for shape of waveform recognition (predict whether it's square or sine) and for this, I needed only small part of the signal (like 100 or 200 points) and even with such small number of features (every point was treated as a feature), training of the model took few minutes.
For this case, I need to process signals which can last for 2 or 3 seconds, which for sampling 44,1kHz generates like 100k or 200k points. It's too much to use it with my standard hardware setup. Unless there is solution related to ML that I don't know about. I'm open for every idea!

What do you guys think? Is there any other way to solve this problem?

  • $\begingroup$ Is the question mainly about the programming approach, for instance so you could scan many of these types of envelopes instead of doing it by inspection? This would be true, for instance, if your ADSR were the same that generated the sound, and the ADSR were programmed in true time units. If so, people often use a state machine approach. Not enough room in the comment for details, but I'd like to know if that's what you're after before elaborating. $\endgroup$ – Nigel Redmon Jan 23 at 3:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.