-
-
Save jcjohnson/603d9b5ab50016429f762cf9a5db2af7 to your computer and use it in GitHub Desktop.
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
import argparse | |
import simfile | |
from simfile.notes import NoteData | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--apply-patch', type=int, default=0) | |
def apply_patch(): | |
from simfile.notes import Note, NoteType | |
from simfile.timing import Beat | |
def _new__iter__(self): | |
for m, measure in enumerate(self._notedata.split(',')): | |
lines = measure.strip().splitlines() | |
subdivision = len(lines) | |
for l, line in enumerate(lines): | |
for c, column in enumerate(line.strip()): | |
if column != '0': | |
yield Note( | |
beat=Beat(4 * m * subdivision + 4 * l, subdivision), | |
column=c, | |
note_type=NoteType(column), | |
) | |
NoteData.__iter__ = _new__iter__ | |
def main(args): | |
if args.apply_patch: | |
apply_patch() | |
with open('test.sm', 'r') as f: | |
data = simfile.load(f) | |
note_data = NoteData.from_chart(data.charts[0]) | |
for note in note_data: | |
print(note.beat.as_integer_ratio()) | |
if __name__ == '__main__': | |
main(parser.parse_args()) |
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
#NOTES: | |
dance-single: | |
Me: | |
Challenge: | |
9: | |
0.644,0.632,0.251,0.099,0.601: | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 | |
1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment