Spectrofon #02: System: Exploring ASC Sound Master for ZX Spectrum

┌───────────────────────────┐  
│ ────── SYSTEM ────── │
└───────────────────────────┘

Today we invite you to get acquainted with the music editor ASC Sound Master (ASM). This is a fully functional music editor for ZX-Spectrum 128 Kb.

We contacted the author of the program - Andrey Sendetsky - and offered him to present his program to all readers of our magazine. The proposal received support and, as a result, we managed to agree with the author on the publication of an official description of the program in the magazine, as well as the inclusion of the latest version of this music editor in the "APPENDIX". So, Andrey Sendetsky became the first author to share his development with us and created a precedent in the formation of the software market in our country.

It is nice to acknowledge the fact that for fans of the ZX-Spectrum computer there are no political or economic barriers. And it will only get better for all of us when the residents of neighboring countries actively join our common cause. Moreover, we already have experience of such cooperation.

In the first issue, we wrote that "SPECTROFON" will support Russian authors of system, application, and game programs in every possible way.

We have already reported that we are ready to provide magazine pages for authors' descriptions, as well as for the placement of demonstration and full versions of programs. We give authors the opportunity to finally start normal, serious work for which they can receive something in return. Now many will have the incentive to write programs not only for themselves and their friends but also for the benefit of all ZX-Spectrum users. SPECTROFON will deliver your programs to all those wishing to acquire them.

Details on how to get started are described in the first issue of the magazine "ZX-REVIEW" for 1994 in the article "On the Distribution of Software".

And now we give the floor to the author of the music editor "ASM".

(c) Andrey Sendetsky.

THE ART OF SOUND
---------------

The times when computers (computers!) were engaged in "grinding" columns of useless digits, stirring the minds of pioneers of the computer industry, are gone. Let us remember with kind words their now gray "egg-shaped" heads. Now, when the world is ruled by Amiga and even the "blue giant" (IBM) has begun to care not only about the size and foolishly wasted megahertz of their computers, people still expect miracles from computers, which have already become a reality.

It is no secret that the sound design of a program can completely change the attitude towards it and raise its rating from hopeless to acceptable, from good to sensational. The names of computer musicians (Rob Hubbard, David Whittaker, Allister Brimble ...) are as popular among computer fans as the names of rock musicians.

And what about Spectrum? Does it have a chance to catch up with the speeding express? Of course not ... Unless a small miracle is performed for it: to make people believe that it is a bit more than just a cheap and simple "toy".

The main goal in writing ASM was to prove to myself that I understand something in programming, to show people that good music can be created on the ZX-Spectrum, and to show the ZX-Spectrum that its time has not yet passed. The only serious limitation was the sound capabilities of AY.

What has come out of this endeavor is for the users to decide, especially now that ASM has become widely available thanks to cooperation with the editorial office of the magazine "SPECTROFON".

Taking this opportunity, I want to reveal a small secret: it is unlikely that we should expect the emergence of ASM v1.13 (just like ASM v0.13 never existed - superstition!).

But at the same time, there are now all chances for the emergence of ASM v2.00, work on which is already underway. There are reasons to believe that no one has yet heard such sound as in ASM v2.00 on AY. Perhaps, for the first time, ASM v2.00 will be demonstrated on the pages of "SPECTROFON". But that is already a matter for the future.

For now, I will consider my work not in vain if ZX Spectrum and ASM allow new talented computer musicians to find themselves, preparing for the times when other computers and other programs will come into our lives.

BRIEF INSTRUCTION
FOR THE MUSIC EDITOR A S M
------------------------------

Date of last edit: 17.1.94
Current version: ASM v.1.12

The music editor ASC Sound Master (hereinafter ASM) is a fully functional music editor for ZX Spectrum 128k and older models with the AY-3-8912A or AY-3-8910A sound processor and TR-DOS v. 5.01, 5.03 and compatible with them.

Main features (description of terminology - below):

- storage of musical text in Position/Pattern/Quant system;
- 100 Positions;
- 32 Patterns;
- 32 Samples;
- 32 Images;
- window interface;
- universal control;
- disk system ADS (MS-DOS style): 12-bit FAT, 255 Dir Entries, 790kb free;
- recording of compiled modules in TR-DOS for further use in other programs.

.n0
.k0b0.k1t1.k2t2.k3b6

Select a part of the description:

