Page 3 of 4

Posted: Tue Jan 25, 2011 1:42 pm
by clueless
Hello guys,

I am 80% done with a tool that directly converts Famitracker FTM files into ca65 compatible assembly. The tool is implemented in whatever C dialect that MSDEV Studio 98 (vc6.0, sp6) will compile. It also compiles cleanly with gcc-4.4.4 on my Linux development server. (I do my nesdev on both, and shuffle code back and forth using svn).

I find it tedious and annoying to run a point + click export plugin inside Famitracker, and then run a secondary tool (text2data, from famitone) to convert the TXT into nesasm assembly, and then a perl script to convert from nesasm syntax into ca65. So I'm cutting out the middle-men.

My converter does not handle DPCM (yet), as I don't plan to use DPCM in my current project. I plan to release the source under the GPL (same as Famitracker). I've tried to ask jsr on IRC if he wanted the source to add as a "command line utility" to Famitracker, but he's not been on and/or ignored me.

I had planned on adding support to emit assembly in nesasm syntax too (changed via a command line switch).

However, since I began studying the Famitone source code, I've decided to change the output format a bit, and I plan to modify Famitone accordingly. Famitone indexes its instruments as arrays of structs. The 6502 is not very efficient at this. Much more efficient would be to store the data as a single set of arrays. That is, split arrays of words into two arrays of bytes (lsb, msb, separately). I think that I can make Famitone use less CPU if I handle this correctly. Of course, I will share any changes that I make.

I think that Famitone's pattern table encoding format is pretty slick. Nice job Shiru!

Anyway, The hardest part of the project is just writing the code that will convert the FTM file into an intermediate format in memory. Internally Famitracker uses the word "track" to refer to entire songs (also calls them "tunes"), and to parts of a song, and the columns / rows of the "frame" table. It gets very confusing, imho.

My converter runs as a command-line app on Windows and Linux (and I suspect that it work would fine on a Mac). My design goal is that I would store only the FTM files in revision control. The assembly produces by my converter is just a temp file used during the build process, and removed when I do a "make clean". I'm a big fan on only having one canonical source for source-code in a given project. Storing a FTM and pre-converted ASM file side-by-side for the same original data set seems anti-(something.. . what is the word that I am looking for??) to me.

Does anyone have any interest in my little FTM->ASM project? If not, I'll stop pestering people about it and keep it to myself. It cold a pretty cold reception on IRC from a few people, so I don't know if anyone really wants it other than me. :(

Posted: Tue Jan 25, 2011 9:11 pm
by GradualGames
Well, I guess it can't hurt to share all these different solutions, then people with different preferences can pick among them as to which suits their development style best. I wrote the direct export system for myself, so I shared it in case others like it. If not...it hasn't harmed anybody. :D Personally I think you should put this in a separate thread, since it is not part of the plugin system and is an alternative solution.

I'm also puzzled, how is this cutting out the middle man? It seems like you're adding a middle man. Shiru's plugin adds a middle man, but the point of his plugin was to allow yet another alternative for writing new converters for people who did not want to ramp up on the plugin system itself. In the end, the only thing that really cuts out the middle man is to write a new plugin, as in the example I provided. The engine included with the example works well, but does not have enough features to satisfy everyone. What we need is a better engine (perhaps FamiTone) AND a direct export plugin that supports it.

Posted: Tue Jan 25, 2011 11:23 pm
by Shiru
It is actually easy to make a direct export plugin for FamiTone (quick and dirty way: constuct a text file in memory or temp file, then use existing converter code on it). It wasn't done yet just because I'm lazy, and there are things in the converter that could be improved.

Posted: Wed Jan 26, 2011 12:49 am
by thefox
clueless wrote: Does anyone have any interest in my little FTM->ASM project? If not, I'll stop pestering people about it and keep it to myself. It cold a pretty cold reception on IRC from a few people, so I don't know if anyone really wants it other than me. :(
Referring to me? :) While I didn't initially see what use it could be over the plugin system, I think your points about the build system are valid. Anyways, I think couple of hours in IRC is a bad way to measure how interested people are in something. I hope you release the tool for the public once it's ready.

Posted: Wed Jan 26, 2011 4:25 am
by Wave
It would be good to have a FTM->ASM direct tool ( I would need NESHLA but that's another history) what I'm really interested in is cpu time reduction, that would be really great.

Posted: Wed Jan 26, 2011 4:50 am
by Shiru
There are few places in FamiTone code you can change to make it faster, but for most part it will increase player code size (unroll some loops, replace some calls with copies of code). setInstrument routine is indeed is the first candidate for optimization.

Posted: Wed Jan 26, 2011 7:25 am
by clueless
I started a new thread http://nesdev.com/bbs/viewtopic.php?p=73155#73155.

I don't want to hijack Gradualore's thread to discuss a non-canonical Famitracker non-plugin.

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Wed May 22, 2013 9:09 pm
by cpow
Sorry to dredge up this thread, but I'm in need of the custom exporter plugin for testing my Qt port of FamiTracker's ability to use custom exporters. The links in this thread and others seem to be broken. Can someone [Shiru/GradualGames/etc.] PM me a custom plugin for my testing, or fix the links? Thanks!

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Thu May 23, 2013 4:23 am
by thefox
FamiTone's source, including the text exporter plugin, is at http://shiru.untergrund.net/code.shtml

EDIT: Maybe missing some header though?

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Mon May 27, 2013 11:25 pm
by zzo38
Do you have the document of format of text plugin? It might be useful, that I can make ppMCK to also export such format, and possibly with other programs too to export into such a format, to write whatever music engine you use, that you can then convert text format into music engine format, that you do not have to have all music for the game written with FamiTracker or all with any one other program, in case writen by many people who use different program to write a music, please.

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Tue May 28, 2013 12:00 am
by rainwarrior
I wrote a text exporter as well as a command line export that is included in the latest version of famitracker. They are completely documented in the .chm included with FamiTracker 0.4.2.

There is no need to try and get that old plugin working, zzo38. This is a more complete text export (exports everything in the FTM, not just the stuff that the plugin author needed), and it's part of the main program, so there isn't anything weird to do to set it up.


Anyhow, cpow, if you need working links for downloads of the old plugins, look here: http://famitracker.com/downloads.php

I haven't tried them in a while, not sure if they still function with 0.4.2

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Fri May 31, 2013 5:34 pm
by zzo38
I don't need the entire program; is it possible to download only the document explaining the format, without downloading and installing the rest of FamiTracker?

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Fri May 31, 2013 8:55 pm
by rainwarrior
Famitracker doesn't require "installation", it's just an executable in a zip (1.3MB). The documentation is in a CHM file in that same zip. Or if you don't like CHM, it's in an HTML file in the source zip (1.1MB).

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Fri May 31, 2013 9:08 pm
by Shiru
That's a great news that Famitracker now have built-in comprehensive text export, with sub songs even. Once I'll get to updating my sound tools, I'll replace my old custom exporter toolchain with this, for sure. Thanks, rainwarrior.

Re: Famitracker Plugins: sound driver + demo rom, text expor

Posted: Sat Jun 01, 2013 12:29 pm
by zzo38
rainwarrior wrote:Famitracker doesn't require "installation", it's just an executable in a zip (1.3MB). The documentation is in a CHM file in that same zip. Or if you don't like CHM, it's in an HTML file in the source zip (1.1MB).
OK, thanks.