by sherk128
A compact PT3 music player for ZX Spectrum Next with automatic support for one, two, or three AY chips — 3, 6, or 9 sound channels — and a live pixel-based spectrum analyser.
Supported channel configurations
- 3 channels: one standard PT3 module on one AY chip.
- 6 channels: two PT3 modules in a standard
02TSTurboSound container. - 9 channels: three PT3 modules in the extended
03TScontainer.
Nine-channel support is already implemented in the player. The upcoming MXTracker will export the new 9-channel PT3 files intended for this mode. Existing PT3 and 6-channel TurboSound music remains fully supported.
Usage
Install the command as /dot/PT3PLAY; an optional shorter alias is /dot/PT3. Run it from NextZXOS:
.pt3play music.pt3.pt3play "file name with spaces.pt3"
Press SPACE to stop playback and return to NextZXOS. The command closes the file, mutes all active AY chips, and restores the previous CPU speed before returning.
What it displays
- file name, PT3 title and author;
- loaded file size;
- detected AY-chip and channel count;
- a 16-band, 128-pixel-high real-time spectrum analyser;
- green, yellow, and red level zones plus slowly falling peak markers;
- a visible
TRUNCATED!warning when the file exceeds the loading area.
The analyser is not an FFT. It reads the tone periods and amplitudes being sent to every active AY voice, maps the eight PT3 octaves into sixteen half-octave bands, and combines voices that fall into the same band.
How 3, 6 and 9 channels are detected
- 3 channels: a regular PT3 file without a TurboSound footer. Output uses one AY chip.
- 6 channels: two complete PT3 modules followed by a
02TSfooter. Output uses two AY chips selected as$FFand$FE. - 9 channels: three complete PT3 modules followed by the MXTracker
03TSfooter. Output uses three AY chips selected as$FF,$FE, and$FD.
The footer consists of one entry per module — "PT3!" plus its 16-bit little-endian length — followed by "02TS" or "03TS". Every embedded module remains a complete PT3 module. The loader checks the marker and basic module-length sanity; an invalid or unknown footer is handled safely as a normal 3-channel PT3 instead of following an unsafe address.
Verified nine-channel path
The source contains the complete third-chip path, not a reserved option: the container parser recognises 03TS and supplies the third module address, the playback engine owns a third independent state and register block, calls the third PT3 player every 50 Hz frame, and writes its AY registers to the third physical chip.
Compatibility and limits
- Designed for ZX Spectrum Next and its three-AY TurboSound-compatible audio hardware.
- Standard one-module PT3 and two-module
02TSfiles keep their established behaviour. - The command temporarily switches the CPU to 28 MHz so playback and visualisation fit comfortably within a frame.
- The module is loaded contiguously at
$8000, with an approximately 30 KB limit. This overwrites the BASIC program area, as the system PT3 player does. - No MMU paging or extra memory-bank allocation is used while loading the song.
- The player uses ABC stereo and enables the Next multi-PSG audio path.
PT3PLAY is based on S. V. Bulba’s Universal PT2’n’PT3 Turbo Sound player, extended from two modules to three for ZX Spectrum Next.
Download, here












