FTM2MID - FTM to MIDI converter [V3]

General discussion about tracking, help and support.
User avatar
HertzDevil
Posts: 466
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR
Contact:

FTM2MID - FTM to MIDI converter [V3]

Postby HertzDevil » Mon Jul 20, 2015 10:27 pm

I wrote a basic FTM to MIDI converter script in Lua, which uses my own partial port of the CFamiTrackerDoc class and a Lua port of MIDI-Perl. Its purpose is to allow one to quickly access the underlying notes in FTM files within a wide class of sequencers; it does not aim at producing listenable General MIDI files from arbitrary FTMs. It is a much faster method of producing usable sequence files compared to recording the MIDI output from FamiTracker with external software. An installation of Lua 5.2 or above is required.

Current features
  • Note-by-note export with proper handling of Gxx and Sxx effects;
  • Multi-chip FTMs are supported with volume mixing, and MIDI channels can be remapped;
  • Percussion mapping for noise channel per instrument, and DPCM per sample;
  • Loop detection and tempo changes, including 0CC-FamiTracker grooves;
  • Notes using the 0xy arpeggio effect or looped absolute arpeggio sequences are expanded into individual notes;
  • Notes of selected instruments can be marked as tie notes;
  • Program change per instrument;
  • Selected DPCM samples can be split into a separate melodic track;
  • [V3] Transposition by Qxy and Rxy effects;
  • [V3] Swapping note velocity and channel volume, plus Axy volume slide effect handling.
To-do
  • wxLua GUI frontend;
  • Option to split notes of selected instrument sets into separate tracks;
  • Option to use accurate fine-pitch;
  • Option to map 4xy or 7xy effects to MIDI modulation events;
  • Option to expand all kinds of arpeggio sequences into individual notes;
  • (Portamento MIDI events;)
  • 0CC-FamiTracker bookmarks for time signatures;
  • DLS / SF2 export for instruments using DPCM samples (I am serious about this feature);
  • Support for 0.5.0 FTMs (this must not be done before the updated CFamiTrackerDoc source code is released) and 0.2.x FTMs.
Feel free to modify the script and/or port it to other languages, or report bugs in this thread. The archive attached below contains everything required to run the script, as well as some FTMs and a batch file that give you an idea of what the current converter is capable of.
Attachments
ftm2mid_v3.zip
(80.75 KiB) Downloaded 1205 times
Last edited by HertzDevil on Mon Jul 27, 2015 4:38 pm, edited 8 times in total.
Constructing Chiptune; Construing 8-Bit. Makes 0CC-FamiTracker and MEGA ZUN.

Join my forum for 0CC-FamiTracker discussion and more

User avatar
iYamWhatIYam
Posts: 422
Joined: Wed Jul 08, 2015 8:19 pm
Location: Fort Wayne, IN

Re: FTM to MIDI converter

Postby iYamWhatIYam » Mon Jul 20, 2015 10:35 pm

This is a great idea. It really is.

But, could you please create a .zip instead of a .rar? It would convenience those of us who don't have WinRAR.

Thank you.
I have permanently switched to 0CC-FamiTracker. If and when JSR decides to update vanilla FamiTracker at this point is entirely out of the question for me.
YouTube
Twitter

User avatar
HertzDevil
Posts: 466
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR
Contact:

Re: FTM to MIDI converter

Postby HertzDevil » Mon Jul 20, 2015 10:40 pm

Done.
Constructing Chiptune; Construing 8-Bit. Makes 0CC-FamiTracker and MEGA ZUN.

Join my forum for 0CC-FamiTracker discussion and more

Roflo
Posts: 292
Joined: Thu May 07, 2015 3:51 pm
Location: Germany
Contact:

Re: FTM to MIDI converter

Postby Roflo » Tue Jul 21, 2015 1:22 pm

Thats the thing I need! Thank you very much :)

User avatar
Potentialing
Posts: 67
Joined: Mon Apr 27, 2015 1:50 am

Re: FTM to MIDI converter

Postby Potentialing » Tue Jul 21, 2015 6:05 pm

Fantastic stuff! I love how it lines everything up like a proper MIDI: This will be great for people who aren't tracker-literate who want to analyze FTMs!

There are two things I was wondering, though:

- Possibility of including MIDI Timesig, accounting for rows per frame?
- Possibility of re-triggering notes in cases such as this: http://i.imgur.com/YZC34CM.png

In any case, thank you for the wonderful tool: I can see myself using this very often!

User avatar
HertzDevil
Posts: 466
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR
Contact:

Re: FTM to MIDI converter

Postby HertzDevil » Tue Jul 21, 2015 6:44 pm

I added track names and a few more commands to V2.
Potentialing wrote:- Possibility of including MIDI Timesig, accounting for rows per frame?

Not viable, but viable if the row highlight settings (and 0CC-FT bookmarks) are used.
Potentialing wrote:- Possibility of re-triggering notes in cases such as this: http://i.imgur.com/YZC34CM.png

Not viable in the sense that these events alter the channel volume directly and there is no "volume detection" that works in all circumstances, but adding the most recent note (or 0CC-FT's ^0) to every row containing a 9 in the volume column will always work. In practice encoding volumes as note velocity makes the exported MIDI more amenable to manipulation than encoding them as channel volume, because otherwise all notes would be at maximum velocity, and almost all DAWs treat notes and track automations independently of each other. Nonetheless this is possible as an option (incidentally, Axy effects can be handled this way).
Constructing Chiptune; Construing 8-Bit. Makes 0CC-FamiTracker and MEGA ZUN.

Join my forum for 0CC-FamiTracker discussion and more

Roflo
Posts: 292
Joined: Thu May 07, 2015 3:51 pm
Location: Germany
Contact:

Re: FTM2MID - FTM to MIDI converter [V2]

Postby Roflo » Tue Jul 21, 2015 10:09 pm

Is there any documentation on how to exactly use this? When looking at the batch file there are various switches (like -N34;52 and such).

User avatar
HertzDevil
Posts: 466
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR
Contact:

Re: FTM2MID - FTM to MIDI converter [V2]

Postby HertzDevil » Tue Jul 21, 2015 10:44 pm

Code: Select all

Usage: lua ftm2mid.lua [filename] ([option ...])
Options:
 -Cx;y Map channel x to MIDI channel y (1 - 16)
 -Dx;y Map DPCM sample x to MIDI percussion note y (0 - 127)
 -Kx   Set the number of MIDI ticks per beat to x (default 96)
 -Lx   Export the track up to x loops (default 2)
 -Mx   Set the time multiplier to x (default 1.0)
 -mx   Set the time multiplier to 1/x
 -Nx;y Map instrument x on the noise channel to MIDI percussion note y
 -O x  Rename the output file to x
 -Px;y Assign instrument x to MIDI instrument y (0 - 127)
 -px   Treat DPCM sample x as melodic note
 -R    Do not treat note release as note off
 -Tx   Export track x (default 1)
 -Vx,y Set the volume of chip x to y (maximum 127)
       x: 0->2A03; 1->VRC6; 2->VRC7; 4->FDS; 8->MMC5; 16->N163; 32->5B
 -vx,y Set the volume of channel x to y (maximum 127)
 -Yx   Recognize instrument x as tie notes
This can be viewed either by running the script with no arguments at all or viewing the script itself in a text editor. Do tell me if you think this is inadequate.
Constructing Chiptune; Construing 8-Bit. Makes 0CC-FamiTracker and MEGA ZUN.

Join my forum for 0CC-FamiTracker discussion and more

Roflo
Posts: 292
Joined: Thu May 07, 2015 3:51 pm
Location: Germany
Contact:

Re: FTM2MID - FTM to MIDI converter [V2]

Postby Roflo » Tue Jul 21, 2015 11:26 pm

Oh yes right, running it without any arguments :?
Thanks!

User avatar
Potentialing
Posts: 67
Joined: Mon Apr 27, 2015 1:50 am

Re: FTM to MIDI converter

Postby Potentialing » Wed Jul 22, 2015 12:44 am

HertzDevil wrote:I added track names and a few more commands to V2.
Potentialing wrote:- Possibility of including MIDI Timesig, accounting for rows per frame?

Not viable, but viable if the row highlight settings (and 0CC-FT bookmarks) are used.
Potentialing wrote:- Possibility of re-triggering notes in cases such as this: http://i.imgur.com/YZC34CM.png

Not viable in the sense that these events alter the channel volume directly and there is no "volume detection" that works in all circumstances, but adding the most recent note (or 0CC-FT's ^0) to every row containing a 9 in the volume column will always work. In practice encoding volumes as note velocity makes the exported MIDI more amenable to manipulation than encoding them as channel volume, because otherwise all notes would be at maximum velocity, and almost all DAWs treat notes and track automations independently of each other. Nonetheless this is possible as an option (incidentally, Axy effects can be handled this way).

Oh of course, didn't think of that. Thank you!


Return to “General Talk”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest