Sets or returns the default instrument.
Syntax
Voice instrument
instrument = Voice()
Description
VOICE selects the default instrument used by generated notes and PLAY strings. In sfxlib, an instrument is a combination of a waveform and an envelope, which together decide the general tone color and how the sound starts and fades.
Changing VOICE is like switching from one simple synth patch to another. A sine-like instrument can sound soft and clean, while a square or saw instrument can sound more electronic or buzzy.
Calling VOICE as a function returns the current default instrument id.
Example
wave 1, 0
envelope 1, 0.01, 0.10, 0.60, 0.20
instrument 1, 1, 1
voice 1
play "o4 c e g"
Notes
- Define custom instruments with WAVE, ENVELOPE, and INSTRUMENT.
See also