JSyn Features

by Phil Burk
(C) Phil Burk 1997 All Rights Reserved
Click here to return to Documentation Home Page.

What is JSyn?

JSyn is a package that allows Java programs to synthesize audio in real-time.  The synthesis is performed by native methods
written in 'C'.

Jsyn creates sound by connecting together various synthesis modules called unit generators.  Type of modules include oscillators, filters, sample players, delay units, etc.

JSyn Engine - The synthesis occurs in the JSyn Engine which is written in 'C' for optimal performance.  We are planning a port to a pure Java implementation that will use Standard JavaSound for audio I/O.

Applications or Applets - Java applications can call JSyn using the native method interface.  Java Applets can call JSyn through a PlugIn interface that allows Applets in a browser to use JSyn.  The user source code is the same for both types of interface.

Event Buffer - In order to achieve very accurate timing of musical events, JSyn supports a mechanism for time stamping events such as starting a unit generator, or setting a unit port parameter.  Thus several events can be time stamped for future execution at precise times.  Even if the application is busy or does not have good real-time response, the sound events will still be synthesized with accurate timing.

Sample and Envelope Queuing - Portions of a sample or envelope can be queued for playback by a sample or envelope unit generator. This could be used with a sample to queue the attack and sustain loop portions of an instrument.  When it is time to release the sample, the release portion of the sample is simply queued and will be played the next time the loop finishes. One could also do things like queue 7 short gun sounds to get a machine gun sound.  Queing events can be time stamped.

Sample Support - Playback of 16 bit sample data is supported.  The sample player can be connected to other units to allow filtering or other types of processing.  The sample rate and amplitude of the sample player can be controlled by other units as well.  AIFF and WAV format samples can be loaded from a file.

WaveTable Support - WaveTables can be accessed randomly by the unit generators that read them unlike samples which can only be accessed sequentially. Also, WaveTables may be stored internally in a floating point format.  WaveTables are useful for synthetic waveform generation, function lookup, and waveshaping.

Floating Point Precision - on general purpose CPUs, JSyn calculations are done in floating point for maximum sound fidelity.

Circuits - several units can be combined together into a circuit so that they can be started together simultaneously. This is particularly useful for preserving the phase relations of delay units.

Security - Because the engine is in 'C', it is important that a malevolent Java program cannot exploit the 'C' code to break security on the client machine.  The JSyn API, therefore,  has a number of features designed to enhance security. Most important, all calls from Java to 'C' are checked for valid parameters.  Pointers are never passed to the 'C' API because they are too easily corrupted.  All unit generators and data structures such as samples are referenced by integer tokens.  All memory which is referenced by the engine, including sample and envelope data, is allocated by the 'C' code.  All acess to that memory is through read and write methods.  References between objects, such as when a sample reader references a sample, are all tracked internally.  If an object such a sample is "deleted" by an application then the actual object deletion is deferred untill all references have been eliminated.  This prevents an application from pulling the rug out from under the synthesis engine.

Visit the JSyn Documentation Home Page.

© 1997-2009 Mobileer Inc All Rights Reserved