If you're working in Z80, this page is for you. There are already ready-to-use testers in the AT2 package ("players/playerAkg/sources/tester", to name only one), but here is a very simple example of how the players work.
Garvalf has also created working examples (for CPC, Spectrum and Garvuino), which you can find on his GitHub repository. Thanks to him!
We will use AKG player here, which is the "generic" player, but the other players work the same way.
This page is made to be straightforward, so let's be concise.
Export of the song via command line
Let's use the command line tools to export your song. You can do it from the graphic interface inside the software, but we want to go fast!
There are many example songs, but let's focus on "Targhan - A Harmless Grenade.aks" located in the songs\ArkosTracker2\3Channels folder.
The command line tools are located in the tools folder. The following command will create the source code of the exported music, which we call music.asm. The input file is of course, the music we talked about just above:
SongToAkg.exe "Targhan - A Harmless Grenade.aks" music.asm
Assemble the whole
The AKG player is located in the players\playerAkg\sources folder, and named PlayerAkg.asm. Let's create a wrapper around it to play the song every 50hz. We use Rasm to assemble. If you want to use any other assembler, please check this tutorial.
This sample targets the Amstrad CPC, but choosing a MSX, Spectrum or anything else works exactly the same. The only specific code is the wait for the frame flyback. Please adapt it according to your target computer.
;Moves the system out of the way.
ld sp,$ ;Put the stack out of the way (it can destroy the beginning of our code, we don't care).
;Let's initialize the song.
ld hl,MusicStart;Declared below.
xor a ;Subsong 0 (the main one).
;Wait for the frame flyback.
;On CPC, we do it this way:
Sync2: in a,(c)
;Let's play our song!
;Of course, we need to include the player and the music to play.
;Uncomment the target you want. Declare this BEFORE the player is included.
PLY_AKG_HARDWARE_CPC = 1
;PLY_AKG_HARDWARE_MSX = 1
;PLY_AKG_HARDWARE_SPECTRUM = 1
;PLY_AKG_HARDWARE_PENTAGON = 1
MusicStart: include "music.asm"
That's it! Just execute this code, starting in 0x1000 and music will be heard!