Open zsiciarz opened 11 years ago
Idea: write a subclass of SignalSource
and reimplement the sample()
method:
SampleType ADSR::sample(std::size_t position) const
{
// calculate gain based on A/D/S/R state and duration progress
return gain * m_originalSource.sample(position);
}
A useful synthesizer component is Attack-Decay-Sustain-Release (ADSR) envelope.
References: