Пример #1
0
 def test_identity(self):
     env = envelope.Linear()
     expected = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0]
     function_tester(env, self, expected)
Пример #2
0
 def test_symmetry(self):
     env = envelope.Linear(symmetry=Fraction(1) / 3)
     expected = [0 / 32, 6 / 32, 12 / 32, 17 / 32, 20 / 32,
                 23 / 32, 26 / 32, 29 / 32, 0 / 32]
     function_tester(env, self, expected)
Пример #3
0
 def test_offset_and_scale(self):
     env = envelope.Linear(offset=0.05, scale=2)
     expected = [0.05, 0.25, 0.45, 0.65, 0.85,
                 1.05, 1.25, 1.45, 1.65, 1.85, 0.05]
     function_tester(env, self, expected)
Пример #4
0
 def test_period(self):
     env = envelope.Linear(period=2)
     expected = [i / 20 for i in range(20)] + [0]
     function_tester(env, self, expected, 10)
Пример #5
0
 def test_disable(self):
     env = envelope.Linear(base_value=0.5, enabled=False)
     expected = [0.5] * 11
     function_tester(env, self, expected)