music in asm

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
music in asm
by on (#226989)
Bonjour
je voudrai savoir si il est possible d inclure un fichier nsf cree avec famitracker
pour pouvoir l inclure dans un programme asm

juste pour faire une melodie sur un jeu basique

pour l instant j ai juste reussi en recuperant des infos
a avoir un background
un personnage qui se deplace
un flip du personnage

ainsi que des ennemi qui se deplacent horizontalement ou verticalement

les prochaines etapes seront une petite melodie comme indique
et surtout la gestion des collisions

in english

Hello
I want to know if it is possible to include a file nsf created with famitracker
to be included in an asm program

just to make a melody on a basic game

for now I just managed to recover some information
to have a background
a moving character
a flip of the character

as well as enemies moving horizontally or vertically

the next steps will be a little melody as indicated
and especially collision management

thank you all
Thierry


merci a tous
Thierry
Re: music in asm
by on (#226990)
Do you have the FTM or 0CC file? If so, there are a few audio drivers that can play music converted from FamiTracker, such as Pently, FamiTone2, FamiTone4, and GGSound. Each of these drivers has limits on which FamiTracker effects it supports: FamiTone2 and GGSound are more basic, whereas Pently and FamiTone4 are more full featured.
Re: music in asm
by on (#226992)
If the NSF is small enough and doesn't bankswitch, you can embed it directly in your assembly program. The NSF header has three fields, LOAD, INIT and PLAY that are needed for doing this. LOAD is where to put the data in the ROM. INIT is the address of the routine to set up a track to be played. PLAY is called once per frame.

If you need sound effects as well, this can be a bit of a problem to implement on top of an NSF. The sound effect code should need to cooperate with the music code, not just run on top of it. For that case one of tepples' suggested alternatives might help.

There is also "NSF driver" assembly source code for Famitracker, which would let you build the NSF data yourself as part of the program. If you used that you could place the data anywhere (not just the INIT address) and modify the source code as needed for sound effect cooperation.
Re: music in asm
by on (#227166)
can you explain more
and example
please
Thierry