1. CONTROL CONCEPT
2. STRUCTURE OF MUSICAL DATA
3. DESCRIPTION OF THE MAIN MENU
CONTROL CONCEPT
---------------------

.k0t0.n:
Control is based on the use of 8 control functions:

- move up (up);
- move down (down);
- move left (left);
- move right (right);
- select (select);
- decrease (sub);
- increase (add);
- exit (escape);

Each of them is implemented by several different keys or their combinations.

As can be seen, the first 5 are joystick functions. Naturally, they are implemented by joysticks: Sinclair I, Sinclair II, Kempston, Cursor (+Enter), QAOP (+Space). These functions are used to navigate through the menu and select options in the menu.

Decrease (TRUE VIDEO (Caps+3) or R) and increase (INV VIDEO (Caps+4) or T) are used to change the parameter of the current menu option.

Exit (BREAK (Caps+Space) or EDIT (Caps+1)) is used to exit the current menu to the previous one without selecting any of its options.

In addition, specific letter keys are assigned for selecting almost all options in all menus. They are not explicitly indicated anywhere, but generally correspond to the first letter of the name of the corresponding option. When such a key is pressed, the cursor moves to the corresponding option and selects it. It should be remembered that if any key performing joystick functions (Q,A,O,P) is assigned to select an option, it will not perform joystick function in this menu.

There are only 2 exceptions to the scheme:

- in Pattern editing mode, when the cursor is in the octave/note field, the 2 bottom rows of the keyboard are used as a piano keyboard, 'I' - to set 'PSE', 'K' - to set 'RLS', 'L' - to set '___', 'U' to enter command editing mode;
- in Pattern, Sample, Image editing mode, pressing 'up' and 'down' simultaneously is used to jump to the beginning of the Pattern, Sample, Image respectively.

STRUCTURE OF MUSICAL DATA
----------------------------

This section describes the system of storing musical data adopted in ASM. It is assumed that the reader is familiar with a number of musical terms.
.k0t0.n:
The construction of music is based on 6 main concepts:

- Quant;
- Pattern;
- Position;
- Sample;
- Image;
- Quark.

The most fundamental of these concepts is Quant: the smallest duration of a note used in the given musical work.

In this case, to indicate the duration of any note, it is sufficient to specify how many Quants it consists of. Usually, a duration of 1/16 or 1/32 is chosen as Quant. Then, for example, for Quant=1/16, a duration of 1/8 will correspond to 2 Quants, a duration of 1/4 with a dot - 6 Quants, and so on.

If it is known that a given note should last a certain number of Quants, then to indicate this, the first Quant should contain the note designation, while the subsequent ones should remain unoccupied ('___').

Thus, all the time of the composition's sound is divided into Quants.

For ease of manipulating individual parts of a musical work, Quants are grouped into Patterns. A Pattern is a set of several Quants. The maximum size of a Pattern is 64 Quants. Then for Quant=1/16, the duration of the Pattern will be 64*(1/16)=4 whole notes or 4 bars for a 4/4 size.

The size of the Pattern can be changed (minimum=1, maximum=64), but it is always convenient for the Pattern to last a whole number of bars (for a 3/4 size and Quant=1/16, a Pattern size of 48 Quants is convenient, which will make 48*(1/16)/(3/4)=4 bars). Small Patterns (less than 1 bar) can, for example, be used to create pickups.

In ASM there are 32 Patterns, numbered 00 .. 31. As is now clear, a Pattern usually contains the musical text of a part of the musical work (musical phrase). To construct a composition based on Patterns, one must specify the sequence of Pattern numbers that should be played. This sequence is called a list of positions (Positions). It is clear that in the Positions list, the number of the same Pattern can be specified any number of times.

The size of the Positions list is 100. Positions are numbered 00 .. 99.

Now, from the description of the structure of the musical text as a whole, let's move on to the encoding of notes and their characteristics.

The AY-3-8912A/10A sound processor has 3 programmable square wave generators (tone) with 16 gradations of volume on a logarithmic scale, 1 white noise generator (white noise) of 32 types, and an envelope generator (envelope) of 8 types. It should be noted that the volume of the noise generator is controlled by the volume registers of the tone generators, which does not allow it to be considered a full-fledged 4th channel.

The envelope generator also does not have sufficient capabilities for complete control of the envelope, so in ASM it is used in a non-standard way to obtain non-square wave signals.

When editing musical text, each Quant is represented as a line of text, in which parameters controlling the operation of the envelope generator, noise generator, and tone generators are specified.

