-
Notifications
You must be signed in to change notification settings - Fork 1
/
sfzCreator_script.py
58 lines (42 loc) · 1.69 KB
/
sfzCreator_script.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script that uses the SFZ Creator Class to create an sfz from a folder containing samples
Created on Sat Nov 28 13:31:09 2020
@author: luiz
"""
from sfzCreatorClass import sfz_creator
# Test (delete all this after testing):
#fp = '/media/luiz/Volume/Downloads/SoundFonts/SteinwayD274/Samples/Bright'
fp = '/media/luiz/Volume/Dokumente/Musik/Projekte/SoundFonts/PTQ_SteinwayD_H'
sfz1 = sfz_creator([], '/media/luiz/Volume/Dokumente/Musik/Projekte/SoundFonts/Steinway_D_HB.sfz')
v1 = 40
v2 = 70
v3 = 90
v4 = 108
v5 = 116
v6 = 127
sfz1.VelMap = {'v1':v1 , 'v2': v2, 'v3': v3, 'v4': v4, 'v5': v5, 'v6': v6}
#sfz1.getSamplesFromFolder(fp, pmidi = 'C(\d+)')
#sfz1.getSamplesFromFolder(fp, pitch = '_([A-G]#?\d)_', vel='_([a-z]+)_')
sfz1.getSamplesFromFolder(fp, pmidi = 'pitch(\d+)', vel='_(v\d)_')
sfz1.autoSpreadKeys('higher')
sfz1.autoSpreadVelocities('lower')
sfz1.setForAll('Ampeg_release', 1.0)
#sfz1.setForAll('Cutoff', 200)
sfz1.setForAllIf('Cutoff', 2000, 'Vel', '==', v1)
sfz1.setForAllIf('Cutoff', 1400, 'Vel', '==', v2)
sfz1.setForAllIf('Cutoff', 600, 'Vel', '==', v3)
sfz1.setForAllIf('Cutoff', 160, 'Vel', '==', v4)
sfz1.setForAllIf('Cutoff', 120, 'Vel', '==', v5)
sfz1.setForAllIf('Cutoff', 100, 'Vel', '==', v6)
sfz1.setForAllIf('Volume', 1, 'Vel', '==', v1)
sfz1.setForAllIf('Volume', 2, 'Vel', '==', v2)
sfz1.setForAllIf('Volume', 5, 'Vel', '==', v3)
sfz1.setForAllIf('Volume', 1, 'Vel', '==', v4)
sfz1.setForAllIf('Volume', 0, 'Vel', '==', v5)
sfz1.setForAllIf('Volume', -1, 'Vel', '==', v6)
sfz1.setForAllIf('Amp_veltrack', 94, 'Vel', '==', v1)
sfz1.setForAllIf('Amp_veltrack', 96, 'Vel', '==', v2)
sfz1.setForAll('Fil_veltrack', 8000)
sfz1.genSfz()