Is a good think make my own Sound Engine?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

User avatar
DRW
Posts: 1976
Joined: Sat Sep 07, 2013 2:59 pm

Re: Is a good think make my own Sound Engine?

Post by DRW » Fri Mar 01, 2019 7:25 am

I would suggest that you do the first few chapters of the tutorial, so that you learn about the NES sound channels and how to control them. This way you aren't completely oblivious to the inner workings.

But for actual practical use, I would suggest using an existing library then. After all, just have a look at FamiTone: Those are more than 1000 lines of code.
And that's his second major version. The first version was much less efficient in ROM size, RAM size and CPU time.

Going through the tutorial first was also a good help for later when I decided that I want a music fadeout in my game. FamiTone doesn't provide runtime changes of the volume, but since I knew how the APU works, I was able to intercept FamiTone's buffer arrays to extract, reduce and reinsert the volume values before the variables are written to the APU.
My game "City Trouble": www.denny-r-walter.de/city.htm

Pokun
Posts: 1491
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Is a good think make my own Sound Engine?

Post by Pokun » Fri Mar 01, 2019 8:37 am

Yes if you have any interest in the APU at all, it is worth to at least read the basic part of the tutorial.

I was very interested how you could make sound out of the NES as it is maybe a bit harder to grasp than graphics. The tutorial shows how to make quite a capable sound driver and you can upgrade it with new features quite easily. It also gave me the necessary knowledge how to do this for other systems with similar sound chips.

That said, it does take time to get things sorted the first time.


One problem with some sound drivers like Famitone is that you have to use a special tracker program to make stuff with it. As for PPMCK you use MML which is probably easier to understand, but it's more designed for composing chiptune NSFs with than to use as a sound driver in a game. With your own sound driver you can design it to take data much similar to MML, or even design your own MML compiler if you want.

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

Re: Is a good think make my own Sound Engine?

Post by tepples » Fri Mar 01, 2019 8:49 am

Pokun wrote:One problem with some sound drivers like Famitone is that you have to use a special tracker program to make stuff with it. As for PPMCK you use MML which is probably easier to understand, but it's more designed for composing chiptune NSFs with than to use as a sound driver in a game. With your own sound driver you can design it to take data much similar to MML, or even design your own MML compiler if you want.
Conversely, based on opinions expressed in the topic "Making MML editing more practical":

One problem with some sound drivers like PPMCK is that you have to use a special MML dialect and compiler to make stuff with it, and beginners may find the edit-compile-run cycle unwieldy. As for FamiTone and GGSound you use a tracker which is probably easier to understand, but the FamiTracker default driver is more designed for composing chiptune NSFs with than to use as a sound driver in a game, and many drivers that take FT exports (such as FamiTone2 and GGSound) cannot handle certain effects, bringing back the edit-compile-run cycle. With your own sound driver you can design it to take data much similar to a tracker, or even design your own tracker if you want.

In theory, just about any driver that works with MML can be made to work with FT exports. It just takes the appropriate converter program.

User avatar
DRW
Posts: 1976
Joined: Sat Sep 07, 2013 2:59 pm

Re: Is a good think make my own Sound Engine?

Post by DRW » Fri Mar 01, 2019 10:24 am

Pokun wrote:One problem with some sound drivers like Famitone is that you have to use a special tracker program to make stuff with it.
Isn't FamiTracker the go to program for creating NES music anyway? Is there really any serious alternative, so that the restriction to FamiTracker for FamiTone could be considered a disadvantage?
My game "City Trouble": www.denny-r-walter.de/city.htm

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

Re: Is a good think make my own Sound Engine?

Post by dougeff » Fri Mar 01, 2019 10:41 am

There used to be thefox's Pornotracker / Musetracker.

And several trackers are multi-platform. deflemask, for example.
nesdoug.com -- blog/tutorial on programming for the NES

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

Re: Is a good think make my own Sound Engine?

Post by FrankenGraphics » Fri Mar 01, 2019 11:15 am

There's also bananmos:es nerdtracker 2 - which is even hosted by nesdev, apparently: http://nesdev.com/nt2/ - what a lovely and refreshing site to visit in this time and age!
It has some interesting differences and choices for effects. Not sure how viable it is for homebrew since i don't think that was on the roadmap back then. It is storing volume commands in nibble-sized(!!) words while most other drivers omit having a volume column altogether. Running on DOS(box) is fine, but the absence of select/copy/cut/paste is a bit too masochistic for me.

i like that the site still points to parodius for the forums
http://www.frankengraphics.com - personal NES blog

User avatar
DRW
Posts: 1976
Joined: Sat Sep 07, 2013 2:59 pm

Re: Is a good think make my own Sound Engine?

Post by DRW » Fri Mar 01, 2019 7:44 pm

O.k., there are other programs. But my focus was:
Is there any serious alternative?
Is there a tracker that has at least half of the popularity of FamiTracker, so that restriction to FamiTracker is an actual disadvantage? Or are these all just niche programs to begin with that nobody really uses anyway?
My game "City Trouble": www.denny-r-walter.de/city.htm

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

Re: Is a good think make my own Sound Engine?

Post by kikutano » Sun Mar 03, 2019 3:12 am

I'm using Famitone 2, really easy to use and with a lot of features that I need for my game. So, for now I will use it and try to import some goof sfx and music. :P

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

Re: Is a good think make my own Sound Engine?

Post by FrankenGraphics » Sun Mar 03, 2019 3:44 am

