new SynthVoice( synth, freq, velocity, type )

Description

Class for a single voice of the Synth

Parameters
Name Type Description
synth Synth

The Synth instance to which it belongs

freq hertz

Frequency expressed in hertz (Hz)

velocity velocity

MIDI Velocity amount (from 0 to 127)

type tonetype

If the voice will be a FTs or HTs

Details

Members


synth :Synth

Description

The Synth instance

Details
Synth

type :Synth

Description

The tone type of the SynthVoice
Type of the voice; FT or HT

Details
Synth

initFrequency :hz

Description

Initial frequency expressed in hertz (Hz)

Details
hz

osc :OscillatorNode

Description

The oscillator

Details
OscillatorNode

envelope :OscillatorNode

Description

The gain/volume to implement the Envelope Generator

Details
OscillatorNode

volume :OscillatorNode

Description

The gain/volume to implement the Velocity
A gain to manage the final voice volume if needed (currently not used)

Details
OscillatorNode

Methods


setWaveform( waveform )

Description

Set/update the voice waveform

Parameters
Name Type Description
waveform 'sine' | 'square' | 'sawtooth' | 'triangle'

Waveform type

Details

setFrequency( update )

Description

Set/update the voice frequency

Parameters
Name Type Description
update boolean

false: The voice must be created.

true : The voice must be updated.

Details

voiceMute()

Description

Turn off the sound of the Voice (release)

Details