AY Sound FX Editor v0.6


Contents

Overview
Interface
Hotkeys
Import effects
Export effects
File formats
ZX Spectrum player
Version history
Thanks
Contacts


^ Overview

AY Sound FX Editor is a complete solution to create sound effects for AY-3-8910 sound chip. The effects could be used in games or other software for ZX Spectrum. It is also possible to use them with other micro computers that use the AY-3-8910. The package includes cross editor itself (a Windows software), an example of simple sound effects player with Z80 assembly source code, compiled example, and a library of sound effects.

The editor allows to create single channel sound effects with duration up to 4096 TV frames. Frame duration is 1/50s, so maximum effect duration is about 80 seconds. Volume, noise and mixer settings can be changed every frame. Data is stored in a compact format that omits repeating values. Effects are combined into banks, up to 256 effects. Effects player works with a bank, an effect is played using its order number in the bank.

It should be noted that the editor can't create effects on its own, it only allows to edit AY registers data in easy way. It is quite similar to the sample editors in AY music trackers. You have to know how the AY sound chip works in order to get desired results. However, the editor allows to import data from various formats, that could make things easier.



^ Interface

Program interface is all-english. There is main menu at the top of the window. The items:

File
New bank - Clear effects bank, create one empty effect;
Load bank - Load effects bank from file;
Save bank - Save effects bank into file;
Save bank w/o names - Save effects bank into file without effect names;

Clear current effect - Clear current effect;
Load current effect - Load single effect file as current effect;
Save current effect - Save current effect into single effect file;

Multi-load to bank - Append a number of single effect files to end of the bank, starting from last empty effect;
Multi-save from bank - Save all effects from bank into separate single effect files. Names will be taken from effect names, all effects will be stored in the selected folder;

Exit - Exit from the editor.
Edit
Cut - Cut selected frames from effect and put them into the clipboard. For this and the next action, when there is no selection, current frame will be used (the one under the cursor);
Copy - Copy selected frames into the clipboard, they will get deselected after this action;
Paste - Paste the clipboard contents into the cursor position, current and subsequent frames will be shifted down;
Delete - Delete selected frames;

Select all - Select all frames that contain actual data;
Unselect all - Remove selection;
Inverse selection - Invert selection.
View
Piano input - Show/hide virtual piano window (see below);
Linear period - Display tone values in linear scale (irregular spread of actual frequences);
Logarithmic period - Display tone values in logarithmic scale.
Bank
Add new effect - Append a new effect to the end of the bank and make it current;
Delete effect - Delete current effect from the bank;
Insert new effect - Insert a new effect in place of current, the current and all subsequent will be shifted.
Import (see Import effects)
PSG for AY - Improt from PSG;
VTX file - Import from VTX;
VGM file - Import from VGM;
Wave file - Import from WAV.
Export (see Export effects)
VTII Sample - Export as Vortex Tracker II instrument;
Wave file - Export as WAV file;
CSV - Export as text-based CSV file.


Below the main menu there is a bar with a number of controls. When you hover the mouse above them, a hint is displayed.

At the left of the bar there are three buttons. Play and Stop perform corresponding actions with the current effect. The button with the piano keys shows or hides the virtual piano window (see below).

At the right of the bar there are bank controls. [Add] appends an effect to the end of the bank. [Del] deletes current effect. Next four buttons with two numbers (current effect and total number of effects in bank) in between are to navigate between effects. Double arrows are to go to the first and the last effect in the bank. Last in the bar there is effect name. You can edit it by clicking it with left mouse button, entering a new name, and pressing Enter to confirm changes. Some hotkeys won't work while the name editor is active.


All remaining space of the program window is the effect editor. You can use either mouse or keyboard to edit values. There are few columns. Pos is frame number. You can select frames with LMB on the frame number or deselect them with RMB. T, N are the AY mixer bits, edited similar to the selection. Per is the tone period. Ns is the noise period. V is the volume. When you click on any of Per, NS or V value, cursor moves to the frame. In the right part of the window the same values are represented in graphic form, they can also be edited using mouse buttons. When the Ctrl button is held down, mouse won't move horizontally, allowing easier drawing a sequence of the same values.

The editor window can be resized vertically with one frame step, but can not be resized horizontally.


There is a special window to simplify creation of sound effects based on musical notes. It can be brought with the button with piano keys or through View->Piano Input item of the main menu. At the left part of the window there is a hint which keyboard buttons correspond to notes. At the right there are controls that affect to the input. The Octave field sets up the current octave (1...8). The Step field sets up the number of frames that the cursor will advance after entering a note. The Fill field sets up how many subsequent frames will be set to the same value with a single note input. The Link button links Step and Fill fields, matching up the fill value to the step. When the Set T button is down, T flag is set for frame at note input, when it is up, existing T value of a frame won't be changed. Set Volume does the same for volume column, entering value that can be changed at the right of the button.



^ Hotkeys

Main window

