pysynth/wrappers/midi/midi.py
def decode(self, event):

        """
        Decodes a given MIDI event.

        We only support note on and off events as of now.
        """

        if isinstance(event, NoteOn):

            # Turn the given synth on:

            note = Note.from_num(event.note - 69)

            # Toggle the note:

            self.seq.start_note(note)

            return

        if isinstance(event, NoteOff):

            # Turn the given synth off:

            note = Note.from_num(event.note - 69)

            # Toggle the note:

            self.seq.stop_note(note)

        Decodes a given MIDI event.

        We only support note on and off events as of now.
        
Decodes a given MIDI event.
We only support note on and off events as of now.
Decodes a given MIDI event . We only support note on and off events as of now .
def decode(self, event):
        if isinstance(event, NoteOn):
            note = Note.from_num(event.note - 69)
            self.seq.start_note(note)
            return
        if isinstance(event, NoteOff):
            note = Note.from_num(event.note - 69)
            self.seq.stop_note(note)
def decode ( self , event ) : if isinstance ( event , NoteOn ) : note = Note . from_num ( event . note - 69 ) self . seq . start_note ( note ) return if isinstance ( event , NoteOff ) : note = Note . from_num ( event . note - 69 ) self . seq . stop_note ( note )
Decodes a given MIDI event.
Decodes a given MIDI event .
"""
        Decodes a given MIDI event.

        We only support note on and off events as of now.
        """ # Turn the given synth on: # Toggle the note: # Turn the given synth off: # Toggle the note:
self
event