JMSL Tutorial: Instruments and Interpreters

Here, we've declared a subclass of Instrument called PrintingInstrument, which overrides play() as described in the previous tutorial. We've also built a four dimensional MusicShape and plugged one of these PrintingInstruments into the MusicShape's Instrument. Here's how:
        myMusicShape.setInstrument(new PrintingInstrument());
The results are shown in the applet below. Note that the duration of each is the first element in the array.

You need a Java-enabled browser to view this applet.
View the complete source for this applet here.
Previous Tutorial Index Tutorial Contents Next

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