JSyn
 
Tutorial
 

This tutorial teaches you how to add audio synthesis to your Java applications and Applets using JSyn. Before using this tutorial, you may wish to download and install the JSyn SDK. Then you can try out the techniques as you learn them. Note that additional documentation is also available online.

The  symbol indicates that the page includes an interactive JSyn program that you can hear.

Start here

How to Use the JSyn Tutorial
What is JSyn?

Basic Sound Output with JSyn

Creating, Connecting and Starting a Sine Wave Oscillator
Hearing a Sine Wave Oscillator 
Sound, Frequency and Amplitude
Hearing Frequency and Amplitude
Importing the JSyn Package
Catching SynthException
Starting the Synthesis Engine
Basic Template for a JSyn Application
Mixing Sounds Together
Hearing Mixed Sounds and Clipping

Waveform Shape Affects Timbre

What is Timbre?
Available Oscillator Waveforms
How is the Sawtooth Generated?
Generating Other Waveforms from the Sawtooth

Using JSyn Applets in a Web Page

Writing an Applet in Java
Basic Template for a JSyn Applet
Calling the Applet from HTML
Using a SynthContext to keep Applets from Interfering with Each Other

Making Circuits Using Multiple Unit Generators

Using One Oscillator to Control Another
Low Frequency Modulation
What are Circuits?
Building a Basic Circuit
Hear a Siren Circuit
Using the SoundTester to Test Circuits

Envelopes as a Modulation Source

What is an Envelope?
Creating an Envelope
Playing an Envelope
Using an Envelope to Control Amplitude
Playing Part of an Envelope (Sustain)
Hear a Sustained Note
Looping Part of an Envelope (Sustain Loop)
Hear a Sustain Loop
Modifying an Envelope
Changing the Envelope Playback Rate
Using Amplitude and Frequency Envelopes in a Circuit
A Theremin with Envelope Rate Scaling 
Using setSustainLoop() and queueOn()
Playing with Pitch Loops 

Time and Scheduled Events

Frames and Ticks
Playing a Sequence Using Relative Timing (Bad)
Hearing Relative Timing 
Playing a Sequence Using Absolute Timing (Better)
Hearing Absolute Timing
Playing a Sequence Using Advance Timing (Best)
Using the Event Buffer to Schedule Musical Events
Hearing Advance Timing

© 1997-2007 Mobileer Inc All Rights Reserved