Overview
DevCPC supports music through the WYZ Tracker format, which provides:- 3-channel AY-3-8912 music (PSG chip)
- Sound effects with channel priority
- Multiple songs in one project
- Interrupt-driven playback (no CPU overhead during gameplay)
Quick Start
1. Get Music Files
You need:.wyz- WYZ Tracker project file.mus- Compiled music data.mus.asm- Assembly include file (optional)
2. Place in Project
3. Include in ASM
In yourmake_musica_mygame.asm:
4. Play from BASIC
5. Stop Music
WYZ Player v4.2
What is WYZ Player?
The WYZ Player is a Z80 assembly routine that:- Plays music files from WYZ Tracker
- Runs on interrupt (IM1 or IM2)
- Supports 3 music channels (A, B, C)
- Supports 1 effects channel (P)
- Minimal CPU usage during playback
Player Files
Included in 8BP projects:Music File Formats
.wyz (WYZ Tracker Project)
The source file created in WYZ Tracker:- Editable in WYZ Tracker software
- Contains patterns, instruments, sequences
- Not used directly by CPC
.mus (Compiled Music Data)
Binary music data:- Compiled from .wyz
- Includes note data, timing, effects
- Loaded into CPC memory
- Typical size: 1-8 KB per song
.mus.asm (Assembly Include)
Optional assembly wrapper:.fx (Sound Effects)
Short sound effects:- Explosion, shoot, jump, etc.
- 1-channel effects
- Can interrupt music temporarily
Creating Music with WYZ Tracker
1. Download WYZ Tracker
Windows: WYZ Tracker Linux/Mac: Use Wine or similar2. Create New Song
- File → New
- Set Target: Amstrad CPC
- Set Clock: 1MHz (CPC standard)
- Set Frequency: 50Hz (PAL) or 60Hz (NTSC)
3. Create Patterns
- Use the pattern editor
- 3 channels: A (left), B (middle), C (right)
- Enter notes: C-3, D#4, etc.
- Add effects: volume, pitch, etc.
4. Create Instruments
- Instruments tab
- Create envelope (volume over time)
- Set waveform (tone/noise)
- Set effects (vibrato, arpeggio)
5. Arrange Song
- Song tab
- Add patterns in sequence
- Set loop points
- Set tempo
6. Export
- File → Export
- Choose MUS format
- Save as
song.mus - Copy to your project’s
music/folder
Including Music in 8BP Projects
Standard 8BP Music Setup
make_musica_mygame.asm
Song Selection
Songs are numbered starting from 0:Playing Music from BASIC
Start Music
Stop Music
Change Songs
Check if Music Playing
Playing Music from Assembly
Initialize Player
Start Music
Stop Music
Music in Interrupt
Sound Effects
Playing Effects from BASIC
If using 8BP with custom effects:Playing Effects from Assembly
Creating Sound Effects
In WYZ Tracker:- Create short pattern (1-4 rows)
- Use envelope for volume control
- Use noise for explosions/hits
- Use tone for melodic sounds
- Export as .fx file
Advanced Music Techniques
Dynamic Music (Adaptive)
Change music based on game state:Crossfade Between Songs
Synchronized Events
Sync game events to music beats:Direct PSG Programming
For custom sound without WYZ:PSG Registers
Writing to PSG
Play Simple Tone
Create Explosion Sound
Music File Organization
Project Structure
Naming Convention
Memory Considerations
Music Size
Typical sizes:- Simple tune: 1-2 KB
- Full song: 4-8 KB
- Complex song: 8-16 KB
Buffer Memory
WYZ Player reserves:- 24 bytes per channel × 4 channels = 96 bytes
- Plus player code: ~2 KB
Optimizing Music Size
- Reuse patterns: Don’t duplicate similar patterns
- Share instruments: Use same instruments across songs
- Shorter loops: Loop earlier in the song
- Fewer effects: Minimize envelope changes
Troubleshooting
No Music Plays
Possible causes:- Music not initialized: Call
PLAYERfirst - Interrupts disabled: Check
EIis called - Wrong song number: Check
INS_cancionvalue - File not included: Verify
incbinpath
Music Sounds Wrong
Possible causes:- Wrong clock speed in WYZ Tracker (use 1MHz)
- Wrong refresh rate (use 50Hz for PAL)
- Corrupted .mus file
- Wrong player version
Music Stutters
Possible causes:- Too much code in interrupt
- Interrupts disabled too long
- DI without matching EI
Sound Effects Don’t Play
Possible causes:- Music using all channels
- Effect not loaded
- Channel priority issue
Best Practices
1. Test Early
Add music early in development to ensure memory budget:2. Provide Mute Option
3. Consistent Volume
Normalize all songs to similar volume levels in WYZ Tracker.4. Loop Points
Set proper loop points in WYZ Tracker for seamless looping.5. Test on Real Hardware
Music timing may differ between emulator and real CPC.Example: Complete Music Setup
See 8BP Game Example for:- Multiple music tracks
- Sound effects
- Music/SFX mixing
- Complete integration
Related
- 8BP Game Example - Full music integration
- Multi-File Projects - Organizing music files
- ASM Project Example - Custom sound routines