NES hombrew music help

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NES hombrew music help
by on (#218484)
Hello I have been slowly getting my head around writing code for the nes in asembly using nesasm however I am not certain how to include the library and song. If anyone could just give me an example of playing a song through ASM I would be most grateful.

Thank you in advance
Re: NES hombrew music help
by on (#218489)
FamiTone2 on this page: https://shiru.untergrund.net/code.shtml
Contains full source code for a demo that plays the included songs, as well as software and documents to put your own software in the format FamiTone2 plays.

Edit: If there's a specific step in the readme you don't understand, ask about that specific step.
Re: NES hombrew music help
by on (#218502)
Right, and you will have to run the music init code (FamiToneInit) and the sfx init code (FamiToneSfxInit) (to set pointers to the start of the music / sfx) at the start of your program , then play a song / sfx with the FamiToneMusicPlay and FamiToneSfxPlay subroutines.

One per frame call FamiToneUpdate, to update the music (run the music engine).

I think this explains it...
https://timcheeseman.com/nesdev/2018/02 ... t-two.html