-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateDeephouse.py
36 lines (34 loc) · 1.14 KB
/
updateDeephouse.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
import os, re
import json
import pdb
def loadArrangement(arrPath):
with open(arrPath, mode='r') as infile:
arr = json.load(infile)
return arr
for fname in os.listdir("."):
if fname.endswith(".json"):
arr = loadArrangement(fname)
if 'path' in arr:
del arr['path']
for track in arr['tracks']:
if 'role' in track and track['role'] == 'lead':
for func in track['compositionFunctions']:
if func['name'] == 'addJazzHarmonies':
func['args'] = {
"clip": "leadClip",
"velocities": [
8,
38
],
"pitchRange": [
50,
72
],
"chordProgression": "chordProgression",
"chordDurations": "CHORD_DURATIONS",
"tonic": "tonic",
"totalDur": "totalDur",
"delayAmt": 0.01
}
with open(fname, 'w') as outfile:
json.dump(arr, outfile, indent=4, sort_keys=True, separators=(',',':'))