Classic Computer Magazine Archive COMPUTE! ISSUE 46 / MARCH 1984 / PAGE 176

Random Music

Roger Hagerty

Looking for some great sound effects for your game programs? "Random Music" plays random combinations of pitch, duration, and volume to produce a wide variety of sounds. And for even more variety, you can use the game paddles to control one of these parameters while the computer selects the others at random.

Displayed on the screen are the digital values of the game paddles (0–255) and paddle buttons (0 or 1). The program plays a random combination of pitch, duration, and volume.

Pressing the right paddle button enables you to control the duration by rotating the right paddle. When the left paddle button is pressed, the pitch is controlled by the value of the left paddle. When both buttons are pressed, the last note is pulsed. By using the noise voice in this mode, you can generate some exciting machine-gun effects. Releasing both buttons returns to the random music mode.

The Atari version uses one voice. The VIC version uses four voices which can be selected by the function keys. In the 64 version, the function keys are used to select the triangle, sawtooth, pulse, and noise waveforms. See the "Automatic Proofreader" article on page 60 before typing in these programs.