Sound synthesis in Java

Real time sound synthesis in Java

Thomas Laskowski

The reason for writing these routines is that I wanted to play around with sound generating algorithms.  I chose Java mostly for it’s ease of use.  Java is a good experimentation platform because it’s so simple.  Once the algorithms are developed, they can easily be ported over to a more efficient language such as C++.

These algorithms are still in early development stages, however there is now enough code to synthesize sounds.

The current units are:

-Wavetable oscillator with four selectable waves
-Simple decay envelope
-Noise generator, for making percussive sounds
-Multimode filter

To demonstrate those units, the following classes were created:

-Playback class to simplify sound handling
-SimpleDrum and TestDrum
-SimpleSynth and TestSynth

Note: Java 1.3 or higher is required for these programs.

To test these programs out, put all the java files in one directory.  Make sure that classpath is pointing to current directory (under DOS, “set classpath=%classpath%;.”)

Then type “javac TestDrum.java” to compile a test drum program.
Or type “javac TestSynth.java” to compile a test synthesizer.

Type “java TestDrum” or “java TestSynth” to run either program.

Demo:

  1. No comments yet.
  1. No trackbacks yet.