more tuning
This commit is contained in:
parent
6de6634586
commit
e02a7b3d83
1 changed files with 58 additions and 12 deletions
70
stt.py
70
stt.py
|
|
@ -56,7 +56,6 @@ print( "BPM: " + str( jsondata["data"]["part"]["measures"][0]["voices"][0]["beat
|
|||
# CC1 Crash Cymbal 1 { "string": 0, "fret": 49 }
|
||||
# CC2 Crash Cymbal 2 { "string": 0, "fret": 57 }
|
||||
# RC Ride Cymbal { "string": 0, "fret": 51 }
|
||||
# fH Foot Hi Hat { "string": 0, "fret": 44 }
|
||||
|
||||
# HMT Hi-Mid Tom { "string": 3, "fret": 48 }
|
||||
# FT Floor Tom { "string": 3, "fret": 43 }
|
||||
|
|
@ -64,16 +63,28 @@ print( "BPM: " + str( jsondata["data"]["part"]["measures"][0]["voices"][0]["beat
|
|||
|
||||
# S Snare { "string": 4, "fret": 38 }
|
||||
# BD Bass Drum { "string": 5, "fret": 35 }
|
||||
# fH Foot Hi Hat { "string": 0, "fret": 44 }
|
||||
|
||||
### CC|-Crash cymbal----|
|
||||
### HH|-Hi-hat----------|
|
||||
### Rd|-Ride cymbal-----|
|
||||
### SN|-Snare-drum------|
|
||||
### SN|-Snare-drum------| Wikipedia notation
|
||||
### T1|-High-tom--------|
|
||||
### T2|-Low-tom---------|
|
||||
### FT|-Floor-tom-------|
|
||||
### BD |-Bass-drum------|
|
||||
### Hf/FH|-Hi-hat-w/foot|
|
||||
|
||||
### Cr - Crash DrumBurp notation
|
||||
### Hh - HiHat
|
||||
### Ri - Ride
|
||||
### HT - High Tom
|
||||
### MT - Mid Tom
|
||||
### Sn - Snare
|
||||
### FT - Floor Tom
|
||||
### Bd - Kick
|
||||
### Hf - Foot pedal
|
||||
|
||||
###
|
||||
###Cymbals
|
||||
###
|
||||
|
|
@ -97,22 +108,57 @@ print( "BPM: " + str( jsondata["data"]["part"]["measures"][0]["voices"][0]["beat
|
|||
### |-B-| Accented one-handed roll
|
||||
### |-@-| Snare rim
|
||||
|
||||
def get_fill(tp, typelength):
|
||||
if tp < typelength:
|
||||
fill = "-" * int( ( typelength / tp ) - 1 )
|
||||
else:
|
||||
fill = ""
|
||||
|
||||
return fill
|
||||
|
||||
def get_typelength(jsondata):
|
||||
typelength = 0
|
||||
for i in range(len(jsondata["data"]["part"]["measures"])):
|
||||
for j in range(len(jsondata["data"]["part"]["measures"][i]["voices"][0]["beats"])):
|
||||
beat = jsondata["data"]["part"]["measures"][i]["voices"][0]["beats"][j]
|
||||
if typelength < beat["type"]:
|
||||
typelength = beat["type"]
|
||||
return typelength
|
||||
|
||||
print("")
|
||||
print( str( jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"] ) )
|
||||
print( "Type: " + str( jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"][0]["type"] ) )
|
||||
print("")
|
||||
|
||||
# get longest type in song
|
||||
typelength = get_typelength(jsondata)
|
||||
|
||||
print("Typelength: " + str(typelength))
|
||||
print("")
|
||||
|
||||
for i in range(len(jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"])):
|
||||
beats = jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"][i]
|
||||
print( str(i+1) + " note " + str( jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"][i]["notes"] ) )
|
||||
for beat in beats:
|
||||
if note == { "string": 5, "fret": 35 }:
|
||||
print("BD")
|
||||
elif note == { "string": 4, "fret": 38 }:
|
||||
print("S")
|
||||
beat = jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"][i]
|
||||
#print( str(i+1) + " note " + str( jsondata["data"]["part"]["measures"][5]["voices"][0]["beats"][i]["notes"] ) )
|
||||
#print("Beat: " + str(beat))
|
||||
#print("Type: " + str(beat["type"]))
|
||||
fill = get_fill(beat["type"], typelength)
|
||||
#print("Notes: " + str(beat["notes"]))
|
||||
for note in beat["notes"]:
|
||||
if note == { "string": 0, "fret": 57 } or note == { "string": 0, "fret": 49 }:
|
||||
print("Cr " + "x" + fill)
|
||||
elif note == { "string": 0, "fret": 51 }:
|
||||
print("Rd")
|
||||
elif note == { "string": 0, "fret": 57 }:
|
||||
print("CC")
|
||||
print("Ri " + "o" + fill)
|
||||
elif note == { "string": 4, "fret": 38 }:
|
||||
print("Sn " + "o" + fill)
|
||||
elif note == { "string": 5, "fret": 35 }:
|
||||
print("Bd " + "o" + fill)
|
||||
elif note == { "string": 0, "fret": 44 }:
|
||||
print("fH " + "o" + fill)
|
||||
elif note == {'rest': True}:
|
||||
print("-" + fill)
|
||||
else:
|
||||
print(note)
|
||||
|
||||
# Sn ------------oooo
|
||||
# Bd o-------o-------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue