Product specifications
Source Code
29
@return: True if locked (bool)
"""
self.conn.open()
bytes = struct.pack('>B', 0x86 | synth)
self.conn.write(bytes)
bytes = self.conn.read(1)
checksum = self.conn.read(1)
self.conn.close()
#self._verify_checksum(bytes, checksum)
mask = (synth << 1) or 0x20
lock = struct.unpack('>B', bytes)[0] & mask
return lock > 0
def get_label(self, synth):
"""
Get synthesizer label or name
@param synth : synthesizer base address
@type synth : int
@return: str
"""
self.conn.open()
bytes = struct.pack('>B', 0x82 | synth)
self.conn.write(bytes)
bytes = self.conn.read(16)
checksum = self.conn.read(1)
self.conn.close()
#self._verify_checksum(bytes, checksum)
return bytes
def set_label(self, synth, label):
"""
Set synthesizer label or name
@param synth : synthesizer base address
@type synth : int
@param label : up to 16 bytes of text
@type label : str
@return: True if success (bool)
"""
self.conn.open()
bytes = struct.pack('>B16s', 0x02 | synth, label)
checksum = self._generate_checksum(bytes)
self.conn.write(bytes + checksum)
bytes = self.conn.read(1)
self.conn.close()
ack = struct.unpack('>B', bytes)[0]
return ack == ACK
def flash(self):
"""
Flash current settings for both synthesizers into non-volatile memory.
@return: True if success (bool)
"""
self.conn.open()
bytes = struct.pack('>B', 0x40)
checksum = self._generate_checksum(bytes)
self.conn.write(bytes + checksum)
bytes = self.conn.read(1)
self.conn.close()
ack = struct.unpack('>B', bytes)[0]
return ack == ACK