audioControl Driver

Last updated: · In development
One place to decide how the game sounds
audioControl brings music and sound effects together for ZX Spectrum Next games. Its purpose is to manage the sound of the game, rather than simply provide another music player.
The game reports what happened: a player jumped, an enemy fired, something was collected or a level ended. The controller chooses an appropriate sound and decides whether it should play now, give way to a more important effect or be suppressed because it has just played.
From a short sample to a full track
Alternating two preloaded banks first proved the handoff. Refilling the inactive bank from RAM, then from SD, extended the same mechanism to a whole piece of music. Both 50 Hz and 60 Hz were checked on KS3.
The original stereo track was converted to mono for this test. The next experiment at this checkpoint is independent left and right PCM from RAM.
Sound that belongs to the game world
The AY sound-effects path now provides hardware-proven left, centre and right placement with near, middle and far distance levels. Nearby sounds have a wider centre region, and the three directions have been matched by ear so the centre does not dominate the scene. These checks passed in both 50 Hz and 60 Hz modes.
The wider plan still includes smoothly moving sampled sounds, world-based source and listener positions, off-screen sounds and optional stereo expansion. These additions are not completed by the simpler AY positioning work.
A useful partner for the other drivers
playerControl handles the player, enemyControl handles enemies and scrollingControl handles the view of the world. Their actions can become audio requests while audioControl decides what should be heard. The main game can also start or stop music and effects directly.
Later cooperation with speechControl is intended to let voices and sound effects occupy the same audible world, with their positions changing as characters move. Speaking and listening remain speechControl’s responsibility; this cooperation is planned.
A wider soundstage when it suits the scene
Alongside individual sound positioning, I want an optional stereo-expansion effect inspired by the broad ideas behind Q-Sound and Q-Expander. Positioning tells the player where a sound comes from; expansion changes how wide the overall scene feels.
A wider soundstage could suit wind, cavern ambience or ghostly voices, while an ordinary character’s dialogue could stay more tightly positioned. This will be the driver’s own effect, with expansion switchable rather than applied to every sound.
A complete tune from SD
On a KS3 ZX Spectrum Next, a standalone audioControl test streamed a complete 150.75-second mono track from SD. One RAM buffer fed the DAC while the other received the next part of the file. The tune played to its last sample with no reported gaps, skips or corruption.
Build 48 remains the AY reference for PT3 music and AYFX effects at 50 Hz and 60 Hz. Build 54 supplies the single-shot DAC path used in the PCM tests. The two baselines give future integration work independent checks for chip audio and sample playback.
Sound for ship and combat events
Future shipControl examples will let BASIC map firing, hits, empty ammunition, insufficient energy, overheating and module changes to audio requests. shipControl will report what happened; it will neither select nor play a sound. audioControl retains the playback, priority and sound-management work.