MIDI : Java Glossary
home M words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-01-22 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
CurrCon neededThe CurrCon Java Applet displays prices on this web page converted with today’s exchange rates into your local international currency, e.g. Euros, US dollars, Canadian dollars, British Pounds, Indian Rupees… CurrCon requires Java 1.1 or later, preferably 1.6.0_06 . If you can’t see the prices, of you if just want to learn more about CurrCon, click here for help.
MIDI
Musical Instrument Digital Interface. It is both a way of connecting to digital musical intruments and a way compactly recording music for playback by digital musical istruments or a software sythesiser in a computer.

MIDI came out in 1991. An augmented, upward compatible MIDI-2 came out in 1999. DLS (Downloadable Sounds) enables sampling, making sounds with a wavetable sound capture rather than mathematicallly. XMF (eXtensible Music Format) combines MIDI and DLS in one file.

The MIDI stream sent to instruments over the 5-pin DIN serial connection contains no embedded timing information. The notes are sent the instant they are intended to be played. MIDI files on the other hand need embedded timing information to track when to send the commands.

Trying Out Midi

So long as your browser has a midi player installed, just clicking on that link will cause it to play. Try it here:
click to listen Bach click to listen Jesu Joy of Man’s Desiring click to listen Maple Leaf Rag click to listen Ain’t Misbehavin
click to listen Ain’t we Got Fun click to listen The living Love catalyst click to listen The Bodyguard click to listen I Can see Clearly Now
click to listen The Impossible Dream click to listen Killing me Softly click to listen Do the Locomotion click to listen Puff The Magic Dragon
click to listen Start Me Up click to listen Take Five click to listen Wind Beneath My Wings click to listen The Pearl Fishers

Advantages and Disadvantage of MIDI

Playing those samples will point out MIDI’s big disadvantage. It can handle only synthesiser intrumentals, no voice. It can’t do speech or other arbitratry sounds. The big advantage is how quick it is to download compared with the other formats such as MP3. It is much more compact.

If you are a musician, you can modify MIDI files to use different instruments, and feed them into your digital musical instruments. You can also modify the music as you please, to change the tempo or even even the notes and durations.

Basically, MIDI just tells your computer to play middle C for 250 milliseconds sounding as best like a piano or a trumpet as it can. The quality of the sound card hardware and the software synthesiser in the computer playing the MIDI file has a lot to with how lush and realistic the performance sounds. It will sound totally different played on different computers. Only the timing and pitch will match.

There are at least 4 flavours of MIDI: MIDI 0, MIDI 1, RIFF MIDI 0, RIFF MIDI 1.

Using MIDI in HTML

To embed a MIDI file on your web page, all you need do is add some HTML like this:
<a href="../sound/bach2.mid">
. You usually want some sort of gif to indicate a playable link. Here is a simple way to embed a midi file and have it automatically play:
<EMBED SRC="../sound/bach2.mid" HIDDEN="TRUE" AUTOSTART="TRUE" ALIGN=LEFT>
It appears to work with Opera, IE and Netscape.

Using JavaScript, it is also possible to cause a song to start playing automatically as soon as a page is loaded.

Using MIDI in Java 1.1

Java 1.1 does not officially support MIDI music files, but on some browsers this trick will work:
getAppletContext().showDocument ( new URL ( getCodeBase(), "test.mid" ) );
They would need a Midi player installed. The music must exist in a file accessible via URL. You can’t use this trick to play some music you have sitting in a byte array.

MIDI in Java 1.3+

With JDK 1.3, Java supports MIDI in a massive way. javax.media.sound.midi provides interfaces and classes for I/O, sequencing, and synthesis of MIDI. javax.media.sound.midi.spi supplies interfaces for service providers to implement when offering new MIDI devices, MIDI file readers and writers, or sound bank readers.

Creating MIDI files

Normally you use music software to enter a score and arrange it. Hackers might enjoy reading up on the MIDI file spec and creating files programmatically with a hex editor. However Digital Ear : Real-time Audio (.wav ) to MIDI converter ! is a $130.00 USD is real time utility to convert midi to wav format, and astoundingly, wav to midi. That utility does much what a human would do listening to music and writing down the equivalent notation. The raw result needs touch up, at least to assign a voice, and requires a monphonic (single voice, no chords or polyphony) source, but it is a way of extracting compact, malleable midi from ordinary sound sources. If you use your own voice as input, it can correct pitch but preserve vibrato.

Convert MIDI to WAV or MP3
Crescendo
How to Generate MIDI files
Intelliscore: MP3 to MIDI
JMF: Java Media Framework streaming audio
MID Converter: shareware to convert MIDI to MP3 and other wave formats
MIDI Standards in Book Form
Piston MIDI to MP3 converter
Rhythm Tutor Student Project
Simple overview of how MIDI works
sound
Timidity: convert MIDI to MP3
Widisoft: Convert MP3 to MIDI

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 18,981. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/midi.html J:\mindprod\jgloss\midi.html