Package com.softsynth.jmsl.score.midi
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 Summary
Fields Modifier and Type Field Description static doublemidiDelayThis delay is used to synchronize with JSyn latency -
Constructor Summary
Constructors Constructor Description MidiScoreInstrument()MidiScoreInstrument(int channel) -
Method Summary
Modifier and Type Method Description voidaddEditListener(EditListener listener)voidbuildFromAttributes()AttributeBuildable interface, used by SimpleXMLLoader.voidedit(java.awt.Frame f)Bring up a Dialog for editing, for examplebooleangetEditEnabled()static voidmain(java.lang.String[] args)static voidopenMidiDelayControlFrame()doubleplay(double playTime, double timeStretch, double[] dar)input velocity is 0..1, which is then scaled to 0..127 and sent to Midi.voidremoveEditListener(EditListener listener)voidsetEditEnabled(boolean flag)Set a flag.Methods inherited from class com.softsynth.jmsl.midi.MidiInstrument
clearMIDIProgramChangeTracker, close, getChannel, getMusicDevice, getNumOutputs, getOutput, getOutput, getProgram, noteOff, noteOn, off, on, open, print, setChannel, setProgram, useSparseMIDIProgramChangeMethods inherited from class com.softsynth.jmsl.InstrumentAdapter
getDimensionNameSpace, getInterpreter, getMixerClassName, getName, getTransposition, noteOnFor, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setName, setTransposition, toString, updateMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
midiDelay
public static double midiDelayThis 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:
playin interfaceInstrument- Overrides:
playin classInstrumentAdapter
-
buildFromAttributes
public void buildFromAttributes()AttributeBuildable interface, used by SimpleXMLLoader. Calls programChange() on getProgram() on getChannel(), if program != -1.- Specified by:
buildFromAttributesin interfaceAttributeBuildable
-
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:EditableBring up a Dialog for editing, for example -
addEditListener
- Specified by:
addEditListenerin interfaceEditable
-
removeEditListener
- Specified by:
removeEditListenerin interfaceEditable
-
setEditEnabled
public void setEditEnabled(boolean flag)Description copied from interface:EditableSet 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:
setEditEnabledin interfaceEditable
-
getEditEnabled
public boolean getEditEnabled()- Specified by:
getEditEnabledin interfaceEditable- Returns:
- flag
-