Quant line format:

|00|027\12|2#G 1 3 15|...|...|
A B CDEF G H I J K L

A. The ordinal number of the Quant in the Pattern.

B. The code of the frequency of the envelope generator. When the oscillations of the tone generator and the envelope generator are summed, if the frequencies of the oscillations relate to each other as small integers (1:1, 2:3, etc.), the result is oscillations with a sufficiently complex signal shape, bringing pleasant variety to the not too rich sound of AY.

C. The symbol of the envelope type.

Type Symbol

|\|\|\|\ \
/|/|/|/| /
/\/\/\/ /\
\/\/\/\/ \/

D. The code for noise offset prohibition - a digit from 0 to 7, indicating to which channels it relates, and to which it does not relate as specified in item.

E. noise offset:

0 - the offset applies to all channels;
1 - the offset is prohibited for channel A;
2 - the offset is prohibited for channel B;
4 - the offset is prohibited for channel C.

By summing these values, mixed prohibitions can be specified (5 - prohibition of offset for channels A and C).

E. The base number of noise, relative to which the noise offsets specified in the Sample (see below) will then be made.

Setting the base for the noise generator is similar to specifying a note (i.e., frequency) for the tone generator. One can specify 1 of 32 possible bases, denoted as follows: 0..9 and then A..V.

F..J. Parameters controlling channel A:

