MidiOutstream is Basically an eventhandler. It is the most central
class in the Midi library. You use it both for writing events to
an output stream, and as an event handler for an input stream.
This makes it extremely easy to take input from one stream and
send it to another. Ie. if you want to read a Midi file, do some
processing, and send it to a midiport.
All time values are in absolute values from the opening of a
stream. To calculate time values, please use the MidiTime and
MidiDeltaTime classes.
|
|
|
update_time(self,
new_time=0,
relative=1)
Updates the time, if relative is true, new_time is relative,
else it's absolute. |
source code
|
|
|
|
|
|
|
|
|
reset_run_stat(self)
Invalidates the running status |
source code
|
|
|
set_run_stat(self,
new_status)
Set the new running status |
source code
|
|
|
get_run_stat(self)
Set the new running status |
source code
|
|
|
set_current_track(self,
new_track)
Sets the current track number |
source code
|
|
|
get_current_track(self)
Returns the current track number |
source code
|
|
|
channel_message(self,
message_type,
channel,
data)
The default event handler for channel messages |
source code
|
|
|
note_on(self,
channel=0,
note=64,
velocity=64)
channel: 0-15
note, velocity: 0-127 |
source code
|
|
|
note_off(self,
channel=0,
note=64,
velocity=64)
channel: 0-15
note, velocity: 0-127 |
source code
|
|
|
aftertouch(self,
channel=0,
note=64,
velocity=64)
channel: 0-15
note, velocity: 0-127 |
source code
|
|
|
continuous_controller(self,
channel,
controller,
value)
channel: 0-15
controller, value: 0-127 |
source code
|
|
|
patch_change(self,
channel,
patch)
channel: 0-15
patch: 0-127 |
source code
|
|
|
channel_pressure(self,
channel,
pressure)
channel: 0-15
pressure: 0-127 |
source code
|
|
|
pitch_bend(self,
channel,
value)
channel: 0-15
value: 0-16383 |
source code
|
|
|
system_exclusive(self,
data)
data: list of values in range(128) |
source code
|
|
|
song_position_pointer(self,
value)
value: 0-16383 |
source code
|
|
|
song_select(self,
songNumber)
songNumber: 0-127 |
source code
|
|
|
|
|
midi_time_code(self,
msg_type,
values)
msg_type: 0-7
values: 0-15 |
source code
|
|
|
header(self,
format=0,
nTracks=1,
division=96)
format: type of midi file in [1,2]
nTracks: number of tracks
division: timing division |
source code
|
|
|
eof(self)
End of file. No more events to be processed. |
source code
|
|
|
meta_event(self,
meta_type,
data)
Handles any undefined meta events |
source code
|
|
|
start_of_track(self,
n_track=0)
n_track: number of track |
source code
|
|
|
end_of_track(self)
n_track: number of track |
source code
|
|
|
sequence_number(self,
value)
value: 0-16383 |
source code
|
|
|
|
|
copyright(self,
text)
Copyright notice
text: string |
source code
|
|
|
sequence_name(self,
text)
Sequence/track name
text: string |
source code
|
|
|
|
|
|
|
|
|
|
|
midi_ch_prefix(self,
channel)
channel: midi channel for subsequent data (deprecated in the spec) |
source code
|
|
|
midi_port(self,
value)
value: Midi port (deprecated in the spec) |
source code
|
|
|
tempo(self,
value)
value: 0-2097151
tempo in us/quarternote
(to calculate value from bpm: int(60,000,000.00 / BPM)) |
source code
|
|
|
smtp_offset(self,
hour,
minute,
second,
frame,
framePart)
hour,
minute,
second: 3 bytes specifying the hour (0-23), minutes (0-59) and
seconds (0-59), respectively. |
source code
|
|
|
time_signature(self,
nn,
dd,
cc,
bb)
nn: Numerator of the signature as notated on sheet music
dd: Denominator of the signature as notated on sheet music
The denominator is a negative power of 2: 2 = quarter
note, 3 = eighth, etc. |
source code
|
|
|
key_signature(self,
sf,
mi)
(+ve) that identifies the key signature (-7 = 7 flats, -1
= 1 flat, 0 = key of C, 1 = 1 sharp, etc). |
source code
|
|
|
sequencer_specific(self,
data)
data: The data as byte values |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|