Class 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
  • 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 class SynthNoteAllPortsInstrument
    • buildFromAttributes

      public void buildFromAttributes()
      Deprecated.
      Specified by:
      buildFromAttributes in interface AttributeBuildable
      Overrides:
      buildFromAttributes in class SynthNoteAllPortsInstrument
    • 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 interface SignalProcessingInstrument
    • removeAllSignalSources

      public void removeAllSignalSources()
      Deprecated.
      JSynSignalProcessingInstrument interface.
      Specified by:
      removeAllSignalSources in interface SignalProcessingInstrument
    • 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(); } }