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 double
midiDelay
This delay is used to synchronize with JSyn latency -
Constructor Summary
Constructors Constructor Description MidiScoreInstrument()
MidiScoreInstrument(int channel)
-
Method Summary
Modifier and Type Method Description void
addEditListener(EditListener listener)
void
buildFromAttributes()
AttributeBuildable interface, used by SimpleXMLLoader.void
edit(java.awt.Frame f)
Bring up a Dialog for editing, for exampleboolean
getEditEnabled()
static void
main(java.lang.String[] args)
static void
openMidiDelayControlFrame()
double
play(double playTime, double timeStretch, double[] dar)
input velocity is 0..1, which is then scaled to 0..127 and sent to Midi.void
removeEditListener(EditListener listener)
void
setEditEnabled(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, useSparseMIDIProgramChange
Methods inherited from class com.softsynth.jmsl.InstrumentAdapter
getDimensionNameSpace, getInterpreter, getMixerClassName, getName, getTransposition, noteOnFor, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setName, setTransposition, toString, update
Methods 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:
play
in interfaceInstrument
- Overrides:
play
in classInstrumentAdapter
-
buildFromAttributes
public void buildFromAttributes()AttributeBuildable interface, used by SimpleXMLLoader. Calls programChange() on getProgram() on getChannel(), if program != -1.- Specified by:
buildFromAttributes
in 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:Editable
Bring up a Dialog for editing, for example -
addEditListener
- Specified by:
addEditListener
in interfaceEditable
-
removeEditListener
- Specified by:
removeEditListener
in interfaceEditable
-
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 interfaceEditable
-
getEditEnabled
public boolean getEditEnabled()- Specified by:
getEditEnabled
in interfaceEditable
- Returns:
- flag
-