..Help .Objects

Oscillator

This object outputs one of eight waveforms.

Pins
io letter name unit description
in F frequency Hertz frequency of waveform
P phase degrees phase angle
A attenuation auto amplitude of waveform
O offset additional offset to add
out = auto the desired waveform

Parameters
name option key description
analog
waveform
sine s Selects which waveshape to use. Analog waveforms sound better but take longer to calculate. Use these for audio data.
square1 q
sqaure2 u
triangle t
ramp1 r
ramp2 a
digital
waveform
square e Digital waveform are faster to calculate but sound worse. Use these for control signals.
ramp m
F/P frequency f Chooses between frequency and phase input.
phase p
Beginning Phase -180 1 When play starts, oscillators may be set to start at -180 degrees or 0 degrees.
0 0

Notes

Frequency and Phase inputs are mutually exclusive. Use the 'Begining Phase setting' for frequency input mode. Starting at -180° will produce a negative edge on the first sample.

The phase input is normalized from -1.0 being equivalent to -180° to +1.0 being equivalent to +180°. A digital ramp wave's output may be used as a phase control. Add an offset to adjust the phase, multiply by an integer to scale the frequency.

The analog waveforms use internal lookup tables to generate their output. Each table has 8192 (213) values.

no anti-aliasing

About -80dB of harmonic distortion, also known as aliasing, is caused by the lookup process. This is shown on the spectrum to the right. The large peak at the left of the spectrum is the oscillator frequency. The smaller sharper peaks are the distortion.
For the sine wave, this can be reduced to better than -120dB by using the Equation Builder with anti-aliasing with a sin(x) formula as shown to the right. The oscillator peak appears wider only because the amplitude scale is now -120dB. A ramp wave generates the phase angle, note the multiplication by pi to convert the -1.0 +1.0 range to radians.




©1999-2008 Andy J Turner
All rights reserved.