Libtimidity

Timidity is a raw application. Libtimidity is a JS variant. This is more about LibtimidityJS.

Timidity++ generates a config file, but it doesn't have the config file in the install.
Libtimidity references the config file, but it appears to be encoded as a CSV parameter near the end of the script.
Midi.js is included in the package and is called by Libtimidity.js, so you don't need to call it. You only call the Libtimidity.js file.
It seems that the only deficiency is that it doesn't handle the stereo controller. I'm not sure that this is the case, but stereo doesn't seem to work in the browser. It may just be a limitation introduced by the browser.

The challenge with getting this up and running is that it doesn't come with a complete sound bank. Sound banks can be anywhere from 10-250MB or whatever.
There's no documentation as to how to acquire the set, the mapping structure, or how to possibly load another bank.
There are many soundfonts that have all of the files you'll need, but this plugin uses .PAT files, so you're better off finding a complete GUS PAT bank.

Jasmid vs Timidity

Jasmid is still very limited. Limited to very simple sine wave adjustments as your single program voice - 1 instrument.
Also, the sound isn't clean. Its a little crackly.

It's Alive!

Sound bank test

Song Tests
Midi theme 1
Midi theme 2
Midi theme 3
Midi theme 4
Midi theme 5
Midi theme 6

Stop Playback | Stop Playback v2

MIDI.js status: Initializing ...
MIDI.js audio time (s): -

Install

Head

This might be able to go in the footer. I didn't try it.

<script type='text/javascript' src='/sites/all/themes/mytheme/js/libtimidity/midi.js'></script>

Body

<a href="#" onClick="MIDIjs.play('midi/hinematov.mid');">Play hinematov.mid</a>
<a href="#" onClick="MIDIjs.stop();">Stop MIDI Playback</a>

Body Footer

<script type='text/javascript'>

  var message_span = document.getElementById('MIDIjs.message');
  message_span.innerHTML = MIDIjs.get_audio_status();

  MIDIjs.message_callback = display_status;
  function display_status(message) {
     message_span.innerHTML = message;
  };

  var time_span = document.getElementById('MIDIjs.audio_time');
  MIDIjs.player_callback = display_time;
  function display_time(player_event) {
     time_span.innerHTML = player_event.time;
  };

</script>

Patterns files

// These go in the PAT folder in:  ../js/libtimidity/pat/*HERE
// The drum files go in:           ../js/libtimidity/pat/MT32Drums/*HERE

Pattern Files

Gravis Ultrasound (GUS) Files and Pro Patches. Referred to as the GUS PAT Format.
This appears to be an old format, as I can't find a way to produce these files. It seems like something FLStudio should be able to do. It's basically a WAV file with a special header.
Apparently there's a Microsoft issue, as to why samples aren't easily found in the web.
I'm not at all sure what the licensing deal is for the Arachno or MT32Drums pat files.

It took me a while to find a full pattern set. In the end I found a project on GitHub. Just download the master and pull out the midi parts.

MT32 Copyright Status

https://en.wikipedia.org/wiki/Roland_MT-32
“It was subsequently proven that Roland Corporation had failed to properly register the MT-32's original ROM code in accordance with the Berne Convention Implementation Act, which came into force on March 1989. As such, the original ROM code of the MT-32 is in the public domain and can be freely used, distributed, and modified without the permission, express or implied, of the Roland Corporation.”
However, there’s no citation for this claim.

Arachno Copyright Status

Arachno sound font
Arachno SoundFont
arachno-soundfont-10-sf2
https://openmpt.org/openmpt-1-21-01-00-released
Authored by: Maxime Abbey
http://www.arachnosoft.com/main/soundfont.php
http://www.arachnosoft.com/main/soundfont.php?documentation
Looks like this could be a mess. Looks like all of the patches are from different sources.
Need to create an account and read the FAQ...
http://www.arachnosoft.com/main/interactive/forum.php?category=3-faq

Old notes for finding PAT files

http://www.vogons.org/viewtopic.php?t=16974

PAT Sets are in:
Timidity freepats / usr / …
Timidityusr /

I found a timidity PAT bank with CFG files - Gravis and Midia
http://linux-audio.com/TiMidity-howto.html
I have a Freepats 30MB Timidity PAT bank.

MT-32

At some point I was referencing the MT-32 standard. Not sure why. We're past that.
mt-32 is a roland synth
Roland LAPC-1 (an internal PC card version of the famous MT-32 sound module)

Midi Info

  Melodic Instruments (oldest first)
MT-32 128
GM 128
GS 226
XG1 480
XG2 1074
XG3 1149
GM2 256

Not sure which midi standard this setup uses.

MIDI instrument | Missing file | Replacement file

* This was a list of PAT files that triggered as missing, when the midi program started. The missing files issue was initially resolved by acquiring the files individually as needed, but it was ultimately resolved when I found the PAT bank on GitHub, linked above.

Project Notes

Looks like this approach might not be exact enough. I might have to do a midi file for each voice, if I cant find a config file.
The patch errors comes from Midi.js. One for each missing instrument.

The [.PAT] WAV files might be 'patch' files, not 'pattern' files.. not sure.

There is a class in Midi.js - scorioMIDI. This might be related to:
http://www.scorio.com/de_DE/web/scorio/technologies

arachno-126.pat 404 (Not Found)
Arachno soundfont:
https://www.dropbox.com/s/2rnpya9ecb9m4jh/arachno-soundfont-10-sf2.zip

Now, in theory, I can look at the mappings using a soundfont editor. Or, i can keep looking into proper configuration in the Libtimidity.js file.
Sound bank configuration is at the bottom of the JS file.
Timidity.cfg is written into this script as a CSV parameter set, it appears anyway.
Near > FS_createPath

​Issues

Looks like it might not be able to run on local.??

Console:
Uncaught ReferenceError: MIDIs is not defined
When both LibTim and Midi are loaded.

Might be some cross domain thing. Maybe the path is missing the protocol or something. Correct, it needs the base path.

Console:
VM11223 1:169 Uncaught SyntaxError: Unexpected token }
Probably means something is malformed in the midi file’s anchor wrapper.

Console: 
Uncaught ReferenceError: Module is not defined
When just Midi.js is loaded.

Console:
Uncaught ReferenceError: Module is not defined
When just LibTiMidity is loaded.
Click loads the midi into Midi.js status, but it doesn’t play.

447 reads • Last Modified: Monday, December 12, 2016