openpiano.midi
Class MidiOutput

java.lang.Object
  extended by openpiano.midi.MidiOutput
All Implemented Interfaces:
Transmitter

public class MidiOutput
extends Object
implements Transmitter

The MidiOutput class transmits events to a selected MIDI out port

Version:
1.0, 07/30/08
Author:
Sascha Westermann

Constructor Summary
MidiOutput(MidiDevice.Info midiDevice)
          Constructs a new Transmitter to a MIDI out port
 
Method Summary
 void allNotesOff()
          Mutes all notes
 void allNotesOff(int channel)
          Mutes all notes on a specified channel
 void close()
          Closes the transmitter und mutes all sounds
 Receiver getReceiver()
          Returns the receiver for the transmitter
 void noteOff(ShortMessage midiMessage)
          Mutes a specified note
 void send(MidiMessage midiMessage)
          Sends a MIDI event to the synthesizer
 void setReceiver(Receiver receiver)
          Sets the receiver for the transmitter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiOutput

public MidiOutput(MidiDevice.Info midiDevice)
Constructs a new Transmitter to a MIDI out port

Parameters:
midiDevice - a MIDI out port
Method Detail

close

public void close()
Closes the transmitter und mutes all sounds

Specified by:
close in interface Transmitter

getReceiver

public Receiver getReceiver()
Returns the receiver for the transmitter

Specified by:
getReceiver in interface Transmitter
Returns:
the receiver for the transmitter

setReceiver

public void setReceiver(Receiver receiver)
Sets the receiver for the transmitter

Specified by:
setReceiver in interface Transmitter
Parameters:
receiver - the receiver for the transmitter

allNotesOff

public void allNotesOff()
Mutes all notes


allNotesOff

public void allNotesOff(int channel)
Mutes all notes on a specified channel

Parameters:
channel - the channel to mute

noteOff

public void noteOff(ShortMessage midiMessage)
Mutes a specified note

Parameters:
midiMessage - the specified note

send

public void send(MidiMessage midiMessage)
Sends a MIDI event to the synthesizer

Parameters:
midiMessage - the MIDI event