(cls, lines, version)
return result
Create an instance based on .p8 data lines.

        Args:
          lines: .p8 lines for the section.
          version: The PICO-8 data version from the game file header.
Create an instance based on .p8 data lines.
Create an instance based on . p8 data lines .
def from_lines(cls, lines, version):
        """Create an instance based on .p8 data lines.

        Args:
          lines: .p8 lines for the section.
          version: The PICO-8 data version from the game file header.
        """
        result = cls.empty(version=version)
        id = 0

        for line in lines:
            if len(line) != 169:
                continue
            editor_mode = int(line[0:2], 16)
            note_duration = int(line[2:4], 16)
            loop_start = int(line[4:6], 16)
            loop_end = int(line[6:8], 16)
            result.set_properties(id,
                                  editor_mode=editor_mode,
                                  note_duration=note_duration,
                                  loop_start=loop_start,
                                  loop_end=loop_end)
            note = 0
            for i in range(8, 168, 5):
                pitch = int(line[i:i+2], 16)
                waveform = int(line[i+2:i+3], 16)
                volume = int(line[i+3:i+4], 16)
                effect = int(line[i+4:i+5], 16)
                result.set_note(id, note,
                                pitch=pitch,
                                waveform=waveform,
                                volume=volume,
                                effect=effect)
                note += 1
            id += 1

        return result
def from_lines ( cls , lines , version ) : result = cls . empty ( version = version ) id = 0 for line in lines : if len ( line ) != 169 : continue editor_mode = int ( line [ 0 : 2 ] , 16 ) note_duration = int ( line [ 2 : 4 ] , 16 ) loop_start = int ( line [ 4 : 6 ] , 16 ) loop_end = int ( line [ 6 : 8 ] , 16 ) result . set_properties ( id , editor_mode = editor_mode , note_duration = note_duration , loop_start = loop_start , loop_end = loop_end ) note = 0 for i in range ( 8 , 168 , 5 ) : pitch = int ( line [ i : i + 2 ] , 16 ) waveform = int ( line [ i + 2 : i + 3 ] , 16 ) volume = int ( line [ i + 3 : i + 4 ] , 16 ) effect = int ( line [ i + 4 : i + 5 ] , 16 ) result . set_note ( id , note , pitch = pitch , waveform = waveform , volume = volume , effect = effect ) note += 1 id += 1 return result