Additive Synthesizer - Michael Chouinard

General Structure

Instrument is created and set up in same way to previous step assignment.
Relevant Classes:
Synthesizer : Creates and maintains the instruments
AdditiveInstrument : The instrument that manages all of the sound resources and classes
HarmonicFactory : Factory class that helps keep the values persistent between notes
Harmonic : Where the sound is generated and Vibrato is calculated
ADSR : Where Attack/Decay/Sustain/Release/Fade-in/Fade-out are done

How it Works

The additive synthesizer takes the ideas of the basic synthesizer from the step assignment and makes the sound richer through harmonics. It allows the user to select (in the score file) the exact amplitude of up to eight harmonics. This allows for a greater variety in sound in order to make more realistic (non-beep-like) sounds.

After reading in the score file, each of the harmonics is created within a loop inside CHarmonic::Generate(). Immediately after, any provided vibrato is then applied to this combined sound. The vibratos effect is determined by a combination of its sinusoidal equation, similar to the one already in place for determining the new radian values for the sound output, but instead using vibrato_freq. This phase value is used to calculate how much of an effect the vibrato should have on the output sound, and this change is then multiplied by the sounds frequency to determine the new phase for the next output.

After the sound has been generated there, it is altered further in ADSR::Generate(). The ADSR envelope first implements attack. Starting the sound at an amplitude of 0 and rising however fast the user input to the attack_increase value. It then decays over a time input by the user back down to the sustain (amplitude = 1) value until it reaches the end. At the end, the sound fades down to 0 quickly in order to release the sound and avoid clicks. Furthermore, the cross fade-in/out are also implemented here. Fade-in is just an addition to attack and fade-out is just an addition to release.

Due to the method of sound generation in the Synthesizer class, polyphony was already innately done within the program. You just need to tell it in the notes file to play multiple sounds at once and it will.

All items completed as required for Additive Synthesizer

Score File General Format
Format ItemDescription
scoreOuter-most tag - Contains bpm and beatspermeasure as variables
bpm="240"Number of beats per minute
beatspermeasure="2"Number of beats per minute
instrumentContains variables for type of instrument and within it contain all specifics of notes.
Note="5d"Plays the note as described in the notes.h file
Measure="2"Which measure to play the note at
Beat="2"Which beat within the measure to play the note at
Duration=".5"How long to play the note for

Additive Synthesis Specific Formatting
Format ItemDescription Value Persistent Over Multiple Notes? Default ValueRange of Values
instrument="AdditiveInstrument"How to declare an instrument for this part. Must enclose all notes that will be played this way. N/A N/A N/A
vibrato_freq="5"Does a vibrato at a sinusoidal rate of 5Hz (can be less than 1) Yes 0.0 0 -> INF
vibrato_change=".1"Does a vibrato The rate a vibrato changes at (floating values 0 -> 1) Yes 0.0 0 -> 1.0
a#=".5"Amplitude for each Harmonic. Can supply values for harmonics 1 through 8 Yes 1 for a1 ||| 0 otherwise 0 -> INF
attack="1.0"The sound will start from 0 and grow to the amplitude of attack_increase over the duration given No 0.050 -> Duration
attack_increase="1.5"The value that the sound will grow to initially before decaying No 1.0 0 -> INF
decay="0.5"How long the sound takes to decay to amplitude = 1 after the attack phase No .025 0 -> Duration
release="1.0"The duration over which the sound will begin to decrease to 0 at the end of the note No .050 -> Duration
fadein="2.5"Fades the sound in over some amount of seconds (cross-fading) No 0.0 0 -> Duration
fadeout="2.5"Fades the sound out over some amount of seconds (cross-fading) No 0.0 0 -> Duration

Component Name Score File Sound File
Additive Synthesizer Michael Chouinard Score File Sound File
Subtractive Synthesizer Luke Pritchett Score File Sound File
Drum Synthesizer Jason Ostroski Score File Sound File
Recorded Performance Synthesizer Yanning Xue Score File Sound File
Effects Component Stephanie Brown Score File Sound File
Back to Main Page