The H command

An H included in any string immediately turns off the PLAY command. The main use of this is where you have an infinitely repeated bass line in one string. You can stop this at the end of the tune by putting an H on the end of the string which plays the melody.

Comments

You can include reminders and comments anywhere you like by using !! marks. Anything written after a ! will be ignored until the next ! or the " at the end of the string is reached, for example:

10 PLAY "abCDEFG!chorus!aCEaDG"

Channel selection

The command M is used to select which of the three channels are in operation per PSG and whether these give noise or musical tones.

You can have a maximum of nine channels (three per PSG) in use at any one time, but it does not matter whether they are all tone, all noise, or a mixture of both.

Your choice is entered with a number following the M, worked out like this:

Tone ChannelsNoise Channels
ChannelABCABC
Number12481632

Table 13 – Channel audio type selection codes

Mark each channel you want to turn on, and note down its number from the table above. Then just add them together to get the code you should use after the M. For example, if you want to use tone channels A, B, and C, you add the numbers 1+2 +4 = 7, so you use the command M7. In the same way, M56 would turn on noise channels A, B, and C.

Noise can be used on any channel but the most wide-ranging frequencies are available in channel A for each PSG. For the best results, put your sound effects in the string which controls this channel for each PSG – 1st, 4th and 7th string, in other words the first string per PSG after the PLAY command.

Stereo control

The PLAY commands L, R and S control the stereo image for each PSG. The first two restrict the current PSG's audio output to Left and Right speakers respectively while the latter resets the Stereo image. If your ZX Spectrum Next is set up with ABC stereo (the default), normally channel A goes to the left speaker, B goes to left and right, and C goes to right.

Therefore, if the L command is used, only channels A and B from the current PSG will be audible. Similarly, if R is used, only channels B and C will be audible. Like the M command, the L, R and S commands need to be re-entered in the strings targeting each PSG.

Digital Audio

Your ZX Spectrum Next also contains hardware that can output digital audio, that is sound previously recorded digitally for reproduction, in a similar manner to your house or car CD and MP3 players. There is no easy way to manipulate this hardware from NextBASIC so NextZXOS provides several dot commands1 (more on dot commands in Chapter 19 –

1 Dot commands are short programs residing in folder c:/dot/ which are used to extend NextZXOS, or to expose facilities not normally available to NextBASIC to the user. Dot commands were originally created for esxDOS (an alternative, free, ZX Spectrum–compatible Operating System which also works on the ZX Spectrum Next) and whose format was adopted by NextZXOS via its esxDOS emulation layer. Most esxDOS dot commands will work with NextZXOS and vice-versa unless they use some special facility not covered by either the esxDOS emulation layer or they are OS or machine dependent.


ZX Spectrum Next User Manual, 3rd Edition (ISBN 978-1-5272-5496-1), written and illustrated by Phoebus R. Dokos. Copyright © 2020-2024 Phoebus Dokos / SpecNext Ltd. Licensed under CC BY-NC-SA 4.0. This is a transcription and can contain errors; check any doubt against the printed page.