It is currently Sun Aug 18, 2019 11:05 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Tue Jul 09, 2019 7:37 am 
Offline
User avatar

Joined: Thu Aug 16, 2018 4:50 pm
Posts: 4
I've been studying NES music for a few months now and started initially as just being interested in emulkating the sounds using a Korg MS-20, but then became interested in creating NSF files. I'm interested in learning 6502 Aseembly because I want to eventually write my own NES game by hand. I have a background in programming and visual art as well and I have a hungry curiousity. My plan is to take a preexisting NSF file and edit it to make different sounds.

Anything I should be aware of before proceeding? Is this idea fundamentally flawed?


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 7:55 am 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1289
An NSF is really just a ROM. In the case of NSFs that contain audio from commercial game, it's the commercial ROM with the game engine/graphical display/enemy and player logic hacked out, leaving only the music player and data.

Editing an NSF to have new sounds is not fundamentally flawed, but it's not something I'd recommend starting with unless you're already familiar with 6502. It's editing a program you didn't write in compiled or assembled form, meaning no access to source code, comments, and existing blocks of code can't be made longer (because branches/jmps refer to places that were decided when the ROM was assembled). You're dead in the water unless you're already familiar with the language or you're making very small data changes. (You still need 6502 knowledge to find what is data vs what is code.)

FamiTracker: http://famitracker.com/ Lets you create music with a GUI, and can export to NSF. If all you want is an NSF, that's a good path to take.

If you want to learn 6502, there's easy6502 which lets you write/test code right in your browser with no extra software or anything: https://skilldrick.github.io/easy6502/
It's not the greatest teaching material, I've realized, but if you already have some programming background, you should be able to get there with it.
6502 is separate from NES hardware, which is the real hidden boss of any of this. Nerdy Nights: http://nintendoage.com/pub/faq/NA/index ... _out.html#

teaches 6502 as well as NES hardware. Unfortunately some of the zips in the audio sections are dead, and you'd have to find mirrors. If you can make an NES ROM (and truly understand how one is put together), you can make an NSF just by reading about the differences. Again, an NSF is really just an NES ROM focused on audio.

If you really want to write your own music engine, you're welcome to by figuring out how audio works from either nerdy nights, or the wiki: https://wiki.nesdev.com/w/index.php/APU_basics

But there are also several open source ones you can freely use. (Including Famitracker's which basically supports everything NES audio hardware can do already.) https://wiki.nesdev.com/w/index.php/Tools#Music_tools

Unless you want to do some really nuts stuff or do it just for the sake of it, it may not be worth writing your own
music engine. The game itself will be hard enough.

Edit: Oh, hey, I recognize your name. You PM'd me on NES Maker's forum. I did respond, it just ended up taking a while since I was having some computer issues at the time.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 8:01 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21558
Location: NE Indiana, USA (NTSC)
If you just want to write music as NSF files, there are a couple ways to go about it.

- If you have experience with LilyPond or MML, or you want a composing interface and workflow that resemble those of programming, Pently or NSD.Lib may be more your style. (Full disclosure: I wrote Pently.)
- If you prefer a tracker interface similar to OpenMPT, j0CC-FamiTracker is the popular tool. It runs in Windows or Wine (except on macOS Catalina). Its sound driver isn't really optimized for use in games, as it uses quite a bit of RAM and there's no built-in support for sound effects, but there exist converters to turn FamiTracker's text export into things that game-oriented drivers (Pently, FamiTone2, FamiTone4, and GGSound) can read. NESmaker in particular currently uses GGSound.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 10:27 am 
Offline
User avatar

Joined: Thu Aug 16, 2018 4:50 pm
Posts: 4
Kasumi wrote:
An NSF is really just a ROM. In the case of NSFs that contain audio from commercial game, it's the commercial ROM with the game engine/graphical display/enemy and player logic hacked out, leaving only the music player and data.

Editing an NSF to have new sounds is not fundamentally flawed, but it's not something I'd recommend starting with unless you're already familiar with 6502. It's editing a program you didn't write in compiled or assembled form, meaning no access to source code, comments, and existing blocks of code can't be made longer (because branches/jmps refer to places that were decided when the ROM was assembled). You're dead in the water unless you're already familiar with the language or you're making very small data changes. (You still need 6502 knowledge to find what is data vs what is code.)

FamiTracker: http://famitracker.com/ Lets you create music with a GUI, and can export to NSF. If all you want is an NSF, that's a good path to take.

If you want to learn 6502, there's easy6502 which lets you write/test code right in your browser with no extra software or anything: https://skilldrick.github.io/easy6502/
It's not the greatest teaching material, I've realized, but if you already have some programming background, you should be able to get there with it.
6502 is separate from NES hardware, which is the real hidden boss of any of this. Nerdy Nights: http://nintendoage.com/pub/faq/NA/index ... _out.html#

teaches 6502 as well as NES hardware. Unfortunately some of the zips in the audio sections are dead, and you'd have to find mirrors. If you can make an NES ROM (and truly understand how one is put together), you can make an NSF just by reading about the differences. Again, an NSF is really just an NES ROM focused on audio.

If you really want to write your own music engine, you're welcome to by figuring out how audio works from either nerdy nights, or the wiki: https://wiki.nesdev.com/w/index.php/APU_basics

But there are also several open source ones you can freely use. (Including Famitracker's which basically supports everything NES audio hardware can do already.) https://wiki.nesdev.com/w/index.php/Tools#Music_tools

Unless you want to do some really nuts stuff or do it just for the sake of it, it may not be worth writing your own
music engine. The game itself will be hard enough.

Edit: Oh, hey, I recognize your name. You PM'd me on NES Maker's forum. I did respond, it just ended up taking a while since I was having some computer issues at the time.


Hi Kasumi. Yes I do remember you too. I don't remember where we left off with our conversation though. I got annoyed with NESmaker and went on my own journey that lead me back to writing a NES game but instead focusing on sound first. After I posted here, I did look at Nerdy Nights again. I am going to try to get through the Nerdy Nights material again next. I got distracted by this whole Commodore 64 and sound synthesis tangent. Long story short I'm back to NESDev.

I think I am going to start with the Nerdy Nights Sound section this time and see how far I get. Will come back with questions.


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 10:29 am 
Offline
User avatar

Joined: Thu Aug 16, 2018 4:50 pm
Posts: 4
tepples wrote:
If you just want to write music as NSF files, there are a couple ways to go about it.

- If you have experience with LilyPond or MML, or you want a composing interface and workflow that resemble those of programming, Pently or NSD.Lib may be more your style. (Full disclosure: I wrote Pently.)
- If you prefer a tracker interface similar to OpenMPT, j0CC-FamiTracker is the popular tool. It runs in Windows or Wine (except on macOS Catalina). Its sound driver isn't really optimized for use in games, as it uses quite a bit of RAM and there's no built-in support for sound effects, but there exist converters to turn FamiTracker's text export into things that game-oriented drivers (Pently, FamiTone2, FamiTone4, and GGSound) can read. NESmaker in particular currently uses GGSound.


Thanks tepples. I will investigate these routes. I plan to start with Nerdy Nights sound section and see where it takes me.


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 10:48 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 525
FWIW I had more luck reading the nesdev wiki than the nerdy nights tutorial.

One thing to note is that many APU features aren't necessary. You don't need to use envelopes and sweep. Many sound engines don't.


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 10:54 am 
Offline
User avatar

Joined: Thu Aug 16, 2018 4:50 pm
Posts: 4
pubby wrote:
FWIW I had more luck reading the nesdev wiki than the nerdy nights tutorial.

One thing to note is that many APU features aren't necessary. You don't need to use envelopes and sweep. Many sound engines don't.


Hi pubby. Whats wrong with the Nerdy Nights tutorial? I actually would like to use all of the availables features in the APU and learn them well. I want to make really good and interesting sound. I got into sound synthesis recently and I am currently focusing on building on that knowledge with the NES.

Likely I would end up working through the Nerdy Nights tutorials and then referencing wikis as needed. All tools can be useful.


Top
 Profile  
 
PostPosted: Tue Jul 09, 2019 1:46 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 525
Oh there's nothing wrong with Nerdy Nights. It's a good tutorial! But if you find it's not your style, try the wiki instead.

The features I mentioned are somewhat redundant. To get started, all you really need to know is pitch, volume, and duty. Envelopes and sweep can be done in software by writing to pitch, volume, and duty. You typically don't need to use the built-in hardware implementation to get envelopes and sweeps.


Top
 Profile  
 
PostPosted: Wed Jul 10, 2019 2:04 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3701
Location: Indianapolis
davidpgil wrote:
I actually would like to use all of the availables features in the APU and learn them well.


Once you have a little familiarity with the register bits, it might be enlightening to play some NSF files in a player that lets you view the audio registers. GNSF and my own NSF player (http://membler-industries.com/SNES/) are the only 2 that come to mind. What you'll see is that only the very earliest games fully used the hardware effects. Here's my own review of the lesser-used ones.

envelope generator: the distinctive sound of early NES games. The fadeout is linear and loud. One could easily recreate it with a software envelope if that sound was really wanted, and that's the way to go. Dragon Quest/Warrior maybe tried the hardest to use it, it plays held notes before enabling the envelope generator to fade them out. I haven't seen anything else try to do that.

envelope looped mode: Weird! When you want something that sounds like tremolo picking, and you want it full volume, there it is. Magmax underground section comes to mind, and the Mappy theme.

sweep: It has the advantage of not resetting the pulse phase, as a $4003/$4007 write does. It's normally for sfx though, Double Dragon is the only game I know of that uses it in music for pitch bends, and it's excellent there. It seems easier to manually control the freq vs using sweep hardware though. If you play the sweep unit in both channels with the same settings, you'll get phasing (boss alarm in The Guardian Legend)

DMC IRQ: Criminally underused feature. See http://slack.net/~ant/misc/nes-saw/


Top
 Profile  
 
PostPosted: Sun Jul 14, 2019 3:40 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1180
Location: Hokkaido, Japan
davidpgil wrote:
Whats wrong with the Nerdy Nights tutorial? I actually would like to use all of the availables features in the APU and learn them well. I want to make really good and interesting sound. I got into sound synthesis recently and I am currently focusing on building on that knowledge with the NES.

Likely I would end up working through the Nerdy Nights tutorials and then referencing wikis as needed. All tools can be useful.
For me the wiki was way too technical to get anything useful out of it when I started out. The Nerdy Nights sound tutorial however teaches you all you need to know in layman terms (except for the DPCM channel, but you can learn that later), including software envelopes and a load of other stuff. I also used both the wiki and Nerdy Nights for understanding everything though.

Only problem with the Nerdy Nights might be that although it's beginner level it gets a bit more complicated than the original Nerdy Nights tutorial that just teaches you how to make Pong. It took me longer to understand everything than the Pong tutorial did. On the other hand, besides teaching how to make a sound engine, it also teaches you how to make a system for buffering background characters as a side effect of making the sound player menu. That's something you never learn in the Pong tutorial, and is essential in a game.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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