Midi Synthesis in Java


Java's Midi package is javax.sound.midi, unlike some of the other media packages like the Java3D one, javax.media.j3d, it isn't under the javax.media namespace. This tutorial is specific to Midi Synthesis, so if you just want to know how to play a WAV File, this ain't for you. If in fact you just want to play a file, goto Java's Site and look for the info, it is there. Anyway, Java makes it rather easy compared to some other languages to do Midi Synthesis. The code to make a simple sound when a Swing JButton is pressed is about oh, 12-15 lines. That's about the size of an equally simple Java3D program. Also, most of those lines just set-up the synthesizer and midi channels and instruments. But enough blabbing, let's see some code!

You might also like...



Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens