com.softsynth.jmsl.score.midi
Class MidiScoreInstrument

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

public class MidiScoreInstrument
extends MidiInstrument
implements AttributeBuildable

Midi Instrument which is compatible with amplitude 0..1.

Author:
Nick Didkovsky, copyright 2000 Nick Didkovsky, all rights reserved

Field Summary
static double midiDelay
          This delay is used to synchronize with JSyn latency
 
Constructor Summary
MidiScoreInstrument()
           
MidiScoreInstrument(int channel)
           
 
Method Summary
 void buildFromAttributes()
          AttributeBuildable interface, used by SimpleXMLLoader.
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.
 
Methods inherited from class com.softsynth.jmsl.midi.MidiInstrument
close, getChannel, getMusicDevice, getNumOutputs, getOutput, getOutput, getProgram, noteOff, noteOn, off, on, open, print, setChannel, setProgram
 
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
 
Methods inherited from interface com.softsynth.jmsl.NoteOnOff
noteOnFor
 

Field Detail

midiDelay

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

Constructor Detail

MidiScoreInstrument

public MidiScoreInstrument()

MidiScoreInstrument

public MidiScoreInstrument(int channel)
Method Detail

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)