Commodore 128 Programmer's Reference Manual page 349

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
SOUND AND MUSIC ON THE COMMODORE 128
339
EXAMPLES:
n
PLAY "V1O4T0U5X0CDEFGAB"
PLAY "V3O5T6U7X1#B$AW.CHDQEIF"
Play the notes C,D,E,F,G,A and
B in voice 1, octave 4, tune enve
lope 0 (piano), at volume 5, with
the filter off.
Play the notes B-sharp, A-flat,
a whole dotted-C note, a half
D-note, a quarter E-note and an
eighth F-note.
SOUND
Create sound effects and musical notes
SOUND v,f,d[,dlr][,m][,s][,w][,p]
where:
v
voice (1-3)
f
frequency value (0-65535)
d
duration (0-32767)
dir step direction (0(up), l(down) or 2(oscillate)) default = 0
m minimum frequency (if sweep is used) (0-65535) default = 0
s
step value for sweep (0-32767) default = 0
w
waveform (0 = triangle, 1 = sawtooth, 2 = variable, 3 = noise) default = 2
p
pulse width (0-4095) default = 2048
The SOUND command is a fast and easy way to create sound effects and
musical tones. The three required parameters v,f and d select the voice, frequency
and duration of the sound. The duration is in units called jiffies. Sixty jiffies equals
1 second.
The SOUND command can sweep through a series of frequencies which allows
sound effects to pass through a range of notes. Specify the direction of the sweep with
the DIR parameter. Set the minimum frequency of the sweep with M and the step value
of the sweep with S. Select the appropriate waveform with W and specify P as the width
of the variable pulse waveform if selected in W.
EXAMPLES:
SOUND 1,40960,60
SOUND 2,20000,50,0,2000,100
Play a SOUND at frequency 40960 in voice 1
for 1 second.
Output a sound by sweeping through frequen
cies starting at 2000 and incrementing upward
in units of 100. Each frequency is played for
50 jiffies.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents