ORG to MIDI converter

Jun 17, 2012 at 7:34 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Here's the ORG to MIDI converter I've been working on: ORGMID.

ORGMID is a command line program. Call it with the name of an ORG file to read and the name of a MID file to create:
orgmid in.org out.mid

ORGMID doesn't choose melodic MIDI instruments for you. All the melody instruments in the MIDI file are set to an organ sound. You should use a MIDI editing program* to choose appropriate sounding MIDI instruments for each melodic part.

See the orgmid.txt file for more information about the conversion.

_____
* For editing MIDI files, I use Sekaiju. If you download Sekaiju, be aware you have to change the language from Japanese to English. Go to the (S) menu and choose Language, select English and restart. (Or before starting Sekaiju, open Sekaiju.ini and change Language=Japanese to Language=English.)

Edit 2012-08-19: Changed ORGMID link from zip file to public ORGMID page.
 
Jun 17, 2012 at 8:57 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
I tried it on GIR's neverdie3.org. Pretty good stuff.

Now, can you do the opposite. As in... MIDI to ORG?
 
Jun 17, 2012 at 8:58 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
soon we will have a toolchain capable of converting anything through .org
 
Jun 23, 2012 at 10:43 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Version 0.81 released: I fixed a bug that caused multiple Note Off events at the beginning of the first melody track in certain cases. (Many unneeded Note Off events caused Media Player mplay32.exe to play the first note with wrong timing.)
 
Aug 19, 2012 at 7:47 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
I made a public page on my website for ORGMID: ORGMID - ORG to MIDI converter.
I posted source code and conversion notes there.

Edit: I'm not pleased with my messy source code (mostly one big main function), but mainly wanted to share the results of my investigations into converting ORG to MIDI. The source code is designed to be plain C, I hope it can complie in other enviroments.
 
Aug 19, 2012 at 8:08 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
I'm pretty sure it can be compiled nearly anywhere.

Are you working on that MIDI to ORG converter? Mine doesn't actually work most of the time, so I'd be great if you could make one.
 
Aug 19, 2012 at 11:33 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Are you working on that MIDI to ORG converter?

I'm not working on a MIDI to ORG converter right now. I have only thought a tiny bit about it. Consider these differences between MIDI and ORG formats:

MIDI file: No limit on polyphony stored in the file.
ORG: One-note polyphony per track (8 melody tracks and 8 percussion tracks).

MIDI file: High time resolution, typically hundreds of divisions per beat.
ORG: Low time resolution, typically 3 to 12 divisions per beat.

MIDI file: Can change tempo, time signature, and instruments anywhere in the file.
ORG: Tempo, time signature, and instruments set once for the entire file.​

Because of these differences, there's more choices you might need to make when converting a MIDI file to an ORG file. For example, if there are too many simultaneous melody notes to fit into 8 monophonic tracks, you have to choose which ones to keep. And you have to choose an appropriate time resolution for the ORG file that fits the MIDI note durations or minimizes note rounding.

If I started making a command-line MIDI to ORG converter, I'd probably end up writing a lot of instructions about how you'd have to limit certain things in the MIDI file for the conversion to work correctly. Ideally, if a lot of settings and choices are needed, a GUI program might be more friendly, but I'd have to learn some language or framework for making GUI programs.

That's as far as I've thought about a MIDI to ORG converter so far.
_____
P.S. To give you a feel for how long I've been working on my ORG to MIDI converter: I started working on it in July 2009 (around the time my first post) and have been working on it intermittently since then. Looking over my archived source code, it looks like I was mostly done in October 2010, but I wanted to write about the conversion process I used and maybe clean up the source code before releasing it. So I continued occasionally drafting and revising documents about it from time to time. In June, someone on the forum asked for a MIDI version of an ORG, and I used my converter to make a MIDI version then tweaked the instruments. After I did that, it felt kind of mean to say "I've got my own ORG to MIDI converter" but not let anyone else use it. So the next weekend I did a quick check for bugs and posted the executable (above on this thread). Today, I finally posted the (still messy) source code and some documents about the ORG to MIDI conversion processes I used.
 
Aug 21, 2012 at 7:44 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
I'm not working on a MIDI to ORG converter right now. I have only thought a tiny bit about it. Consider these differences between MIDI and ORG formats:

MIDI file: No limit on polyphony stored in the file.
ORG: One-note polyphony per track (8 melody tracks and 8 percussion tracks).

MIDI file: High time resolution, typically hundreds of divisions per beat.
ORG: Low time resolution, typically 3 to 12 divisions per beat.

MIDI file: Can change tempo, time signature, and instruments anywhere in the file.
ORG: Tempo, time signature, and instruments set once for the entire file.​

Because of these differences, there's more choices you might need to make when converting a MIDI file to an ORG file. For example, if there are too many simultaneous melody notes to fit into 8 monophonic tracks, you have to choose which ones to keep. And you have to choose an appropriate time resolution for the ORG file that fits the MIDI note durations or minimizes note rounding.

Well that's unfortunate.

If I started making a command-line MIDI to ORG converter, I'd probably end up writing a lot of instructions about how you'd have to limit certain things in the MIDI file for the conversion to work correctly. Ideally, if a lot of settings and choices are needed, a GUI program might be more friendly, but I'd have to learn some language or framework for making GUI programs.

GUIs are easy. Use Java Swing or C++ OpenGL.

P.S. To give you a feel for how long I've been working on my ORG to MIDI converter: I started working on it in July 2009 (around the time my first post) and have been working on it intermittently since then. Looking over my archived source code, it looks like I was mostly done in October 2010, but I wanted to write about the conversion process I used and maybe clean up the source code before releasing it. So I continued occasionally drafting and revising documents about it from time to time. In June, someone on the forum asked for a MIDI version of an ORG, and I used my converter to make a MIDI version then tweaked the instruments. After I did that, it felt kind of mean to say "I've got my own ORG to MIDI converter" but not let anyone else use it. So the next weekend I did a quick check for bugs and posted the executable (above on this thread). Today, I finally posted the (still messy) source code and some documents about the ORG to MIDI conversion processes I used.

Well that's a lot of time. Since I'm curious, I'm gonna look over your source code.
 
Aug 21, 2012 at 6:10 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
You may want to make it truncate everything after the repeat is called.
 
Nov 10, 2012 at 11:43 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Version 0.82 released: Fixed a bug that was excluding some MIDI Pan and Expression events from being added. Download it at the same place: ORGMID - ORG to MIDI converter.

More information: To reduce unneeded events in the MIDI file, ORGMID only inserts MIDI Pan and Expression events when the ORG Pan and Volume levels are different than the previous ones. Unfortunately, ORGMID version 0.81 was incorrectly comparing ORG Pans and Volumes at the start of notes seperately from ORG Pans and Volumes during notes. ORGMID version 0.82 now correctly compares all ORG Pans and Volumes (both from note starts and during notes) to the previous value.
 
Jul 4, 2013 at 8:05 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Apr 23, 2012
Location: United States
Posts: 161
My apologies for the bump on this thread. Does anyone have any idea how I might get this application to work on a Mac?

*after the ridicule for using a Mac has subsided*

I've usually had success with Wine for programs like CS mods, OrgMaker, Pxtone, and a few others, but can't get OrgMid to work... :( I have tried booting it up on Wine, but the application just kind of shuts down before it lets me input anything. Maybe Wine doesn't like command line programs? I've also tried running it directly from the Mac Terminal, but I don't really know what I'm doing in that arena and didn't get anywhere trying that method either.
 
Jul 4, 2013 at 3:02 PM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Nov 14, 2012
Location:
Posts: 167
Csn I turn the MIDI to an MP3?
 
Jul 4, 2013 at 3:56 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
MP3s are just recorded sounds, while MIDIs have something to do with tracks and instruments and shit. There isn't a set of instruments for MP3 files, which is why you can make pretty much anything music or sound related into an MP3. I would use audacity to record the MIDI while you play it on your computer, and then export the recorded file as an MP3 file.
 
Jul 4, 2013 at 7:51 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Jul 11, 2009
Location: Texas, USA
Posts: 90
Mosaic said:
Does anyone have any idea how I might get this application to work on a Mac? [...] I have tried booting it up on Wine, but the application just kind of shuts down before it lets me input anything.
(In Windows, if you double-click on orgmid.exe you will also see a black window quickly appear and disappear. So that's why same thing happens when you use Wine to run it on your Mac. This isn't how ORGMID works.)

To use ORGMID in Windows, you have to open the Command Prompt, change to the folder where ORGMID is located, then type something like

orgmid "cave story.org" "cave story.mid"

using the name of an ORG file you have and the name of a MIDI file you want to make.

In a Wine FAQ, I found How do I pass command line arguments to a program? Following the pattern shown there, maybe you could go to the Terminal, and enter something like

wine orgmid.exe "cave story.org" "cave story.mid"

Alternatively, if you have a C compiler, you may be able to download the ORGMID source code and make a Mac command-line executable. I tried to use platform-independent C code, but I don't have any other systems to test with.
 
Top