Org to Midi Converter

Feb 14, 2007 at 7:30 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 11, 2007
Location:
Posts: 6
So, I'm working on an Org-Midi conversion script in Python (I'm going to assume one doesn't exist, because I haven't found one). From what I've read around here, there are a few people who'd like something like that. I've already got a skeleton of it working, with all of the first 8 org tracks (the not-drum instruments), and drum tracks sort of working, with volume controls mostly correct. I ought to be done with it in a couple of weeks (I'm kind of busy right now), and at that point, I'll be able to release it to all of you here. However, I'm uncertain on a few aspects of the org file format and other things.

So, I now come to you, denizens of these forums, to ask you a question of utmost importance...

How does one convert from the tempo system used by Org Files (the weird thing where a higher number is slower) to the standard Beats Per Minute used by musicians everywhere? I couldn't find any straightforward formula for conversion, so I just played some org click tracks, tried to ascertain the equivalent beat on a midi device, plugged the values into excel, drew a graph, and it gave me this as the closest line of fit:

BPM = 16610*(OrgTempo^-1.0286)

Naturally, this is an undesirable equation - there must be something more elegant than this. Could anybody help me out?

Also: Some of the songs (especially Eyes of Flame) sound really weird when they're played just on the piano/Acoustic Grand. Do you suppose it would be beneficial to convert certain org sounds to various MIDI instruments (most likely piano variations or lead synth instruments (charang, sawtooth, whatever))?

EDIT: Also, major thanks to Osmose - without his Org Filetype Description, I wouldn't have been able to get started on this.
 
Feb 14, 2007 at 8:19 PM
Been here way too long...
"..."
Join Date: Jun 25, 2005
Location:
Posts: 372
Tempo in OrgMaker is, simply put, a bitch. Seriously, I could never figure it out myself.

Oh, and at least someone found a use for that. :o
 
Feb 14, 2007 at 10:07 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 11, 2007
Location:
Posts: 6
Osmose said:
Tempo in OrgMaker is, simply put, a bitch. Seriously, I could never figure it out myself.
Ah. I see. That kind of sucks. Oh well.

In any case, I uploaded three midis automagically made by the conversion script:

Cave Story
Eyes of Flame
Last Battle

those links are dead

Presently, the script lacks the capability to effect panning, volume changes within a note, and the union of all drum tracks into a single midi track. It also cannot alter the pitch of drum notes (the only place I've really noticed this is in Running Hell; I'm pretty sure that this is a MIDI limitation that I can't easily overcome). All notes are played on the Acoustic Grand. Some drum notes are much louder than they should be. The script itself is an example of everything you should not do when programming. Nonetheless, it produces decently passable midis.

Shake well before enjoying.
 
Feb 15, 2007 at 3:06 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Nov 4, 2006
Location:
Posts: 3
I tried to do that awhile ago, but I gave up because I couldn't figure out how MIDI worked. You can check out my script here if you want.
 
Feb 15, 2007 at 3:09 AM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Feb 15, 2007 at 11:36 AM
Been here way too long...
"..."
Join Date: Jun 25, 2005
Location:
Posts: 372
Zecritic said:
I tried to do that awhile ago, but I gave up because I couldn't figure out how MIDI worked. You can check out my script here if you want.

MIDI is pretty whack. It works by using a series of events. Each event has a value at the end of it that tells how long to wait until moving on to the next event. And to play instruments, you have to activate the instrument, wait as long as you want the note to play, and then deactivate it.

It's pretty ridiculous. But I'm sure there's libraries out there that can make things simpler.
 
Feb 15, 2007 at 2:59 PM
Indie game enthusiast
"What is a man!? A miserable pile of secrets! But enough talk, have at you!"
Join Date: Apr 18, 2006
Location: Forever wandering the tower...!
Posts: 1789
Appreciated and enjoyed! Looking forward to a complete set of midis~!
 
Feb 15, 2007 at 10:03 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 11, 2007
Location:
Posts: 6
X-Calibar said:
Appreciated and enjoyed! Looking forward to a complete set of midis~!
Well, if you find the quality of the midis satisfactory as-is, I can definitely provide the full set of 39 (or whatever) midis. Note that they retain their original names (the ones that you see using ResHacker), so the names might be confusing (for example, "WANPAK2"). Get them here (zip file, 43KB):

http://ashvin.21.googlepages.com/orgmidis.zip
that link is dead. use this: http://www.box.net/shared/ziu67o28i6

It's pretty ridiculous. But I'm sure there's libraries out there that can make things simpler.
Yeah, I'm using a third-party Python midi library. I tried to write my own library at first. Then, I realized that doing so would be far more pain than it was worth, and instead found some masochist (the guy who wrote the aforementioned library) who would do the work for me.

"Shining Phantom" said:
A MIDI2ORG converter would be moar cool (Iam waiting a long time for one)
That would definitely be nice... I think I'll take a look at that. Naturally, there's the problem of having only 8 instrumental tracks, and only one note on each... Plus, there's probably some bugs in the Org file format that would be encountered when doing this. But a very interesting idea!

Zecritic said:
I tried to do that awhile ago, but I gave up because I couldn't figure out how MIDI worked. You can check out my script here if you want.
Ah. I see. Your script looks much sounder and robuster (sp?) than what I'm doing. Would you mind if I used a bit of it? Specifically, the Org parsing code - My code has a nasty habit of buggering up every so often, and it's really inefficient.

Now, a question: Does anyone actually like making songs in the Org file format (whether OrgMaker/OrgAsm)? Because it seems to me to be rather cumbersome.

Also, tangentially and unrelatedly: Is there any way to use some sort of vBulletin default skin for the forums? Because all of the themes in the skin chooser are kind of big and bright and overly colorful.
 
Feb 24, 2007 at 7:30 PM
Junior Member
"Fresh from the Bakery"
Join Date: Jul 4, 2006
Location:
Posts: 19
Osmose said:
Tempo in OrgMaker is, simply put, a bitch. Seriously, I could never figure it out myself.
I'm pretty sure that OrgMaker's tempo (the "wait" value) is the length of a 16th note, in milliseconds.

Therefore, assuming that a quarter note is one beat:
BPM = 60/(Wait*0.004)

Anarch said:
Now, a question: Does anyone actually like making songs in the Org file format (whether OrgMaker/OrgAsm)? Because it seems to me to be rather cumbersome.
I've composed a couple of things in OrgMaker. They're not particularly good, but that's more my fault than the program's.


Also, there are some good Cave Story midis at the video game music archive.
 
Feb 24, 2007 at 8:05 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Well I've already converted MIDI2ORG and ORG2MIDI with my hands so its possible.
 
Jun 27, 2009 at 9:49 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 11, 2007
Location:
Posts: 6
Apologies for bumping this years-old thread; it's just that apparently my collection of midi files proved to be of use to GermanSeabass (whose stuff is, incidentally, excellent), so I figured I'd post a link to the new location of these files, in case somebody else might find them to be useful. Here: http://www.box.net/shared/ziu67o28i6
 
Jun 27, 2009 at 12:57 PM
Hax on....Hax off....
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 476
Cool.
Did you make these with the converter? I've wanted to be able to put my org music on my ipod so with this tool it will be much easier.
 
Jun 27, 2009 at 5:47 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Feb 11, 2007
Location:
Posts: 6
If you want to do that, you'll probably want to look into org->mp3 conversion. Somebody made a thread about that somewhere around here. I'd provide you with the conversion script, but it stopped working recently because I updated python or something like that.
 
Jun 27, 2009 at 11:22 PM
Hax on....Hax off....
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 476
Yeah I know about that but it's much easier to convert Midi to Mp3. If i convert my org music to Midi, I can change the tracks first and then use another program to convert it.

It's still probably better to just work out the settings on my sound card and record it.
 
Jun 28, 2009 at 9:22 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
Also, I can confirm that what Snarwin said about org tempo is correct, although I'd like to add that it depends on what time signature the music has.

wait value (milliseconds per click) * clicks per beat * beats per minute = 60000 (milliseconds per minute)

or

beats per minute = 60000 / (wait value * clicks per beat)

There are usually 4 clicks per beat so normally...

beats per minute = 15000 / wait value

Not difficult at all ;)
 
Jul 12, 2009 at 5:36 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
When converting the tempo, you should only calculate BPM for display purposes. MIDI files store the tempo as microseconds per quarter note.

x = milliseconds per OrgMaker step (the OrgMaker "wait" or "tempo" value)
y = microseconds per quarter note

If you want the
OrgMaker step to be a... then use... because...
======================== =========== =============================================================
quarter note y = 1000x there are 1000 microseconds in a millisecond
eighth note y = 2000x " " and there are 2 eighth notes in a quarter note
eighth note triplet y = 3000x " " and there are 3 eighth note triplets in a quarter note
sixteenth note y = 4000x " " and there are 4 sixteenth notes in a quarter note
sixteenth note triplet y = 6000x " " and there are 6 sixteenth note triplets in a quarter note


etc.

The "OrgMaker step" is the smallest time division in OrgMaker (the smallest segment of the grid, the smallest note you can make in OrgMaker). You probably wouldn't want to make that into a quarter note in the MIDI file, but I showed that above so you can see how the calculation works.


I've started making an ORG to MIDI converter of my own. I'll let you know how it comes out...

_____
Edit 2012-08-12: I'm now calling the smallest grid division a "step". Changed (OrgMaker tempo, wait value) to (the OrgMaker "wait" or "tempo" value). Changed text table from CODE to FONT.
 
Top