def format(self, patch, data): bitstream = BitStream(data) bitstream.write_bits(7, len(patch.ctrls)) for ctrl in patch.ctrls: param = ctrl.param bitstream.write_bitsa([7, 2, 8, 7], [ ctrl.midicc, param.module.area.index, param.module.index, param.index ]) return bitstream.tell_bit()
def format(self, patch, data): bitstream = BitStream(data) if len(patch.notes): lastnote = patch.lastnote if not lastnote: values = [ 64, 0, 0 ] else: values = [ lastnote.note, lastnote.attack, lastnote.release ] bitstream.write_bitsa([7, 7, 7], values) bitstream.write_bits(5, len(patch.notes)-1) for note in patch.notes: bitstream.write_bitsa([7, 7, 7], [note.note, note.attack, note.release]) else: bitstream.write_bits(24, 0x800000) bitstream.write_bits(24, 0x200000) return bitstream.tell_bit()
def format(self, patch, data): bitstream = BitStream(data) if len(patch.notes): lastnote = patch.lastnote if not lastnote: values = [64, 0, 0] else: values = [lastnote.note, lastnote.attack, lastnote.release] bitstream.write_bitsa([7, 7, 7], values) bitstream.write_bits(5, len(patch.notes) - 1) for note in patch.notes: bitstream.write_bitsa([7, 7, 7], [note.note, note.attack, note.release]) else: bitstream.write_bits(24, 0x800000) bitstream.write_bits(24, 0x200000) return bitstream.tell_bit()
def format(self, patch, data): bitstream = BitStream(data) bitstream.write_bits(16, NKNOBS) for knob in patch.knobs: bitstream.write_bits(1, knob.assigned) if not knob.assigned: continue module = knob.param.module bitstream.write_bitsa([2, 8, 2, 7], [ module.area.index, module.index, knob.isled, knob.param.index ]) if type(patch) == Performance: bitstream.write_bits(2, knob.slot) return bitstream.tell_bit()