The Midi Kit Table of Contents | The Midi Kit Index |
Derived from: public BMidi
Declared in: be/midi/MidiText.h
Library: libmidi.so
A BMidiText object prints, on standard output, a text description of each MIDI message it receives. You use BMidiText objects to debug and monitor your application; it has no other purpose.
To use a BMidiText object, you construct it and connect it to some other BMidi object as shown below:
BMidiText midiText; otherMidiObj.Connect(midiText); otherMidiObj.Start();
BMidiText's output (the text it displays) is timed: When it receives a MIDI message that's timestamped for the future, the object waits until that time has come before it displays its message. While it's waiting, the object won't process any other in-coming messages. Because of this, you shouldn't connect the same BMidiText object to more than one BMidi object. To monitor two or more MIDI-producing objects, you should connect a separate BMidiText object to each.
The text that's displayed by a BMidiText follows this general format:
timestamp: MESSAGE TYPE; message data
(Message-specific formats are given in the section "Output Text" on page40.) Of particular note is the timestamp field. Its value is the number of milliseconds that have elapsed since the object received its first message. The time value is computed through the use of an internal timer; to reset this timer—a useful thing to do between performances, for example—you call the ResetTimer() function.
The BMidiText class doesn't generate or spray MIDI messages, so the performance and connection functions that it inherits from BMidi have no effect.
|
The constructor creates a new BMidiText object. The object's timer is set to zero and doesn't start ticking until the first message is received. To force the timer to start, call ResetTimer(true).
The destructor destroys the object.
|
Sets the object's internal timer to zero. If start is false the timer doesn't start ticking until the next MIDI message is received. If start is true, the timer begins immediately.
The timer value is used to compute the timestamp that's displayed at the beginning of each message description.
The text strings that a BMidiText object displays are shown below, listed by MIDI event
timestamp: CHANNEL PRESSURE; channel = channel, pressure = pressure
timestamp: CONTROL CHANGE; channel = channel, control = ctrl_num,
value = ctrl_value
timestamp: KEY PRESSURE; channel = channel, note = note, pressure = pressure
timestamp: NOTE OFF; channel = channel, note = note, velocity = velocity
timestamp: NOTE ON; channel = channel, note = note, velocity = velocity
timestamp: PITCH BEND; channel = channel, lsb = lsb, msb = msb
timestamp: PROGRAM CHANGE; channel = channel, program = program_num
timestamp: SYSTEM COMMON; status = status, data1 = data1, data2= data2
timestamp: SYSTEM EXCLUSIVE;
Followed by the data itself (in hex, byte-by-byte), starting on the next line.
timestamp: SYSTEM REAL TIME; status = status
The Midi Kit Table of Contents | The Midi Kit Index |
Copyright © 2000 Be, Inc. All rights reserved..