JMSL Tutorial: JSyn and JMSL, Signal Processing Instruments
JSynUnitVoiceInstrument can process another signal. This is interesting because you have polyphonic signal processing available to you: play a MusicShape with a signal processing instrument, and multiple voices will be allocated as necessary, with independent parameters. The one requirement is that the Circuit that the signal processing JSynUnitVoiceInstrument uses must implement UnitSink (which implements getInput(), otherwise it would not be a signal processor!)
JSynUnitVoiceInstrument supports a method called addSignalSource(UnitOutputPort src), permitting you to take any JSyn UnitOutputPort 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!
Note that the source could also be the getOutput() of another JSynUnitVoiceInstrument, as for example:
// signal source
JSynUnitVoiceInstrument ins = new JSynUnitVoiceInstrument(8, SubtractiveSynthVoice.class.getName());
// signal processor
String className = com.softsynth.jmsl.jsyn2.unitvoices.SimpleDelay.class.getName();
JSynUnitVoiceInstrument signalProcessingIns = new JSynUnitVoiceInstrument(8, className);
signalProcessingIns.addSignalSource(ins.getOutput());
mixer.addInstrument(signalProcessingIns);
So now you could two MusicShapes playing simultaneously. One is playing a melody using the SubtractiveSynthVoice, the other is controlling an 8 voice polyphonic Delay unit, whose parameters are being changed over time. Pretty cool idea: a polyphonic delay instrument means you could send it a "chord" of different delay durations, and the instrument will allocate a new voice for each. So you could generate polyrhythmic delays, for example, and change them every few seconds, or in synch with the durations of the melody.
Here's another example of signal processing in JMSL, with source :
Finally, here's one more example, which shows you how you can just turn an instrument on() without having to perform it with a MusicShape. In this example, a JSynUnitVoiceInstrument that has a Delay in it is simply turned on and processes a melody performed by a different JSynUnitVoiceInstrument in a MusicShape. Here's the source
(C) 1997 Phil Burk and Nick Didkovsky, All Rights Reserved
JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.