The Definitive Guide to Composing NESmaker-Compatible Music and Sound

CutterCross

Active member
INTRODUCTION:



Okay, this is going to be a big one.

I've seen a ton of information about NESmaker's sound capabilities scattershot all over the forum. Some of it is outdated/incorrect, and I wanted to make this topic to be a sort of definitive list of limitations/quirks and rules to follow creating music and SFX with NESmaker. I have learned a lot composing all sorts of music/SFX for this software and optimizing the music for Mystic Searches. Keep in mind that this list is for NESmaker 4.1.5 (and 4.5.6.), so older versions may not have exactly the same limitations as this list. So with all that out of the way, let's get started.

For more information regarding Music and SFX for NESmaker projects, watch the official "Zero to 8-Bit Hero" tutorial on Music and SFX by The New 8-Bit Heroes:

View: https://www.youtube.com/watch?v=Qt3Gd9pTcbE


NESmaker uses a modified version of the Gradual Games Sound Engine, AKA GGsound. The following list of features come from GGsound's official webpage.



GGSOUND'S FEATURES (STRAIGHT FROM THE OFFICIAL GGSOUND WEBPAGE):



- Square [Pulse] 1, 2, Triangle, Noise, and DPCM channels *
- Volume, Arpeggio, Pitch and Duty envelopes
- Hi-Pitch envelopes are NOT supported
- Looping envelopes at an arbitrary loop point
- Speed and Tempo
- Looping with the Bxx (must be present in all channels, using unique patterns) command **
- Note cuts
- Tempo and pitch adjustment for NTSC, PAL and Dendy
- Multi-song export
- Sound effects on two channels
- Pause/unpause
- All 87 audible notes in FamiTracker
- 128 of each type of envelope ***
- 128 songs ***
- 128 sound effects ***
- 256 byte long envelopes ***

Source: http://www.gradualgames.com/p/sound-engine.html

It's important to note that GGsound does NOT support note effects (aside from Bxx) or the channel volume column in FamiTracker. Anything written there will be ignored in the compiled ROM.
Also keep in mind that Releasing envelopes at an arbitrary loop point is NOT supported.

ALSO NOTE: This should be obvious, but GGsound does NOT support famicom expansion audio of any kind. The North American and PAL region NES (unmodified) systems cannot take advantage of expansion audio in the first place, and VERY few famicom games even took advantage of expansion audio (aside from FDS).



NESMAKER-SPECIFIC QUIRKS/LIMITATIONS:



* DPCM channel is NOT supported by default, and can only be re-implemented by following this topic:
** Bxx effect is NOT supported by default, and can only be re-implemented by using GGsound's official ft_txt_to_asm Python script or the GGsound ft_txt_to_asm executable on this forum. The latter of which can be found here:
*** Limited to 64 instruments by default, as well as 64 songs and SFX entries combined.
*** The amount of songs/SFX you will be able to use will also be limited by the ROM space you have to work with, and how complex/long your songs and SFX are.



BEST PRACTICES FOR COMPOSING MUSIC/SFX:



