VOICE

v3.1 VIC20 C64 C16 Plus4 C128

Selects various properties like waveform, tone, filters, etc. of a voice. The command is also used for turning a voice on or off. The command implements a uniform interface to the VIC, TED and SID chips, however differences between the sound capabilities of these chips must be considered as explained in more details below.

Syntax

VOICE <voice_no> <subcmd> [<subcmd> ...]

Where <voice_no> is a literal number, identifying the voice register (1, 2 on C16 Plus4, 1 to 3 on C64 C128 and 1 or 4 on VIC20). The command is then is followed by at least one of the following:

  • ON or OFF
  • TONE <tone_value>
  • ADSR <attack>, <decay>, <sustain>, <release>
  • WAVE SAW|TRI|PULSE|NOISE
  • PULSE <freq>
  • FILTER ON|OFF

Note

Not all sub-commands are available for VIC20 C16 Plus4 as these machines have limited sound capabilities compared to C64 C128.

Examples

' Clear all registers
SOUND CLEAR
VOLUME 15
' Set up voice 1 for a high-pitch sawtooth wave but do not turn it on yet
VOICE 1 WAVE SAW TONE 2500 ADSR 0, 7, 12, 1
' Turn it on
VOICE 1 ON
' Set up voice 2 properties and turn it on immediately
VOICE 2 WAVE PULSE PULSE 450 TONE 400 ADSR 9, 7, 10, 4 ON
' Change its tone while the voice is still on
VOICE 2 TONE 2300

VOICE ON|OFF

Turns the voice on or off. Supported on all platforms.

VOICE <voice_no> ON
VOICE <voice_no> OFF

VOICE TONE

Sets the tone (frequency) for a voice. Supported on all platforms.

VOICE <voice_no> TONE <tone_number>

The <tone_number> means a different value on each platform.

VOICE WAVE

Sets the waveform for a particular voice.

VOICE <voice_no> WAVE SAW
VOICE <voice_no> WAVE TRI
VOICE <voice_no> WAVE PULSE
VOICE <voice_no> WAVE NOISE
  • On C64 C128 all three voices can take any waveforms.
  • On C16] Plus4 voice 1 is always PULSE and voice 2 can take PULSE or NOISE
  • On VIC20 voices 1, 2 and 3 are always PULSE and voice 4 is always NOISE

VOICE PULSE

Sets the pulse frequency for a particular voice. Only works if the waveform of that voice is set to PULSE. Supported on C64 C128 only.

VOICE <voice_no> WAVE PULSE PULSE <freq>

Frequency must be a value between 4096.

VOICE ADSR

Sets the envelope for a particular voice. Supported on C64 C128 only.

VOICE <voice_no> ADSR <attack>, <decay>, <sustain>, <release>

All four values are expressions that must evaluate to a number between 0 and 15.

VOICE FILTER ON|OFF

Applies or removes filter for the particular voice. The filter properties must be set using the FILTER command. Supported on C64 C128 only.

VOICE <voice_no> FILTER ON
VOICE <voice_no> FILTER OFF

See also