Please make a Pd patch that implements additive synthesis and an ADSR envelope while synthesizing 2 clarinet-like sounds:
use theoretically derived harmonics (every odd harmonic) each having an amplitude of one over its harmonic number;
Consider the following steps when making your patch:
Your additive synthesizer should have at least 5 (but no more than 10) sinusoidal oscillators created using the osc∼ object. The frequencies may be set using a single message that is unpacked (using the unpack object).
For theoretical synthesis, calculate the frequency of each oscillator according to some fundamental (sounding) frequency and its harmonic number. You should be able to play this version at any frequency.
The output of each oscillator should be multiplied by an ADSR envelope, defined with a single message having 5 values: the length of the attack (A), decay (D), sustain (S) and release (R) segments, as well as the sustain level (the attack goes to a level of 1).
The ADSR should be implemented as an abstraction1. It should take the message as its input (through an inlet), unpack it (using the unpack object), and send values where needed.
In the ADSR abstraction, use
• one line∼ object,
• a message implementing each ADSR segment
• 2 delay objects for triggering the decay and release;
• any other objects needed depending on your approach.
Apply an ADSR (with different parameters) to each oscillator before summing them to a final output. usually higher frequencies take longer to reach their steady state and are the first to decay.