- It's been reported by The New 8-Bit Heroes that putting a Pulse channel SFX only on Pulse Channel 1 can cause some issues with playback. It's recommended that any single-channel Pulse SFX be located on Pulse channel 2.
- It's recommended to keep the Tempo setting at 150 BPM, while instead using the Speed setting to change how fast/slow the song plays.
- While note cuts are supported, it's also a good idea to create a "silent" instrument (an instrument with a volume envelope of 0) to act as a note cut, in case any issues arise with using regular note cuts.
- For SFX, it is a good idea to add a "silent" instrument note before the note cut to make sure the SFX ends properly.
- Do NOT delete instruments in the middle of your instrument bank without replacing them! If there is a gap in the instrument numbers such as this: (00, 01, 02, 04,) NESmaker will go haywire and will prevent the file from importing.
- Make sure your frames for each channel in the frame editor go in order. (For one channel, something like this: 00, 01, 02, 03... will work. Or if you're repeating frames, something like this: 00, 00, 01, 01... will also work. Do NOT do something like 00, 02, 01, 03...)
- For adding pitch bends by looping the Pitch envelope, there is NO lower/upper bounds handling like there is in FamiTracker! Once the lowest pitch is reached it will loop back to the highest pitch. Likewise, once the highest pitch is reached it will loop back to the lowest pitch. Keep this in mind when using large pitch bends.
- Avoid using notes lower than A-0 on the Pulse and Triangle channels. In FamiTracker, the lowest audible note on those channels is A-0, and all notes below A-0 sound identical to each other. However, these lower notes do not behave the same way in GGsound. Using those notes will cause their pitch to behave incorrectly.
- Blank note patterns following other distinct note patterns will prevent your music file from importing into NESmaker.
- Sustained notes do not carry over frames when played through GGsound. You'll have to design your music around this.
- On the Triangle channel, using a silent instrument (volume envelope of 0) with a pitch significantly higher than the last played pitch will cause an audible click during playback. This may be something you want to avoid or embrace in your sound design.



BEST PRACTICES FOR SAVING ROM SPACE:



- Putting more notes in your song will take up more ROM space, but keep in mind that blank spaces do NOT count towards ROM space!
- It's best to create instruments with longer envelopes (putting fewer notes down as a result) than it is to create instruments with simpler envelopes (putting more notes down as a result). More notes take up more ROM space than longer envelopes.
- More instruments DO take up more ROM space, but the amount is trivial compared to the amount of space taken up by more note data.
- Repeat frames as much as you can. The small amount of ROM space it takes to repeat another frame is trivial compared to the massive amount of ROM space taken by creating a new frame with new notes.
- Cram your notes together if you can, and run the song at a slower speed to keep the same tempo. This can save the tiny amount of ROM space taken up by adding/repeating a frame, but it's rare that you'll have to resort to this method to free up space.



OTHER THINGS OF NOTE (AS OF NESMAKER 4.5.9):



- The 09 ORDER limitation that NESmaker had in the past has appeared to be gone. You can write songs longer than 10 frames now.
- Noise channel arpeggios don't seem to be inverted anymore.
- NESmaker can be fickle with filenames and song names when trying to import. Make sure that your filenames and song names only use letters (combinations of uppercase or lowercase is fine) and numbers, and don't use spaces or weird characters.
- Instrument names can have spaces, but they cannot START with a number. They should otherwise adhere to the previous naming rules.
- For naming SFX, make sure to label them as "sfx_" followed by the SFX name. The "sfx_" part of the name must be lowercase. Use the same naming rules as previously stated.
- Older versions of NESmaker can have some different quirks/limitations than what's been shown here.



If any of this information is incorrect/outdated, or if there is anything additional you've found regarding NESmaker's music quirks/limitations, please let me know.
 
Last edited:

Raftronaut

Member
Great Work Cutter! Very thorough breakdown of the engine.

I'm still hesitant to make any long volume or pitch envelopes after some advice I got from Frankegraphics about modularizing my instruments, but I have never done any file size testing to back up my current working theories on saving space. I am at the point in file size where every decision is a balancing act, so it's good to have these things clarified. I'd always like more space for more detail in the music if possible, solos, drum fills etc....

Thanks for taking the time to lay this out
 

CutterCross

Active member
Raftronaut said:
Great Work Cutter! Very thorough breakdown of the engine.

I'm still hesitant to make any long volume or pitch envelopes after some advice I got from Frankegraphics about modularizing my instruments, but I have never done any file size testing to back up my current working theories on saving space. I am at the point in file size where every decision is a balancing act, so it's good to have these things clarified. I'd always like more space for more detail in the music if possible, solos, drum fills etc....

Thanks for taking the time to lay this out

I feel I should clarify further. What my style typically does is create many instruments with a very short set volume envelope. (One is set at 10, another at 8, another at 6, and so forth.) So if I wanted to fade out a note I would make a string of instruments with the same note to pull off the fade effect, and I used that method so I could reuse envelopes and instruments as much as possible. But when I started optimizing the music for Mystic Searches, I found that the long strings of notes ate up much more ROM space than what was saved by reusing the instruments and envelopes across the whole soundtrack. So using a specifically made instrument with a longer envelope to do the fade effect, while not as flexible as the other method, saved a bunch of ROM space in the long run by not having to plot down as many notes.

Of course, it's all something to consider in moderation to get the results you want. You don't want to have TOO long of envelopes, but enough to save a good chunk of note data. And really, this should only be considered if you're trying to cram a TON of music into your project (like Mystic Searches, which has 16+ songs to cram in!). I've never really had that problem outside of that scenario.

Bottom line: Prioritize reducing the amount of note data over all else.

Sorry if that explanation seems a bit incoherent. It's a lot easier for me to do it rather than explain it, haha.
 

dale_coop

Moderator
Staff member
Love you CutterCross <3 Very interesting topic.
So talented... I wish I would know about music like you do.
 

Raftronaut

Member
CutterCross said:
Raftronaut said:
Great Work Cutter! Very thorough breakdown of the engine.

I'm still hesitant to make any long volume or pitch envelopes after some advice I got from Frankegraphics about modularizing my instruments, but I have never done any file size testing to back up my current working theories on saving space. I am at the point in file size where every decision is a balancing act, so it's good to have these things clarified. I'd always like more space for more detail in the music if possible, solos, drum fills etc....

Thanks for taking the time to lay this out

I feel I should clarify further. What my style typically does is create many instruments with a very short set volume envelope. (One is set at 10, another at 8, another at 6, and so forth.) So if I wanted to fade out a note I would make a string of instruments with the same note to pull off the fade effect, and I used that method so I could reuse envelopes and instruments as much as possible. But when I started optimizing the music for Mystic Searches, I found that the long strings of notes ate up much more ROM space than what was saved by reusing the instruments and envelopes across the whole soundtrack. So using a specifically made instrument with a longer envelope to do the fade effect, while not as flexible as the other method, saved a bunch of ROM space in the long run by not having to plot down as many notes.

Of course, it's all something to consider in moderation to get the results you want. You don't want to have TOO long of envelopes, but enough to save a good chunk of note data. And really, this should only be considered if you're trying to cram a TON of music into your project (like Mystic Searches, which has 16+ songs to cram in!). I've never really had that problem outside of that scenario.

Bottom line: Prioritize reducing the amount of note data over all else.

Sorry if that explanation seems a bit incoherent. It's a lot easier for me to do it rather than explain it, haha.

I appreciate the insight on your Arp instruments, I've always found your Arps to be very expressive and elegant in design. My application of them at the moment is much more brutish, adding additional volume envelopes to them is something I hoped to add in further revisions. so this gives me something to chew on, wondering now how I can re-purpose existing volume envelopes into the Arps I already have notated. That shouldn't eat up too much memory since they're already in the notation.


Also, It might be worth noting HERE, constant sound effect loops still need to be capped by a blank instrument row. I created a static noise channel sound effect loop over the past week. It would only work when the conditions were being met to start the sound effect and would only cut back to the music if the said conditions were no longer met AND the sound effect ended in a blank instrument. If you don't cap your SFX with a blank instrument, the effect will play indefinitely until something else triggers an event on that channel. I think this seems to work on ALL the channels.

Maybe another topic of discussion is how best to optimize SFX in general. Tempo, Row length, etc..... What are the most efficient ways to set them up to get cut IN and OUT as quickly as possible.
 

CutterCross

Active member
Raftronaut said:
I appreciate the insight on your Arp instruments, I've always found your Arps to be very expressive and elegant in design. My application of them at the moment is much more brutish, adding additional volume envelopes to them is something I hoped to add in further revisions. so this gives me something to chew on, wondering now how I can re-purpose existing volume envelopes into the Arps I already have notated. That shouldn't eat up too much memory since they're already in the notation.


Also, It might be worth noting HERE, constant sound effect loops still need to be capped by a blank instrument row. I created a static noise channel sound effect loop over the past week. It would only work when the conditions were being met to start the sound effect and would only cut back to the music if the said conditions were no longer met AND the sound effect ended in a blank instrument. If you don't cap your SFX with a blank instrument, the effect will play indefinitely until something else triggers an event on that channel. I think this seems to work on ALL the channels.

Maybe another topic of discussion is how best to optimize SFX in general. Tempo, Row length, etc..... What are the most efficient ways to set them up to get cut IN and OUT as quickly as possible.

Well, I wasn't really talking about my Arp instruments, I was more talking about the volume envelopes for EVERY kind of sound, but thanks!

Does it matter or not if your looping SFX also ends with a note cut after the silent instrument note? Because otherwise I'm pretty sure what you're talking about is already in the main post. I know it's sort of a different application, but the general idea is still mentioned.

"For SFX, it is a good idea to add a "silent" instrument note before the note cut to make sure the SFX ends properly."
 

Raftronaut

Member
CutterCross said:
Does it matter or not if your looping SFX also ends with a note cut after the silent instrument note? Because otherwise I'm pretty sure what you're talking about is already in the main post. I know it's sort of a different application, but the general idea is still mentioned.

"For SFX, it is a good idea to add a "silent" instrument note before the note cut to make sure the SFX ends properly."

Yes, you are correct, looping instruments require the silent instrument note before the note cut as well. In fact, I have omitted ALL note cuts from my sound effects and replaced them solely with the Silent Instrument, This seemed to work the best as far as creating the quickest sfx interrupts during gameplay.

Is there any added benefit to using both the silent instrument AND the note cut? Or is the note cut a redundancy as I suspected?


Also, One more thing that has been on mind recently and that has not been addressed on the forums for easy reference is SFX priority.
Can anyone here explain how GGsound organizes bit values for sound effects priority? It would be incredibly helpful to know how to choose the importance of a sound effects.

This video was posted on the FB forum back in April, and it's been ruminating in my brain since I saw it. In the forums Joe indicated that GGsound should organize the bits similarly. Though I am uncertain how to investigate.
https://www.youtube.com/watch?v=2VH...jeH7TowGhSVEiYfWuReTJIQ4WB0TvXoYXkdH0DGzgR4_s
 

CutterCross

Active member
Raftronaut said:
Is there any added benefit to using both the silent instrument AND the note cut? Or is the note cut a redundancy as I suspected?

Using both the silent instrument and the note cut is a redundancy, you are correct. But it's a sort of "catch all" solution to make sure all the SFX ends properly. I just wanted to be safe with this sort of thing.

Raftronaut said:
Also, One more thing that has been on mind recently and that has not been addressed on the forums for easy reference is SFX priority.
Can anyone here explain how GGsound organizes bit values for sound effects priority? It would be incredibly helpful to know how to choose the importance of a sound effects.

That might be something to bring up to the creator of GGsound on NintendoAge or something. That's far beyond my expertise (and many others' here).
 

Raftronaut

Member
Raftronaut said:
Also, One more thing that has been on mind recently and that has not been addressed on the forums for easy reference is SFX priority.
Can anyone here explain how GGsound organizes bit values for sound effects priority? It would be incredibly helpful to know how to choose the importance of a sound effects.

That might be something to bring up to the creator of GGsound on NintendoAge or something. That's far beyond my expertise (and many others' here).

Good to know, I've considered emailing Derek at GG to see what I can learn about this, I would think that having the ability to set the SFX priority would be a terrific boon to any nesmakers looking to add sound design polish to their game.
 

Raftronaut

Member
i've been digging further into SFX priority. I emailed Gradual Games to see if he had any documentation on the engine. He sent me the Git-Hub page, and indicated that there is information about how the sound effects are prioritized in the README.md included.
Here is the github on GG sound:
https://github.com/gradualgames/ggs..._inQFG8bGfn3p3fxYCMdOHYXH7-3Bagy2uH_rePjvrqMs

Here is the link direct to the README.md file:
https://github.com/gradualgames/ggsound/blob/master/README.md

(MY URLs never work on the forums for some reason, you'll have to copy/paste)


The README.md file contains the following directly regarding sound effects:
playing sound effects.PNG



I discussed sound effects priority with Kasumi and he indicated that Nesmaker has no way of determining the priority flag of sound effects in GG sound. However, I believe there are some work arounds.. I'll try my best to explain what I believe is true after my personal testing...

GGsound allows up to 2 sound effects at a time as seen in the Documentation, soundeffect_one and soundeffect_two. I believe that NESmaker is only able to use one of these sound effect slots for a solo effect = soundeffect_one. soundeffect_two seems to reserved entirely for creating dual channel effects (fx using 2 different channels). So basically soundeffect_two cannot be selected because it's already in use waiting for a dual channel effect to occur.

-Priority on solo fx with soundeffect_one seems to be set entirely by timing, Play sfx#A on the noise channel, the immediately play sfx#B
on the noise channel as well and you will only hear sfx#B. This seems to be the hard rule of soundeffect_one..

-Priority on dual channel sound effects will always been given to soundeffect_two which I believe will be the channel on the right as it shows in your famitracker file. When another sound effect challenges the priority of this dual sound effect, soundeffect_one will be CUT soundeffect_two will WIN. Basically all you will hear is soundeffect_two...


AS an example, I had a long single noise channel explosion sound I was using for player death, but the sound effect would get cut completely if the player fired a projectile at the moment of death, instead replaced by my much shorter projectile sound effect. To correct this, I added an additional channel to my explosion sound effect on square2. NOW, when my player fires projectile at the moment of death, the long noise sound effect plays everytime because it is prioritized as soundeffect_two, in this instance my square wave channel gets cut instead because it is now soundeffect_one..

I tried to explain this as clearly as possible to be the best of my knowledge. It is very likely I've made oversights here in my evaluations as I am only just beginning to understand some of these concepts, so please, anyone feel free to jump in with corrections if necessary. Just hoping to shed more light on this topic for those of us interested in utilizing this knowledge to create more polished sound tracks...


Also, it is worth mentioning that GGsound has a mute command for each channel that could be used as a command to drop certain channels for certain events in gameplay (for example: open a menu = mute the drums, or talk to a NPC = mute the melody, etc....) , though I haven't researched enough to comment on it's viability yet.
 

Raftronaut

Member
Raftronaut said:
i've been digging further into SFX priority. I emailed Gradual Games to see if he had any documentation on the engine. He sent me the Git-Hub page, and indicated that there is information about how the sound effects are prioritized in the README.md included.
Here is the github on GG sound:
https://github.com/gradualgames/ggs..._inQFG8bGfn3p3fxYCMdOHYXH7-3Bagy2uH_rePjvrqMs

Here is the link direct to the README.md file:
https://github.com/gradualgames/ggsound/blob/master/README.md

(MY URLs never work on the forums for some reason, you'll have to copy/paste)


The README.md file contains the following directly regarding sound effects:
playing sound effects.PNG



I discussed sound effects priority with Kasumi (I can't take any credit for figuring out most of this stuff) and he indicated that Nesmaker has no way of determining the priority flag of sound effects in GG sound. However, I believe there are some work arounds.. I'll try my best to explain what I believe is true after my personal testing...

GGsound allows up to 2 sound effects at a time as seen in the Documentation, soundeffect_one and soundeffect_two. I believe that NESmaker is only able to use one of these sound effect slots for a solo effect = soundeffect_one. soundeffect_two seems to reserved entirely for creating dual channel effects (fx using 2 different channels). So basically soundeffect_two cannot be selected because it's already in use waiting for a dual channel effect to occur.

-Priority on solo fx with soundeffect_one seems to be set entirely by timing, Play sfx#A on the noise channel, the immediately play sfx#B
on the noise channel as well and you will only hear sfx#B. This seems to be the hard rule of soundeffect_one..

-Priority on dual channel sound effects will always been given to soundeffect_two which I believe will be the channel on the right as it shows in your famitracker file. When another sound effect challenges the priority of this dual sound effect, soundeffect_one will be CUT soundeffect_two will WIN. Basically all you will hear is soundeffect_two...


AS an example, I had a long single noise channel explosion sound I was using for player death, but the sound effect would get cut completely if the player fired a projectile at the moment of death, instead replaced by my much shorter projectile sound effect. To correct this, I added an additional channel to my explosion sound effect on square2. NOW, when my player fires projectile at the moment of death, the long noise sound effect plays everytime because it is prioritized as soundeffect_two, in this instance my square wave channel gets cut instead because it is now soundeffect_one..

I tried to explain this as clearly as possible to be the best of my knowledge. It is very likely I've made oversights here in my evaluations as I am only just beginning to understand some of these concepts, so please, anyone feel free to jump in with corrections if necessary. Just hoping to shed more light on this topic for those of us interested in utilizing this knowledge to create more polished sound tracks...


Also, it is worth mentioning that GGsound has a mute command for each channel that could be used as a command to drop certain channels for certain events in gameplay (for example: open a menu = mute the drums, or talk to a NPC = mute the melody, etc....) , though I haven't researched enough to comment on it's viability yet.
 

Raftronaut

Member
Popping back in here to document another issue I found.
I created a pitch drop in my triangle channel to serve as percussion:
pitch broken.PNG
I discovered that using a max value of 127 causes the pitch to actually wrap around to the higher pitches creating a really terrible sound. Anyone using triangle instruments for percussion should take note!
 

CutterCross

Active member
Raftronaut said:
Popping back in here to document another issue I found.
I created a pitch drop in my triangle channel to serve as percussion:
I discovered that using a max value of 127 causes the pitch to actually wrap around to the higher pitches creating a really terrible sound. Anyone using triangle instruments for percussion should take note!

Added to the guide. I can't believe I forgot to mention that when I made this! Thanks for bringing that up man.
 

Raftronaut

Member
[/quote]

Added to the guide. I can't believe I forgot to mention that when I made this! Thanks for bringing that up man.
[/quote]

Ha! yeah, my head exploded when I imported the text file, took me a while to determine exactly what was happening.

Hoping to save others the headache of trying to trouble shoot that!
 
A couple of things I discovered that I didn't see mentioned:

Frames in the FamiTracker module have to progress together. If you want to loop a channel, you have to loop ALL the channels.

so your module can look like this:

00|00 00 00 00 00
01|01 01 01 01 01
02|01 01 01 01 01
03|02 02 02 02 02


But it can't look like this:

00|00 00 00 00 00
01|01 01 01 01 01
02|02 02 02 01 02
03|03 03 03 01 03

Another problem I ran into is that NesMaker does not like empty frames. I had a song that used some polyrhthmic envelopes to make some ambient textures across a couple frames and it would it kept spitting back the error message "Object reference not set to an instance of an object" (Same error for the issue above. My guess is that famitracker tries to consolidate the blank and irregular frames in a way that either Nesmaker or the GG sound engine doesn't support.) As long as you have a note on at least one channel per a frame it shouldn't be a problem. I also learned that instrument trails don't carry between frames in the compiled rom the way they do in famitracker so I'll be needing to fill those frames in regardless.
 

Jonny

Well-known member
So much information. Thank you for putting this together. Started watching a youtube series on famitracker so I can now use this guide alongside that to create some banging beeps.
 

CutterCross

Active member
Andrew. Pierce.2032 said:
A couple of things I discovered that I didn't see mentioned:

Frames in the FamiTracker module have to progress together. If you want to loop a channel, you have to loop ALL the channels.

so your module can look like this:

00|00 00 00 00 00
01|01 01 01 01 01
02|01 01 01 01 01
03|02 02 02 02 02


But it can't look like this:

00|00 00 00 00 00
01|01 01 01 01 01
02|02 02 02 01 02
03|03 03 03 01 03

Another problem I ran into is that NesMaker does not like empty frames. I had a song that used some polyrhthmic envelopes to make some ambient textures across a couple frames and it would it kept spitting back the error message "Object reference not set to an instance of an object" (Same error for the issue above. My guess is that famitracker tries to consolidate the blank and irregular frames in a way that either Nesmaker or the GG sound engine doesn't support.) As long as you have a note on at least one channel per a frame it shouldn't be a problem. I also learned that instrument trails don't carry between frames in the compiled rom the way they do in famitracker so I'll be needing to fill those frames in regardless.

The looping quirk with Bxx is already documented both here and in GGsound's official documentation. Those other quirks you mentioned have been known, but I forgot to add them here. Thanks for reminding me, they're now added to the list.
 
CutterCross said:
The looping quirk with Bxx is already documented both here and in GGsound's official documentation. Those other quirks you mentioned have been known, but I forgot to add them here. Thanks for reminding me, they're now added to the list.

I wasn't using Bxx but if it was mentioned it's entirely possible that just I missed it.
Also, thank you for maintaining this thread. It has made my life significantly less stressful and I very much appreciate it.
 
Top Bottom