JMSL Tutorial: JSyn and JMSL, writing a SynthCircuit by hand

Here we design a SynthCircuit by hand and create our own Instrument class.  This peak under the hood gives you a lot of power over the design of your own instruments, although most of the time you will be able to design arbitrary SynthNotes and simply hand them to JSynInsFromClassName

Our JSyn circuit will be a sine oscillator whose frequency and amplitude can be controlled from a JMSL Instrument. Since we use frequency and amplitude, the SynthNote subclass of SynthCircuit, which requires that these two inputs be defined, is the appropriate class for use to extend.

The MusicShape data will be straightforward:
duration  frequency    amplitude    holdtime
1.0       440.0         0.5         0.8
0.5       880.0         0.5         0.4
2.5      1880.0         0.5         2.0

It will be the task of the JMSL Instrument to extract this data from the MusicShape element, and hand it to a JSyn circuit.

Check the source for the simple JSyn circuit, called SineCircuit. Note that it extends SynthNote, which is a convenient subclass of SynthCircuit and includes a NoteOn() method. Our Instrument will later hit this noteOn() method.

Next, we will build a JMSL Instrument which controls one of these SineCircuits.
Previous Tutorial Index Tutorial Contents Next
  (C) 2003 Nick Didkovsky and Phil Burk, All Rights Reserved
JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.