@@ -68,11 +68,6 @@ class MIDI:
6868
6969 """
7070
71- NOTE_ON = 0x90
72- NOTE_OFF = 0x80
73- PITCH_BEND = 0xE0
74- CONTROL_CHANGE = 0xB0
75-
7671 def __init__ (self , midi_in = None , midi_out = None , * ,
7772 in_channel = None , out_channel = 0 , in_buf_size = 30 , debug = False ):
7873 if midi_in is None and midi_out is None :
@@ -173,55 +168,6 @@ def send(self, msg, channel=None):
173168
174169 self ._send (data , len (data ))
175170
176- def note_on (self , note , vel , channel = None ):
177- """Sends a MIDI Note On message.
178-
179- :param int note: The note number. Must be 0-127.
180- :param int vel: The note velocity. Must be 0-127.
181-
182- """
183- self ._generic_3 (self .NOTE_ON , note , vel , channel )
184-
185- def note_off (self , note , vel , channel = None ):
186- """Sends a MIDI Note Off message.
187-
188- :param int note: The note number. Must be 0-127.
189- :param int vel: The note velocity. Must be 0-127.
190-
191- """
192- self ._generic_3 (self .NOTE_OFF , note , vel , channel )
193-
194- def pitch_bend (self , value , channel = None ):
195- """Send a MIDI Pitch Wheel message.
196-
197- :param int value: Range is 0-16383. A ``value`` of 8192 equates to no pitch bend, a value
198- of less than 8192 equates to a negative pitch bend, and a value of more
199- than 8192 equates to a positive pitch bend.
200-
201- """
202- self ._generic_3 (self .PITCH_BEND , value & 0x7F , value >> 7 , channel )
203-
204- def control_change (self , control , value , channel = None ):
205- """Sends a MIDI CC message.
206-
207- :param int control: The controller number. Must be 0-127.
208- :param int value: The control value. Must be 0-127.
209-
210- """
211- self ._generic_3 (self .CONTROL_CHANGE , control , value , channel )
212-
213- def _generic_3 (self , cmd , arg1 , arg2 , channel = None ):
214- if not 0 <= arg1 <= 0x7F :
215- raise RuntimeError ("Argument 1 value %d invalid" % arg1 )
216- if not 0 <= arg2 <= 0x7F :
217- raise RuntimeError ("Argument 2 value %d invalid" % arg2 )
218- if channel is None :
219- channel = self ._out_channel
220- self ._outbuf [0 ] = (cmd & 0xF0 ) | (channel & 0x0f )
221- self ._outbuf [1 ] = arg1
222- self ._outbuf [2 ] = arg2
223- self ._send (self ._outbuf , 3 )
224-
225171 def _send (self , packet , num ):
226172 if self ._debug :
227173 print ("Sending: " , [hex (i ) for i in packet [:num ]])
0 commit comments