Class MidiScoreInstrument

java.lang.Object
com.softsynth.jmsl.InstrumentAdapter
com.softsynth.jmsl.midi.MidiInstrument
com.softsynth.jmsl.score.midi.MidiScoreInstrument
All Implemented Interfaces:
Editable, Instrument, Namable, NoteOnOff, OutputProvider, Transposable, AttributeBuildable

public class MidiScoreInstrument
extends MidiInstrument
implements AttributeBuildable, Editable
Midi Instrument which is compatible with amplitude 0..1.
Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved
  • Field Details

    • midiDelay

      public static double midiDelay
      This delay is used to synchronize with JSyn latency
  • Constructor Details

    • MidiScoreInstrument

      public MidiScoreInstrument()
    • MidiScoreInstrument

      public MidiScoreInstrument​(int channel)
  • Method Details

    • play

      public double play​(double playTime, double timeStretch, double[] dar)
      input velocity is 0..1, which is then scaled to 0..127 and sent to Midi. Also observes midiDelay for synching with JSyn audio latency
      Specified by:
      play in interface Instrument
      Overrides:
      play in class InstrumentAdapter
    • buildFromAttributes

      public void buildFromAttributes()
      AttributeBuildable interface, used by SimpleXMLLoader. Calls programChange() on getProgram() on getChannel(), if program != -1.
      Specified by:
      buildFromAttributes in interface AttributeBuildable
    • openMidiDelayControlFrame

      public static void openMidiDelayControlFrame()
    • main

      public static void main​(java.lang.String[] args)
    • edit

      public void edit​(java.awt.Frame f)
      Description copied from interface: Editable
      Bring up a Dialog for editing, for example
      Specified by:
      edit in interface Editable
    • addEditListener

      public void addEditListener​(EditListener listener)
      Specified by:
      addEditListener in interface Editable
    • removeEditListener

      public void removeEditListener​(EditListener listener)
      Specified by:
      removeEditListener in interface Editable
    • setEditEnabled

      public void setEditEnabled​(boolean flag)
      Description copied from interface: Editable
      Set a flag. For example you might setEditEnabled(false) after first edit(), or you might hard code values for some Editable class and so want to disable editing.
      Specified by:
      setEditEnabled in interface Editable
    • getEditEnabled

      public boolean getEditEnabled()
      Specified by:
      getEditEnabled in interface Editable
      Returns:
      flag