Cursor Up/DownGo to the previous/next frame.
Cursor Left/RightSwitch between tone/noise/volume columns.
0-9, A-FEnter tone/noise/volume value.
Page Up/DownGo a page up/down.
Mouse wheelGo five frames up/down.
HomeGo to the begin of current effect (frame 0).
EndGo to the end of current effect (last frame with non-zero volume).
Mouse buttonsOn the tone/noise/volume bars - change a value, on the effect name - edit name mode.
Left Mouse ButtonOn the T/N flags - set them; on a frame number - select frame.
Right Mouse ButtonOn the T/N flags - reset them; on a frame number - deselect frame.
CtrlDisable horizontal mouse movements inside the effect value bars.
~Show/hide the piano input window.
EnterIn the effect edit mode - play current effect; in the name edit mode - go to the effect edit mode.
Ctrl+EnterPlay effect starting from current frame.
SpaceStop playing.
DeleteDelete selection, selected frames will be removed, remaining will be shifted. When there is no selection, current frame will be deleted.
InsertInsert an empty frame, current and subsequent frames will be shifted down.
Ctrl+InsertClone current frame, subsequent frames will be shifted down.
TToggle T flag for the current frame.
NToggle N flag for the current frame.
Ctrl+ASelect the whole actual effect, from start to last frame with non-zero volume.
Ctrl+IInvert selection in the actual effect frames.
Ctrl+XCut frames into the clipboard.
Ctrl+CCopy frames into the clipboard, selection will be reset.
Ctrl+VPaste the clipboard content into the cursor position, current and subsequent frames will be shifted down.
[+] or Numpad [+]Go to the next effect.
[-] or Numpad [-]Go to the previous effect.
Shift+[+] or Shift+Numpad [+]Increase tone, noise, or volume value by 1.
Shift+[-] or Shift+Numpad [-]Decrease tone, noise, or volume value by 1.


Piano window

Z,S,X,D,C,V,G,B,H,N,J,MNote keys, input notes in range of current octave.
Shift+Note keyInput note one octave higher.
Ctrl+Note keyInput note one octave below.
Numpad 1...8Change current octave.



^ Import effects

Following file formats are supported.

PSG

AY registers dump. Files with complete 16-byte header are supported. These files could be created with AY Emulator or Z80Stealth. You can select channel that will be source of data before import. Auto option will select the channel where the volume changes first, with automatic skip of the pause before. Tone, noise, volume, and mixer settings of selected channel will be imported. To simplify things, it is better to use source files with single channel effects.

VTX

AY registers dump. These files could be created with AY Emulator and UnrealSpeccy. Import options are the same as for PSG.

VGM

Registers dump for SN76489 or compatibles, the sound chip that has been used in Master System, Game Gear, Sega Genesis, ColecoVision, and some other computers or game consoles. The imported data is adapted to get similar sound, but as the chip capabilities are quite different, there will be difference.

WAV

Only standard, unpacked PCM files supported, of any sample rate, bits depth, mono or stereo. Volume envelope gets imported, tone pitch gets analyzed. If it is possible to detect pitch for a frame, T flag sets along with the pitch value, otherwise N flag sets.

^ Export effects

Following file formats are supported.

VTII Instrument

Vortex Tracker II instrument, which is a plain text file. Export dialogs allows to set a base note that should be used to get original pitch in the tracker.

WAV

Standard uncompressed PCM file, 44100 Hz, 16 bit, mono.

CSV

Comma separated values in a text file. Can be handy for further parsing and processing with external tools.

Current effect

When this item is checked, export functions will export current effect only, under specified filename.

All effects

When this item is checked, export functions will export all effects from the bank. The filename can have an optional prefix with effect number and name, this can be selected as the file type in the export dialog.

^ File formats

16-bit numbers stored in the LSB,MSB format.

Single effect, file extension .afx

Every frame encoded with a flag byte and a number of bytes, which is vary depending from value change flags.

 bit0..3  Volume
 bit4     Disable T
 bit5     Change Tone
 bit6     Change Noise
 bit7     Disable N

When the bit5 set, two bytes with tone period will follow; when the bit6 set, a single byte with noise period will follow; when both bits are set, first two bytes of tone period, then single byte with noise period will follow. When none of the bits are set, next flags byte will follow.

End of the effect is marked with byte sequence #D0, #20. Player should detect it before outputting it to the AY registers, by checking noise period value to be equal #20. The editor considers last non-zero volume value as the last frame of an effect, other parameters aren't matter.

Effects bank, file extension .afb

Header:

+0 (1 byte) Total number of effects in the bank, up to 256 (0 means 256);
+1 (2 bytes per effect) Table of offsets to data of every effect. Offset value is given relative to the second byte of the offset itself, this allows to calculate absolute address very fast:

   hl=offset in the effects table
   ld c,(hl)
   inc hl
   ld b,(hl)
   add hl,bc
   hl=absolute address of effect data

Data:

+n (m bytes) The effects data, format is the same as in the single effect file. After every effect there could be a null terminated text string with name of the effect. It may absent, if the bank was saved into a file using corresponding item of the File menu, in this case null terminator bytes are absent as well.



^ ZX Spectrum player

The package includes a simple sound effects player. It is located at /z80player/ayfxplay.a80. This file is a text file with Z80 source code for asm80 cross assembler. There are comments on use and internals as well.

The player can play effects using all three AY channels. When there is an empty (not playing) channel, it will be used, otherwise the one that was active for longest time will be used. AY music can't play while this version of the player is active.

Besides the player, there is an example program, available as compiled SCL disk image and source code. All keys has sound effects assigned to them. Space key turns on/off music that is played on the second sound chip of TurboSound device (NedoPC version), if it is available. If the TurboSound is absent, music will play on the same chip, producing various sound artefacts.



^ Version history

v0.6 01.02.17
v0.5, v0.51, v0.52 unreleased during 2006-2017
v0.4 09.05.06
v0.3 28.02.06
v0.2 12.02.06
v0.1 02.02.06



^ Thanks

Thanks goes to: Alone Coder, for help with the project;
Sergey Bulba, for AY Emulator, Vortex Tracker, and various docs at his webpage;
SMT, for UnrealSpeccy and open source VTX format player;
Copper Feet, for asm80 cross assembler;
Also thanks to authors of the sound effects that are included into the library.



^ Contacts

You can send bug reports, suggestions, or sound effects to include into the bundled library, at shiru@mail.ru