Oscillator

Selected waveform kernels, continuous morphing, harmonic shapes and phase/gate control; an optional MIDI input plays notes in the Toy's tuning.

  • Source
  • Since 0.1.0
  • oscillator
  • waveform
  • morph
  • detune
  • midi
  • voices

Open in TuneToys

Used in the templates Little Sine.

Oscillator as the Patch draws it, at default values: inlets on the left, outlets on the right.

A full-featured sound source with eight waveforms, a morph control, detune and phase. It has no audio input; an optional MIDI input plays it from notes.

What it does#

The oscillator generates a tone at Frequency, shaped by Type. The waveforms are Morph, Sine, Triangle, Saw, Pulse, Double saw, Organ and Harmonic bell. Morph blends continuously between sine, triangle, saw and pulse, evaluating only the two neighboring waves. Saw and pulse edges are band-limited to reduce aliasing. Detune offsets the pitch in cents, Phase sets the starting position of the cycle, and a rising Gate edge restarts the wave from that position.

With a cable into its midi input, the oscillator plays the newest held note instead of Frequency: the note's pitch comes from the Toy's tuning, Detune still offsets it, pitch bend moves it by up to Bend range semitones, and Glide slides between notes. Releasing the newest note falls back to the newest still-held one; after the last release the pitch stays where it was, so a downstream envelope can fade it out. Before the first note, Frequency sets the pitch. The MIDI input does not gate the sound: pair it with an Envelope whose Gate comes from MIDI to control. Inside a polyphonic group each voice's oscillator sees only that voice's note.

When to use it#

Use it as the main source of a synth patch, as a test signal, or for several detuned voices. Pair it with an Envelope for notes and a Filter to shape the tone. To play chords with your own oscillator, filter and envelope, put them in a group and give it voices.

Ports#

PortDirectionSignalLanes
midiInputMIDI16 MIDI channels
audioOutputAudioInferred from the cable

Parameters#

ParameterLabelRangeDefaultUnitScaleNotes
frequencyFrequency20 to 20000220HzlogFundamental pitch, capped below Nyquist; detune uses cents.
amplitudeLevel0 to 0.50.12linearlinearOutput gain.
shapeMorph0 to 30linearContinuous sine/triangle/saw/pulse morph; only its two neighboring waveforms are evaluated. Shown when type is 0.
pulse_widthPulse width0.05 to 0.950.5linearPulse duty cycle with a frequency-dependent safe edge width. Shown when type is 0 or 4.
typeType0 to 70linearSelects the implemented algorithm. Choices are discrete and are not LFO targets. Choices: 0 Morph, 1 Sine, 2 Triangle, 3 Saw, 4 Pulse, 5 Double saw, 6 Organ, 7 Harmonic bell.
phasePhase0 to 10cycleslinearCycle offset; Gate rising edges restart phase from this position.
detuneDetune-1200 to 12000centslinearPitch offset in cents.
gateGate0 to 11linearOn or off. A rising edge retriggers; held on runs the oscillator or envelope. A control cable switches it at 0.5.
bend_rangeBend range0 to 482stlinearSemitones a full pitch bend on the MIDI input moves the note, up or down.
glide_msGlide0 to 20000mslinearTime constant of the slide from one MIDI note's pitch to the next; 0 jumps.

Frequency (frequency)#

The fundamental pitch, from 20 to 20000 Hz, capped below Nyquist.

Level (amplitude)#

Output gain from 0 to 0.5.

Morph (shape)#

Used when Type is Morph. 0 is sine, 1 is triangle, 2 is saw, 3 is pulse.

Pulse width (pulse_width)#

The pulse duty cycle, 0.05 to 0.95. It applies to Morph and Pulse. Edges are kept safe at high frequencies.

Type (type)#

Chooses the waveform. A discrete choice.

Phase (phase)#

A cycle offset from 0 to 1. A rising Gate restarts the wave from this position.

Detune (detune)#

A pitch offset from -1200 to 1200 cents (one octave each way).

Gate (gate)#

Defaults to on, so the oscillator runs. A rising edge retriggers the phase.

Bend range (bend_range)#

How far a full pitch bend on the midi input moves the note, 0 to 48 semitones each way. 2 is the usual keyboard range; set it to the MPE bend of a polyphonic group (48 by default) when you play it from an MPE controller.

Glide (glide_ms)#

The time constant, in milliseconds, of the slide from one MIDI note's pitch to the next. 0 jumps straight to each note; the first note always starts at its own pitch.

Tips#

  • Detune two oscillators by a few cents and sum them for a thick tone.
  • Use Pulse with a low Pulse width for a nasal, reedy sound.
  • Keep Level low, then raise the monitor level.
  • With a MIDI cable, a Frequency knob does nothing until you disconnect it: notes own the pitch.

See also#

Envelope, Filter, MIDI to control, Voices.

Help patches

Each help patch is an ordinary Toy that teaches one idea. The diagram shows the Patch; the preview shows its Frame. Open it in TuneToys to play and edit it.

