Modules/arkos/akm player
From MSX Game Library
< Modules
The arkos/akm_player module lets you play music and sound effects in Arkos Tracker II's Minimalist player (AKM) format.
Usage
To use this module, include "arkos/akm_player.h" in your source code, and add "arkos/akm_player" to the modules list (LibModules) in your project's configuration file (project_config.js).
Music address
Arkos music is designed to work only if played at a specific address. When you export a music file from Arkos Tracker, you select this address (e.g., 0xD000).
In your program, you must ensure that the music is placed at this address to initialize the playback properly.
There are several possible approaches:
- Store your music in a compressed format (Pletter, ZX0, etc.) anywhere in your program and then decompress it to the correct address in RAM when needed. In this case, you must reserve enough space in RAM to put the current music and the SFX (if needed). A possible layout maybe:
- Music at 0xD000 (4 KB up to 0xDFFF)
- SFX at 0xE000 (1 KB up to 0xE3FF)
- Put the music directly in the "right" place in your program. This can be quite complicated in C, unless you manually place the data at a given address (with the __at() directive). This is possible in page 0 of 48 KB ROMs, for example, or more simply with mapper segments. For example, with an 8 KB mapper, you could use the last bank (0xA000-0xBFFF) to put your music at the beginning of the segment, so that it's readable in 0xA000.
Samples
See module use cases in the sample programs:
Settings
Dependencies
Dependency on other modules: None
Documentation