JMSL Tutorial: JSyn and JMSL, Signal Processing Instruments

SynthNoteAllPortsInstrumentSP is a subclass of SynthNoteAllPortsInstrument, which you saw in the previous tutorial. SynthNoteAllPortsInstrumentSP behaves exactly the same way as its superclass by giving you control over all input ports. However, it requires that its SynthNote have a SynthInput called "input".

SynthNoteAllPortsInstrumentSP adds a method with the following signature:

    public void addSignalSource(Object signalSource);
... permitting you to take any JSyn SynthOutput and process it.  Playing a MusicShape with a signal processing instrument permits you to change its processing parameters over time, completely independently of the signal sources!

Here we present a simple delay line SynthNote designed in Wire.  See the patch diagram below.

IMPORTANT: A SynthNote, by definition, must have a "frequency" and an "amplitude" input port. JMSL's use of SynthNote assumes you follow this convention, so you must use this exact spelling. Of course you may name your other input ports anything you like.

Delay Line with Feedback, Wire diagram
 
 




The applet below takes the output of the SynthNoteAllPortsInstrument from the previous tutorial and routes its output to a SynthNoteAllPortsInstrumentSP which uses the delay patch above.

The essential code follows.

   // signal source
    ins = new SynthNoteAllPortsInstrument(8, "com.softsynth.jsyn.circuits.FilteredSawtoothBL");
   // signal processor
    insSP = new SynthNoteAllPortsInstrumentSP(8, signalProcessingSynthNoteClassName);


  // connect the signal source to the processor
  insSP.addSignalSource( ins.getOutput() );    // NOTE: any JSyn SynthOutput will work here!
 
  


You need a Java-enabled browser to view this applet. 
 

View complete source
 
 
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.