Class PlayLurkingJSynInstrument

  extended by com.softsynth.jmsl.InstrumentAdapter
      extended by com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
          extended by com.softsynth.jmsl.jsyn.TunedSynthNoteInstrument
              extended by com.softsynth.jmsl.jsyn.JSynInsFromClassName
                  extended by com.softsynth.jmsl.jsyn.SynthNoteAllPortsInstrument
                      extended by jmslexamples.jsyn.PlayLurkingJSynInstrument
All Implemented Interfaces:
Instrument, Namable, OutputProvider, PlayLurker, Transposable, AttributeBuildable

public class PlayLurkingJSynInstrument
extends SynthNoteAllPortsInstrument
implements PlayLurker

This behaves just like a SynthNoteAllPortsInstrument playing a com.softsynth.jsyn.circuits.FilteredSawtoothBL, adding the PlayLurker interface so that it can be notified of elements being played by other objects. This could be used to create an arpeggiating instrument, for example, that listens to notes being played by a MusicShape or a MusicList or a JMSL Score Track.


 package jmslexamples.jsyn;
 import com.softsynth.jmsl.*;
 import com.softsynth.jmsl.score.jsyn.SynthNoteAllPortsInstrument;
 import com.softsynth.jsyn.*;
 public class PlayLurkingFSBLInstrument extends SynthNoteAllPortsInstrument implements PlayLurker {
     public PlayLurkingFSBLInstrument() {
         super(8, com.softsynth.jsyn.circuits.FilteredSawtoothBL.class.getName());
     public void notify(double playTime, com.softsynth.jmsl.MusicJob job, int index) {
         System.out.println("PlayLurkingFSBLInstrument being notified of index " + index + " being played");
     public static void main(String args[]) {
         try {
             String filename = "PlayLurkingFSBLInstrument.xml";
             PlayLurkingFSBLInstrument ins = new PlayLurkingFSBLInstrument();
             ins.setName("Play Lurking FilteredSawtoothBL ins");
    pout = new;
             (new com.softsynth.jmsl.score.util.SimpleXMLSaver(ins, "jmslscoreinstrument")).writeXML(pout);
             System.out.println("Wrote " + filename);
         } catch ( e) {
             System.out.println("ERROR in main: " + e);

Nick Didkovsky, July 23, 2002, (c) 2002 Nick Didkovsky all rights reserved

Field Summary
Fields inherited from class com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
Constructor Summary
          Hard coded to call super(8, com.softsynth.jsyn.circuits.FilteredSawtoothBL.class.getName());
Method Summary
static void main(java.lang.String[] args)
          Just instantiate an instrument and write out an XML file so it can be loaded into JMSL Score
 void notifyPlayLurker(double playTime, MusicJob job, int index)
          PlayLurker interface.
Methods inherited from class com.softsynth.jmsl.jsyn.SynthNoteAllPortsInstrument
buildDimensionNameSpace, buildFromAttributes, on, toString, update
Methods inherited from class com.softsynth.jmsl.jsyn.JSynInsFromClassName
getSynthContext, getSynthNoteClassName, setSynthContext, setSynthNoteClassName
Methods inherited from class com.softsynth.jmsl.jsyn.TunedSynthNoteInstrument
getTuning, setTuning
Methods inherited from class com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
close, getAllocator, getMaxVoices, getName, getNumOutputs, getOutput, getOutput, getPolyphonic, getUpdateDimension, off, off, open, play, setAllocator, setMaxVoices, setName, setSynthNote, setUpdateDimension
Methods inherited from class com.softsynth.jmsl.InstrumentAdapter
getDimensionNameSpace, getInterpreter, getMixerClassName, getMusicDevice, getTransposition, noteOff, noteOn, noteOnFor, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setTransposition
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public PlayLurkingJSynInstrument()
Hard coded to call super(8, com.softsynth.jsyn.circuits.FilteredSawtoothBL.class.getName());

Method Detail


public void notifyPlayLurker(double playTime,
                             MusicJob job,
                             int index)
PlayLurker interface. notify() is called by any MusicShape or MusicList which has this object in its list of PlayLurkers

Specified by:
notifyPlayLurker in interface PlayLurker


public static void main(java.lang.String[] args)
Just instantiate an instrument and write out an XML file so it can be loaded into JMSL Score