We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 22,033 times

Contents

Related Categories

Midi Synthesis in Java - Introduction

Michael H

Introduction

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!

Comments

  • Re: [2664] Midi Synthesis in Java

    Posted by spulka on 07 Apr 2006

    I am writing a simple program; the user will select instrument (from a drop-down menu), pitch and delay for the tone, and press the Play button. I understand playing sounds. ...

  • complete bare bones example

    Posted by KarlStroetmann on 18 Aug 2004

    Below is the complete code to play a scale.


    import java.util.*;
    import javax.sound.midi.*;

    class SoundTest
    {
       public static void main(String[] args) {
    try {
    Synthesiz...

  • How do I record

    Posted by Turtle on 28 Jan 2004

    Hi

    I have successfully synthesized note using midi/java. now I want to save a particular sequence as a midi file and also retrieve the sequence when needed... How do I do that????

    Thanking You
    ...

  • Writing

    Posted by leonjollans on 09 Sep 2002

    Thanks, I might just do that. ;) I found your article on a search for Java MIDI example code so I haven't been through the site yet. I do c# and ASP primarily but I really love Java (and I'm Sun Certi...

  • Posted by Michael H on 08 Sep 2002

    I may or may not try Sequencing, it depends if I find a tutorial on it.

    The reason I wrote this tutorial on Synthesizing is because I wanted to do it but was unable to find a tutorial. I figured ou...