JMSL Tutorial: JSyn and JMSL, play your hand-made instrument

We now build an JFrame that plays a MusicShape with a SineInstrument. The MusicShape is stuffed with duration, frequency, and amplitude data. A SineInstrument which interprets this data with a JSyn sine oscillator is plugged into the Instrument. When the MusicShape is launch()'ed, it runs through each of its elements, handing each to its Instrument, which makes the sound.

This example is strict in that it avoids any JSyn calls directly.  It instantiates a SineInstrument, queries it for its MusicDevice, opens an editor to test the device, opens the device, and proceeds.  If you follow this slightly more verbose technique, you will be writing code that is flexible and absorbs your future ideas and changes gracefully.

Check the source for this example here.  There's some algorithmic tools in the MusicShape building loop that you may not have seen before, like a 1/F generator and Gaussian distribution.



  (C) Nick Didkovsky, All Rights Reserved
  JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.