The best way to create Music for a complete noob?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
The best way to create Music for a complete noob?
by on (#235046)
Hello to everyone,
I need to create sound effects and music for my game, with "normal" game programming I can find a lot of sample on Internet to use in my Demo/Game, but in this case I don't know where to start. So my question is, there is a tool to convert midi, wav o something else in a NES format? If no, there are some samples for NES that I can use in my game?

Thanks for any suggets! :)
Re: The best way to create Music for a complete noob?
by on (#235048)
FamiTracker is probably the best way to get started creating NES music, as most homebrew audio drivers can read a format that FamiTracker exports. See 8bitdannoct1's introduction, Teuthida's introduction, and FamiTracker.org.

You mentioned MIDI. If you're familiar with LilyPond or MML as means of creating MIDI files, Pently is worth a try.
Re: The best way to create Music for a complete noob?
by on (#235049)
https://nesdoug.com/2016/01/24/25-impor ... mitracker/

I wrote this about making and importing a MIDI to famitracker. (must be an older version, they removed that feature from recent versions because it never worked very well). Then you would export from famitracker to use with famitone2.

This is a long complex process, that I don't even use. It will not work for just any MIDI file. You can only have 1 note at a time. If you have a chord, you need to put each individual note on a different channel. Specifically channels 1-3.

And, there is a subtle artform (in famitracker) to making instruments that sound good.

Plus, there are many restrictions to what the famitone engine can do.
Re: The best way to create Music for a complete noob?
by on (#235054)
While you technically *can* play or stream samples, it is most often not the best choice, simply put. The fidelity is generally too low, and it will tax various resources.

Instead, think of its audio capabilities as a basic synth that you're playing live. Or that your program plays live.

Once you figure out how to set up a project in famitracker, i think it becomes straightforward quickly. You input notes with your computer keyboard into a roll of instructions, not too unlike a modern sequencer. the key E on your keyboard is actually the note E and you can orient yourself from there.
Re: The best way to create Music for a complete noob?
by on (#235078)
Ok thanks a lot! Unfortunately I can't compose music, so, to me, the best way to use some music is to "copy" from some source. Anyway, I will read your links and try to figure out how to make some sample for my game :).
Re: The best way to create Music for a complete noob?
by on (#235111)
If you don't want to use a tool like famitracker:

Just doing simple sound effects is pretty easy. when the event occurs in your game that you want to make the sound, just write the correct values to the registers for the channel that you want it to play on (pulse1 is $4000 - $4003, etc.). A little experimentation will give you an idea of what the different registers do.

Music is rather harder. I think the simplest way to play music is to have a table of all the data you want to load into the audio registers for a channel, and an index variable that points to the current byte you want to load. use the length counter for the channel, and read $4015 on every frame to determine when each note has ended. When it has ended, increment your index and load the next four bytes for that channel. This is not a very flexible sound engine, but it's probably the easiest to conceptualize.

Music and sound effects at the same time gets even more complicated. You could just set aside one channel (probably pulse2) for only sound effects and the other 3 for just music. Some games do this. Making a channel switch back and forth between music and sound effects is more challenging. You'd have to set up boolean variables to indicate whether each channel is supposed to be playing music or sound effects on any given frame, and a system to keep each channel's music index in the correct place in the music table while sound effects are playing, or that channel will get out of sync with the others. This is when you're starting to enter territory of building a real audio engine though.
Re: The best way to create Music for a complete noob?
by on (#235124)
gravelstudios wrote:
If you don't want to use a tool like famitracker:

Just doing simple sound effects is pretty easy. when the event occurs in your game that you want to make the sound, just write the correct values to the registers for the channel that you want it to play on (pulse1 is $4000 - $4003, etc.). A little experimentation will give you an idea of what the different registers do.

Music is rather harder. I think the simplest way to play music is to have a table of all the data you want to load into the audio registers for a channel, and an index variable that points to the current byte you want to load. use the length counter for the channel, and read $4015 on every frame to determine when each note has ended. When it has ended, increment your index and load the next four bytes for that channel. This is not a very flexible sound engine, but it's probably the easiest to conceptualize.

Music and sound effects at the same time gets even more complicated. You could just set aside one channel (probably pulse2) for only sound effects and the other 3 for just music. Some games do this. Making a channel switch back and forth between music and sound effects is more challenging. You'd have to set up boolean variables to indicate whether each channel is supposed to be playing music or sound effects on any given frame, and a system to keep each channel's music index in the correct place in the music table while sound effects are playing, or that channel will get out of sync with the others. This is when you're starting to enter territory of building a real audio engine though.


I'm reading this: http://nintendoage.com/forum/messagevie ... adid=23452 , it's very complete as tutorial, but I still need to have a music "Traslated" in HEX for NES :D .
Re: The best way to create Music for a complete noob?
by on (#239957)
Great, that's what I was looking for!