Effects

A CEffect class was created that inherits from CAudioNode. Each individual effect is its own class that inherits from CEffect. This allows there to be a vector of CEffect* in the CInstrument class. Effects are added to this vector through the XML file.An instrument creates a frame and than iterates through the vector of effects. Four effects were made to satisy requirements and two others were made to improve the music file. The CNoiseGate class receives a frame, if the value of the frame is greater than a threshold or less than the negative of that threshold the frame is unchanged. If it is not the value of the frame is set to zero. The CCompression class behaves similarly. It receives a frame and if the value of the frame is less than a threshold and greater than the negative of that threshold it is unchanged.If not, the value of the frame is set to the threshold.The CChorus and CFlange classes simply play a the current frame plus a delayed frame. This is implemented using a circular queue in each class.The other classes only change the amplitude of a particular instrument so that different instruments can be featured at different parts of a song.