-
Notifications
You must be signed in to change notification settings - Fork 0
Audio
FourcadeL edited this page Apr 18, 2025
·
3 revisions
The audio engine has four Major components :
- audio
- tracker
- instruments
- sfx
The audio module handles hardware initialization, song playback, sound effect playback and CH3 wavetable.
[!INFO] Song Playback Song Playback is handled as follows :
- audio initialise trackers on specific songs
- trackers interpret a list of instructions and pass notes to play to instruments
- instruments play individual notes on each channels
Audio tracks must follow the Song format SFX must follow the SFX format
Main audio module Contains the main audio control routines.
Control routines :
- Audio_init(b = playback speed)
- Audio_off()
- Audio_load song([hl] = (8 bytes) song structure)
- Audio_start_song()
- Audio_stop_song()
- Audio_set_wave_pattern([hl] = (16 bytes) wave pattern)
Timed_routines :
- Audio_update()
Sound effect module Handles sound effects on top of songs playback.
Control routines :
- sfx_request(a = sfx control byte)
- sfx control byte has format :
%ccpxxxxx-
%cc: channel -
%p: priority bit (1 = high priority) -
%xxxxx: sfx id
-
- sfx control byte has format :
Timed_routines :
- sfx_update()