EasyManua.ls Logo

Commodore 128 - Writing a SOUND Program

Commodore 128
448 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The first parameter (VC) in the SOUND statement selects which
voice will be played. The second parameter (FREQ) determines
the frequency of the sound, which ranges from 0 through 65535.
The third setting (DUR) specifies the amount of time the sound is
played. The duration is measured in 60ths of a second. If you
want to play a sound for one second, set the duration to 60, since
60 times 1 /60 equals 1. To play the sound for two seconds,
specify the duration to be 120. To play the sound ten seconds,
make the duration 600, and so on.
The fourth parameter (DIR) selects the direction in which the
frequency of the sound is incremented or decremented. This is
referred to as the sweep. The fifth setting (MIN) sets the minimum
frequency where the sweep begins. The sixth setting (SV) is the
step value of the sweep. It is similar to the step value in a
FOR...NEXT loop. If the DIR, MIN and SV values are specified in
the SOUND command, the sound is played first at the original
level specified by the FREQ parameter. Then the synthesizer
sweeps through and plays each level of the entire range of
frequency values starting at the MIN frequency. The sweep is
incremented or decremented by the step value (SV) according to
the direction specified by the DIR parameter and the frequency is
played at the new level.
The seventh parameter (WF) in the SOUND command selects
the waveform for the sound. (Waveforms are explained in detail in
the paragraph titled, Advanced Sound and Music in C128
Mode.)
The final setting in the SOUND command determines the width of
the pulse width waveform if it is selected as the waveform
parameter. (See the Advanced Sound discussion for an
illustration of the pulse width waveform.)
Writing a SOUND Program
Now it’s time to write your first SOUND program. Here’s an
example of the SOUND statement:
10 VOL 5
20 SOUND 1,4096,60
7-5

Table of Contents

Other manuals for Commodore 128

Related product manuals