Another good MIDI summary can be found at .
What: Muzic Where: http://wiki.tcl.tk/muzic Description: Muzic is the Tcl MIDI music interface used in the Eolas Muse product. It provides a simple interface that allows the playing of notes and loading of SoundFonts from Tcl scripts. Updated: 08/2005 Contact: [email protected] What: midilib Where: http://www.uttis.de/midi/index.htm Description: A Tcl extension (MS Windows only) for low-level MIDI device interaction. Updated: 03/2001 Contact: [email protected] What: Tclmidi Where: http://jagger.me.berkeley.edu/~greg/tclmidi/ (broken) Description: Tcl extension (phrased on the site as if it were a language of its own) for creating and editing standard MIDI files. Made for 7.5; no compiled version available. Probably a challenge to compile. Updated: 06/2001 Contact: [email protected] What: TiSM Where: http://tism.sourceforge.net/ Description: TiSM is a real-time MIDI sequencer for Linux (in the style of midish [http://caoua.org/midish/]). It is written in C++, fully programmable with Tcl scripts and allows to process messages depending to the user needs. Updated: 07/2008 Contact: [email protected] What: vkeybd Where: http://www.alsa-project.org/~tiwai/alsa.html#vkeybd Description: Virtual MIDI Keyboard for the Linux AWE32 driver, OSS MIDI sequencer, or ALSA MIDI sequencer. It allows you to generate MIDI events on your computer without needing a hardware MIDI keyboard. Mainly written in Tcl/Tk. Updated: 08/2009 Contact: [email protected]
MDD 2003-12-19: FYI: When trying the midilib test code under tclkit 8.4.2, I get the following error:
couldn't load library "midi.dll": this library or a dependent library could not be found in library pathI get this error message even if I try to explicitly "load midi.dll" rather than using "package require"FW: I used a dependency walker and it looks like it's relying on 8.3 dlls. I just emailed the author about it, in case he's willing to dig it up and make the little change. At the moment, a workaround is possible by going into your Tcl directory and making a copy of tcl84.dll or tcl85.dll, or whatever version you may have, and renaming it to tcl83.dll. That lets the package load but it's crashing for me when I try to open an output - which might not even be related, mind you.Brian Theado: A few months ago, I recompiled midi.dll to be stubs enabled so I could use it with tclkit. I used msys to compile. I recall there being some compiler or linker errors and I took the short route of commenting out some functions that had to do with reading midi events. Since I was only interested in playing some notes on the midi synthesizer internal to my soundcard, losing the ability to read events didn't matter to me. My midi.dll file can be downloaded from .FW: I still get the same error on trying to open an output, on two different XP home machines, with either dll. So I think it's safe to say this is kind of a dodgy lib with or without dependency errors.TV 2004-05-11: A good midi lib is a nice idea, but a lot of barriers have been built it seems.About the above: I'm not sure midi stayed with version 1.0, there are later versions which define things like 'general midi', and there are a number of variations on the basic protocols, which drove midi synthesizer users nuts at times over the years.Mostly, the note on/note off messagas and basic controller messages (pitch bend, modulation wheel, monophonic aftertouch, program change), and probably midi active sensing (a repeated message to make clear the channel is still active and connected) and all-notes-off will work between synths, rack devices and computers. But *certainly* not always, unfortunately, due to protocol simplifications/extensions the some machines implement, and others don't.On the computer most midi files will play on every other machine, though real good compatibility is hard to achieve when all that is in MIDI messages is information about notes being played. When the other party has different sounds assigned to certain midi channels, the result can sound very different, and also the mix of the signals from various channels can be very differen.General Midi was a later attempt to resolve also some of these issues by having a set of standardized midi-instrument setups. That works to an extend. GM synth sounds tend to sound like computer midi renderings, though: major fun, but hardly interesting or funky or popular. There are always exceptions, of course, and playing a general midi file on a good computer program or extensive synth setup can give stunning results, too.I wouldn't mind doing something about the midi and tcl thing, though I'm inclined to do that with a separate process and a socket link. On a PC I'd pretty much have the code for most cases, see e.g. my String Simulator , which incidently has been developed with fellow help of Tcl/Tk, and still in principle can write tcl data.On linux/unix there should be a device for midi data, but unfortunately I can't test that in any working fashion at the moment. Driving the machine's midi-renderer I also don't know too much about, though I guess that is what people may want midi::playfile exa.mid or something.Live midi data is not the same as a midi file: a live stream is basically a 31.25 kb/s serial data stream, while a midi file usually has got timing information in it according to an standard. A renderer for midi files into something like a list of tcl-human readable events wouldn't be bad, and maybe interface with things like RS's TclMusic or my The BWise drum subwindow and driving a C-code sample processor program.In these days of the (sampling theoretic errors prone and usually more delaying than nice) computer sequencers, usually midi-plugins are made to make program modules communicate with midi sources like keyboards and sequence files.
lv: Anyone know of a good cross platform Tcl/Tk based midi player? I've tried using [timidity], but it doesn't seem to recognize the midi files that I have that play elsewhere (like on cell phones, etc.)
GN: Just use the Quicktime Tcl extension (win/mac)  it will let you load, play and export midi files from within Tcl/Tk
D. McC: Great, now what can you do on unix systems other than Mac OS X?
Marc van Doornik: After a bit of fiddling about, it seems that using MIDI in Linux is so obvious the solution is easily overlooked. Just use a MIDI device from the /dev/ directory and open it r/w as you would any other file. If you use the virtual MIDI card from the ALSA package (modprobe snd-virmidi) you can use the virtual ports named /dev/snd/midiCxDx in which the 'x'-es represent the virtual card number and its port number, respectively. Use format and scan to convert the data to/from hexadecimal and just read and puts 'til you drop.kbr: That does indeed work just like that on GNU/Linux. If you need more control over timing and routing though, it's probably better to check out the ALSA sequencer API. Even better nowadays is using JACK MIDI which gives you the benefit of being able to do what you need to do in a JACK callback.
LV: During Sept, 2005, on comp.lang.tcl, a thread  about music with tcl came up. jos decoster and andreas leitgeb both talk about having written some code relating somewhat to the topic.jos decoster: I made a Tcl package to manage MIDI files, check tclMIDI.I believe also muzic is another recent development.AMG: jdc's tclMIDI is distinct from the Greg Wolodkin's (?) Tclmidi listed in the links above.
LV Please add more MIDI resources!
See Also edit
- puredata (Pd)
- Provides a graphical programming environment for audio, video and MIDI, amongst other things.
- Open Sound Control, or OSC
- Often named as an alternative for MIDI. It has some (more or less interesting) differences to be checked out.