Chapter 24 – Play it again CoCo, or, playing with the PLAY command!

Chapter 24 in programming in BASIC on the Color Computer, introduces us to the PLAY command, which is a very flexible BASIC statement to play music notes in a variety of ways, and offers a greater degree of options than the traditional SOUND command.

The PLAY command allows you to play music notes by specifying notes in one of two ways, you can specify them by the actual letter, “ABCDEFG”, and even specifying if the note is sharp # or flat – , or you could refer to one of the 12 notes within a given octave by the numbers 1-12

In addition to specifying the note you wish to play, you can specify one of 5 octaves with the “O” option, followed by the number 1-5, you can specify the Tempo with the “T” option and give a temp between 1-255, and set the note length with the L option, where length can be between 1-255

A sample PLAY statement may be

PLAY "O1;L2;C;O2;L1;B;"

This would play a half note “C” in octave 1, and a whole note “B” in octave 2, for example.

If you are familiar with reading and writing music and musical notation, you can use the variety of options the PLAY command gives us to compose music on your CoCo.  I’m neither a musician or looking to create music, but the great thing the PLAY command gives us, is the ability to generate sounds in such a way that we can create some pretty cool video game sound effects that sound a heck of a lot better than we can do with the normal SOUND command.  Playing fast length tones allows us to create a variety of sounds from whistles, to lasers, to explosions, and the demo I created for this chapter, which is also available from the downloadable disk image contains a few examples of what you can do with such commands.

Sound Effects Demo

To watch the latest video showing off all these features, click here

To download the latest disk image that includes all the demos sown in the video click here:  Chaper 24 PLAY demos

Leave a Reply