FamiStudio NES music editor

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

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

Re: FamiStudio NES music editor

Post by kikutano »

Wow! Looks amazing! :D Thanks you!
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

FamiStudio 1.4.0 was just released!
  • VRC6 audio expansion support
  • Slide notes
  • Vibrato effect
  • Workaround "pops" on square channels (Blargg's smooth vibrato technique)
  • NSF improvements
  • Ability to remove attack on notes
  • Relative pitch envelopes
Image

-Mat
User avatar
Aparich
Posts: 3
Joined: Sun Feb 02, 2020 9:37 pm

Re: FamiStudio NES music editor

Post by Aparich »

Looks cool. I'll test it out in some time. Thanks.
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

What's the "guidelines" for using music from FamiStudio in your own NES-productions (demos/games/whatever)? I was perhaps expecting some kind of music replayer sourcecode attached but it doesn't seem to be included? Does people use NSF's only or?
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

oRBIT2002 wrote: Wed Jun 03, 2020 1:37 am What's the "guidelines" for using music from FamiStudio in your own NES-productions (demos/games/whatever)? I was perhaps expecting some kind of music replayer sourcecode attached but it doesn't seem to be included? Does people use NSF's only or?
Hello!

You can export to many formats: WAV, NSF, NES ROM, FamiTracker Text, FamiStudio Text and FamiTone2 (More info here: https://famistudio.org/doc/importexport/). Some of those, the text formats especially, open the door to exporting to pretty much any sound engine. Next version will have command line support for exporting and I definitely would like to add support for more sound engines in the future.

There is a "FamiStudio" sound engine in there, which is my Frankenstein version of FamiTone2, but I dont advertise or recommend using it because the code is not super-clean or optimized. I intend to clean it up when i start using it in my own game and release it officially one day.

If you are curious: https://github.com/BleuBleu/FamiStudio/ ... mistudio.s

That's pretty much it, use the tool as you wish, its there, its free, do whatever you want!

-Mat
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

Ok, so I can export to a FamiTone2 assembler file, which in fact is the song/pattern data. Then I'll need the replayer in my code I guess. How much RAM (and where) are used for playback?
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

oRBIT2002 wrote: Wed Jun 03, 2020 10:03 am Ok, so I can export to a FamiTone2 assembler file, which in fact is the song/pattern data. Then I'll need the replayer in my code I guess. How much RAM (and where) are used for playback?
Yes exactly, it will spit out FamiTone2 ASM that you can compile with your game.

You can also take the long way and export FamiTracker Text and use the regular FamiTone2 toolset. But i did fix a few issue with his exporter in FamiStudio, so i think you'll be happy with what FamiStudio generates.

As far as memory usage goes, this is more of a question for Shiru (author of FamiTone2) but from his readme, this is the base memory usage (+ your music data, or course).

Code: Select all

RAM: 186
Zero Page: 3
ROM: 1636
EDIT: If you have a favorite sound engine (ggsound, plenty) and are serious about using it in your game, we can talk about adding support.
EDIT2: One thing i currently dont support (but also plan to add since i will need it for my game) is the SFX export for FamiTone2. Again if you have urgent needs for this, it can be added.

-Mat
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

I guess it's relevant to know which addresses the replayer needs aswell?
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

oRBIT2002 wrote: Thu Jun 04, 2020 2:39 am I guess it's relevant to know which addresses the replayer needs aswell?
Well the rest is just you using FamiTone2 as usual. At this point FamiStudio is completely out of the picture.

You include the assembly file that it generated for you, you call FamiToneInit and you give it the pointer to your song data (which comes from the generated assembly) and call FamiToneMusicPlay.

Example generated file from FamiStudio:

Code: Select all

;this file for FamiTone2 library generated by FamiStudio

famistudio_tutorial_music_data:
	.byte 1
	.word @instruments
	.word @samples-3
	.word @song0ch0,@song0ch1,@song0ch2,@song0ch3,@song0ch4,307,256
	
; ... rest of the file is not shown ...
And then in your game you do something like:

Code: Select all

; Initialize with your music data
ldy #<famistudio_tutorial_music_data
ldx #>famistudio_tutorial_music_data
lda #1 ; NTSC
jsr FamiToneInit

; Play song #0
lda #0
jsr FamiToneMusicPlay
-Mat
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

I have no knowledge of FamiTone2 whatsoever, but it didn't seem that straightforward to get it running (NESASM completely hated my attempts anyway..).
You don't have a "FamiStudio" musicformat except for the XML-exports that's suitable for NES-binaries?
You've never considered writing your own replayer?
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

oRBIT2002 wrote: Thu Jun 04, 2020 12:20 pm I have no knowledge of FamiTone2 whatsoever, but it didn't seem that straightforward to get it running (NESASM completely hated my attempts anyway..).
You don't have a "FamiStudio" musicformat except for the XML-exports that's suitable for NES-binaries?
You've never considered writing your own replayer?
As I said, there is a FamiStudio sound engine, but its a FamiTone2-derivative, so you wont like it haha! Plus its not well tested or optimized, so I dont recommend it at all.

Maybe you should tell me a bit more what you want to achieve so i can help you find the best solution!

For example, if you just want to hear your music on a NES, there is the ROM export which is gonna give you a ROM that you can just run. But if you are making a game, that's not helpful. For a game, you will likely have to figure out how to make a sound engine work, I assume other sound engine (ggsound, plenty) have very similar setup to FamiTone2.

-Mat
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

I'm interested in a replayer that's easy to implement and use. :) As a former demo-coder (sort of anyway) on the Commodore Amiga platform and I'd like to try to code some stuff on the NES aswell.
On the Amiga we just included a replayer and play our music but on the NES, well, things are a little bit more complicated at the moment. But with a replayer-source, that isn't tuned just for one specific assembler, and is well documented.. Well, it would be nice. :)
User avatar
bleubleu
Posts: 108
Joined: Wed Apr 04, 2018 7:29 pm
Location: Montreal, Canada

Re: FamiStudio NES music editor

Post by bleubleu »

oRBIT2002 wrote: Thu Jun 04, 2020 10:10 pm I'm interested in a replayer that's easy to implement and use. :) As a former demo-coder (sort of anyway) on the Commodore Amiga platform and I'd like to try to code some stuff on the NES aswell.
On the Amiga we just included a replayer and play our music but on the NES, well, things are a little bit more complicated at the moment. But with a replayer-source, that isn't tuned just for one specific assembler, and is well documented.. Well, it would be nice. :)
Got it.

Then you have 3 main choices, i think: FamiTone2, GGSound and Plenty. Afaik, they are all available for the 3 main assemblers, except Plenty with does not support NESASM, but dont quote me on this!

They all have pretty good doc, Plenty probably having the most detailed one. FamiTone2 has a big readme.txt file and GGSound has a solid readme on github.

-Mat
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

I found some FamiTone2 example I experimented with but I can't get it to play anything.
I got the example code from https://shiru.untergrund.net/code.shtml and I stripped the example from just about everything but the music-code but I'm probably doing something wrong. I'm using ASM6.
Anyone see anything obvious?
Attachments
demo2.zip
(18.44 KiB) Downloaded 189 times
User avatar
oRBIT2002
Posts: 687
Joined: Sun Mar 19, 2006 3:06 am
Location: Gothenburg/Sweden

Re: FamiStudio NES music editor

Post by oRBIT2002 »

Got it running, NMI was causing problems. But the music doesn't sound as it sounds in FamiStudio (or exported as a NES-ROM) so there's still something wrong. I attach a new example if anyone's interested.
Attachments
demo.zip
(11.96 KiB) Downloaded 196 times
Post Reply