Added MIDI type 1 support to the MidiConv tool

Topics on software tools like TileStudio, comments on documentation and tutorials (or the lack of) should go here.
Post Reply
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Added MIDI type 1 support to the MidiConv tool

Post by Artcfox »

I added MIDI type 1 support to the existing uzetools.jar file.

Example Usage:

Code: Select all

java -cp ~/uzebox/tools/JavaTools/dist/uzetools.jar org.uzebox.tools.converters.midi.MidiConvert -f 8 midisong.mid midisong.h
where midisong.mid may be either a type 0 MIDI file, or a type 1 MIDI file.

Now on Linux, you don't need to install wine just so you can run the gn1to0.exe tool every time you make a change to your midi file! :D

Edit: I originally was not able to rebuild uzetools.jar because TileMap.java was missing, but that's no longer the case. Just in case anyone comes across the build errors that I experienced, I'm leaving what I originally wrote here in the hopes that it might help someone:

When I originally tried to rebuild the uzetools.jar file using ant, I got a bunch of errors.The binary constant error can be fixed by bumping the java version number from 1.6 to 1.7 in the build.xml file, and the UTF-8 encoding issues can be fixed by running all of the offending files through a process like this:

Code: Select all

iconv -f ISO-8859-1 -t UTF-8//TRANSLIT /home/user/uzebox/tools/JavaTools/src/org/uzebox/tools/converters/gfx/Main.java -o /home/user/uzebox/tools/JavaTools/src/org/uzebox/tools/converters/gfx/Main.java.utf8
mv /home/user/uzebox/tools/JavaTools/src/org/uzebox/tools/converters/gfx/Main.java.utf8 /home/user/uzebox/tools/JavaTools/src/org/uzebox/tools/converters/gfx/Main.java
but I don't see where TileMap is defined (it looks like the file that is supposed to define what a TileMap is was not added to git), so I can't do a complete rebuild of the uzetools.jar file.

I was able to build the modified MidiConvert tool by deleting the tools/JavaTools/bin/org/uzebox/tools/converters/gfx/ and tools/JavaTools/bin/org/uzebox/tools/converters/xm/ directories, running ant in the main JavaTools directory, and then renaming uzetools.jar to MidiConv.jar[/size]
Last edited by Artcfox on Mon Feb 20, 2017 2:56 am, edited 1 time in total.
User avatar
D3thAdd3r
Posts: 3175
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Added MIDI type 1 support to the MidiConv tool

Post by D3thAdd3r »

Cool, that is a nice extra to have.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Added MIDI type 1 support to the MidiConv tool

Post by Artcfox »

D3thAdd3r wrote:Cool, that is a nice extra to have.
Now it is possible to go from Rosegarden -> Export MIDI -> .inc file on Linux using 100% native tools. I'm shocked at how few lines of code it required for the conversion.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Added MIDI type 1 support to the MidiConv tool

Post by Artcfox »

Thanks to Alec, I'm now able to rebuild the entire uzetools.jar package (TileMap.java was missing), so the standalone MidiConv.jar package that I made has now been removed, and all of the new MIDI goodness is contained in an updated uzetools.jar package (that is part of the git repository). I also added TileMap.java to the repository, so the uzetools.jar file should now be buildable by everyone.

I also updated the instructions in the beginning of this post to reflect this change.
Post Reply