Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > Some questions about FamiTracker NSFs Owner: Dr_Mustache New post
Page 1 of 1 Sort:  
Some questions about FamiTracker NSFs Posted: 2014-03-06 02:02 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55125
I have a few questions about FT generated NSFs, mostly nooby ones for which I didn't find information:

1.- What's the maximum size for an NSF file? Can FT build NSFs of the maximum size or does it have a smaller limit?

2.- Are there any composition methods that can help in making smaller NSF files? Does it help to make smaller frames, more pattern repetition, or stuff like that?

3.- How are instruments defined within an NSF file? How much space do they take up?

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
RE: Some questions about FamiTracker NSFs Posted: 2014-03-06 02:46  (Last Edited: 2014-03-06 02:47) Reply | Quote
Jarhmander

Avatar

Member for: 5900 days
Status: Offline

#55128
Partial answers:
[quote=]1.- What's the maximum size for an NSF file? Can FT build NSFs of the maximum size or does it have a smaller limit?[/quote]
An NSF can swap 4K banks in $8000-$FFFF by writing into $5FF8-$5FFF; as these "registers" are 8-bit wide, that means an NSF can be up to 256*4K, or 1MB. Not all hardware players support NSF that large however. I don't know if FT can make an NSF that large either.

[quote=]2.- Are there any composition methods that can help in making smaller NSF files? Does it help to make smaller frames, more pattern repetition, or stuff like that?[/quote]
I don't know anything specific to FT, jsr can answer that precisely (or anyone who is familiar with its source code) but making smaller frames with more repetitions will certainly make the NSF smaller—if that minimises the redudancy of song data. In the same way, actively using instruments (and reusing them) instead of tweaking channel parameters in a pattern will surely make the NSF smaller.

Patterns and instruments are facilities to capture redundancy in tracked music. Think of it as a form of compression. A tune with a long frame with, say, 8 times the same data over and over will use more space than a smaller frame with the same non-repeated data, played 8 times in the frame editor.

Posted: 2014-03-06 02:52 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55129
So using instruments without placing effects or volume control makes the NSF smaller? I run into a bit of a problem if I want to make smaller NSFs then, because I use few instruments and control everything else with pattern effects. The difference isn't too big, right?

Nice to know that smaller patterns and more repetition make NSFs smaller.

Thank you for your help!

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Posted: 2014-03-06 03:00 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#55130
Why do you need to make your NSFs smaller? Under what situation is this constrained for you?

It's useful when making an NES game, for sure, but if you're doing that you probably want a custom driver instead of FamiTracker's relatively large ~5.5k driver, and if you're doing that, none of the rules about what makes a FamiTracker NSF small really apply anymore.

For a ballpark:
- A single note is probably 2 bytes under most circumstances.
- A volume column entry at least 1 byte.
- Any effect adds 2 bytes.
- Empty space doesn't add to size.
- Reusing patterns does save space.
- Instrument macros are a few bytes of overhead plus 1 byte per entry in the macro.
- Instruments themselves are probably about 10 bytes, though more if an expansion is used.
- DPCM data size is what you'd expect.

There are a zillion little details about the size of the music data in a FamiTracker NSF, but you can read the source code if you want to know more. Alternatively, try things out and export your NSF, it tells you in the export window how many bytes various pieces of data take.

Posted: 2014-03-06 03:12 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55131
I wanted to save some space in a generated NSF from an OST I'm covering at the moment. While this OST isn't really big (Super Mario World), there are some details like DPCM samples that would make an NSF a lot bigger, and I wouldn't like to face the situation where you can't export an NSF because it's too big. That's why I wanted to make it smaller, to avoid problems when I'm in the finishing stages of this project.

Thanks for the extra information you wrote there, I'll try to learn all that and have it in mind in the future.

[And yeah! I read the stuff FamiTracker shows when you export the NSF. I think it's interesting to know how all this works, even if I don't actually program for the NES]

Once I learn more programming I'll read the FamiTracker source code. I'd love to know the inner workings of it.

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Posted: 2014-03-06 03:16  (Last Edited: 2014-03-06 03:23) Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#55132
The 1MB limit is a huge amount of song data. Other than using massive amounts of DPCM samples, it would be extremely hard to reach this limit with FamiTracker.

The NES game with the most music data was Metal Slader Glory, at a whopping 210k. Almost all NES games have under 32k of music data for their entire soundtrack.

I made a 45 minute album in FamiTracker that I eventually put into a 256k NSF. If I had put more work into the ROM layout, I could have got that down to 128k, I'm sure. If I had been paying attention to size constraints when composing I could likely have done it in 64k with a bit of simplification to the music.

Posted: 2014-03-06 03:21  (Last Edited: 2014-03-06 03:27) Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55133
Nice to know. Still, FamiTracker allows a maximum of 64 DPCM samples so that's a limitation too... And I don't think that all those samples would be of the biggest size (4081 bytes?).

Wow, 210k of music data. That's a lot.

The 256k size of your album is because FamiTracker limited you to that size? Could you have made it bigger in any way? Still, I wouldn't make my compositions simpler to save space, but I don't make complex stuff either :D

I think I'll relax a bit for now then, but I'll still have all of this in mind. Thanks for your help.

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Posted: 2014-03-07 07:07 Reply | Quote
Xyz_39808

Avatar

Member for: 4180 days
Location: South Texas
Status: Offline

#55163
I remember in the public release of nicetas' and mex's fcm9 cover, they ended up using an FDS channel solely for the effects column. It seems to use up more space if you expand the fx columns into fx2, fx3, or fx4

Posted: 2014-03-07 07:11 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55164
Really? I'll have to try that then...
But FDS just for the effects column? What kind of song were they creating?

Thanks for your input.

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Posted: 2014-03-07 10:43 Reply | Quote
Xyz_39808

Avatar

Member for: 4180 days
Location: South Texas
Status: Offline

#55169
Please download the Famicompo Mini Vol 9 Exhibition entry pack and it should be clear, I don't remember which entry# but it's their Beethoven Piano Sonata no 9 cover

Posted: 2014-03-07 13:21 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55172
Right, I'll find the track in the entry pack, thanks!

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Posted: 2014-03-07 17:33 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#55180
My NSF album was 256k because that's the size I built the ROM at. It wasn't a Famitracker limitation at all. I was compiling several FTMs into a single NSF manually. It could have been a lot smaller if I wanted to spend more time packing things in tight, is what I was saying.

Posted: 2014-03-07 17:41 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55181
Now I understand that clearly, thanks.

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
RE: Some questions about FamiTracker NSFs Posted: 2014-03-09 13:23 Reply | Quote
jsr
Administrator

Avatar

Member for: 5925 days
Location: Sweden
Status: Offline

#55215
[quote=Dr_Mustache]1.- What's the maximum size for an NSF file? Can FT build NSFs of the maximum size or does it have a smaller limit?[/quote]
There is no particular limit, sizes up to 1MB should be possible. I've never seen a file that large though.

_______________________
Programmer and developer
Posted: 2014-03-09 18:16 Reply | Quote
Dr_Mustache

Avatar

Member for: 3141 days
Location: On your screen
Status: Offline

#55228
Great! Thanks for that.

_______________________
[color=#b0b0b0]This version of Dr. Mustache is outdated. Please download latest version [url=about:blank]here.
[url=https://www.dropbox.com/sh/md3lbsamcj39c9v/t0g5rFmzX_][Dropbox (my FT stuff)]
Page 1 of 1 Sort: