Limitations of the NESMaker Sound Engine?

adesyndicate

New member
EDIT: Disregard everything because I am an idiot who used the default music player instead of an emulator!

Hi, My name is Alex! I'm trying to do the soundtrack for a game in the upcoming Byte-Off 2019 competition, but I'm having difficulties wrapping my head around the limitations of the built-in sound engine. I understand that NESMaker uses a modified version of GGSound by homebrew dev Gradual Games. I also understand that the full potential of what can be achieved in FamiTracker by itself does not match the potential what can be achieved with GGSound. Generally, the more complex the sound engine, the less complex the game. (That is a gross simplification, by the way. I am but a mere composer, not an NES dev, so take what I say with a grain of salt.)

DISCOVERED LIMITATIONS OF FAMITRACKER-NESMAKER SOUND ENGINE

After two days of testing, this is the list of limitations I discovered.

  • All instruments must have a volume envelope assigned or else the instrument will not sound at all.
  • Speed can be changed from 1–31.
  • Tempo can be changed from 32–255.
  • When speed is set to 1 and tempo is set to 255, nothing will sound. When speed is set to 31 and tempo is set to 32 however, it will play.
  • Notes above around B-5 in FamiTracker will sound very dissonant and chaotic (for lack of a better term). However, the triangle wave can play up to B-7 perfectly fine.
  • Notes below A-1 will not play.
  • Vibrato, when implemented as a separate instrument and not an effect, does not work. It will be ignored.
  • Pitch envelopes do not work, whether sweeping up or down, whether looped or not. They will instead play as the note you input into the tracker.
  • Hi-pitch envelopes do not work even with vanilla GGSound, whether looped or not. They will instead play as the note you input into the tracker.
  • Arpeggio envelopes do not work, whether looped or not. They will instead play as the note you input into the tracker.
  • Only noise type 0 is supported. Any notes with type 1 will play as type 0.
  • Noise pitches do not match with notes input in the tracker.
  • Using DPCM samples is technically possible, but requires ASM knowledge to use.
  • Frame looping does not seem to work, even when the Bxx effect is applied to the first four channels or to all five.

Keep in mind that these are the limitations I discovered in testing using 0CC-FamiTracker 0.3.15.3 and NESMaker 4.1.0, using the default music player. Surely, there are ways to work around these limitations with some creativity and ingenuity on the composer's part. Joe Granato said in Part 11 of his Getting Started series that he's plans to add a music and sound effects composition tool built right into NESMaker itself. Hopefully with that tool the disparities and errors between FamiTracker and NESMaker will disappear or at least be less frequent.

If I missed a limitation or am just plain wrong about something, please let me know and I'll add it to the list! That way, more composers will be less frustrated and able to figure out what they are capable of pulling off!
 

Attachments

  • NESMaker Sound Engine Limitations Test.rar
    2.1 KB · Views: 139

Mugi

Member
noise arpeggios are inverted by default when using nesmaker.
this can be fixed by using the official GGsound converter instead of the one nesmaker provides, however, using the official converter most likely causes the imported famitracker txt to not play in nesmaker GUI (it will still work in the actual game, but clicking on the files in nesmaker causes an error.) more details here: http://nesmakers.com/viewtopic.php?f=39&t=1919
 

Mugi

Member
as far as i know, they should work just fine, though im no composer and i did not compose the music of my game so im hardly a good person to comment what does or does not work :p
 

CutterCross

Active member
Arpeggio and Pitch envelopes work just fine. Same for noise instruments with type 1 and pitches on the noise channel work fine as well. Did you actually compile and test a ROM in an emulator with your music? Because the music playback feature in the tool itself does not monitor Pitch or Arpeggio envelopes, as well as those noise channel quirks. However, they will play just fine in the compiled ROM.

Take a look at my NESmaker game The Tower of Turmoil, and you can hear arpeggios, vibrato, and pitch changes just fine:

https://www.youtube.com/watch?v=Iqw_ytS9lig
 

adesyndicate

New member
OH.

I did not compile the ROM in an emulator; I used the default music player that comes with NESMaker. I wish I had known this two days ago. :cry:

Given the self-imposed limitations I've been working under that I thought were legitimate, I am absolutely blown away by the music in this game!
The game itself looks awesome, too!! The cutscene where the door closes behind the main character was really cool.

Thank you for telling me this. I'll try to figure out a way to redo everything given this new information. Is there a fast way to play music in the emulator so that testing goes faster? I imagine plopping a TXT file into a blank project and compiling the ROM won't do a thing. I'll start watching all the tutorial videos in order to figure it out.
 

Mugi

Member
propably the best way (read: easiest) to test the music in game is how cuttercross made his sound test screen.
basically, make a series of screens next to each other, and assign a different BGM to each screen, then just walk from one screen to another to test all of them.

i made an actual sound test menu, because i just roll that way, but for quick testing, all you need is said above. it's faster, it's easier and it's more fun to use too :p
 

adesyndicate

