NES hombrew music help

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
Flapperultra
Posts: 1
Joined: Sun May 13, 2018 3:32 pm

NES hombrew music help

Post by Flapperultra »

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
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: NES hombrew music help

Post by Kasumi »

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.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: NES hombrew music help

Post by dougeff »

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
nesdoug.com -- blog/tutorial on programming for the NES
Post Reply