(self, id, note, pitch=None, waveform=None, volume=None,
                 effect=None)
Sets a note in a pattern.

        (See get_note() for definitions.)

        Args:
          id: The pattern ID. (0-63)
          note: The note number. (0-31)
          pitch: The pitch value, or None to leave unchanged. (0-63)
          waveform: The waveform type, or None to leave unchanged. (0-15)
          volume: The volume level, or None to leave unchanged. (0-7)
          effect: The effect type, or None to leave unchanged. (0-7)
Sets a note in a pattern.
Sets a note in a pattern .
def set_note(self, id, note, pitch=None, waveform=None, volume=None,
                 effect=None):
        """Sets a note in a pattern.

        (See get_note() for definitions.)

        Args:
          id: The pattern ID. (0-63)
          note: The note number. (0-31)
          pitch: The pitch value, or None to leave unchanged. (0-63)
          waveform: The waveform type, or None to leave unchanged. (0-15)
          volume: The volume level, or None to leave unchanged. (0-7)
          effect: The effect type, or None to leave unchanged. (0-7)
        """
        lsb = self._data[id * 68 + note * 2]
        msb = self._data[id * 68 + note * 2 + 1]

        if pitch is not None:
            assert 0 <= pitch <= 63
            lsb = (lsb & 0xc0) | pitch
        if waveform is not None:
            assert 0 <= waveform <= 15
            lsb = (lsb & 0x3f) | ((waveform & 3) << 6)
            msb = (msb & 0x7e) | ((waveform & 4) >> 2) | ((waveform & 8) << 4)
        if volume is not None:
            assert 0 <= volume <= 7
            msb = (msb & 0xf1) | (volume << 1)
        if effect is not None:
            assert 0 <= effect <= 7
            msb = (msb & 0x8f) | (effect << 4)

        self._data[id * 68 + note * 2] = lsb
        self._data[id * 68 + note * 2 + 1] = msb
def set_note ( self , id , note , pitch = None , waveform = None , volume = None , effect = None ) : lsb = self . _data [ id * 68 + note * 2 ] msb = self . _data [ id * 68 + note * 2 + 1 ] if pitch is not None : assert 0 <= pitch <= 63 lsb = ( lsb & 0xc0 ) | pitch if waveform is not None : assert 0 <= waveform <= 15 lsb = ( lsb & 0x3f ) | ( ( waveform & 3 ) << 6 ) msb = ( msb & 0x7e ) | ( ( waveform & 4 ) >> 2 ) | ( ( waveform & 8 ) << 4 ) if volume is not None : assert 0 <= volume <= 7 msb = ( msb & 0xf1 ) | ( volume << 1 ) if effect is not None : assert 0 <= effect <= 7 msb = ( msb & 0x8f ) | ( effect << 4 ) self . _data [ id * 68 + note * 2 ] = lsb self . _data [ id * 68 + note * 2 + 1 ] = msb