A comparison that a fellow community member drew between a project of his and Cemetech's longstanding, erstwhile converter to turn MIDI music files into mobileTunes 3.0-compatible files for playing on your calculator recently prompted me to look at that project once again. Over the past 36 hours, I greatly improved the converter's layer-merging algorithm, added a complex compression algorithm that I wrote from scratch that works with the existing mobileTunes 3.0 without any modification, and simplified the conversion routine. It now boils down to three simple steps:

Step 1: Select a MIDI file.
Step 2: Choose tracks from file to include (if it is a Type 1 MIDI file, as 95% of the files on the internet are). Preview individual tracks to pick the best ones and most representative ones to use.
Step 3: The converter will automatically dissect the chosen tracks and attempt to re-merge them into a maximum of four channels. Next, it will use a new form of the Longest Repeated Substring family of algorithms I wrote to try to compress the song, and return instantly-compilable ASM of the compressed and uncompressed song, ready for playing in mobileTunes 3.

Needless to say, not every song generates great-sounding on-calc music, but the converter strives to achieve the best possible results with no more than a few seconds of effort from the end-user. To fine-tune songs, you can easily try a different subset of the tracks in the original MIDI file and re-generate the compilable ASM.

The mobileTunes 3.0 converter, which I first wrote about five and a half years ago when I was still in high school, can understand and decode any Type 0 or Type 1 MIDI file, with any number of tracks. At one point, most available files were Type 0, but as a rough estimate from observation now puts the share of more complex, multi-track Type 1 files at 95%, the converter's ability to flawlessly handle such files greatly expands what would otherwise be a severe limitation on which songs could be used without tedious modifications of the songs before conversion. The layer-merging algorithm ensures that the result will be as true as possible to the original; one particular Zelda theme song I tried was properly merged from 40 tracks down to 4 channels of quadraphonic sound by the converter with zero notes lost. The format generated for assembly allows easy insertion of metadata, and offers a single value to change to speed up or slow down the resulting song as desired.

Feel free to head to the converter, give it a try, and post bug reports in the attached topic. Be patient with songs; if one doesn't work well, try a different set of tracks from it, or a different file. The best performance from the player is usually achieved when percussion tracks are omitted.

mobileTunes 3 Converter

Looking great! The compression is definitely a lot better Laughing

The converter I wrote I did in literally less than a day from when I first got the idea. And I had never used midi before so I was reading up on how the layout works online at the same time as I was coding which is why my converter is so basic. And although our players/converters are similar in concept, they are vastly different in application. Although it certainly wouldn't be difficult to write an MT3 player in Axe either. I should try that Smile

I have a question though about the chords. Each of the 4 channels is a monophonic frequency correct? If the chord is more than 4 notes, how do you decide which notes to keep and which ones to discard?
quigibo wrote:
Looking great! The compression is definitely a lot better 0x5
Thanks. Razz

quigibo wrote:
The converter I wrote I did in literally less than a day from when I first got the idea. And I had never used midi before so I was reading up on how the layout works online at the same time as I was coding which is why my converter is so basic. And although our players/converters are similar in concept, they are vastly different in application. Although it certainly wouldn't be difficult to write an MT3 player in Axe either. I should try that Smile
That would be nifty, I'd quite like to see that.

