It is currently Sat Aug 17, 2019 5:45 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Feb 26, 2019 10:09 am 
Offline

Joined: Sat May 26, 2018 6:14 am
Posts: 90
Location: Italy
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! :)


Top
 Profile  
 
PostPosted: Tue Feb 26, 2019 11:28 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21556
Location: NE Indiana, USA (NTSC)
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.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Tue Feb 26, 2019 11:59 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2548
Location: DIGDUG
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


Top
 Profile  
 
PostPosted: Tue Feb 26, 2019 1:55 pm 
Offline
Formerly WheelInventor
User avatar

Joined: Thu Apr 14, 2016 2:55 am
Posts: 2024
Location: Gothenburg, Sweden
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


Top
 Profile  
 
PostPosted: Wed Feb 27, 2019 1:01 am 
Offline

Joined: Sat May 26, 2018 6:14 am
Posts: 90
Location: Italy
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 :).


Top
 Profile  
 
PostPosted: Wed Feb 27, 2019 5:51 pm 
Offline
User avatar

Joined: Mon Mar 13, 2017 5:21 pm
Posts: 60
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.


Top
 Profile  
 
PostPosted: Thu Feb 28, 2019 2:25 am 
Offline

Joined: Sat May 26, 2018 6:14 am
Posts: 90
Location: Italy
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 .


Top
 Profile  
 
PostPosted: Wed Jun 19, 2019 4:19 am 
Offline

Joined: Wed Jun 19, 2019 4:16 am
Posts: 1
Great, that's what I was looking for!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group