1. A pure tone you can tune

beginner Teaches: frequency, amplitude

A sine oscillator with pitch and level controls.

Patch: Oscillator audio output connected to Patch outputs audio input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Frequency is logarithmic: equal turns move by equal musical intervals.
  • The amplitude range is small on purpose. Keep your monitor volume low.
Frame preview: A pure tone you can tuneFrame “A pure tone you can tune” with 3 elements: knob Level, knob Frequency, text heading.0.12 linearLevel220 HzFrequencyA PURE TONE YOU CAN TUNE
Frame preview (static). Controls show their default values.

Open in TuneToys

2. Hear every wave shape

beginner Teaches: type, frequency, amplitude

Pick any waveform and play with its pitch and level.

Patch: Oscillator audio output connected to Patch outputs audio input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Sine has one harmonic. Saw and pulse have many, so they sound brighter.
Frame preview: Hear every wave shapeFrame “Hear every wave shape” with 4 elements: knob Level, knob Frequency, text heading, segmented Type.0.15 linearLevel220 HzFrequencyHEAR EVERY WAVE SHAPEMorphSineTriangleSawPulseDouble sawOrganHarmonic …Type
Frame preview (static). Controls show their default values.

Open in TuneToys

3. Tune two tones until they beat

intermediate Teaches: frequency

Two nearby sine tones summed together to expose beating.

Patch: Oscillator “low” audio output connected to Mixer low.in input. Oscillator “high” audio output connected to Mixer high.in input. Mixer audio output connected to Patch outputs audio input.
Connections as text
  • Oscillator “low” audio output connected to Mixer low.in input
  • Oscillator “high” audio output connected to Mixer high.in input
  • Mixer audio output connected to Patch outputs audio input
  • Bring Tone B close to Tone A. The slow pulsing is the two sines drifting in and out of phase.
  • At equal frequencies the pulsing stops.
Frame preview: Tune two tones until they beatFrame “Tune two tones until they beat” with 3 elements: text heading, knob Tone B, knob Tone A.TUNE TWO TONES UNTIL THEY BEAT223 HzTone B220 HzTone A
Frame preview (static). Controls show their default values.

Open in TuneToys

4. Morph, pulse width and detune

intermediate Teaches: shape, pulse_width, detune, phase, gate

Continuous morphing, pulse width, detune and gate restart.

Patch: Oscillator audio output connected to Patch outputs audio input.
Connections as text
  • Oscillator audio output connected to Patch outputs audio input
  • Morph blends between neighboring waves: 0 sine, 1 triangle, 2 saw, 3 pulse.
  • A rising Gate edge restarts the wave at the Phase position.
Frame preview: Morph, pulse width and detuneFrame “Morph, pulse width and detune” with 6 elements: knob Detune, toggle Gate, text heading, knob Phase, knob Pulse width, knob Morph.0 centsDetuneGateMORPH, PULSE WIDTH AND DETUNE0 cyclesPhase0.3Pulse width3Morph
Frame preview (static). Controls show their default values.

Open in TuneToys

5. Play it from MIDI

advanced Teaches: bend_range, glide_ms

Notes into the oscillator's MIDI input set its pitch; glide slides between them and bend range scales pitch bend.

Patch: Select lanes control output connected to Envelope @gate input. MIDI to control control output connected to Select lanes control input. Keyboard midi output connected to MIDI to control midi input. Envelope audio output connected to Patch outputs audio input. Keyboard midi output connected to Oscillator midi input. Oscillator audio output connected to Envelope audio input.
Connections as text
  • Select lanes control output connected to Envelope @gate input
  • MIDI to control control output connected to Select lanes control input
  • Keyboard midi output connected to MIDI to control midi input
  • Envelope audio output connected to Patch outputs audio input
  • Keyboard midi output connected to Oscillator midi input
  • Oscillator audio output connected to Envelope audio input
  • The keyboard's notes set the oscillator's pitch through its midi input. Frequency is ignored while the cable is connected.
  • MIDI to control turns the same notes into a gate lane; Select picks lane 2 for the envelope's Gate.
Frame preview: Play it from MIDIFrame “Play it from MIDI” with 5 elements: knob Level, knob Bend range, knob Glide, text heading, piano Keys.0.12 linearLevel2 stBend range120 msGlidePLAY IT FROM MIDI
Frame preview (static). Controls show their default values.

Open in TuneToys

  • Envelope Curved AD, AR and ADSR gain envelopes with looping and explicit retrigger behavior.
  • Filter Low-pass, high-pass, band-pass, notch, all-pass or morphing filter with resonance, 12/24 dB slopes, curve editing and output RTA.
  • MIDI to control Turn MIDI into six control lanes: pitch, gate, velocity, bend, pressure and one CC, with last-note priority.
  • Polyphonic instrument Eight owned, velocity-sensitive oscillator voices with ADSR, sustain and MPE, played from a MIDI cable in the Toy's tuning.

Edit this page on GitHub

esc

↑ ↓ move↩ open⌘↩ new tabesc close