-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" Test validation methods | ||
""" | ||
|
||
from typing import List | ||
|
||
from miditoolkit import Instrument, Note | ||
|
||
|
||
def valid_track(expected_track: Instrument, produced_track: Instrument): | ||
|
||
return 0 | ||
|
||
|
||
def strict_valid(expected_notes: List[Note], produced_notes: List[Note]): | ||
for exp_note, prod_note in zip(expected_notes, produced_notes): | ||
if exp_note.start != prod_note.start: | ||
return False | ||
elif exp_note.end != prod_note.end: | ||
return False | ||
elif exp_note.pitch != prod_note.pitch: | ||
return False | ||
elif exp_note.velocity != prod_note.velocity: | ||
return False |