public class Routing extends Object
+----- MidiEvent---+ | long tick | | +---MidiMesage-+ | | | | | | +--------------+ | +------------------*
Attention: The time stamps in "midi events", coming from a "midi standard file", and those coming with "MidiMessages" (as separate method parameters) have different meanings.
Modifier and Type | Class and Description |
---|---|
static class |
Routing.DemuxE |
static class |
Routing.DemuxM
A
Receiver receives a {link MidiMessage} and a time stamp. |
static class |
Routing.EventReceiver
A
Receiver receives a {link MidiMessage} and a time stamp. |
static class |
Routing.ToTrack |
Modifier and Type | Field and Description |
---|---|
protected static Pattern<Integer> |
any |
protected static Pattern<MidiEvent> |
anyE |
static Motif<MidiMessage,MidiEvent> |
content |
static Pattern<Integer> |
isChannelMessage |
static int |
midi_control_change |
static int |
midi_monophonic_aftertouch |
static int |
midi_note_off |
static int |
midi_note_on |
static int |
midi_pitchbend |
static int |
midi_polyphonic_aftertouch |
static int |
midi_program_change |
static int |
midi_system_message |
Constructor and Description |
---|
Routing() |
Modifier and Type | Method and Description |
---|---|
static int |
extract14bits(ShortMessage message) |
static int |
extractChannel(int m) |
static int |
extractCommand(int m) |
static int |
getKeyNumber(MidiMessage m)
ATTENTION: java-bytes are SIGNED, and must be converted to int to get their midi
meaning, wich is unsigned.
|
static Pattern<MidiMessage> |
keyM(Pattern<Integer> keyNumber) |
static void |
main(String[] args) |
static int |
packStatus(int code,
int channel) |
static Pattern<Integer> |
range_included(int from,
int to)
A pattern which matches any Integer in the range between the two bounds, both INCLUDED!
|
static Pattern<Integer> |
range(int from,
int to)
A pattern which matches any Integer in the range between the two bounds, lower included,
upper not.
|
static Pattern<MidiMessage> |
status(Pattern<Integer> statusByte) |
static Pattern<Integer> |
statusByte(Pattern<Integer> command,
Pattern<Integer> channel)
Constructs a Pattern for an integer which represents a status byte.
|
static Pattern<MidiEvent> |
statusByteE(Pattern<Integer> command,
Pattern<Integer> channel) |
static Pattern<MidiMessage> |
statusByteM(Pattern<Integer> command,
Pattern<Integer> channel)
Replace by content( statusByte(..,..))
|
static Pattern<Integer> |
system(Pattern<Integer> systemMessage) |
static Pattern<MidiEvent> |
systemE(Pattern<Integer> systemMessage) |
static Pattern<MidiMessage> |
systemM(Pattern<Integer> systemMessage) |
public static final int midi_note_on
public static final int midi_note_off
public static final int midi_polyphonic_aftertouch
public static final int midi_control_change
public static final int midi_program_change
public static final int midi_monophonic_aftertouch
public static final int midi_pitchbend
public static final int midi_system_message
public static Motif<MidiMessage,MidiEvent> content
public static int extractCommand(int m)
m
- the int value of a MidiMessage
status bytemidi_note_on
to midi_system_message
as defined in this class.public static int extractChannel(int m)
m
- the int value of a MidiMessage
status bytepublic static int extract14bits(ShortMessage message)
message
- a pitch bend messagepublic static int packStatus(int code, int channel)
code
- the int value of the command, packed into the higher nibble.
(May by based on zero or eight, since hi bit will be set anyhow.)channel
- value packed into the lower nibble.public static int getKeyNumber(MidiMessage m)
public static Pattern<Integer> range_included(int from, int to)
public static Pattern<Integer> range(int from, int to)
public static Pattern<Integer> statusByte(Pattern<Integer> command, Pattern<Integer> channel)
public static Pattern<MidiMessage> status(Pattern<Integer> statusByte)
public static Pattern<MidiMessage> statusByteM(Pattern<Integer> command, Pattern<Integer> channel)
public static Pattern<MidiEvent> statusByteE(Pattern<Integer> command, Pattern<Integer> channel)
public static Pattern<MidiMessage> systemM(Pattern<Integer> systemMessage)
public static Pattern<MidiMessage> keyM(Pattern<Integer> keyNumber)
public static void main(String[] args) throws InvalidMidiDataException, IOException
InvalidMidiDataException
IOException