(cls, lines, version)
return cls(data=data, version=version)
Parse the music .p8 section into memory bytes.

        Args:
          lines: .p8 lines for the music section.
          version: The PICO-8 data version from the game file header.

        Returns:
          A Music instance with the loaded data.
Parse the music .p8 section into memory bytes.
Parse the music . p8 section into memory bytes .
def from_lines(cls, lines, version):
        """Parse the music .p8 section into memory bytes.

        Args:
          lines: .p8 lines for the music section.
          version: The PICO-8 data version from the game file header.

        Returns:
          A Music instance with the loaded data.
        """
        data = bytearray()
        for line in lines:
            if line.find(b' ') == -1:
                continue
            flagstr, chanstr = line.split(b' ')
            flags = bytes.fromhex(str(flagstr, encoding='ascii'))[0]
            fstop = (flags & 4) >> 2
            frepeat = (flags & 2) >> 1
            fnext = flags & 1

            chan1 = bytes.fromhex(str(chanstr[0:2], encoding='ascii'))
            chan2 = bytes.fromhex(str(chanstr[2:4], encoding='ascii'))
            chan3 = bytes.fromhex(str(chanstr[4:6], encoding='ascii'))
            chan4 = bytes.fromhex(str(chanstr[6:8], encoding='ascii'))
            data.append(chan1[0] | fnext << 7)
            data.append(chan2[0] | frepeat << 7)
            data.append(chan3[0] | fstop << 7)
            data.append(chan4[0])

        return cls(data=data, version=version)
def from_lines ( cls , lines , version ) : data = bytearray ( ) for line in lines : if line . find ( b' ' ) == - 1 : continue flagstr , chanstr = line . split ( b' ' ) flags = bytes . fromhex ( str ( flagstr , encoding = 'ascii' ) ) [ 0 ] fstop = ( flags & 4 ) >> 2 frepeat = ( flags & 2 ) >> 1 fnext = flags & 1 chan1 = bytes . fromhex ( str ( chanstr [ 0 : 2 ] , encoding = 'ascii' ) ) chan2 = bytes . fromhex ( str ( chanstr [ 2 : 4 ] , encoding = 'ascii' ) ) chan3 = bytes . fromhex ( str ( chanstr [ 4 : 6 ] , encoding = 'ascii' ) ) chan4 = bytes . fromhex ( str ( chanstr [ 6 : 8 ] , encoding = 'ascii' ) ) data . append ( chan1 [ 0 ] | fnext << 7 ) data . append ( chan2 [ 0 ] | frepeat << 7 ) data . append ( chan3 [ 0 ] | fstop << 7 ) data . append ( chan4 [ 0 ] ) return cls ( data = data , version = version )