de.humatic.mmj
Class MidiOutput

java.lang.Object
  extended by de.humatic.mmj.MidiOutput

public class MidiOutput
extends java.lang.Object

An opened Midi output to which the application sends Midi.


Method Summary
 void close()
           
 CoreMidiDevice getDeviceInfo()
          Returns a CoreMidiDevice object that holds general information on the hard- or software device this port belongs to or null if the port is virtual.
 java.lang.String getName()
           
 void sendMidi(byte[] data)
          Sends raw Midi bytes immediately.
 void sendMidi(byte[] data, long time)
          Sends raw Midi bytes scheduled at %time.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

close

public void close()

sendMidi

public void sendMidi(byte[] data)
Sends raw Midi bytes immediately. It is in the application's responsibility to provide valid Midi messages.


sendMidi

public void sendMidi(byte[] data,
                     long time)
Sends raw Midi bytes scheduled at %time. When using mmj standalone, time is expressed in microseconds and in relation to HostTime. So, to send a message 10 seconds from now, call sendMidi(databytes, MidiSystem.getHostTime()+10000000).
When using mmj via the javax.sound.midi SPI - where you do not call this method directly, but rather call something like: receiver.send(MidiMessage midiMessage, long timestamp) - time is expressed in microseconds and in relation to the current device time as returned by MidiDevice.getMicrosecondPosition(). So to send a message 10 seconds from now, call sendMidi(databytes, myMidiDevice.getMicrosecondPosition()+10000000).
Events scheduled > 100msec in the past are discarded.
All time values <= 0 will cause immediate delivery in both use cases.
It is in the application's responsibility to provide valid Midi messages in %data.


getName

public java.lang.String getName()

getDeviceInfo

public CoreMidiDevice getDeviceInfo()
Returns a CoreMidiDevice object that holds general information on the hard- or software device this port belongs to or null if the port is virtual.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object