Ejemplo n.º 1
0
 def _parse(self, data):
     self.send_reverb = helpers.parse_signed_byte(data[0])
     self.send_fx = helpers.parse_signed_byte(data[1])
     pad0 = data[2:4]
     self.priority = helpers.parse_signed_byte(data[4])
     self.mutegroup = helpers.parse_signed_byte(data[5])
     self.playback = helpers.parse_signed_byte(data[6])
     self.midi_channel = helpers.parse_signed_byte(data[7])
     self.midi_note = helpers.parse_signed_byte(data[8])
     self.midi_gate = helpers.parse_signed_byte(data[7])
     self.midi_noteoff = helpers.parse_signed_byte(data[8])
     pad1 = data[9]
     ffterminator = data[10:15]
     pad2 = data[15:]
Ejemplo n.º 2
0
 def _parse(self, data):
     self._fx_type_val = data[0]
     self._fx_type = helpers.pretty_fx_type(self._fx_type_val)
     self._fx_level = data[1]
     self._delay_left = helpers.parse_dword(data[2:4])
     self._delay_right = helpers.parse_dword(data[4:6])
     self._feedback_left = data[6]
     self._feedback_right = data[7]
     self._depth = data[8]
     self._rate = data[9]
     self._damping = helpers.parse_signed_byte(data[10])
     mystery_byte = data[11]
     """
Ejemplo n.º 3
0
 def test_parse_signed_byte_negative_two(self):
     value = b"FE"
     expected = -2
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 4
0
 def test_parse_signed_byte_negative_lowerbound(self):
     value = b"80"
     expected = -128
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 5
0
 def test_parse_signed_byte_positive_upperbound(self):
     value = b"7f"
     expected = 127
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 6
0
 def test_parse_signed_byte_positive_seven(self):
     value = b'7'
     expected = 7
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 7
0
 def test_parse_signed_byte_positive_one(self):
     value = b"01"
     expected = 1
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 8
0
 def test_parse_signed_byte_zero(self):
     value = b"00"
     expected = 0
     actual = target.parse_signed_byte(value)
     self.assertEqual(expected, actual)
Ejemplo n.º 9
0
 def test_signed_byte_int(self):
     expected = 7
     actual = target.parse_signed_byte(expected)
     self.assertEqual(expected, actual)
Ejemplo n.º 10
0
 def _parse(self, data, samples=None):
     # 0-47 if there's a sample. FF if not
     self._sample_index = helpers.parse_signed_byte(data[0])
     if self._sample_index >= 0 and self._sample_index != 255:
         self._sample_name = samples.get_sample_by_index(self._sample_index)
     else:
         self._sample_name = ""
     # mystery pad byte.
     byte2 = data[1]
     self.lvl_level = helpers.parse_signed_byte(data[2])
     self.lvl_pan = helpers.parse_signed_byte(data[3])
     self.lvl_decay = helpers.parse_signed_byte(data[4])
     pad0 = data[5:8]
     self.tone_tune = helpers.parse_signed_byte(data[8])
     self.tone_fine = helpers.parse_signed_byte(data[9])
     self.tone_cutoff = helpers.parse_signed_byte(data[10])
     self.vel_filtertype = helpers.parse_signed_byte(data[11])
     self.vel_decay = helpers.parse_signed_byte(data[12])
     self.vel_pitch = helpers.parse_signed_byte(data[13])
     self.vel_filter = helpers.parse_signed_byte(data[14])
     self.vel_level = helpers.parse_signed_byte(data[15])
     self.pad1 = data[16]
     self.term_pad = data[17:20]