New member
Putting the sound test as an in-game easter egg is really neat idea!! I'm going to build a really basic adventure game to create something like this. If I can't figure it out, I'll just have the programmer do it.
Thank you!
 

Raftronaut

Member
Has anyone figured out a way to test the size your music text? Or rather, How much memory it is using?

I am coming up against what I believe is the hard note limit and I am hoping someone has some insight into space saving measures..

I started notating my music before I understood how the frames worked in famitracker so many of my frames can be broken down into smaller repeatable chunks to save memory space.

I have a few specific questions:

Does the amount of instruments used affect the hard note limit at all? Are you able to fit more notes in the sound file if less instruments are used?

If instruments do not affect the file size, is it possible to manipulate instrument arp envelopes to play additional melody lines without using extra notes in the frame?

Do the songs tempos affect file size?

Are blank instrument notes preferred to the note cut command? or rather, does the note cut take up memory?

After the byte-off I am trying to advance my understanding of famitracker so I can focus on squeezing as much music as possible into my eventual release.

Hoping also to reinvigorate the discussion on what can/cannot be done with GGsound since it seems there has been a lot of conflicting info. There are a bunch of features in famitracker I have not investigated because I thought they were off limits such as the FX coiumn.

Does anyone have any insight into these questions after spending more time with the tool?
 

misterjosel

New member
I have a related question regarding tempo, pattern size, and file size:

Let's say you create two songs with the same amount of notes, but one runs at one tempo (let's say 80) and another one has twice the pattern length and runs twice as fast (160), with the same notes spread out twice as far to produce the same song.

If they're otherwise the same song with the same amount of notes, is there any difference in file size or even CPU or memory usage?

Asking because longer patterns running faster can allow for swing, triplets, etc
 

FrankenGraphics

New member
No, let's say you make a 32 step loop with 4 notes and one instrument, vs a 64 step loop with 4 notes and one instrument. both projects will end up the same file size after conversion.

It is advisable to keep tempo set at 150 all times and instead vary the speed parameter. Music updates happens per screen frame. If you have a non-integral tempo, then tempo will sound slightly uneven and the sound will also be slightly more unpredictable. It's not *too* bad but good to know. 150 is the only integral for both NTSC and PAL regions. Conveniently, at this specific tempo, you'll know for sure that the speed setting equals picture frames per row.

To get your bearings using speed to achieve tempos, 6 (the preset) is precicely 150 bpm. 5 frames 180. 7 frames 128.57
 

FrankenGraphics

New member
@raftonat, here's some answers:
Does the amount of instruments used affect the hard note limit at all? Are you able to fit more notes in the sound file if less instruments are used?
-Yes, in the sense that you need your song project file to fit in a a single memory bank. Everything you define takes memory.
But also. it's not so much the # of instruments, as the # of instriment envelopes. You want your instruments to share envelopes as much as possible, and get the variation out of combining reused envelopes into new instruments.
Also, it can help to break up a long envelope into several smaller that describe a function each: attack, sustain, release/echo for example. modularizing your envelopes means you can reuse them more efficiently.

If instruments do not affect the file size, is it possible to manipulate instrument arp envelopes to play additional melody lines without using extra notes in the frame?
Everything you do affects the file size, that's just the nature of it. But yeah, sometimes you can use arpeggios as a way to compress file sizes, if you're okay with their inflexibility. FT arpeggios aren't key/scale/mode aware.

Do the songs tempos affect file size?
no. but if you have a fine step granularity, chances are you'll feel more encouraged to spend notes on trills and triplets and what not, so i guess you could argue that file size is influenced indirectly through your musical preferences.

Are blank instrument notes preferred to the note cut command? or rather, does the note cut take up memory?
Everything takes up memory. I haven't looked that closely at the format but i believe each message is at (edit here to correct my statement) one byte to tell the function of a note; be it "play this note" or "wait this long between notes". "Wait this long between notes" is emitted as a byte by the converter script each time you change the duration of a note from what it was previously, which means a lot of the time you can just assume the same note length and save a byte each note.

I had a look and a note cut in ggsound is just a an instrument the script generates at build time, which mutes the volume.
I also noted that a "wait byte" isn't used after each note.
 

Raftronaut

Member
Super helpful Frankengraphics!

This definitely gives me a lot to consider moving forward while trying to make the densest sounding NES soundtrack I can!

What are using to test the memory being used by the music. Are you using Shiru's Space Checker by chance?

Also, I wanted to tell you that I'm a really big fan of your blog which I discovered through the Assembly line podcast. Your pixel art breakdowns and journals have been super helpful and inspiring. So thank you for sharing :)
 

misterjosel

New member
FrankenGraphics said:
No, let's say you make a 32 step loop with 4 notes and one instrument, vs a 64 step loop with 4 notes and one instrument. both projects will end up the same file size after conversion.