DRW wrote:Is there any serious alternative?
Is there a tracker that has at least half of the popularity of FamiTracker
There's 0cc-famitracker which is currently the only maintained fork of famitracker, which improves the UI quite a bit and has done some changes to the driver as well (linear vibratos being one, musician-friendly arpeggios being another - both leading to less instrument copy-clutter which is significant considering you can only share 64 instruments across a project). It has been disregarded in some threads on here as even less homebrew-oriented in the past, but i'm curious as to what exactly makes conversion from 0cc-famitracker less viable than vanilla famitracker. I might be missing something, but you'd still export a subset of the features and the song format.

edit:
The linear vibrato style should make it a better candidate for converting to pently. Other drivers would not be what you hear is what you get in that regard, so there's that.
http://www.frankengraphics.com - personal NES blog

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

Re: Is a good think make my own Sound Engine?

Post by tepples » Sun Mar 03, 2019 6:57 am

FrankenGraphics wrote:There's 0cc-famitracker which is currently the only maintained fork of famitracker
0CC-FT is an improvement on FT, but it's no longer "maintained". HertzDevil went on hiatus, jimbo1qaz took it up, and then jimbo1qaz went on hiatus since October.
FrankenGraphics wrote:It has been disregarded in some threads on here as even less homebrew-oriented in the past, but i'm curious as to what exactly makes conversion from 0cc-famitracker less viable than vanilla famitracker.
The 0CC-FamiTracker text export includes many of the new features. However, as stated in specs.txt: "Bookmarks and the linear pitch setting are not exported to text files." This means a converter cannot tell a song's time signature, which is stored in bookmarks, nor whether the module was authored with linear pitch turned on. I would link to the feature request that I had filed against HertzDevil's fork to include these, but HertzDevil's bug report forum is in "Maintenance Mode" where only administrators can log in:
This board is in 'Maintenance Mode'." /> Okay faithful users...we're attempting to restore an older backup of the database...news will be posted once we're back!

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

Re: Is a good think make my own Sound Engine?

Post by kikutano » Mon Mar 04, 2019 10:02 am

I'm using famitone2 and NESASM3 without any problems, the music is played well and sound effects are ok. I'm using Famitracker to play some samples but when I try to convert a text file or nsf with famitone tool "text2data" or "nsf2data" it give me ALWAYS some error: Error: effect is too long, Cxx at end of the effect may be missing or Parsing error (row 394,col 10): Note is out of supported range (C-1..D-6). I've no idea how to find some .ftm or .nsf that can convert in sfx or music. This is really frustrating, I can't compose, so I need to find pre cooked samples and use it. So, what's the best way to find a sound fx, music archive that I can use for my game? Famitracker had a lot of samples, but nothing that I can convert to famitone :roll: . There is a way to rip the sound from other game and reuse it?

Thanks a lot for any suggests!

User avatar
NOOPr
Posts: 68
Joined: Tue Feb 27, 2018 10:41 am
Location: Brazil
Contact:

Re: Is a good think make my own Sound Engine?

Post by NOOPr » Mon Mar 04, 2019 11:26 am

Moderators: Please, delete my post if it's inappropriate!

kikutano, you can get some NSFs from this topic or directly from
MrNorbert1994's site.
To properly open an NSF on Famitracker, use the rainwarrior's NSF importer, save the sound as ftm and open it in a newer version of Famitracker for edition.
Remember that as the famitone documentation states: "Every effect should be finished with silence, and C00 command put to the last row of the effect".
Hope it helps.

User avatar
Bregalad
Posts: 7890
Joined: Fri Nov 12, 2004 2:49 pm
Location: Chexbres, VD, Switzerland

Re: Nerdy Nights Tutorial Source Code

Post by Bregalad » Mon Mar 04, 2019 1:05 pm

dougeff wrote:My advice for making a sound engine from scratch...

Don't.

Use an existing one.
Horrible advice. If your goal is to quickly develop something that "just work" then it's OK but if you're more curious and want to have your own features...

User avatar
tokumaru
Posts: 11755
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Is a good think make my own Sound Engine?

Post by tokumaru » Mon Mar 04, 2019 2:12 pm

Personally, if I wanted to use other people's code, I'd be coding for a modern platform using libraries. A big part of the fun in coding for the NES is doing everything myself.

If you're more focused on results and want to get your game out more quickly, using other people's code is fine, but don't let anyone dissuade you from doing things yourself just because "it's hard" or "it takes time". Do whatever you think will make the development process more enjoyable to you, and don't hesitate to do things differently if you change your mind along the way.

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

Re: Is a good think make my own Sound Engine?

Post by kikutano » Mon Mar 04, 2019 2:20 pm

tokumaru wrote:Personally, if I wanted to use other people's code, I'd be coding for a modern platform using libraries. A big part of the fun in coding for the NES is doing everything myself.

If you're more focused on results and want to get your game out more quickly, using other people's code is fine, but don't let anyone dissuade you from doing things yourself just because "it's hard" or "it takes time". Do whatever you think will make the development process more enjoyable to you, and don't hesitate to do things differently if you change your mind along the way.
I agree, but as I said before, I prefer to spend the time to develop the gameplay and the graphics, maybe someday I will try to develop my own sound engine. But sometime I prefer to not reinvent the wheel, and the sound programming is not my favorite part when I develop games for work. To be honest, now I use Famitone so I can focus my self on the bank switching.

Post Reply