def chord():
chords = request.args.get('transcript')
confidence = request.args.get('confidence')
'''do midi stuff with chord request'''
t = Template("request='${chords}' (${confidence})")
str = t.substitute({"chords": chords, "confidence": confidence})
print("========================================")
print(str)
print("========================================")
resp = parser(chords)
print json.dumps(resp, indent=4, sort_keys=True)
chord = Chord()
chord.getchord()
for note in resp['notes']:
chord.getchord(note['note'], note['params'][0], resp['octave'])
chord.play()
return json.dumps(resp)
评论列表
文章目录