(self)
Generates lines for the music section of a .p8 file.

        Yields:
          One line.
Generates lines for the music section of a .p8 file.
Generates lines for the music section of a . p8 file .
def to_lines(self):
        """Generates lines for the music section of a .p8 file.

        Yields:
          One line.
        """
        for start_i in range(0, len(self._data), 4):
            fstop = (self._data[start_i+2] & 128) >> 7
            frepeat = (self._data[start_i+1] & 128) >> 7
            fnext = (self._data[start_i] & 128) >> 7
            p8flags = (fstop << 2) | (frepeat << 1) | fnext
            chan1 = self._data[start_i] & 127
            chan2 = self._data[start_i+1] & 127
            chan3 = self._data[start_i+2] & 127
            chan4 = self._data[start_i+3] & 127
            yield (
              bytes(util.bytes_to_hex(bytes([p8flags])), encoding='ascii') +
              b' ' +
              bytes(util.bytes_to_hex(bytes([chan1, chan2, chan3, chan4])),
                    encoding='ascii') +
              b'\n')
def to_lines ( self ) : for start_i in range ( 0 , len ( self . _data ) , 4 ) : fstop = ( self . _data [ start_i + 2 ] & 128 ) >> 7 frepeat = ( self . _data [ start_i + 1 ] & 128 ) >> 7 fnext = ( self . _data [ start_i ] & 128 ) >> 7 p8flags = ( fstop << 2 ) | ( frepeat << 1 ) | fnext chan1 = self . _data [ start_i ] & 127 chan2 = self . _data [ start_i + 1 ] & 127 chan3 = self . _data [ start_i + 2 ] & 127 chan4 = self . _data [ start_i + 3 ] & 127 yield ( bytes ( util . bytes_to_hex ( bytes ( [ p8flags ] ) ) , encoding = 'ascii' ) + b' ' + bytes ( util . bytes_to_hex ( bytes ( [ chan1 , chan2 , chan3 , chan4 ] ) ) , encoding = 'ascii' ) + b'\n' )