-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8_1_1_make_64x367_from_256_2048.pyscript
42 lines (25 loc) · 1.11 KB
/
8_1_1_make_64x367_from_256_2048.pyscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""Elektron stuff"""
# from enveditor import Editor, EditorSample, Utils, MEEditor, ScriptDialog, Sample
from enveditor import EditorSample, Utils
from akscripts.edison.resample_get_sample_rate import resample_get_sample_rate
from akscripts.edison.set_waveform_regions import set_waveform_regions
from akscripts.edison.remove_all_regions import remove_all_regions
from akscripts.edison.set_sample_to_mono_sum_stereo import set_sample_to_mono_sum_stereo
TOTAL_NR_WAVEFORMS = 64
WF_LENGTH = 367
WT_LENGTH = TOTAL_NR_WAVEFORMS * WF_LENGTH
def main():
"""Main function."""
set_sample_to_mono_sum_stereo()
remove_all_regions()
EditorSample.DeleteFromTo((2048 * 64), EditorSample.Length - 1)
set_waveform_regions(nr_of_waveforms=64, waveform_sample_length=2048)
new_sample_rate = resample_get_sample_rate(target_sample_length=WT_LENGTH)
if new_sample_rate:
EditorSample.SampleRate = new_sample_rate
EditorSample.NormalizeFromTo(0, EditorSample.Length - 1, 0.98)
return
else:
Utils.ShowMessage("Invalid sample length.")
if __name__ == "__main__":
main()