Marsyas  0.5.0-beta1
Public Member Functions
APDelayOsc Class Reference

A non-aliasing analog oscillator algorithm. More...

#include <APDelayOsc.h>

Inherits MarSystem.

Public Member Functions

 APDelayOsc (std::string name)
 APDelayOsc (const APDelayOsc &a)
MarSystemclone () const
void myProcess (realvec &in, realvec &out)
 Processes data.
 ~APDelayOsc ()

Detailed Description

A non-aliasing analog oscillator algorithm.

This is a non-aliasing virtual analog oscillator algorithm.

For the saw algorithm the output of the fractional delay is fed back into the delay line. This creates a perceptually harmonic spectrum that approximates having all the harmonics at equal power up to the Nyquist frequency. The saw algorithm ends up having a considerable DC offset, that is removed by subtracting frequency/Samplerate from each sample. Finally the leaky integrator is used to apply an exponential decay to the frequency spectrum.

The saw wave is generated in a similar way, but we don't need to worry about any DC offset. The only real difference is the square algorithm is that we negate the samples as we feed them back into the delay line. This will generate a spectrum containing the even harmonics. The one other side effect of this as that we double our period, so we must shorten the delay line to compensate.

TODO: Add triangle wave

TODO: Add ability to modulate pitch. This could be done using two read pointers and a cross fader. It could also be done by changing the delay time at the end of each cycle. Controls:

Definition at line 61 of file APDelayOsc.h.


Constructor & Destructor Documentation

APDelayOsc ( std::string  name)

Definition at line 25 of file APDelayOsc.cpp.

APDelayOsc ( const APDelayOsc a)

All member MarControlPtr have to be explicitly reassigned in the copy constructor.

Definition at line 32 of file APDelayOsc.cpp.

~APDelayOsc ( )

Definition at line 41 of file APDelayOsc.cpp.


Member Function Documentation

MarSystem * clone ( ) const [virtual]

Implements MarSystem.

Definition at line 45 of file APDelayOsc.cpp.

void myProcess ( realvec in,
realvec out 
) [virtual]

Processes data.

Parameters:
inInput data to read.
outOutput data to write.

Implement this method in subclass to define specific data processing.

Implements MarSystem.

Definition at line 130 of file APDelayOsc.cpp.


The documentation for this class was generated from the following files: