MIDI file conversion?

Topics on software tools like TileStudio, comments on documentation and tutorials (or the lack of) should go here.
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: MIDI file conversion?

Post by DaveyPocket »

I'd really like to have this hodge podge of functions converted to discrete C/C++ console apps or C# one day. That would make them easier to just include in a make process.
If you need me to make a console app in C++, I might be able to do it. Also if you want it on Mac OS X I can do that too ;)
User avatar
uze6666
Site Admin
Posts: 4822
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MIDI file conversion?

Post by uze6666 »

I'm getting a handful or errors which I'm a bit lost how to handle...
Hey Clay, What version of Eclipse are you using? I'm using the "Ganymede" release. You can remove that line "import com.sun.xml.internal.ws.util.StringUtils;" this class is not even used!

Also, you can delete the whole package named "com.belogic.uzebox.tools.patchmaker" (or in other words, all .java files under \tools\UzeboxTools\src\com\belogic\uzebox\tools\patchmaker and do a refresh in the IDE) That's only good if you have the MIDI interface anyways.

Uze
User avatar
uze6666
Site Admin
Posts: 4822
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MIDI file conversion?

Post by uze6666 »

If you need me to make a console app in C++, I might be able to do it. Also if you want it on Mac OS X I can do that too ;)
Sure, not problem. But I think I'll skip the MIDI convertion too, since MIDI is a real pain, the MS APIs are completely different. I'll rather look at a MOD converter.

Uze
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: MIDI file conversion?

Post by havok1919 »

uze6666 wrote:
I'm getting a handful or errors which I'm a bit lost how to handle...
Hey Clay, What version of Eclipse are you using? I'm using the "Ganymede" release. You can remove that line "import com.sun.xml.internal.ws.util.StringUtils;" this class is not even used!
Yep, I've got Ganymede as well-- ripped out the import as you suggested... no more error. ;-)
Also, you can delete the whole package named "com.belogic.uzebox.tools.patchmaker" (or in other words, all .java files under \tools\UzeboxTools\src\com\belogic\uzebox\tools\patchmaker and do a refresh in the IDE) That's only good if you have the MIDI interface anyways.
...and got rid of that! No more errors. So of course I chose to copy and paste the one "convertSong" line that was missing an argument (ikari) as my template. :-P Anyway, figured that out and ran the converter finally!

"Exception in thread "main" java.lang.RuntimeException: MIDI file resolution must be 120. Currently:48"

Dammit! Ok, no worries... Over to Quartz Audiomaster, search the help for "resolution"... Care to guess? Supported values? 48, 96, 240, 480. I kid you not. :x

So, fine. I just went in the converter source, changed '120' to '48' and tweaked the tempo argument to compensate. :-P

Anyway, that actually ran and gave me some data and it plays something sort-of approximating my music (patch issues not withstanding)... BUT... I get a spurious reset shortly into things. Looks like it's going through a full cold-start.

Did my "replace" 120->48 hack break things, or possibly my song file boned something?

I've been dying to post this, so for now here's a 'no music' version and a 'short music->crash' version for comparison...

works, but no music...
http://www.embeddedengineeringllc.com/U ... en2008.hex

music, but only for a short time...
http://www.embeddedengineeringllc.com/U ... _crash.hex

I guess I'll read through the converter and see if I can understand what's going on.

If I left a cord or something in the arrangement would that cause a total failure like that maybe?

-Clay
User avatar
uze6666
Site Admin
Posts: 4822
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MIDI file conversion?

Post by uze6666 »

Really sorry you have all those problems, not easy to be the guinea pig huh ;) ! I'm wondering if its your sequencer that could add some additional crap that screws up the playback. There's not much bound checking on anything in the player, and most probably the cause of resets. So insure you don't use a patch (or note # for chan 4) whose number is greater than those you have in patches.inc. Same for the MIDI events/controller that must be supported and patch stream commands.
If I left a cord or something in the arrangement would that cause a total failure like that maybe?
Don't think so. It should cause some clicks or note cuts, since many notes are re-trigged rapidly on the same channel.

Send me your source midi file and the patch set your made(if any)? I think it's the fastest way I can help you on this one, since I really know what to look for.

Uze

ps: Holly crap, awesome little demo, you really did all that stuff!?! And very clever animation to never get more than 4 sprites per scanline :P ! And the tombstone writing... :lol:
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: MIDI file conversion?

Post by havok1919 »

uze6666 wrote:Really sorry you have all those problems, not easy to be the guinea pig huh ;) ! I'm wondering if its your sequencer that could add some additional crap that screws up the playback.
Entirely possible. I'm also pretty useless with Quartz Audiomaster. I just sort of flail around like a blind squirrel looking for nuts and finally beat it into something that looks usable. ;-)
Don't think so. It should cause some clicks or note cuts, since many notes are re-trigged rapidly on the same channel.
Control messages? (I think there's some pitch bend or something in the track-- or portamento/glide... I don't remember what was up to the synth and what was in the MIDI stream!)
Send me your source midi file and the patch set your made(if any)? I think it's the fastest way I can help you on this one, since I really know what to look for.
Cool! Thanks-- I'll PM it to you. I just used your patches-- first walk, then run. ;-)
ps: Holly crap, awesome little demo, you really did all that stuff!?! And very clever animation to never get more than 4 sprites per scanline :P ! And the tombstone writing... :lol:
Yeah, I was having fun with that one although I admit to stealing the idea for the graveyard and pumpkin from stuff I saw online. More than four sprites per line will be really cool if you get it going, but there's a lot of trickery to be done even without it. I used all the background tiles, so I had to use sprites for text, but that turned into a kind neat effect in itself. I've got lots of sprite tiles and flash left at the moment too. (Sprites are just the bats, skulls, text, and candle flame.) You can kinda steer the bats with the joypad too, but they're bats and all so they're kinda figgety. ;-) Glad you liked the tombstone, I wasn't sure if that would be recognizeable text or not...

-Clay
havok1919
Posts: 474
Joined: Thu Aug 28, 2008 9:44 pm
Location: Vancouver, WA
Contact:

Re: MIDI file conversion?

Post by havok1919 »

uze6666 wrote:Really sorry you have all those problems, not easy to be the guinea pig huh ;)
Realized that I didn't really respond to this-- no worries at all! In fact the kernel runs so damn well I'm amazed. Really solid for a beta release!

As for slogging through MIDI hell, half the problem is just that it's outside my comfort zone, but I do agree that a simple Amiga-style 4 track mod player would be ideal. Certainly a much lower learning curve I think.
So insure you don't use a patch (or note # for chan 4) whose number is greater than those you have in patches.inc. Same for the MIDI events/controller that must be supported and patch stream commands.
Now that is *very* possible. (Queue blind squirrel behaviour.) QuartzAM is f-ing complicated to figure out from scratch, so I really don't know how my patch numbers are working (or not). I wonder if it's just using the general MIDI software synth ones. Could certainly be the problem...

-Clay
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: MIDI file conversion?

Post by DaveyPocket »

About making the MIDI file conversion into a C++ console app, you said you might go with MOD, or that the MIDI conversion tool in Java isn't fully completed yet? I'm just trying to catch up on things, I was away for three days, I'm not sure if this is exactly right. And why do you want it to be converted into a C++ app anyway? Just curious.



Some updates on my Uzebox, I got the parts, and halfway through building it, I figured out that I forgot to order the oscillator :shock:
User avatar
uze6666
Site Admin
Posts: 4822
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: MIDI file conversion?

Post by uze6666 »

About making the MIDI file conversion into a C++ console app, you said you might go with MOD, or that the MIDI conversion tool in Java isn't fully completed yet? I'm just trying to catch up on things, I was away for three days, I'm not sure if this is exactly right. And why do you want it to be converted into a C++ app anyway? Just curious.
Yeah, for me, this whole MIDI thing is a mess. I wanted to have it done in C/C++, basically because it's generally more known (accessible?) than Java. Though afterward, I could not find any good MIDI libraries for C. Moreover MIDI is hard to grasp at first and, in the end, not the best tool when you have only 4 tracks. That's why I think a MOD tracker would be much better and easier tool. And last, but not the least, you would be able to hear your song exactly as it would sound on the console in the end.

Uze
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Re: MIDI file conversion?

Post by DaveyPocket »

I would also like to do MOD, I find it better than MIDI and a little easier to compose(for me that is). Can you find any MOD libraries for C++? Do you want the C++ app to be a Windows based application instead of a console app? Or would you like it to be a console app? :?
Post Reply