It is advisable to keep tempo set at 150 all times and instead vary the speed parameter. Music updates happens per screen frame. If you have a non-integral tempo, then tempo will sound slightly uneven and the sound will also be slightly more unpredictable. It's not *too* bad but good to know. 150 is the only integral for both NTSC and PAL regions. Conveniently, at this specific tempo, you'll know for sure that the speed setting equals picture frames per row.

To get your bearings using speed to achieve tempos, 6 (the preset) is precicely 150 bpm. 5 frames 180. 7 frames 128.57
good to know thanks!!!!!!
 

Raftronaut

Member
FrankenGraphics said:
-Yes, in the sense that you need your song project file to fit in a a single memory bank. Everything you define takes memory.

I've re worked my entire soundtrack using some of your tips here with great results. I was able to fit the remainder of my songs into my soundtrack by modularizing my instruments per your advice. After adding in the additional songs I started going back through and adding more advanced sound design touches until recently running out of memory space again. (assuming this is what caused my bank overflow)

I have a few more questions if you wouldn't mind.

-How can you check the amount of memory your soundtrack is using? I would love to be able to conduct my own experiments as far as which sound design techniques work the most efficiently to save memory. Optimizing my sound design would help me cram in additional sound details and polish up what I've got so far. IS there software that helps you determine?

-Are song sizes responsible for memory bank overflows as well? Is there anything conclusive about Frame limits within a song? LIke, if a song's frames are reduced to a single bar of music to reduce redundant frames, Is it better to have shorter frames that repeat or longer frames with redundant notes?

-SFX optimization. What is the best way to build FX so that they get out of the way of the music as quickly as possible? Is it better to run SFX tempos faster so they reach their end point quicker? Or is it better to have the SFX run slower and put the notes closer together?

I've been paying attention to NES games with great sound design and their SFX never seem to interupt the music very long, even when using complex arps or pitch bends. I feel a bit baffled how to improve the performance of my SFX... any advice would be appreciated:)

I can't thank you enough for the improvements I've already been able to make on my sound per your input. thanks!!!!
 

FrankenGraphics

New member
-famitracker has a way you can get an idea about song sizes... if you export an .nsf, you get a fairly detailed listing. Note that these sizes don't correspond too well to a ggsound converted file. ggsound and other more game-oriented sound drivers aim to minimize song sizes, so whatever you see here is bound to be much smaller in ggsound.

-if you're down to analyzing code, i recommend checking out the ggsound source files. they'll provide black on white what information goes where and by how much.

-yes, it's fairly probably thay you run out of space in the dedicated song bank if you have enough/many songs.

-for some songs, it may work well to break down longer patterns into smaller so you can modularize drum sections more efficiently.

-SFX: keep them short and sweet, but a bit louder than your soundtrack. I don't remember exactly how ggsound works, but the golden standard is that a driver prioritizes whatever is loudest: sfx or music. Either way it's a good mixing rule. but this might be a moot point since NM is using an sfx handler of its own, and i wouldn't be surprised if it just silecenced music until the sfx envelope reads 0. Good part is you can compose multi-instrument effects as if they were songs (at the expense of even more significant music cutouts).

One additional thing you can do is try to keep all pulse SFX on one channel and try to use that same channel for notes of lesser importance in your music (flavour notes, echoes, chorus layers, short notes in rapid succession for example) as much as possible.
 

Raftronaut

Member
Ok great!
I'd never thought to create an NSF to test sound file size!

I have my FX mixed fairly well, it is just a matter of cutting it in and out as quickly as possible. I've cut down my FX frames as short as I can and added a blank instrument to finish the sound, which after testing seems to work the best and quickest. I have all my Pulse FX on the same channel as to not
interfere with the main melody.

sounf file capture 4.PNG


Does the screen grab from the creation of the NSF Mean that my sound file is 11752 bytes beforebeing compressed by GGSound?
 

vufka

New member
CutterCross said:
Arpeggio and Pitch envelopes work just fine.

Hi! Thanks for your post. Are effect column arpeggios (0xx) supported? Or do they HAVE to be in the instrument settings? Also, is there a limit to the number of instruments? Or limit to the envelope length in the instrument editor?

I replied elsewhere but it looks like it was an old forum/topic.
 

CutterCross

Active member
vufka said:
Hi! Thanks for your post. Are effect column arpeggios (0xx) supported? Or do they HAVE to be in the instrument settings? Also, is there a limit to the number of instruments? Or limit to the envelope length in the instrument editor?

I replied elsewhere but it looks like it was an old forum/topic.

NESmaker currently does not support effects of any kind. [GGsound (NESmaker's sound engine) does support Bxx, but last I checked NESmaker does not.] So no, the compiled ROM will just ignore effects like 0xx, they won't do anything. Arpeggios have to be set up in instrument settings.

NESmaker currently has a limit of 64 instruments. I don't know the limit on envelope length, as my music style never really uses long envelopes, so I can't really give a definitive answer on that. (If anyone else does, please let me know!) But best practice is to keep them relatively short, since longer envelopes take up more ROM space in the music bank.
 
Top Bottom