The best way to create Music for a complete noob?

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

Moderator: Moderators

Post Reply
User avatar
kikutano
Posts: 100
Joined: Sat May 26, 2018 6:14 am
Location: Italy

The best way to create Music for a complete noob?

Post by kikutano » Tue Feb 26, 2019 10:09 am

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! :)

tepples
Posts: 21715
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: The best way to create Music for a complete noob?

Post by tepples » Tue Feb 26, 2019 11:28 am

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.

User avatar
dougeff
Posts: 2599
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: The best way to create Music for a complete noob?

Post by dougeff » Tue Feb 26, 2019 11:59 am

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

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2030
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: The best way to create Music for a complete noob?

Post by FrankenGraphics » Tue Feb 26, 2019 1:55 pm

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.
http://www.frankengraphics.com - personal NES blog

User avatar
kikutano
Posts: 100
Joined: Sat May 26, 2018 6:14 am
Location: Italy

Re: The best way to create Music for a complete noob?

Post by kikutano » Wed Feb 27, 2019 1:01 am

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 :).

gravelstudios
Posts: 70
Joined: Mon Mar 13, 2017 5:21 pm
Contact:

Re: The best way to create Music for a complete noob?

Post by gravelstudios » Wed Feb 27, 2019 5:51 pm

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.

User avatar
kikutano
Posts: 100
Joined: Sat May 26, 2018 6:14 am
Location: Italy

Re: The best way to create Music for a complete noob?

Post by kikutano » Thu Feb 28, 2019 2:25 am

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 .

rchuprina91
Posts: 1
Joined: Wed Jun 19, 2019 4:16 am

Re: The best way to create Music for a complete noob?

Post by rchuprina91 » Wed Jun 19, 2019 4:19 am

Great, that's what I was looking for!

Post Reply