nesdev.com
http://forums.nesdev.com/

Program music from Famitracker into game?
http://forums.nesdev.com/viewtopic.php?f=2&t=15865
Page 1 of 3

Author:  JWinslow23 [ Thu Apr 27, 2017 11:35 am ]
Post subject:  Program music from Famitracker into game?

I created a song in Famitracker that I plan to put in a new game I'm making. How would I put it in a game that I'm making in 6502 asm? I tried generating a .asm file with the "Create .nsf" dialog, but I'm unsure how to play it. I will have sound effects playing with the music, as well.

Author:  tepples [ Thu Apr 27, 2017 12:02 pm ]
Post subject:  Re: Program music from Famitracker into game?

It depends on which effects and instrument features your piece uses. Two publicly available music engines that can be used with music composed in FamiTracker are Pently and FamiTone2. Neither supports all effects and instrument features.

Author:  dougeff [ Thu Apr 27, 2017 12:17 pm ]
Post subject:  Re: Program music from Famitracker into game?

But, you forget, Shiru made a full famitracker driver that is compatible with famitone2. And, it is what I'm using for my Ninja game.

It's also complicated, and cc65. And needs lots of ROM space for music data.

Author:  JWinslow23 [ Thu Apr 27, 2017 12:26 pm ]
Post subject:  Re: Program music from Famitracker into game?

I'm not using any effects except Cxx (halt song), and my instruments only have volume changes. Thanks for pointing me to Famitone2, I might use that. Is that compatible with NESASM3?

Author:  DRW [ Thu Apr 27, 2017 12:34 pm ]
Post subject:  Re: Program music from Famitracker into game?

JWinslow23 wrote:
Is that compatible with NESASM3?

Why don't you download it and check it out? :wink:


As dougeff already said: Shiru made two versions of it.

The regular FamiTone2 v1.15 is the one that he created as a minimalistic sound driver for NES development.

And because he got frustrated by people who complained that certain things don't work in FamiTone, he created neslib + FamiTracker player which uses the original FamiTone only for sound effects while the music is done with the native FamiTracker driver:
Quote:
Since release of FamiTone I was getting complaints on how restricted it is, and
how missing features not allowing to create good music with it. It gets as far
as people now trying to expand the engine to support more FamiTracker features,
for some reason - rather pointless to me, as the very idea of FamiTone was to be
that restricted, the design was never intended to be expandable, and it would be
easier to just write another engine from scratch.

So, it's your choice which one you want to use.

With neslib + FamiTracker player, you can do everything that FamiTracker can do. But it will probably require a lot of ROM space and I assume calling the functions would also require a lot of the precious CPU time (which, unlike ROM space, cannot be added with mappers).

For my game, I used the regular FamiTone, i.e. the limited, but small one.

I don't understand the problem many people have. I myself don't know much about making music. But I would say my composer did a pretty neat soundtrack, even with FamiTone's restrictions:
https://iyamwhatiyam.bandcamp.com/releases

Author:  JWinslow23 [ Thu Apr 27, 2017 3:30 pm ]
Post subject:  Re: Program music from Famitracker into game?

I'm having a problem in the first step. When I'm using the text2data tool that comes with Famitone, it always crashes. There is no error message, it just freezes for a second, and then my computer says "text2data.exe has stopped working". I'm on Windows 10, and the .txt file FamiTracker generates is attached. How do I fix this?

Attachments:
WalRush_Main_Theme.txt [9.09 KiB]
Downloaded 24 times

Author:  DRW [ Thu Apr 27, 2017 3:34 pm ]
Post subject:  Re: Program music from Famitracker into game?

What happens when you just call the program without any parameters? Does the error appear as well?

If yes, you might have to install the Visual C++ Runtime (version 2008 or later) first.

Edit: The problem happens on my PC as well, but only with your FamiTracker file.

Did you use the regular FamiTracker or that beta version?

I assume you have to use FamiTracker 0.4.6.

Author:  JWinslow23 [ Thu Apr 27, 2017 3:36 pm ]
Post subject:  Re: Program music from Famitracker into game?

Without any parameters, it just gives me usage information.

Author:  DRW [ Thu Apr 27, 2017 3:38 pm ]
Post subject:  Re: Program music from Famitracker into game?

I added some text to my previous post.

Author:  DRW [ Thu Apr 27, 2017 3:40 pm ]
Post subject:  Re: Program music from Famitracker into game?

Alright, I see now: Your file is created from FamiTracker 0.4.2. I'd suggest to download the latest version (0.4.6):
www.famitracker.com/downloads.php

Author:  JWinslow23 [ Thu Apr 27, 2017 3:55 pm ]
Post subject:  Re: Program music from Famitracker into game?

I did get FamiTracker v0.4.6. That's what it says in the "About FamiTracker" information. I also have the latest version of Famitone.

I'm confused. :\

Here is my actual FamiTracker project, if it's something to do with that. (It has two songs: the main theme, and a "flap" sound-effect.)

Attachments:
WalRush_Main_Theme.ftm [3.6 KiB]
Downloaded 30 times

Author:  DRW [ Thu Apr 27, 2017 4:05 pm ]
Post subject:  Re: Program music from Famitracker into game?

O.k., looks like the problem is with your FTM file somehow since it has exactly the same symptoms on my PC.

In the past, we've had this as well, that some dirty stuff was somewhere inside the binary file that was also put into the text file and made it semi-invalid.

My suggestion:
Open a clean new file (with the latest FamiTracker version).
Open the current file in another FamiTracker instance.
Put everything from the dirty file to the clean file via copy & paste.

And then save the clean file.
Whatever dirty stuff is in the old file should be gone. (You can do a file compare of the text export from the new and the old file to see where they differ.)

Author:  DRW [ Thu Apr 27, 2017 4:09 pm ]
Post subject:  Re: Program music from Famitracker into game?

Unrelated hint, but this has nothing to do with the error: Sound effects have to be created with nsf2data and therefore go into a separate file.

Unfortunately, sound effects in FamiTone cannot use an infinite loop. If you want an infinite sound effect, you either have to time the sound effect call in code or you have to do it as a song after all. But doing it as a song means that you cannot have another background song while the effect is played.

Author:  JWinslow23 [ Thu Apr 27, 2017 4:25 pm ]
Post subject:  Re: Program music from Famitracker into game?

DRW wrote:
Unrelated hint, but this has nothing to do with the error: Sound effects have to be created with nsf2data and therefore go into a separate file.

Unfortunately, sound effects in FamiTone cannot use an infinite loop. If you want an infinite sound effect, you either have to time the sound effect call in code or you have to do it as a song after all. But doing it as a song means that you cannot have another background song while the effect is played.

I do not want an infinite loop. I actually made it stop with Cxx, but apparently Famitone doesn't support that. What effect would do this?

Also, I got text2data working now, thanks!

Author:  dougeff [ Thu Apr 27, 2017 4:31 pm ]
Post subject:  Re: Program music from Famitracker into game?

I had no problems. (note, I removed the 2nd song before exporting from 0.4.6).

(leaving it on crashes text2data for some reason).

Attachments:
WalRush.asm [2.01 KiB]
Downloaded 23 times

Page 1 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/