Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

denormalize the chords

  • Loading branch information...
commit d88abe6be9573111b97726d746899d64422a5436 1 parent 13cebcc
Raphael Sofaer authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 scripts/graph.py
View
12 scripts/graph.py
@@ -174,7 +174,7 @@ def chords_to_midi(chords):
#first need to put it in json format (4 voices)
json_dict = [[],[],[],[]]
for st, chord in enumerate(chords):
- c = chord.chord
+ c = denormalize_chord(chord.chord)
print c
for i in range(4):
cpitch = c[i]
@@ -213,6 +213,16 @@ def tableify(l):
l_out.append([v[i] for v in l])
return l_out
+def denormalize_chord(chord):
+ """ Takes a tuple representing a chord, returns a new tuple"""
+ newChord = list(chord)
+ newChord[0] = newChord[0] + 60
+ newChord[1] = newChord[1] + 48
+ newChord[2] = newChord[2] + 48
+ newChord[3] = newChord[3] + 36
+ return tuple(newChord)
+
+
if __name__ == '__main__':
time1 = dt.now()
Please sign in to comment.
Something went wrong with that request. Please try again.