list compreeeheeension
This commit is contained in:
@@ -10,10 +10,7 @@ from mido import MidiFile
|
|||||||
RATIO = 1.0
|
RATIO = 1.0
|
||||||
|
|
||||||
def getPartition(midiFile: str, cursors) -> Partition:
|
def getPartition(midiFile: str, cursors) -> Partition:
|
||||||
notes = []
|
notes = [Key(i["note"], cursor["timestamp"], i["duration"]) for cursor in cursors for i in cursor["notes"]]
|
||||||
for cursor in cursors:
|
|
||||||
for i in cursor["notes"]:
|
|
||||||
notes += [Key(i["note"], cursor["timestamp"], i["duration"])]
|
|
||||||
'''
|
'''
|
||||||
s = 0
|
s = 0
|
||||||
notes_on = {}
|
notes_on = {}
|
||||||
@@ -33,7 +30,7 @@ def getPartition(midiFile: str, cursors) -> Partition:
|
|||||||
note_start = notes_on[d["note"]]
|
note_start = notes_on[d["note"]]
|
||||||
notes.append(Key(d["note"], note_start, duration - 10))
|
notes.append(Key(d["note"], note_start, duration - 10))
|
||||||
notes_on[d["note"]] = s # 500
|
notes_on[d["note"]] = s # 500
|
||||||
'''
|
'''
|
||||||
return Partition(midiFile, notes)
|
return Partition(midiFile, notes)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user