quigibo wrote:
I have a question though about the chords. Each of the 4 channels is a monophonic frequency correct? If the chord is more than 4 notes, how do you decide which notes to keep and which ones to discard?
I try to show preference to the initial channels that had the most notes, on the assumption that they are the most important. Of course, there are some situations where that is a poor choice, hence the occasional need for manual tweaking afterwards to make your songs sound as you'd like.
Nice Kerm, too bad I am not familiar on how to compile in z80 :/
qazz42 wrote:
Nice Kerm, too bad I am not familiar on how to compile in z80 :/
It's pretty straightfoward; all you need is notes.inc from the mobiletunes 3 zip, and SPASM, TASM, or Brass. You might need my BinPac8x tool as well. Let me know if you need any help with this. Were you suitably happy with the songs it came up with?
Yes, sorry if I caused trouble the other day, I had no idea that just changing the extension would not work
qazz42 wrote:
Yes, sorry if I caused trouble the other day, I had no idea that just changing the extension would not work
Not a problem. It turned out that part of the problem is that I forgot I forced it not to accept MIDI files over 100KB, because such files will put excessive load on my webserver while they're being parsed and processed.
Thats fine, I can understand that.
qazz42 wrote:
Thats fine, I can understand that.
Did you get a chance to try out assembling one of the songs yet? Let me know (and everyone else, please do the same) if you have troubles.
Ugghh, I dont know which is the easiest assembler to use?
qazz42 wrote:
Ugghh, I dont know which is the easiest assembler to use?
They're all pretty straightforward. If you decide to wait until I update the Doors CS SDK, you could simply grab that and use it, but it'll be several weeks at least until I get to it.
Kerm, I need a compile favor


can you, or anyone, put http://www.vgmuseum.com/mrp/multi/Music/cv1-%20Poison%20Mind(NICH2).mid through the converter, compile it, and send it to me?


Email is q25centfun@yahoo.com
qazz42 wrote:
Kerm, I need a compile favor


can you, or anyone, put http://www.vgmuseum.com/mrp/multi/Music/cv1-%20Poison%20Mind(NICH2).mid through the converter, compile it, and send it to me?


Email is q25centfun@yahoo.com
I'm afraid that that song (a 30-"track" Type 1 MIDI) didn't work too well. Am I correct that the song is Church of the Poisoned Mind? I checked out some alternative files, which seemed to work very nicely. If you're dead set on that, I'll try working with it a bit more.
Errr, no it is Poisoned mind from the castlevania series


it is usualy playes when you encounter a boss

Epic: http://www.youtube.com/watch?v=hb2VQmWQ-J8


If you cant do that, then how about http://castlevaniadungeon.net/Media/Midi/Heart_of_Fire_3.mid

If all else fails, here is a site with a whole lot of midi files to play with :/


http://www.vgmuseum.com/mrp/multi/midis.htm
OK, I'll see what I can do, would you mind reminding me later? Smile
Anything to get either poisoned mind or heart of fire on my calc


Wait, will MT3 have the same problems as calcmod did, remember the little problem I had with the 3.0-2.5 converter?
I tried converting this myself, and I'd have to agree with Kerm that it doesn't translate as well as you are probably hoping.

Here was the result, run with Asm()
POISONMD.8xp
quigibo wrote:
I tried converting this myself, and I'd have to agree with Kerm that it doesn't translate as well as you are probably hoping.

Here was the result, run with Asm()
POISONMD.8xp
I grabbed the multi-channel (8 channels, iirc) MIDI from here:

http://www.midishrine.com/index.php?id=36

It works amazingly in the mobileTunes converter. Here's the result with the only different being all the notes in octave 4 moved to octave 3 for the sake of sounding a little less shrill. It was a single find/replace with the power of Regex in Notepad++. Smile Tell me what you think, Qazz (also Quigibo).

http://www.cemetech.net/files/poismind.8xp [788 bytes]
Yeah, mine was 12 tracks (I have type 1 working in my converter now but I still need to fix a few bugs). I probably could have made it a little better if I removed some of the tracks but I just dragged it into the converter without any editing.

That one sounds pretty good Kerm. Definitely the lower octave helps with the base.
quigibo wrote:
Yeah, mine was 12 tracks (I have type 1 working in my converter now but I still need to fix a few bugs). I probably could have made it a little better if I removed some of the tracks but I just dragged it into the converter without any editing.

That one sounds pretty good Kerm. Definitely the lower octave helps with the base.
Thanks quigibo. Smile I'm thinking of attempting some of the other MIDIs on that page to see how they turn out.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement