Esempio n. 1
0
 def _setup_new_controller_wavetable(self):
     self.controller_wavetable_string = pd_wavetables.random_wavetable(partials=randint(3, 10))
     self.gateway.pd.send(["sys", "controller_wavetable", self.controller_wavetable_string])
     self.controller_wavetable = pd_wavetables._apply_wavetable(self.controller_wavetable_string)
     # the transitions are used for the single voices moving from one peak point to another
     self.rendezvous_transitions = wavetable_peaks.extract_peak_passages(
         self.controller_wavetable)
Esempio n. 2
0
def test_extract_peak_passages2(test_array):
    returned_downwards = wavetable_peaks.extract_peak_passages(test_array)['downwards']
    found = [entry for entry in returned_downwards
             if entry['deviation'] > 75 and
                entry['start'][0] == 2 and
                entry['in_between'][0][0] == 4 and
                entry['end'][0] == 5
    ]
    assert found
Esempio n. 3
0
def test_extract_peak_passages(test_array_short):
    returned = wavetable_peaks.extract_peak_passages(test_array_short)
    expected = {
        'downwards': [{
            'start': (2, 0.9), 'end': (3, 0.5), 'in_between': [], 'deviation': 1}, {
            'start': (5, 1.0), 'end': (2, 0.9), 'in_between': [(3, 0.5)],
                'deviation': 0.5 / (1.0 - 0.9)}, {
            'start': (5, 1.0), 'end': (3, 0.5), 'in_between': [], 'deviation': 1
            }],
        'upwards': [{
            'start': (2, 0.9), 'end': (5, 1.0), 'in_between': [(3, 0.5)],
                'deviation': 0.5 / (1.0 - 0.9)}, {
            'start': (3, 0.5), 'end': (2, 0.9), 'in_between': [], 'deviation': 1}, {
            'start': (3, 0.5), 'end': (5, 1.0), 'in_between': [], 'deviation': 1}
    ]}
    assert returned == expected