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

We now build an Applet 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 applet is strict in that it avoid any JSyn calls directly.  It instantiates a SineInstrument, gets its MusicDevice, pops open an editor to test the device, opens the device, and proceeds.  Applet.stop calls JMSL.closeMusicDevices() .  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 Applet 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..

You need a Java-enabled browser to view this applet. 
 
Previous Tutorial Index Tutorial Contents Next



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