Description
Small Arrow Vortex clipboard processing library.
Install
You can install this library from PyPI with pip install av-clipboard-lib
or compile it from source with python setup.py build
.
Usage
import av_clipboard_lib as av
row_based_copy = """ArrowVortex:notes:!!WE'!<<-/!Xo&G!uM"""
changed_row_based_copy = """ArrowVortex:notes:!!WE'!<<-/!Xo&G!Z1"""
time_based_copy = """ArrowVortex:notes:!<rN(z!!!!"zz!<<*"!!!#W56:fbzi'.2Az!:W2Tz!!)LQ"""
structural_copy = """ArrowVortex:tempo:!WW3#zz:-]Wrz!!!"L<^6Zd0E;(Qz!!)4I!!"""
parsed_row_copy = av.parse_av_clipboard_data(row_based_copy)
assert parsed_row_copy == av.clipboard_data.RowCopy(objects=[
av.Tap(column=0, position=av.RowPosition(0)), av.Tap(1, av.RowPosition(0)),
av.Tap(1, av.RowPosition(12)), av.Tap(2, av.RowPosition(12)),
av.Tap(0, av.RowPosition(24)), av.Tap(3, av.RowPosition(24)),
])
parsed_row_copy.objects[-1].column = 2
assert av.produce_av_clipboard_data(parsed_row_copy) == changed_row_based_copy
parsed_row_copy.objects[-1].column = 0
av.produce_av_clipboard_data(parsed_row_copy)
parsed_time_copy = av.parse_av_clipboard_data(time_based_copy)
assert parsed_time_copy == av.clipboard_data.TimeCopy(objects=[
av.Tap(0, av.TimePosition(0.0)), av.Tap(1, av.TimePosition(0.0)),
av.Tap(1, av.TimePosition(0.5)), av.Tap(2, av.TimePosition(0.5)),
av.Tap(0, av.TimePosition(1.0)), av.Tap(3, av.TimePosition(1.0)),
])
parsed_structure_copy = av.parse_av_clipboard_data(structural_copy)
assert parsed_structure_copy == av.clipboard_data.StructureCopy(objects=[
av.BPM(av.RowPosition(0), bpm=60.000),
av.BPM(av.RowPosition(24), bpm=90.000),
av.Stop(av.RowPosition(48), time=0.750)
])