Skip to main content

Wave: oscillator

ReverbWave AWave BWave CEnvelope #0Envelope #1Envelope #2Envelope #3Envelope #4DDleftrightAPPLY_EFFECTChannel Block (there are six of them)RIGHT_LEVEL*REVERB_LEVEL*LEFT_LEVEL*APPLY_WIDENER80 samples (3.6ms)DelayEffectD
Where we are in the synthesizer diagram
LowpassOscillatorOSCILLATOR_SHAPEOSCILLATOR_HZ*PULSE_WIDTH*OSCILLATOR_LEVEL*FILTER_KINDFILTER_HZ*FILTER_RESONANCEDIGITAR_MODEDIGITAR_BLENDDIGITAR_HZ*DIGITAR_FEEDBACK*OUTPUT_LEVEL*FilterDelayDigitar Block (Wave A/B only)Input Gate+/- Blend
Wave component (oscillator highlighted)

The next three sections will examine the "Wave" component, which appears in the synthesizer diagram as Wave A, Wave B, and Wave C. There are three parts: the oscillator, the digitar, and the filter. Let's start with the oscillator.

What is an oscillator?

In classic analog electronics, an oscillator is a component that produces an electronic voltage that fluctuates ("oscillates") in a repeating pattern. For a digital synthesizer such as Jamdac, it is a computer algorithm that generates a stream of audio samples with a specific waveform. Waveform is a fancy name for the general shape of the repeating signal.

Basically all sound produced by Jamdac originates from oscillators. The other components can transform an existing signal, but generally if their input is silent (a signal whose samples are all zero), then their output will be silent as well.

OSCILLATOR_SHAPE

You can choose from four classic waveforms, popular because they can be easily implemented by digital electronics or software code:

  1. Triangle wave: For the first half of its period it traces a straight line from -1.0 to 1.0, then it reverses and goes back to -1.0. Its flute-like sound is very similar to a pure sine wave, with the advantage of not requiring any trigonometry.

  2. Sawtooth wave: Its entire period traces a straight line from -1.0 to 1.0, then it immediately jumps back to -1.0. This causes a much sharper sound somewhat like a violin, probably the most familiar sound from classic synthesizers.

  3. Pulse wave: Its basic form is a square wave that stays at 1.0 for the first half of its period, then immediately jumps to -1.0 for the second half of its period, producing the famous electronic "beep" tone. Unlike triangle and sawtooth waves, the pulse samples are always either -1.0 or 1.0. The PULSE_WIDTH parameter adjusts whether more time is spent on -1.0 or 1.0.

  4. White noise: The noise waveform is made from randomly generated sample values between -1.0 and 1.0. They are produced by 32-bit Xorshift, one of the simplest random number generator algorithms. White noise sounds like TV static.

OSCILLATOR_HZ

The OSCILLATOR_HZ parameter controls the frequency of the oscillator, measured in cycles per second (Hertz). For example, 1 Hz means the wave will complete its period once per second. The standard "A" note on a piano is 440 Hz. This parameter has no effect for a noise waveform. (If you want to "tune" noise, you could apply a bandpass filter whose cutoff frequency is the desired pitch.)

OSCILLATOR_LEVEL

This amplifier adjusts the volume of the waveform. Normally it's just a constant volume, or an envelope that decays to silence. However you can also create amplitude modulation sound effects by adjusting OSCILLATOR_LEVEL using a looping envelope with an extremely short duration.

PULSE_WIDTH

This is only used with the pulse wave. A value of 0.5 produces a perfect square wave. Larger or smaller values adjust whether more time is spent on -1.0 or 1.0, sometimes called the duty cycle. To get interesting results from PULSE_WIDTH, you need to use an envelope to modify it continuously, for example sweeping back and forth from -1.0 to 1.0 every second or two.

I/O definitions

CLASS IO_WAVE # SIZE 30
# 0=NONE, 1=TRIANGLE, 2=SAW, 3=PULSE, 4=NOISE
VAR OSCILLATOR_SHAPE: BYTE

# UNITS: HERTZ
INSET OSCILLATOR_HZ: IO_DYNAMIC

# UNITS: S6.10 FIXED POINT
INSET OSCILLATOR_LEVEL: IO_DYNAMIC

# UNITS: S6.10 FIXED POINT, RANGE 0.0 .. 1.0
# 0.0 PRODUCES CONSTANT OUTPUT OF -1.0
# 1.0 PRODUCES CONSTANT OUTPUT OF 1.0
INSET PULSE_WIDTH: IO_DYNAMIC

# 0 = NONE
# 1 = LOWPASS
# 2 = BANDPASS
# 3 = HIGHPASS
# 4 = NOTCH
# 5 = PEAK
VAR FILTER_KIND: BYTE

# UNITS: HERTZ INDICATING THE FILTER'S CUTOFF FREQUENCY
INSET FILTER_HZ: IO_DYNAMIC

# UNITS: S6.10 FIXED POINT, RANGE 0.0 .. 1.0
VAR FILTER_RESONANCE: PAIR

# UNITS: S6.10 FIXED POINT
INSET OUTPUT_LEVEL: IO_DYNAMIC

# 0=DRY, 1=CHANNEL EFFECT
VAR APPLY_EFFECT: BYTE
END CLASS