示例#1
0
 def test_sysex_deserialize_slot_reply(self):
     message = bytes([
         0xf0, 0x00, 0x00, 0x0e, 0x00, 0x3f, 0x66, 0x00, 0x03, 0x02, 0x7f,
         0x55, 0xf7
     ])
     r = SysexMessage.deserialize(message)
     assert r.type == 'slot_reply'
     assert r.model == AlesisVI49
     assert r.offset == 0x17f
     assert r.datum == 0x55
示例#2
0
    def test_sysex_deserialize_reply(self):
        m = AlesisV25()
        m.buttons.button1.cc = IntValue(0x55)

        q = SysexMessage('reply', m)
        b = q.serialize()

        r = SysexMessage.deserialize(b)
        assert r.type == 'reply'
        assert r.model.buttons.button1.cc.as_int() == 0x55
示例#3
0
 def _recv(self):
     while True:
         r = self._port.receive()
         if r.type == 'sysex':
             break
     return SysexMessage.deserialize(r.bin())
示例#4
0
 def test_deserialize_query_vmini(self):
     b = bytes([0xf0, 0x00, 0x00, 0x0e, 0x00, 0x49, 0x62, 0x00, 0x38, 0xf7])
     r = SysexMessage.deserialize(b)
     assert r.type == 'query'
示例#5
0
 def get_config(self):
     with open(self.filename, 'rb') as f:
         return SysexMessage.deserialize(f.read()).model
示例#6
0
def test_deserialize_query():
    b = bytes([0xf0, 0x00, 0x00, 0x0e, 0x00, 0x41, 0x62, 0x00, 0x5d, 0xf7])
    r = SysexMessage.deserialize(b)
    assert r.type == 'query'