Famitracker to Pently converter

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

Moderator: Moderators

User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Famitracker to Pently converter

Post by NovaSquirrel »

Manually transcribing music from Famitracker over to Pently's format is tedious, especially in comparison to all the other music engines that can convert from Famitracker with an included conversion tool.

I whipped up a simple converter that mostly works for most things I throw at it. It's still a work in progress, and it doesn't yet support the effects here (except arpeggio) or converting noise instruments to sound effects, and it still doesn't fully support multiple songs yet. There are also still some problems with some songs I've tried, that I'm still working out.

GitHub repository if someone wants to help on the code or compile it.
Attachments
pently.nes
First level music from Alter Ego through the converter (with percussion manually changed) and with problems on pitch sliding instruments
(24.02 KiB) Downloaded 332 times
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Famitracker to Pently converter

Post by dougeff »

Cool.

Would it be ok if I made an asm6 version of Pently and removed that python dependency? (I believe the note table is generated from scratch every time).
?
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Famitracker to Pently converter

Post by NovaSquirrel »

I'm not Pently's author, but because it's licensed under the MIT License I'd assume you could do whatever with its source as long as you kept the copyright notices.

Assuming you mean the note frequency table, in my own projects I just include a table that works right into the game and don't have Python generate it. The Famitracker->Pently conversion is still going to need Python though since it needs pentlyas.py
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Famitracker to Pently converter

Post by tepples »

If I wrote pentlyas in C or C++ instead of Python, there'd be a dependency on a C or C++ compiler.

In what language could I write something that doesn't have a dependency on some programming language not bundled with every major personal computer operating system?
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: Famitracker to Pently converter

Post by lidnariq »

The difference is that C/C++ binaries can be compiled using mingw and depend on nothing not already distributed with the OS.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Famitracker to Pently converter

Post by dougeff »

My point was...I don't need a Python script to make a note table. I made a note table a year ago, hand calculated with a calculator.

I'm aware that you're not the author, I was asking tepples. I'd like to make Pently useable for the 60% or so who don't use ca65 or have Python installed.

I was just excited that someone wrote a famitracker to pently conversion tool, and I thought this would be the next logical step.
licensed under the MIT License I'd assume you could do whatever
I thought it would be polite to ask anyway.
nesdoug.com -- blog/tutorial on programming for the NES
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Famitracker to Pently converter

Post by tepples »

lidnariq wrote:The difference is that C/C++ binaries can be compiled using mingw and depend on nothing not already distributed with the OS.
MinGW binaries don't work out of the box on OS X, FreeBSD, or GNU/Linux. First you need to install Wine. And Wine doesn't work in non-i386 environments, such as the Raspberry Pi in NovaSquirrel's bedroom or the AMD64-only PC in calima's room. True, ft2pently users will already have either Windows or Wine installed as a dependency of FamiTracker, but people writing directly in Pently-MML might not. Finally, I'd need to learn how to install a cross-compiler on the computer that I primarily use to develop Pently, which runs an OS based on Debian GNU/Linux, so that I can create MinGW binaries, and I'd need to rewrite everything line by line in C++ and eat the overhead of maintaining C++ compared to maintaining Python.

Perhaps I could continue to distribute the Python version as free software, make a line-by-line translation into C++ that's not updated as often, make the C++ translation proprietary software, charge for copies of the C++ translation to cover the cost of purchasing a genuine Windows license on which to test a MinGW port, the cost of my time keeping the Windows installation updated, and the cost of my time making the C++ translation. I imagine most users of Windows would install Python to work around this, just as they install Oracle's Java virtual machine to play Minecraft.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: Famitracker to Pently converter

Post by Banshaku »

Note: didn't read all the details.

If it's just something that generate text them most people should have a browser installed. In that case, JavaScript can be a solution.
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Famitracker to Pently converter

Post by NovaSquirrel »

tepples wrote:If I wrote pentlyas in C or C++ instead of Python, there'd be a dependency on a C or C++ compiler.
Pentlyas isn't the thing that's being complained about, the frequency table generation is. This is solvable by just including a premade NTSC or PAL table, and I already do this in my games. It's not the language used for generating the table, but the fact that the step is there at all.

Rewriting pentlyas in C++ would be a waste of time, because I think the only people who care about having to get Python are Windows users, and you can have a py2exe build available for them. When I release a Windows build of ft2pently I'm going to include an exe of pentlyas alongside it.

---

I can try to help with an asm6 port of Pently. I'd like to know if the rest of these effects have any demand. If they're not important I'm probably going to work on optimizing the resulting files for ROM space.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Famitracker to Pently converter

Post by tepples »

Banshaku wrote:If it's just something that generate text them most people should have a browser installed. In that case, JavaScript can be a solution.
That would depend on a way of copying and pasting text into the browser and then copying and pasting the result, all from the command prompt. Node.js is a JavaScript environment intended to be used at the command line, but I imagine that more desktop PCs have Python than Node.js installed.
NovaSquirrel wrote:Pentlyas isn't the thing that's being complained about, the frequency table generation is.
My reasoning is that if you have Python installed to do one, you might as well have Python installed to do the other. But if py2exe is available to you, and the scope of the functionality of the program built with py2exe is the major issue, then I could add a command-line argument to have pentlyas.py include a frequency table in its output (by importing mktables.py).
NovaSquirrel wrote: I'd like to know if the rest of these effects have any demand.
In Press Your Luck, I used Bxx (loop point other than start of song), Dxx (variable pattern length), and Sxx (note cut at fractional row).

In a Balloon Fight-esque NSF, I used Bxx (loop point other than start of song), grace wait (Gxx), and staccato (Sxx), though most of the Sxx uses would have been captured by the staccato flag of Pently instruments.

In Byelomorye Dam Zone, I used Bxx (loop point other than start of song), 3xx (legato) for the arpeggiated pad during Waluigi Pinball, Dxx (variable pattern length) at the end of each section, and Qxy (hammer-on) a few places throughout the thing.

In Concentration Room and Zap Ruder, the jingle after the end of a level needs C00 (stop playback).

I'll provide FTMs of these three songs once the Press Your Luck contest ends.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Famitracker to Pently converter

Post by dougeff »

Ok, I made a functioning asm6 version of Pently...but I need to clean it up a lot, put back in a few 'if, else' bits I deleted, double check it, etc.

Just FYI, I had to change most of the important macros (or remove them entirely).
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: Famitracker to Pently converter

Post by dougeff »

Here's a slightly broken version of Pently for asm6...

http://dl.dropboxusercontent.com/s/smvk ... y_asm6.zip

I say 'slightly broken' because the Happy Flappy Crappy song doesn't seem to play right. Not sure why. All the other tests seem to play fine.
nesdoug.com -- blog/tutorial on programming for the NES
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Famitracker to Pently converter

Post by tepples »

tepples wrote:I could add a command-line argument to have pentlyas.py include a frequency table in its output
This feature has been pushed to GitHub, along with a new slur notation.
User avatar
Jarhmander
Formerly ~J-@D!~
Posts: 568
Joined: Sun Mar 12, 2006 12:36 am
Location: Rive nord de Montréal

Re: Famitracker to Pently converter

Post by Jarhmander »

Sorry to go a bit off-topic, but I must say something.

Yes, I did troll tepples for, you know, Coily things, because it was fun remembering what Koitsu said. But my honest opinion of the matter is, I can't agree more on the choice of Python for his script compared to C/C++. I would do exactly the same. I might be one of the few in this forum to strongly advocate C++, but you can't beat the productivity of a scripting language, especially one with tons of libraries like Python. I can't count the times I wrote scripts using Python that were simple, almost "throw away" programs done really quickly that would be much longer to write in C++, and do not even mention C. In a matter of hours I made a code generator for C using Python that rendered several characters of a particular font to 1bit bitmap and encoded them into a RLE-like format, then generated a source code containing arrays with the bitmap data, structs with metadata and pointer to those arrays, and finally an array of those structs. Even with my experience it would have taken a couple of days making the same thing using C++.

tepples, please ignore the complaints about some "Python" dependencies, it's not worth your time. After all, you made the tools for you, didn't you. And frankly, Python causes less problems in porting to Windows that supporting any kind of compiling setup, be it cross-compiling or using a separate VM to develop for Windows. When problem arises, you can fix the Windows compatibility problem in a matter of minutes. Heck, even the user can modify the script to test and fix things.
((λ (x) (x x)) (λ (x) (x x)))
User avatar
NovaSquirrel
Posts: 483
Joined: Fri Feb 27, 2009 2:35 pm
Location: Fort Wayne, Indiana
Contact:

Re: Famitracker to Pently converter

Post by NovaSquirrel »

I've got a bunch of stuff implemented (slur, loop points, pattern breaks, tempo changes, grace notes, delayed note cuts, slurring up or down, multiple songs, attack channel) though I still have a lot of things to do.

I attached a Windows build of ft2pently (build it from here if on Linux) as well as the Alter Ego song I was using as a test, and the readme should explain how to use it. I wasn't able to get py2exe working.

I'm putting this on hold for now as I'd really like to get back to Nova the Squirrel.
Attachments
ft2pently.zip
(85.5 KiB) Downloaded 313 times
Post Reply