be.hogent.tarsos.midi
Class MidiUtils

java.lang.Object
  extended by be.hogent.tarsos.midi.MidiUtils

public final class MidiUtils
extends java.lang.Object

MidiUtils provides a lot of MIDI messages. Also it can be used to build and send tuning messages to a receiver. Uses a lot of unmodified code from the gervill software package, licensed under the GPL with the classpath exception. Gervill source code

Author:
Karl Helgason

Nested Class Summary
static class MidiUtils.DestinationSettings
           
static class MidiUtils.DeviceControl
           
static class MidiUtils.GeneralMidiMessages
           
static class MidiUtils.KeyBasedInstrumentControl
           
static class MidiUtils.MidiTuningStandard
          See: the MIDI Tuning Messages specification.
 
Field Summary
static int ALL_DEVICES
           
 
Method Summary
static void sendTuningChange(javax.sound.midi.Receiver recv, int channel, int tuningpreset)
          Enables a tuning preset.
static void sendTunings(javax.sound.midi.Receiver recv, int bank, int preset, java.lang.String name, double[] tunings)
          Sends a MidiUtils.MidiTuningStandard.keyBasedTuningDump MIDI message to a receiver using the specified tuning in cents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_DEVICES

public static final int ALL_DEVICES
See Also:
Constant Field Values
Method Detail

sendTuningChange

public static void sendTuningChange(javax.sound.midi.Receiver recv,
                                    int channel,
                                    int tuningpreset)
                             throws javax.sound.midi.InvalidMidiDataException
Enables a tuning preset.

Parameters:
recv - the receiver to send the message to
channel - the channel to send the message on
tuningpreset - the index of the tuning preset
Throws:
javax.sound.midi.InvalidMidiDataException - if something goes awry.

sendTunings

public static void sendTunings(javax.sound.midi.Receiver recv,
                               int bank,
                               int preset,
                               java.lang.String name,
                               double[] tunings)
                        throws java.io.IOException,
                               javax.sound.midi.InvalidMidiDataException
Sends a MidiUtils.MidiTuningStandard.keyBasedTuningDump MIDI message to a receiver using the specified tuning in cents.

Parameters:
recv -
bank -
preset -
name -
tunings -
Throws:
java.io.IOException
javax.sound.midi.InvalidMidiDataException