F. Indicator of the presence of a command (# - yes, | - no). Commands (Command) are a powerful means of additional control of this channel or the composition as a whole. The list of commands is in the description of the Pattern editor.

G. Octave and note. In ASM, 1 incomplete and 7 full octaves are allowed:

U - subcontra octave (it has only 2 notes: #A and B);
C - contra octave;
L - great octave;
S - small octave;
1 - first octave;
2 - second octave;
3 - third octave;
4 - fourth octave.

Notes are denoted according to the international standard:

C - do; #F - fa sharp;
#C - do sharp; G - sol;
D - re; #G - sol sharp;
#D - re sharp; A - la;
E - mi; #A - la sharp;
F - fa; B - si.

H. Indication of the Sample number used when playing this note. In ASM, you can define 32 Samples, the first 10 of which are denoted by digits (0..9), and the rest by letters (A..V).

Sample is the main sound identifier. In Sample, the characteristics of the envelope, the involvement of tone, noise, and envelope generators, the offset of the noise number relative to the base, and the offset of the tone frequency relative to the specified note (in units of AY frequency) are specified.

A detailed description of the structure and capabilities of Sample is in the description of the Sample editor (see below).

I. Indication of the Image number used when playing this note. In ASM, you can define 32 Images, the first 10 of which are denoted by digits (0..9), and the rest by letters (A..V).

Image is an auxiliary sound identifier. In Image, the offset of the noise number relative to the base (as in Sample) and the offset of the tone frequency relative to the specified note (in semitones) are specified.

A detailed description of the structure and capabilities of Image is in the description of the Image editor (see below).

J. Volume. Acceptable values: 01..15. Specifying the volume means that the range of volume values 0..15 when playing this note will be scaled to the range from 0 to the specified value. Specifying EN in this field allows the use of the envelope generator (if its use is also specified in Sample (see item H)).

K. and L. Similarly to F..J for channels B and C respectively.

Now let's consider the relationship between the program's operation and some vital parameters of the ZX Spectrum.

As is known, interrupts in the ZX Spectrum are generated at a frequency of 50 Hz. The time interval of 1/50 second, equal to the interval between two adjacent interrupts, is called a quark (Quark). The program's operation is synchronized by interrupt pulses, and, moreover, the interaction of the computer with AY also occurs at this frequency. This means that only 50 times per second can the values in the AY registers be changed. Based on this fact, it is easy to conclude that the sound duration of one Quant (see above) must be equal to a whole number of Quarks (it is not possible to start playing a new note without changing the values in the AY registers).

The time of one Quant is specified for each composition in the main menu. (for example, QV.06 - Quant equals 6 Quarks). Acceptable values for the duration of Quant range from 3 to 50 Quarks.

If Quant equals 6 Quarks and corresponds to 1/16 of a note, then the tempo of the composition will be approximately 125 beats per minute. The same can be said if Quant equals 3 Quarks but corresponds to 1/32 of a note. Unfortunately, changing the time of Quant is quite rough, but it is the only way to set the tempo of the composition.

The sound descriptors Sample and Image also implicitly use the concepts of Quark: each line in the description of Sample or Image corresponds to one Quark, which ensures the characteristics of the sound are set with maximum permissible discreteness (as already noted, it is not possible to change the AY sound parameters in ASM through a time interval shorter than Quark).

The maximum size of Sample is 150, Image is 30 Quarks. Sample line format:

|002|()|+05|-002|12|TN-|
A B C D E F

A. The ordinal number of the Quark in the Sample.

B. Loop markers.

'(' - start of the loop,

')' - end of the loop.

When playing the Sample, Quarks 'inside' these markers will be played until the playback of another note, pause (Pause - PSE) begins, or the phase of release (Release - RLS) is allowed to start.

In the latter case, when reaching a Quark with the marker ')', the transition will occur to the next Quark (if there is one), and not to the Quark with the marker '('.

C. Offset of the noise number relative to the one played in the previous Quark. This means that with each subsequent playback of this Quark (since in the example it is specified inside the loop), the noise number will change according to the sequence: n+5,n+10,n+15, etc., where n is the noise number played in the Quark with ordinal number 01.

D. Similarly to C, but for the frequency of the tone generator. It should be noted that this frequency offset is specified in units of AY frequency. As is known, each tone generator of AY can currently play one of 4095 frequencies, the number of which is entered into the corresponding AY registers.

The frequency can be determined by the formula: F=110.83/n [kHz], where n is the frequency number (1..4095).

From the formula, it is evident that at low frequencies, the interval between two adjacent frequencies of AY is a fraction of a hertz, while at high frequencies it reaches several kilohertz.

This should be taken into account when specifying the frequency offset in the Sample. In practice, for notes of the first octave, the total frequency offset usually does not exceed 5-10 units.

E. Volume. Since the AY tone generator has 16 gradations of volume, the acceptable values here are: 00..15.

F. Operating mode of the channel. Contains 3 positions:

1. involvement of the tone generator: 'T' - yes, '_' - no;
2. involvement of the noise generator: 'N' - yes; '_' - no;
3. additional capabilities:

'_' - do not use additional capabilities;
'E' - use the envelope generator if EN is specified in the Pattern;
'+' - increase the volume offset by 1;
'-' - decrease the volume offset by 1;

The volume offset means the difference between the actually reproduced volume and the one specified in item E. At the beginning of the Sample playback, it is zero, and then its values can accumulate, remaining in the range of -15..+15. If the operating mode 'T_E' or '__E' is specified, then the offset specified in item C refers not to noise, but to the frequency of the envelope generator.

The format of the Image line is similar to the format of the Sample line, except that items E. and F. are absent, and the frequency offset in item D. is specified in semitones, which allows for chord playback in Image.

Contents of the publication: Spectrofon #02

  • Экспертиза
    Analysis of the game 'SHADOWFIRE' (Beyond 1985), its connection to 'ENIGMA FORCE'. Discussion on 'SHADOWFIRE TUNER' and its mysterious nature. Detailed gameplay mechanics, character roles, and strategic elements.
  • Дебют
    Overview of two ZX Spectrum games: 'Deactivators', a puzzle game focusing on strategic bomb defusal using droids, and 'Vendetta', an arcade-adventure game featuring a rescue mission against the mafia.
  • Эказамен
    Quiz question for 'DEACTIVATORS' game players about saving a droid on level two. Prize is a new issue of the magazine. Still accepting answers for 'DRILLER' program from issue one.
  • Обзор
    The article reviews the Novosibirsk version of the game ELITE2, which introduced new missions and ships, followed by the announcement of ELITE3 and ELITE4 by the creator, Vladimir Kladov. Despite technical issues with compatibility on certain computers, discussions are ongoing for including ELITE3 in a future magazine issue. The article reflects concerns about developers focusing too much on repetitive game plots.
  • С миру по биту - В.Ананьин
    Discussion on adapting games to the iS-DOS system and its implications for ZX Spectrum's future. Comparison of TR-DOS and iS-DOS utility and limitations. Critical view on the practicality of game adaptations.
  • Система - ASC
    Detailed overview of the ASC Sound Master music editor for ZX Spectrum. Discussion on the role of sound in elevating program reception and future potential of ZX Spectrum. Insights from developer Andrey Sendeckiy and description of the editor's features.
  • Реклама
    Information on purchasing the SPECTROFON magazine and distribution details.