Package com.softsynth.jmsl.jsyn
Class SynthNoteAllPortsInstrumentSP
java.lang.Object
com.softsynth.jmsl.InstrumentAdapter
com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
com.softsynth.jmsl.jsyn.TunedSynthNoteInstrument
com.softsynth.jmsl.jsyn.JSynInsFromClassName
com.softsynth.jmsl.jsyn.SynthNoteAllPortsInstrument
com.softsynth.jmsl.jsyn.SynthNoteAllPortsInstrumentSP
- All Implemented Interfaces:
Instrument
,Namable
,OutputProvider
,SignalProcessingInstrument
,Transposable
,UpdatableInstrument
,AttributeBuildable
,Tunable
public class SynthNoteAllPortsInstrumentSP extends SynthNoteAllPortsInstrument implements SignalProcessingInstrument
Deprecated.
use the pure Java JSyn2 package instead
SignalProcessing Instrument.
This Instrument behaves just like SynthNoteAllPortsInstrument except that it
implements JSynSignalProcessingInstrument which defines
addSignalSource(SynthOutput signalSource). So the output from another
SynthCircuit or from some JSynInstrument.getoutput() can be sent into it for
SignalProcessing. play() bangs all the input ports of the signal processor.
The class name passed into the constructor *must* be a JSyn SynthNote that,
beside amplitude and frequency ports, has a public input port named "input"
on() and off() are implemented here, giving the user a finer grain of control
over the instrument
Note that this instrument is polyphonic so you could stack effects with
different parameters (for example in JScore, a chord with one of these
instruments could have different delay times on each note)
- Author:
- Nick Didkovsky, (c) 2002 Nick Didkovsky
-
Field Summary
Fields inherited from class com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
insNum
-
Constructor Summary
Constructors Constructor Description SynthNoteAllPortsInstrumentSP()
Deprecated.SynthNoteAllPortsInstrumentSP(int maxVoices, java.lang.String className)
Deprecated.The class name passed into the constructor *must* be a JSyn SynthNote that, besides amplitude and frequency ports, has a public input port named "input"SynthNoteAllPortsInstrumentSP(int maxVoices, java.lang.String className, com.softsynth.jsyn.SynthContext synthContext)
Deprecated. -
Method Summary
Modifier and Type Method Description void
addSignalSource(java.lang.Object signalSource)
Deprecated.JSynSignalProcessingInstrument interface.void
buildFromAttributes()
Deprecated.static void
main(java.lang.String[] args)
Deprecated.Filter white noise with a signal processing synthnote instrument public static void main(String args[]) { java.awt.Frame f = new java.awt.Frame("Closebox to quit"); f.setLayout(new java.awt.BorderLayout()); f.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { JMSL.closeMusicDevices(); System.exit(0); } }); f.setSize(300, 200); f.setVisible(true); JSynMusicDevice.instance().edit(f); JSynMusicDevice.instance().open(); JMSL.clock.setAdvance(0.5); JMSLRandom.randomize(); String synthNoteClassName = com.softsynth.jmsl.jsyn.circuits.BandPassSynthNote.class.getName(); SynthNoteAllPortsInstrumentSP ins = new SynthNoteAllPortsInstrumentSP(); ins.setMaxVoices(1); ins.setSynthNoteClassName(synthNoteClassName); try { ins.buildFromAttributes(); JMSLMixerContainer mixer = new JMSLMixerContainer(); mixer.start(); mixer.addInstrument(ins); f.add(java.awt.BorderLayout.NORTH, mixer.getPanAmpControlPanel()); MusicShape naiveMusicShape = new MusicShape(5); naiveMusicShape.setDimensionName(4, "Q"); // dimensions 0..3 will be copied across to instrument's double[] as standard invariants // so just need to define dimensions above 3 whose names match instrument ports for (int i = 0; i < 17; i++) { double dur = JMSLRandom.choose(0.1, 0.4); double pitch = JMSLRandom.choose(1, 128); double amp = JMSLRandom.choose(0.2, 1.0); int indexOfQ = ins.getDimensionNameSpace().getDimension("Q"); double q = JMSLRandom.choose( ins.getDimensionNameSpace().getLowLimit(indexOfQ), ins.getDimensionNameSpace().getHighLimit(indexOfQ)); naiveMusicShape.add(dur, pitch, amp, dur, q); } naiveMusicShape.setInstrument(ins); naiveMusicShape.setRepeats(1000); // Signal source WhiteNoise noise = new WhiteNoise(); noise.start(); ins.addSignalSource(noise.output); naiveMusicShape.launch(JMSL.now()); com.softsynth.jmsl.view.MusicShapeEditor se = new com.softsynth.jmsl.view.MusicShapeEditor(); se.addMusicShape(naiveMusicShape); f.add(java.awt.BorderLayout.SOUTH, se.getComponent()); f.pack(); } catch (Exception e2) { e2.printStackTrace(); } }void
removeAllSignalSources()
Deprecated.JSynSignalProcessingInstrument interface.java.lang.String
toString()
Deprecated.Methods inherited from class com.softsynth.jmsl.jsyn.SynthNoteAllPortsInstrument
buildDimensionNameSpace, on, 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
Methods inherited from interface com.softsynth.jmsl.Instrument
close, getDimensionNameSpace, getInterpreter, getMixerClassName, getMusicDevice, off, on, open, play, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, update
Methods inherited from interface com.softsynth.jmsl.OutputProvider
getNumOutputs, getOutput, getOutput
Methods inherited from interface com.softsynth.jmsl.Transposable
getTransposition, setTransposition
-
Constructor Details
-
SynthNoteAllPortsInstrumentSP
public SynthNoteAllPortsInstrumentSP()Deprecated. -
SynthNoteAllPortsInstrumentSP
public SynthNoteAllPortsInstrumentSP(int maxVoices, java.lang.String className)Deprecated.The class name passed into the constructor *must* be a JSyn SynthNote that, besides amplitude and frequency ports, has a public input port named "input" -
SynthNoteAllPortsInstrumentSP
public SynthNoteAllPortsInstrumentSP(int maxVoices, java.lang.String className, com.softsynth.jsyn.SynthContext synthContext)Deprecated.
-
-
Method Details
-
toString
public java.lang.String toString()Deprecated.- Overrides:
toString
in classSynthNoteAllPortsInstrument
-
buildFromAttributes
public void buildFromAttributes()Deprecated.- Specified by:
buildFromAttributes
in interfaceAttributeBuildable
- Overrides:
buildFromAttributes
in classSynthNoteAllPortsInstrument
-
addSignalSource
public void addSignalSource(java.lang.Object signalSource)Deprecated.JSynSignalProcessingInstrument interface. Use this to bus another output of some SynthNote or JSynInstrument to this Signal Processing Instrument- Specified by:
addSignalSource
in interfaceSignalProcessingInstrument
-
removeAllSignalSources
public void removeAllSignalSources()Deprecated.JSynSignalProcessingInstrument interface.- Specified by:
removeAllSignalSources
in interfaceSignalProcessingInstrument
-
main
public static void main(java.lang.String[] args)Deprecated.Filter white noise with a signal processing synthnote instrument public static void main(String args[]) { java.awt.Frame f = new java.awt.Frame("Closebox to quit"); f.setLayout(new java.awt.BorderLayout()); f.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent e) { JMSL.closeMusicDevices(); System.exit(0); } }); f.setSize(300, 200); f.setVisible(true); JSynMusicDevice.instance().edit(f); JSynMusicDevice.instance().open(); JMSL.clock.setAdvance(0.5); JMSLRandom.randomize(); String synthNoteClassName = com.softsynth.jmsl.jsyn.circuits.BandPassSynthNote.class.getName(); SynthNoteAllPortsInstrumentSP ins = new SynthNoteAllPortsInstrumentSP(); ins.setMaxVoices(1); ins.setSynthNoteClassName(synthNoteClassName); try { ins.buildFromAttributes(); JMSLMixerContainer mixer = new JMSLMixerContainer(); mixer.start(); mixer.addInstrument(ins); f.add(java.awt.BorderLayout.NORTH, mixer.getPanAmpControlPanel()); MusicShape naiveMusicShape = new MusicShape(5); naiveMusicShape.setDimensionName(4, "Q"); // dimensions 0..3 will be copied across to instrument's double[] as standard invariants // so just need to define dimensions above 3 whose names match instrument ports for (int i = 0; i < 17; i++) { double dur = JMSLRandom.choose(0.1, 0.4); double pitch = JMSLRandom.choose(1, 128); double amp = JMSLRandom.choose(0.2, 1.0); int indexOfQ = ins.getDimensionNameSpace().getDimension("Q"); double q = JMSLRandom.choose( ins.getDimensionNameSpace().getLowLimit(indexOfQ), ins.getDimensionNameSpace().getHighLimit(indexOfQ)); naiveMusicShape.add(dur, pitch, amp, dur, q); } naiveMusicShape.setInstrument(ins); naiveMusicShape.setRepeats(1000); // Signal source WhiteNoise noise = new WhiteNoise(); noise.start(); ins.addSignalSource(noise.output); naiveMusicShape.launch(JMSL.now()); com.softsynth.jmsl.view.MusicShapeEditor se = new com.softsynth.jmsl.view.MusicShapeEditor(); se.addMusicShape(naiveMusicShape); f.add(java.awt.BorderLayout.SOUTH, se.getComponent()); f.pack(); } catch (Exception e2) { e2.printStackTrace(); } }
-