1 from MidiOutStream
import MidiOutStream
3 class MidiOutPassThrough(MidiOutStream
):
8 This class i mainly used for testing the event dispatcher. The
9 methods just returns the passed parameters as a tupple.
15 ## Midi channel events
18 def note_on(self
, channel
, note
, velocity
, time
=None):
19 return channel
, note
, velocity
, time
22 def note_off(self
, channel
, note
, velocity
, time
=None):
23 return channel
, note
, velocity
, time
26 def aftertouch(self
, channel
, note
, velocity
, time
=None):
27 return channel
, note
, velocity
, time
30 def continuous_controller(self
, channel
, controller
, value
, time
=None):
31 return channel
, controller
, value
, time
34 def patch_change(self
, channel
, patch
, time
=None):
35 return channel
, patch
, time
38 def channel_pressure(self
, channel
, pressure
, time
=None):
39 return channel
, pressure
, time
43 ## defined continuous controller events
50 def system_exclusive(self
, data
, time
=None):
54 def song_position_pointer(self
, hiPos
, loPos
, time
=None):
55 return hiPos
, loPos
, time
58 def song_select(self
, songNumber
, time
=None):
59 return songNumber
, time
62 def tuning_request(self
, time
=None):
67 #########################
68 # header does not really belong here. But anyhoo!!!
70 def header(self
, format
, nTracks
, division
):
71 return format
, nTracks
, division
81 def start_of_track(self
, n_track
=0):
85 def end_of_track(self
, n_track
=0, time
=None):
89 def sequence_number(self
, hiVal
, loVal
, time
=None):
90 return hiVal
, loVal
, time
93 def text(self
, text
, time
=None):
97 def copyright(self
, text
, time
=None):
101 def sequence_name(self
, text
, time
=None):
105 def instrument_name(self
, text
, time
=None):
109 def lyric(self
, text
, time
=None):
113 def marker(self
, text
, time
=None):
117 def cuepoint(self
, text
, time
=None):
121 def midi_port(self
, value
, time
=None):
125 def tempo(self
, value
, time
=None):
128 def smtp_offset(self
, hour
, minute
, second
, frame
, framePart
, time
=None):
129 return hour
, minute
, second
, frame
, framePart
, time
132 def time_signature(self
, nn
, dd
, cc
, bb
, time
=None):
133 return nn
, dd
, cc
, bb
, time
136 def key_signature(self
, sf
, mi
, time
=None):
140 def sequencer_specific(self
, data
, time
=None):
146 #####################
149 def timing_clock(self
, time
=None):
153 def song_start(self
, time
=None):
157 def song_stop(self
, time
=None):
161 def song_continue(self
, time
=None):
165 def active_sensing(self
, time
=None):
169 def system_reset(self
, time
=None):
176 if __name__
== '__main__':
178 midiOut
= MidiOutStream()
179 midiOut
.note_on(0, 63, 127, 0)
180 midiOut
.note_off(0, 63, 127, 384)