diff --git a/circuit_samples.py b/circuit_samples.py index aa5a051..8d54877 100644 --- a/circuit_samples.py +++ b/circuit_samples.py @@ -29,10 +29,10 @@ #-------------------------------------------------- class circuit_samples(object): circuitHeader = (0x00, 0x20, 0x29, 0x00) - maxLength = 0x0023B000 + maxLength = 0x0057F000 - length = 0x0023B000 - offset = 0x0057F000 + offset = 0x0023B000 + length = 0 unpackedData = None checksum = 0 @@ -105,8 +105,8 @@ def readSysEx(self, filename): cmd = msg.data[4] if header == self.circuitHeader: if cmd == 0x77: - self.length = self.unpackNyble(msg.data[5:13]) - self.offset = self.unpackNyble(msg.data[13:21]) + self.offset = self.unpackNyble(msg.data[5:13]) + self.length = self.unpackNyble(msg.data[13:21]) if cmd == 0x79: self.unpackedData += self.unpack(bytes(msg.data[5:])) if cmd == 0x7a: @@ -123,8 +123,8 @@ def writeSysEx(self, filename, unpackedData): self.checksum = crc32(unpackedData) data = bytes(self.circuitHeader) + b"\x77" + \ - self.packNyble(self.length) + \ - self.packNyble(self.offset) + self.packNyble(self.offset) + \ + self.packNyble(self.length) messages.append(mido.Message('sysex', data=data)) while unpackedData: