diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..577784f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +name: Lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + env: + RUFF_OUTPUT_FORMAT: github diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..339f8fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +name: Run tests + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + tests: + name: Tests on ${{ matrix.os }} with python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # os: [ ubuntu-latest, macOS-latest, windows-latest ] + os: [ ubuntu-latest ] + python-version: [ "3.7", "3.x", "pypy3.9" ] + exclude: + - os: macos-latest + python-version: "pypy3.9" + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: setup.py + + - name: Install dependencies + run: | + # Install local package with tests dependencies extras + python -m pip install --upgrade pip + pip install -e ".[test]" + + - name: Test with pytest + run: pytest --cov=./ --cov-report=xml -n auto --durations=0 -v + + - name: Codecov + uses: codecov/codecov-action@v3.1.0 diff --git a/.gitignore b/.gitignore index 02dfca2..f5d38df 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ **/settings.json **/__pycache__ **/*.pyc -**/.vscode \ No newline at end of file +**/.vscode diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0fe058d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 + hooks: + - id: ruff + args: + - --fix + - id: ruff-format + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/README.md b/README.md index 0146cfe..28cc2c7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The library is written in cpp and based on [minimidi](https://github.com/lzqlzzq/minimidi/tree/main). It offers a python binding using pybind11. -Here, we have added a tutorial.ipynb for you to learn about how to use the library. +Here, we have added a tutorial.ipynb for you to learn about how to use the library. Tutorial and Benchmark: Open In Colab @@ -71,5 +71,3 @@ pip install ./symusic * [pybind11-stubgen](https://github.com/sizmailov/pybind11-stubgen) A nice tool to generate stub files for pybind11 projects. * [zpp_bits](https://github.com/eyalz800/zpp_bits) : An extraordinary fast and lightweight single header library for serialization and deserialization. I use it to support pickle. * [geek_time_cpp](https://github.com/adah1972/geek_time_cpp/tree/master) The example code of the book "Modern C++ Programming Practice". We use the [metamacro.h](https://github.com/adah1972/geek_time_cpp/blob/master/40/metamacro.h#L1-L622) in it for shortening the code. - - \ No newline at end of file diff --git a/generate_stub.sh b/generate_stub.sh index b7c729e..597a835 100644 --- a/generate_stub.sh +++ b/generate_stub.sh @@ -3,4 +3,4 @@ python3 setup.py build bdist_wheel pip install dist/*.whl pybind11-stubgen symusic.core --numpy-array-remove-parameters -o . pip uninstall -y symusic -rm -rf dist build *.egg-info \ No newline at end of file +rm -rf dist build *.egg-info diff --git a/include/MetaMacro.h b/include/MetaMacro.h index de631ab..711c33f 100644 --- a/include/MetaMacro.h +++ b/include/MetaMacro.h @@ -619,4 +619,4 @@ #define PAIR(x) EXPAND x // PAIR((int) x) => EXPAND(int) x => int x #define STRIP(x) EAT x // STRIP((int) x) => EAT(int) x => x -#endif // METAMACRO_H \ No newline at end of file +#endif // METAMACRO_H diff --git a/include/Score.hpp b/include/Score.hpp index 9766a0d..6c322f7 100644 --- a/include/Score.hpp +++ b/include/Score.hpp @@ -54,9 +54,9 @@ inline std::string strip_non_utf_8(const std::string *str) { } if (c < 127) { //normal ASCII - to.append(1, c); + to.append(1, c); continue; - } + } //control char (nothing should be defined here either ASCII, ISO_8859-1 or UTF8, so skipping) if (c < 160) { //fix microsoft mess, add euro @@ -70,19 +70,19 @@ inline std::string strip_non_utf_8(const std::string *str) { to.append(1, 10); to.append(1, 13); } continue; - } + } //invalid for UTF8, converting ASCII if (c < 192) { to.append(1, (unsigned char) 194); to.append(1, c); continue; - } + } //invalid for UTF8, converting ASCII if (c < 194) { to.append(1, (unsigned char) 195); to.append(1, c - 64); continue; - } + } //possibly 2byte UTF8 if (c < 224 && i + 1 < f_size) { const u8 c2 = static_cast((*str)[i + 1]); @@ -94,7 +94,7 @@ inline std::string strip_non_utf_8(const std::string *str) { to.append(1, c2); } i++; continue; } - } + } //possibly 3byte UTF8 else if (c < 240 && i + 2 < f_size) { const u8 c2 = static_cast ((*str)[i + 1]), @@ -106,7 +106,7 @@ inline std::string strip_non_utf_8(const std::string *str) { to.append(1, c3); i += 2; continue; } - } + } //possibly 4byte UTF8 else if (c < 245 && i + 3 < f_size) { @@ -1270,7 +1270,7 @@ Score::Score(const minimidi::file::MidiFile &midi) { uint32_t duration = cur_tick - note_on.time; track.notes.emplace_back( // note_on.time, duration, - helper.convert_ttype(note_on.time), + helper.convert_ttype(note_on.time), helper.convert_ttype(duration), pitch, note_on.velocity ); @@ -1505,4 +1505,4 @@ minimidi::file::MidiFile Score::to_midi() const { return midi; } // Score::to_midi end } // namespace score end -#endif //SCORE_HPP \ No newline at end of file +#endif //SCORE_HPP diff --git a/symusic/__init__.py b/py-symusic/__init__.py similarity index 100% rename from symusic/__init__.py rename to py-symusic/__init__.py diff --git a/symusic/core.pyi b/py-symusic/core.pyi similarity index 72% rename from symusic/core.pyi rename to py-symusic/core.pyi index e23de3a..80ca109 100644 --- a/symusic/core.pyi +++ b/py-symusic/core.pyi @@ -4,7 +4,68 @@ import typing import numpy -__all__ = ["ControlChangeQuarter", "ControlChangeQuarterList", "ControlChangeSecond", "ControlChangeSecondList", "ControlChangeTick", "ControlChangeTickList", "KeySignatureQuarter", "KeySignatureQuarterList", "KeySignatureSecond", "KeySignatureSecondList", "KeySignatureTick", "KeySignatureTickList", "NoteQuarter", "NoteQuarterList", "NoteSecond", "NoteSecondList", "NoteTick", "NoteTickList", "PedalQuarter", "PedalQuarterList", "PedalSecond", "PedalSecondList", "PedalTick", "PedalTickList", "PitchBendQuarter", "PitchBendQuarterList", "PitchBendSecond", "PitchBendSecondList", "PitchBendTick", "PitchBendTickList", "Quarter", "ScoreQuarter", "ScoreTick", "Second", "TempoQuarter", "TempoQuarterList", "TempoSecond", "TempoSecondList", "TempoTick", "TempoTickList", "TextMetaQuarter", "TextMetaQuarterList", "TextMetaSecond", "TextMetaSecondList", "TextMetaTick", "TextMetaTickList", "Tick", "TimeSignatureQuarter", "TimeSignatureQuarterList", "TimeSignatureSecond", "TimeSignatureSecondList", "TimeSignatureTick", "TimeSignatureTickList", "TrackQuarter", "TrackQuarterList", "TrackSecond", "TrackSecondList", "TrackTick", "TrackTickList"] +__all__ = [ + "ControlChangeQuarter", + "ControlChangeQuarterList", + "ControlChangeSecond", + "ControlChangeSecondList", + "ControlChangeTick", + "ControlChangeTickList", + "KeySignatureQuarter", + "KeySignatureQuarterList", + "KeySignatureSecond", + "KeySignatureSecondList", + "KeySignatureTick", + "KeySignatureTickList", + "NoteQuarter", + "NoteQuarterList", + "NoteSecond", + "NoteSecondList", + "NoteTick", + "NoteTickList", + "PedalQuarter", + "PedalQuarterList", + "PedalSecond", + "PedalSecondList", + "PedalTick", + "PedalTickList", + "PitchBendQuarter", + "PitchBendQuarterList", + "PitchBendSecond", + "PitchBendSecondList", + "PitchBendTick", + "PitchBendTickList", + "Quarter", + "ScoreQuarter", + "ScoreTick", + "Second", + "TempoQuarter", + "TempoQuarterList", + "TempoSecond", + "TempoSecondList", + "TempoTick", + "TempoTickList", + "TextMetaQuarter", + "TextMetaQuarterList", + "TextMetaSecond", + "TextMetaSecondList", + "TextMetaTick", + "TextMetaTickList", + "Tick", + "TimeSignatureQuarter", + "TimeSignatureQuarterList", + "TimeSignatureSecond", + "TimeSignatureSecondList", + "TimeSignatureTick", + "TimeSignatureTickList", + "TrackQuarter", + "TrackQuarterList", + "TrackSecond", + "TrackSecondList", + "TrackTick", + "TrackTickList", +] + class ControlChangeQuarter: __hash__: typing.ClassVar[None] = None number: int @@ -18,24 +79,18 @@ class ControlChangeQuarter: """ Deep copy """ - def __eq__(self, arg0: ControlChangeQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: ControlChangeQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: ControlChangeQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, number: int, value: int) -> None: - ... - def __ne__(self, arg0: ControlChangeQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, number: int, value: int) -> None: ... + def __ne__(self, arg0: ControlChangeQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> ControlChangeQuarter: """ Deep copy @@ -45,8 +100,8 @@ class ControlChangeQuarter: Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class ControlChangeQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -67,53 +122,42 @@ class ControlChangeQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: ControlChangeQuarterList) -> bool: - ... + def __eq__(self, arg0: ControlChangeQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> ControlChangeQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> ControlChangeQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> ControlChangeQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: ControlChangeQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: ControlChangeQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ControlChangeQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: ControlChangeQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: ControlChangeQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: ControlChangeQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: ControlChangeQuarter) -> None: """ Add an item to the end of the list @@ -154,11 +198,12 @@ class ControlChangeQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class ControlChangeSecond: __hash__: typing.ClassVar[None] = None number: int @@ -172,24 +217,18 @@ class ControlChangeSecond: """ Deep copy """ - def __eq__(self, arg0: ControlChangeSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: ControlChangeSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: ControlChangeSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, number: int, value: int) -> None: - ... - def __ne__(self, arg0: ControlChangeSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, number: int, value: int) -> None: ... + def __ne__(self, arg0: ControlChangeSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> ControlChangeSecond: """ Deep copy @@ -199,8 +238,8 @@ class ControlChangeSecond: Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class ControlChangeSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -221,53 +260,42 @@ class ControlChangeSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: ControlChangeSecondList) -> bool: - ... + def __eq__(self, arg0: ControlChangeSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> ControlChangeSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> ControlChangeSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> ControlChangeSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: ControlChangeSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: ControlChangeSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ControlChangeSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: ControlChangeSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: ControlChangeSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: ControlChangeSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: ControlChangeSecond) -> None: """ Add an item to the end of the list @@ -308,11 +336,12 @@ class ControlChangeSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class ControlChangeTick: __hash__: typing.ClassVar[None] = None number: int @@ -326,24 +355,18 @@ class ControlChangeTick: """ Deep copy """ - def __eq__(self, arg0: ControlChangeTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: ControlChangeTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: ControlChangeTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, number: int, value: int) -> None: - ... - def __ne__(self, arg0: ControlChangeTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, number: int, value: int) -> None: ... + def __ne__(self, arg0: ControlChangeTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> ControlChangeTick: """ Deep copy @@ -353,8 +376,8 @@ class ControlChangeTick: Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class ControlChangeTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -375,53 +398,42 @@ class ControlChangeTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: ControlChangeTickList) -> bool: - ... + def __eq__(self, arg0: ControlChangeTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> ControlChangeTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> ControlChangeTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> ControlChangeTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: ControlChangeTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: ControlChangeTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ControlChangeTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: ControlChangeTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: ControlChangeTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: ControlChangeTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: ControlChangeTick) -> None: """ Add an item to the end of the list @@ -462,11 +474,12 @@ class ControlChangeTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class KeySignatureQuarter: __hash__: typing.ClassVar[None] = None key: int @@ -480,24 +493,18 @@ class KeySignatureQuarter: """ Deep copy """ - def __eq__(self, arg0: KeySignatureQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: KeySignatureQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: KeySignatureQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, key: int, tonality: int) -> None: - ... - def __ne__(self, arg0: KeySignatureQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, key: int, tonality: int) -> None: ... + def __ne__(self, arg0: KeySignatureQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> KeySignatureQuarter: """ Deep copy @@ -507,11 +514,10 @@ class KeySignatureQuarter: Shift the event time by offset """ @property - def degree(self) -> int: - ... + def degree(self) -> int: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class KeySignatureQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -532,53 +538,42 @@ class KeySignatureQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: KeySignatureQuarterList) -> bool: - ... + def __eq__(self, arg0: KeySignatureQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> KeySignatureQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> KeySignatureQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> KeySignatureQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: KeySignatureQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: KeySignatureQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: KeySignatureQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: KeySignatureQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: KeySignatureQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: KeySignatureQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: KeySignatureQuarter) -> None: """ Add an item to the end of the list @@ -619,11 +614,12 @@ class KeySignatureQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class KeySignatureSecond: __hash__: typing.ClassVar[None] = None key: int @@ -637,24 +633,18 @@ class KeySignatureSecond: """ Deep copy """ - def __eq__(self, arg0: KeySignatureSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: KeySignatureSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: KeySignatureSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, key: int, tonality: int) -> None: - ... - def __ne__(self, arg0: KeySignatureSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, key: int, tonality: int) -> None: ... + def __ne__(self, arg0: KeySignatureSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> KeySignatureSecond: """ Deep copy @@ -664,11 +654,10 @@ class KeySignatureSecond: Shift the event time by offset """ @property - def degree(self) -> int: - ... + def degree(self) -> int: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class KeySignatureSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -689,53 +678,42 @@ class KeySignatureSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: KeySignatureSecondList) -> bool: - ... + def __eq__(self, arg0: KeySignatureSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> KeySignatureSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> KeySignatureSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> KeySignatureSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: KeySignatureSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: KeySignatureSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: KeySignatureSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: KeySignatureSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: KeySignatureSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: KeySignatureSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: KeySignatureSecond) -> None: """ Add an item to the end of the list @@ -776,11 +754,12 @@ class KeySignatureSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class KeySignatureTick: __hash__: typing.ClassVar[None] = None key: int @@ -794,24 +773,18 @@ class KeySignatureTick: """ Deep copy """ - def __eq__(self, arg0: KeySignatureTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: KeySignatureTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: KeySignatureTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, key: int, tonality: int) -> None: - ... - def __ne__(self, arg0: KeySignatureTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, key: int, tonality: int) -> None: ... + def __ne__(self, arg0: KeySignatureTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> KeySignatureTick: """ Deep copy @@ -821,11 +794,10 @@ class KeySignatureTick: Shift the event time by offset """ @property - def degree(self) -> int: - ... + def degree(self) -> int: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class KeySignatureTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -846,53 +818,42 @@ class KeySignatureTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: KeySignatureTickList) -> bool: - ... + def __eq__(self, arg0: KeySignatureTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> KeySignatureTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> KeySignatureTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> KeySignatureTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: KeySignatureTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: KeySignatureTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: KeySignatureTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: KeySignatureTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: KeySignatureTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: KeySignatureTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: KeySignatureTick) -> None: """ Add an item to the end of the list @@ -933,11 +894,12 @@ class KeySignatureTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class NoteQuarter: __hash__: typing.ClassVar[None] = None duration: float @@ -953,24 +915,20 @@ class NoteQuarter: """ Deep copy """ - def __eq__(self, arg0: NoteQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: NoteQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: NoteQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, start: float, duration: float, pitch: int, velocity: int) -> None: - ... - def __ne__(self, arg0: NoteQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__( + self, start: float, duration: float, pitch: int, velocity: int + ) -> None: ... + def __ne__(self, arg0: NoteQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> NoteQuarter: """ Deep copy @@ -979,8 +937,7 @@ class NoteQuarter: """ duration <= 0 or velocity <= 0 """ - def end_time(self) -> float: - ... + def end_time(self) -> float: ... def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: """ Shift the pitch by offset @@ -994,11 +951,10 @@ class NoteQuarter: Shift the velocity by offset """ @property - def end(self) -> float: - ... + def end(self) -> float: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class NoteQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1019,53 +975,42 @@ class NoteQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: NoteQuarterList) -> bool: - ... + def __eq__(self, arg0: NoteQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> NoteQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> NoteQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> NoteQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: NoteQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: NoteQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: NoteQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: NoteQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: NoteQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: NoteQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: NoteQuarter) -> None: """ Add an item to the end of the list @@ -1106,11 +1051,12 @@ class NoteQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class NoteSecond: __hash__: typing.ClassVar[None] = None duration: float @@ -1126,24 +1072,20 @@ class NoteSecond: """ Deep copy """ - def __eq__(self, arg0: NoteSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: NoteSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: NoteSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, start: float, duration: float, pitch: int, velocity: int) -> None: - ... - def __ne__(self, arg0: NoteSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__( + self, start: float, duration: float, pitch: int, velocity: int + ) -> None: ... + def __ne__(self, arg0: NoteSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> NoteSecond: """ Deep copy @@ -1152,8 +1094,7 @@ class NoteSecond: """ duration <= 0 or velocity <= 0 """ - def end_time(self) -> float: - ... + def end_time(self) -> float: ... def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: """ Shift the pitch by offset @@ -1167,11 +1108,10 @@ class NoteSecond: Shift the velocity by offset """ @property - def end(self) -> float: - ... + def end(self) -> float: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class NoteSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1192,53 +1132,42 @@ class NoteSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: NoteSecondList) -> bool: - ... + def __eq__(self, arg0: NoteSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> NoteSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> NoteSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> NoteSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: NoteSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: NoteSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: NoteSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: NoteSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: NoteSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: NoteSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: NoteSecond) -> None: """ Add an item to the end of the list @@ -1279,11 +1208,12 @@ class NoteSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class NoteTick: __hash__: typing.ClassVar[None] = None duration: int @@ -1299,24 +1229,20 @@ class NoteTick: """ Deep copy """ - def __eq__(self, arg0: NoteTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: NoteTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: NoteTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, start: int, duration: int, pitch: int, velocity: int) -> None: - ... - def __ne__(self, arg0: NoteTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__( + self, start: int, duration: int, pitch: int, velocity: int + ) -> None: ... + def __ne__(self, arg0: NoteTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> NoteTick: """ Deep copy @@ -1325,8 +1251,7 @@ class NoteTick: """ duration <= 0 or velocity <= 0 """ - def end_time(self) -> int: - ... + def end_time(self) -> int: ... def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: """ Shift the pitch by offset @@ -1340,11 +1265,10 @@ class NoteTick: Shift the velocity by offset """ @property - def end(self) -> int: - ... + def end(self) -> int: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class NoteTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1365,53 +1289,42 @@ class NoteTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: NoteTickList) -> bool: - ... + def __eq__(self, arg0: NoteTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> NoteTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> NoteTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> NoteTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: NoteTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: NoteTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: NoteTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: NoteTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: NoteTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: NoteTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: NoteTick) -> None: """ Add an item to the end of the list @@ -1452,11 +1365,12 @@ class NoteTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class PedalQuarter: __hash__: typing.ClassVar[None] = None duration: float @@ -1469,38 +1383,31 @@ class PedalQuarter: """ Deep copy """ - def __eq__(self, arg0: PedalQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PedalQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PedalQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, duration: float) -> None: - ... - def __ne__(self, arg0: PedalQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, duration: float) -> None: ... + def __ne__(self, arg0: PedalQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PedalQuarter: """ Deep copy """ @property - def end(self) -> float: - ... + def end(self) -> float: ... def shift_time(self, offset: float, inplace: bool = False) -> PedalQuarter: """ Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class PedalQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1521,53 +1428,42 @@ class PedalQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PedalQuarterList) -> bool: - ... + def __eq__(self, arg0: PedalQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PedalQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PedalQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PedalQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PedalQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PedalQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PedalQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PedalQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: PedalQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PedalQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PedalQuarter) -> None: """ Add an item to the end of the list @@ -1608,11 +1504,12 @@ class PedalQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class PedalSecond: __hash__: typing.ClassVar[None] = None duration: float @@ -1625,38 +1522,31 @@ class PedalSecond: """ Deep copy """ - def __eq__(self, arg0: PedalSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PedalSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PedalSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, duration: float) -> None: - ... - def __ne__(self, arg0: PedalSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, duration: float) -> None: ... + def __ne__(self, arg0: PedalSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PedalSecond: """ Deep copy """ @property - def end(self) -> float: - ... + def end(self) -> float: ... def shift_time(self, offset: float, inplace: bool = False) -> PedalSecond: """ Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class PedalSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1677,53 +1567,42 @@ class PedalSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PedalSecondList) -> bool: - ... + def __eq__(self, arg0: PedalSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PedalSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PedalSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PedalSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PedalSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PedalSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PedalSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PedalSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: PedalSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PedalSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PedalSecond) -> None: """ Add an item to the end of the list @@ -1764,11 +1643,12 @@ class PedalSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class PedalTick: __hash__: typing.ClassVar[None] = None duration: int @@ -1781,38 +1661,31 @@ class PedalTick: """ Deep copy """ - def __eq__(self, arg0: PedalTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PedalTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PedalTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, duration: int) -> None: - ... - def __ne__(self, arg0: PedalTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, duration: int) -> None: ... + def __ne__(self, arg0: PedalTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PedalTick: """ Deep copy """ @property - def end(self) -> int: - ... + def end(self) -> int: ... def shift_time(self, offset: int, inplace: bool = False) -> PedalTick: """ Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class PedalTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1833,53 +1706,42 @@ class PedalTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PedalTickList) -> bool: - ... + def __eq__(self, arg0: PedalTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PedalTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PedalTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PedalTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PedalTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PedalTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PedalTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PedalTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: PedalTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PedalTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PedalTick) -> None: """ Add an item to the end of the list @@ -1920,11 +1782,12 @@ class PedalTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class PitchBendQuarter: __hash__: typing.ClassVar[None] = None time: float @@ -1937,24 +1800,18 @@ class PitchBendQuarter: """ Deep copy """ - def __eq__(self, arg0: PitchBendQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PitchBendQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PitchBendQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, value: int) -> None: - ... - def __ne__(self, arg0: PitchBendQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, value: int) -> None: ... + def __ne__(self, arg0: PitchBendQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PitchBendQuarter: """ Deep copy @@ -1964,8 +1821,8 @@ class PitchBendQuarter: Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class PitchBendQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -1986,53 +1843,42 @@ class PitchBendQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PitchBendQuarterList) -> bool: - ... + def __eq__(self, arg0: PitchBendQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PitchBendQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PitchBendQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PitchBendQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PitchBendQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PitchBendQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PitchBendQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PitchBendQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: PitchBendQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PitchBendQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PitchBendQuarter) -> None: """ Add an item to the end of the list @@ -2073,11 +1919,12 @@ class PitchBendQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class PitchBendSecond: __hash__: typing.ClassVar[None] = None time: float @@ -2090,24 +1937,18 @@ class PitchBendSecond: """ Deep copy """ - def __eq__(self, arg0: PitchBendSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PitchBendSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PitchBendSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, value: int) -> None: - ... - def __ne__(self, arg0: PitchBendSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, value: int) -> None: ... + def __ne__(self, arg0: PitchBendSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PitchBendSecond: """ Deep copy @@ -2117,8 +1958,8 @@ class PitchBendSecond: Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class PitchBendSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -2139,53 +1980,42 @@ class PitchBendSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PitchBendSecondList) -> bool: - ... + def __eq__(self, arg0: PitchBendSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PitchBendSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PitchBendSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PitchBendSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PitchBendSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PitchBendSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PitchBendSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PitchBendSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: PitchBendSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PitchBendSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PitchBendSecond) -> None: """ Add an item to the end of the list @@ -2226,11 +2056,12 @@ class PitchBendSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class PitchBendTick: __hash__: typing.ClassVar[None] = None time: int @@ -2243,24 +2074,18 @@ class PitchBendTick: """ Deep copy """ - def __eq__(self, arg0: PitchBendTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: PitchBendTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: PitchBendTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, value: int) -> None: - ... - def __ne__(self, arg0: PitchBendTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, value: int) -> None: ... + def __ne__(self, arg0: PitchBendTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> PitchBendTick: """ Deep copy @@ -2270,8 +2095,8 @@ class PitchBendTick: Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class PitchBendTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -2292,53 +2117,42 @@ class PitchBendTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: PitchBendTickList) -> bool: - ... + def __eq__(self, arg0: PitchBendTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> PitchBendTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> PitchBendTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> PitchBendTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: PitchBendTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: PitchBendTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: PitchBendTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: PitchBendTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: PitchBendTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: PitchBendTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: PitchBendTick) -> None: """ Add an item to the end of the list @@ -2379,21 +2193,19 @@ class PitchBendTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class Quarter: __hash__: typing.ClassVar[None] = None - def __eq__(self, arg0: typing.Any) -> bool: - ... - def __init__(self) -> None: - ... - def __repr__(self) -> str: - ... - def is_time_unit(self) -> bool: - ... + def __eq__(self, arg0: typing.Any) -> bool: ... + def __init__(self) -> None: ... + def __repr__(self) -> str: ... + def is_time_unit(self) -> bool: ... + class ScoreQuarter: __hash__: typing.ClassVar[None] = None key_signatures: KeySignatureQuarterList @@ -2416,13 +2228,10 @@ class ScoreQuarter: """ Deep copy """ - def __eq__(self, arg0: ScoreQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: ScoreQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self, tpq: int) -> None: - ... + def __init__(self, tpq: int) -> None: ... @typing.overload def __init__(self, other: ScoreQuarter) -> None: """ @@ -2438,12 +2247,9 @@ class ScoreQuarter: """ Convert Tick to Quarter """ - def __ne__(self, arg0: ScoreQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __ne__(self, arg0: ScoreQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def clip(self, start: float, end: float, clip_end: bool = False) -> ScoreQuarter: """ Clip events a given time range @@ -2458,33 +2264,25 @@ class ScoreQuarter: Dump to midi file """ @typing.overload - def dump_midi(self, path: typing.Any) -> None: - ... - def empty(self) -> bool: - ... - def end(self) -> float: - ... - def note_num(self) -> int: - ... - def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: - ... - def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: - ... - def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = False) -> typing.Any: - ... - def start(self) -> float: - ... + def dump_midi(self, path: typing.Any) -> None: ... + def empty(self) -> bool: ... + def end(self) -> float: ... + def note_num(self) -> int: ... + def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: ... + def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: ... + def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = False + ) -> typing.Any: ... + def start(self) -> float: ... def to(self, ttype: typing.Any) -> typing.Any: """ Convert to another time unit """ @property - def ttype() -> Quarter: - ... + def ttype() -> Quarter: ... + class ScoreTick: __hash__: typing.ClassVar[None] = None key_signatures: KeySignatureTickList @@ -2507,13 +2305,10 @@ class ScoreTick: """ Deep copy """ - def __eq__(self, arg0: ScoreTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: ScoreTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self, tpq: int) -> None: - ... + def __init__(self, tpq: int) -> None: ... @typing.overload def __init__(self, other: ScoreTick) -> None: """ @@ -2529,12 +2324,9 @@ class ScoreTick: """ Convert Quarter to Tick """ - def __ne__(self, arg0: ScoreTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __ne__(self, arg0: ScoreTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def clip(self, start: int, end: int, clip_end: bool = False) -> ScoreTick: """ Clip events a given time range @@ -2549,43 +2341,32 @@ class ScoreTick: Dump to midi file """ @typing.overload - def dump_midi(self, path: typing.Any) -> None: - ... - def empty(self) -> bool: - ... - def end(self) -> int: - ... - def note_num(self) -> int: - ... - def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: - ... - def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_time(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = False) -> typing.Any: - ... - def start(self) -> int: - ... + def dump_midi(self, path: typing.Any) -> None: ... + def empty(self) -> bool: ... + def end(self) -> int: ... + def note_num(self) -> int: ... + def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: ... + def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_time(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = False + ) -> typing.Any: ... + def start(self) -> int: ... def to(self, ttype: typing.Any) -> typing.Any: """ Convert to another time unit """ @property - def ttype() -> Tick: - ... + def ttype() -> Tick: ... + class Second: __hash__: typing.ClassVar[None] = None - def __eq__(self, arg0: typing.Any) -> bool: - ... - def __init__(self) -> None: - ... - def __repr__(self) -> str: - ... - def is_time_unit(self) -> bool: - ... + def __eq__(self, arg0: typing.Any) -> bool: ... + def __init__(self) -> None: ... + def __repr__(self) -> str: ... + def is_time_unit(self) -> bool: ... + class TempoQuarter: __hash__: typing.ClassVar[None] = None tempo: float @@ -2598,24 +2379,18 @@ class TempoQuarter: """ Deep copy """ - def __eq__(self, arg0: TempoQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TempoQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TempoQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, qpm: float) -> None: - ... - def __ne__(self, arg0: TempoQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, qpm: float) -> None: ... + def __ne__(self, arg0: TempoQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TempoQuarter: """ Deep copy @@ -2625,8 +2400,8 @@ class TempoQuarter: Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TempoQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -2647,53 +2422,42 @@ class TempoQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TempoQuarterList) -> bool: - ... + def __eq__(self, arg0: TempoQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TempoQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TempoQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TempoQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TempoQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TempoQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TempoQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TempoQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: TempoQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TempoQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TempoQuarter) -> None: """ Add an item to the end of the list @@ -2734,11 +2498,12 @@ class TempoQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TempoSecond: __hash__: typing.ClassVar[None] = None tempo: float @@ -2751,24 +2516,18 @@ class TempoSecond: """ Deep copy """ - def __eq__(self, arg0: TempoSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TempoSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TempoSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, qpm: float) -> None: - ... - def __ne__(self, arg0: TempoSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, qpm: float) -> None: ... + def __ne__(self, arg0: TempoSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TempoSecond: """ Deep copy @@ -2778,8 +2537,8 @@ class TempoSecond: Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TempoSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -2800,53 +2559,42 @@ class TempoSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TempoSecondList) -> bool: - ... + def __eq__(self, arg0: TempoSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TempoSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TempoSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TempoSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TempoSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TempoSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TempoSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TempoSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: TempoSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TempoSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TempoSecond) -> None: """ Add an item to the end of the list @@ -2887,11 +2635,12 @@ class TempoSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TempoTick: __hash__: typing.ClassVar[None] = None tempo: float @@ -2904,24 +2653,18 @@ class TempoTick: """ Deep copy """ - def __eq__(self, arg0: TempoTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TempoTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TempoTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, qpm: float) -> None: - ... - def __ne__(self, arg0: TempoTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, qpm: float) -> None: ... + def __ne__(self, arg0: TempoTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TempoTick: """ Deep copy @@ -2931,8 +2674,8 @@ class TempoTick: Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class TempoTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -2953,53 +2696,42 @@ class TempoTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TempoTickList) -> bool: - ... + def __eq__(self, arg0: TempoTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TempoTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TempoTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TempoTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TempoTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TempoTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TempoTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TempoTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: TempoTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TempoTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TempoTick) -> None: """ Add an item to the end of the list @@ -3040,11 +2772,12 @@ class TempoTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class TextMetaQuarter: __hash__: typing.ClassVar[None] = None text: str @@ -3057,24 +2790,18 @@ class TextMetaQuarter: """ Deep copy """ - def __eq__(self, arg0: TextMetaQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TextMetaQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TextMetaQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, text: str) -> None: - ... - def __ne__(self, arg0: TextMetaQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, text: str) -> None: ... + def __ne__(self, arg0: TextMetaQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TextMetaQuarter: """ Deep copy @@ -3084,8 +2811,8 @@ class TextMetaQuarter: Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TextMetaQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3106,53 +2833,42 @@ class TextMetaQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TextMetaQuarterList) -> bool: - ... + def __eq__(self, arg0: TextMetaQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TextMetaQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TextMetaQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TextMetaQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TextMetaQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TextMetaQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TextMetaQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TextMetaQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: TextMetaQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TextMetaQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TextMetaQuarter) -> None: """ Add an item to the end of the list @@ -3193,11 +2909,12 @@ class TextMetaQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TextMetaSecond: __hash__: typing.ClassVar[None] = None text: str @@ -3210,24 +2927,18 @@ class TextMetaSecond: """ Deep copy """ - def __eq__(self, arg0: TextMetaSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TextMetaSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TextMetaSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: float, text: str) -> None: - ... - def __ne__(self, arg0: TextMetaSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: float, text: str) -> None: ... + def __ne__(self, arg0: TextMetaSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TextMetaSecond: """ Deep copy @@ -3237,8 +2948,8 @@ class TextMetaSecond: Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TextMetaSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3259,53 +2970,42 @@ class TextMetaSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TextMetaSecondList) -> bool: - ... + def __eq__(self, arg0: TextMetaSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TextMetaSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TextMetaSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TextMetaSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TextMetaSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TextMetaSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TextMetaSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TextMetaSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: TextMetaSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TextMetaSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TextMetaSecond) -> None: """ Add an item to the end of the list @@ -3346,11 +3046,12 @@ class TextMetaSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TextMetaTick: __hash__: typing.ClassVar[None] = None text: str @@ -3363,24 +3064,18 @@ class TextMetaTick: """ Deep copy """ - def __eq__(self, arg0: TextMetaTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TextMetaTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TextMetaTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, time: int, text: str) -> None: - ... - def __ne__(self, arg0: TextMetaTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, time: int, text: str) -> None: ... + def __ne__(self, arg0: TextMetaTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TextMetaTick: """ Deep copy @@ -3390,8 +3085,8 @@ class TextMetaTick: Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class TextMetaTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3412,53 +3107,42 @@ class TextMetaTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TextMetaTickList) -> bool: - ... + def __eq__(self, arg0: TextMetaTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TextMetaTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TextMetaTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TextMetaTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TextMetaTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TextMetaTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TextMetaTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TextMetaTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: TextMetaTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TextMetaTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TextMetaTick) -> None: """ Add an item to the end of the list @@ -3499,21 +3183,19 @@ class TextMetaTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class Tick: __hash__: typing.ClassVar[None] = None - def __eq__(self, arg0: typing.Any) -> bool: - ... - def __init__(self) -> None: - ... - def __repr__(self) -> str: - ... - def is_time_unit(self) -> bool: - ... + def __eq__(self, arg0: typing.Any) -> bool: ... + def __init__(self) -> None: ... + def __repr__(self) -> str: ... + def is_time_unit(self) -> bool: ... + class TimeSignatureQuarter: __hash__: typing.ClassVar[None] = None denominator: int @@ -3527,24 +3209,18 @@ class TimeSignatureQuarter: """ Deep copy """ - def __eq__(self, arg0: TimeSignatureQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TimeSignatureQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TimeSignatureQuarter) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: float, arg1: int, arg2: int) -> None: - ... - def __ne__(self, arg0: TimeSignatureQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, arg0: float, arg1: int, arg2: int) -> None: ... + def __ne__(self, arg0: TimeSignatureQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TimeSignatureQuarter: """ Deep copy @@ -3554,8 +3230,8 @@ class TimeSignatureQuarter: Shift the event time by offset """ @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TimeSignatureQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3576,53 +3252,42 @@ class TimeSignatureQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TimeSignatureQuarterList) -> bool: - ... + def __eq__(self, arg0: TimeSignatureQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TimeSignatureQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TimeSignatureQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TimeSignatureQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TimeSignatureQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TimeSignatureQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TimeSignatureQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TimeSignatureQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: TimeSignatureQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TimeSignatureQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TimeSignatureQuarter) -> None: """ Add an item to the end of the list @@ -3663,11 +3328,12 @@ class TimeSignatureQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Quarter: - ... + def ttype(self) -> Quarter: ... + class TimeSignatureSecond: __hash__: typing.ClassVar[None] = None denominator: int @@ -3681,24 +3347,18 @@ class TimeSignatureSecond: """ Deep copy """ - def __eq__(self, arg0: TimeSignatureSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TimeSignatureSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TimeSignatureSecond) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: float, arg1: int, arg2: int) -> None: - ... - def __ne__(self, arg0: TimeSignatureSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, arg0: float, arg1: int, arg2: int) -> None: ... + def __ne__(self, arg0: TimeSignatureSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TimeSignatureSecond: """ Deep copy @@ -3708,8 +3368,8 @@ class TimeSignatureSecond: Shift the event time by offset """ @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TimeSignatureSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3730,53 +3390,42 @@ class TimeSignatureSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TimeSignatureSecondList) -> bool: - ... + def __eq__(self, arg0: TimeSignatureSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TimeSignatureSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TimeSignatureSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TimeSignatureSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TimeSignatureSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TimeSignatureSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TimeSignatureSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TimeSignatureSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: TimeSignatureSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TimeSignatureSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TimeSignatureSecond) -> None: """ Add an item to the end of the list @@ -3817,11 +3466,12 @@ class TimeSignatureSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Second: - ... + def ttype(self) -> Second: ... + class TimeSignatureTick: __hash__: typing.ClassVar[None] = None denominator: int @@ -3835,24 +3485,18 @@ class TimeSignatureTick: """ Deep copy """ - def __eq__(self, arg0: TimeSignatureTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TimeSignatureTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload def __init__(self, other: TimeSignatureTick) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: int, arg1: int, arg2: int) -> None: - ... - def __ne__(self, arg0: TimeSignatureTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __init__(self, arg0: int, arg1: int, arg2: int) -> None: ... + def __ne__(self, arg0: TimeSignatureTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def copy(self) -> TimeSignatureTick: """ Deep copy @@ -3862,8 +3506,8 @@ class TimeSignatureTick: Shift the event time by offset """ @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class TimeSignatureTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -3884,53 +3528,42 @@ class TimeSignatureTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TimeSignatureTickList) -> bool: - ... + def __eq__(self, arg0: TimeSignatureTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TimeSignatureTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TimeSignatureTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TimeSignatureTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TimeSignatureTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TimeSignatureTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TimeSignatureTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TimeSignatureTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: TimeSignatureTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TimeSignatureTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TimeSignatureTick) -> None: """ Add an item to the end of the list @@ -3971,11 +3604,12 @@ class TimeSignatureTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype(self) -> Tick: - ... + def ttype(self) -> Tick: ... + class TrackQuarter: __hash__: typing.ClassVar[None] = None controls: ControlChangeQuarterList @@ -3993,24 +3627,18 @@ class TrackQuarter: """ Deep copy """ - def __eq__(self, arg0: TrackQuarter) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TrackQuarter) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, other: TrackQuarter) -> None: """ Copy constructor """ - def __ne__(self, arg0: TrackQuarter) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __ne__(self, arg0: TrackQuarter) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def clip(self, start: float, end: float, clip_end: bool = False) -> TrackQuarter: """ Clip notes and controls to a given time range @@ -4019,27 +3647,20 @@ class TrackQuarter: """ Deep copy """ - def empty(self) -> bool: - ... - def end(self) -> float: - ... - def note_num(self) -> int: - ... - def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: - ... - def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: - ... - def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = False) -> typing.Any: - ... - def start(self) -> float: - ... + def empty(self) -> bool: ... + def end(self) -> float: ... + def note_num(self) -> int: ... + def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: ... + def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: ... + def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = False + ) -> typing.Any: ... + def start(self) -> float: ... @property - def ttype() -> Quarter: - ... + def ttype() -> Quarter: ... + class TrackQuarterList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -4060,53 +3681,42 @@ class TrackQuarterList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TrackQuarterList) -> bool: - ... + def __eq__(self, arg0: TrackQuarterList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TrackQuarterList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TrackQuarter: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TrackQuarter: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TrackQuarterList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TrackQuarterList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TrackQuarterList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TrackQuarter) -> None: - ... + def __setitem__(self, arg0: int, arg1: TrackQuarter) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TrackQuarterList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TrackQuarter) -> None: """ Add an item to the end of the list @@ -4147,11 +3757,12 @@ class TrackQuarterList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype() -> Quarter: - ... + def ttype() -> Quarter: ... + class TrackSecond: __hash__: typing.ClassVar[None] = None controls: ControlChangeSecondList @@ -4169,24 +3780,18 @@ class TrackSecond: """ Deep copy """ - def __eq__(self, arg0: TrackSecond) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TrackSecond) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, other: TrackSecond) -> None: """ Copy constructor """ - def __ne__(self, arg0: TrackSecond) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __ne__(self, arg0: TrackSecond) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def clip(self, start: float, end: float, clip_end: bool = False) -> TrackSecond: """ Clip notes and controls to a given time range @@ -4195,27 +3800,20 @@ class TrackSecond: """ Deep copy """ - def empty(self) -> bool: - ... - def end(self) -> float: - ... - def note_num(self) -> int: - ... - def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: - ... - def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: - ... - def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = False) -> typing.Any: - ... - def start(self) -> float: - ... + def empty(self) -> bool: ... + def end(self) -> float: ... + def note_num(self) -> int: ... + def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: ... + def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_time(self, offset: float, inplace: bool = False) -> typing.Any: ... + def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = False + ) -> typing.Any: ... + def start(self) -> float: ... @property - def ttype() -> Second: - ... + def ttype() -> Second: ... + class TrackSecondList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -4236,53 +3834,42 @@ class TrackSecondList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TrackSecondList) -> bool: - ... + def __eq__(self, arg0: TrackSecondList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TrackSecondList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TrackSecond: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TrackSecond: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TrackSecondList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TrackSecondList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TrackSecondList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TrackSecond) -> None: - ... + def __setitem__(self, arg0: int, arg1: TrackSecond) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TrackSecondList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TrackSecond) -> None: """ Add an item to the end of the list @@ -4323,11 +3910,12 @@ class TrackSecondList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype() -> Second: - ... + def ttype() -> Second: ... + class TrackTick: __hash__: typing.ClassVar[None] = None controls: ControlChangeTickList @@ -4345,24 +3933,18 @@ class TrackTick: """ Deep copy """ - def __eq__(self, arg0: TrackTick) -> bool: - ... - def __getstate__(self) -> bytes: - ... + def __eq__(self, arg0: TrackTick) -> bool: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, other: TrackTick) -> None: """ Copy constructor """ - def __ne__(self, arg0: TrackTick) -> bool: - ... - def __repr__(self) -> str: - ... - def __setstate__(self, arg0: bytes) -> None: - ... + def __ne__(self, arg0: TrackTick) -> bool: ... + def __repr__(self) -> str: ... + def __setstate__(self, arg0: bytes) -> None: ... def clip(self, start: int, end: int, clip_end: bool = False) -> TrackTick: """ Clip notes and controls to a given time range @@ -4371,27 +3953,20 @@ class TrackTick: """ Deep copy """ - def empty(self) -> bool: - ... - def end(self) -> int: - ... - def note_num(self) -> int: - ... - def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: - ... - def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_time(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: - ... - def sort(self, key: typing.Any = None, reverse: bool = False, inplace: bool = False) -> typing.Any: - ... - def start(self) -> int: - ... + def empty(self) -> bool: ... + def end(self) -> int: ... + def note_num(self) -> int: ... + def pianoroll(self, quantization: float, mode: str) -> numpy.ndarray: ... + def shift_pitch(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_time(self, offset: int, inplace: bool = False) -> typing.Any: ... + def shift_velocity(self, offset: int, inplace: bool = False) -> typing.Any: ... + def sort( + self, key: typing.Any = None, reverse: bool = False, inplace: bool = False + ) -> typing.Any: ... + def start(self) -> int: ... @property - def ttype() -> Tick: - ... + def ttype() -> Tick: ... + class TrackTickList: __hash__: typing.ClassVar[None] = None def __bool__(self) -> bool: @@ -4412,53 +3987,42 @@ class TrackTickList: """ Delete list elements using a slice object """ - def __eq__(self, arg0: TrackTickList) -> bool: - ... + def __eq__(self, arg0: TrackTickList) -> bool: ... @typing.overload def __getitem__(self, s: slice) -> TrackTickList: """ Retrieve list elements using a slice object """ @typing.overload - def __getitem__(self, arg0: int) -> TrackTick: - ... - def __getstate__(self) -> bytes: - ... + def __getitem__(self, arg0: int) -> TrackTick: ... + def __getstate__(self) -> bytes: ... @typing.overload - def __init__(self) -> None: - ... + def __init__(self) -> None: ... @typing.overload def __init__(self, arg0: TrackTickList) -> None: """ Copy constructor """ @typing.overload - def __init__(self, arg0: typing.Iterable) -> None: - ... - def __iter__(self) -> typing.Iterator: - ... - def __len__(self) -> int: - ... - def __ne__(self, arg0: TrackTickList) -> bool: - ... + def __init__(self, arg0: typing.Iterable) -> None: ... + def __iter__(self) -> typing.Iterator: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: TrackTickList) -> bool: ... @typing.overload def __repr__(self) -> str: """ Return the canonical string representation of this list. """ @typing.overload - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @typing.overload - def __setitem__(self, arg0: int, arg1: TrackTick) -> None: - ... + def __setitem__(self, arg0: int, arg1: TrackTick) -> None: ... @typing.overload def __setitem__(self, arg0: slice, arg1: TrackTickList) -> None: """ Assign list elements using a slice object """ - def __setstate__(self, arg0: bytes) -> None: - ... + def __setstate__(self, arg0: bytes) -> None: ... def append(self, x: TrackTick) -> None: """ Add an item to the end of the list @@ -4499,8 +4063,8 @@ class TrackTickList: """ Remove the first item from the list whose value is x. It is an error if there is no such item. """ - def sort(self, key: typing.Any, reverse: bool = False, inplace: bool = True) -> typing.Any: - ... + def sort( + self, key: typing.Any, reverse: bool = False, inplace: bool = True + ) -> typing.Any: ... @property - def ttype() -> Tick: - ... + def ttype() -> Tick: ... diff --git a/symusic/factory.py b/py-symusic/factory.py similarity index 86% rename from symusic/factory.py rename to py-symusic/factory.py index 00a1b58..b060470 100644 --- a/symusic/factory.py +++ b/py-symusic/factory.py @@ -88,7 +88,7 @@ class CoreClasses(Generic[T, Q, S]): second: S def dispatch( - self: "CoreClasses[T, Q, S]", ttype: smt.GeneralTimeUnit + self: "CoreClasses[T, Q, S]", ttype: smt.GeneralTimeUnit ) -> Union[T, Q, S]: """ Dispatch the correct Core class according to the ttype. @@ -120,12 +120,12 @@ class NoteFactory: __core_classes = CoreClasses(core.NoteTick, core.NoteQuarter, core.NoteSecond) def __call__( - self, - time: smt.TimeDtype, - duration: smt.TimeDtype, - pitch: int, - velocity: int, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + duration: smt.TimeDtype, + pitch: int, + velocity: int, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.Note: """ Note that `smt.TimeDtype = Union[int, float]`, and Note constructor requires @@ -146,11 +146,11 @@ class KeySignatureFactory: ) def __call__( - self, - time: smt.TimeDtype, - key: int, - tonality: int, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + key: int, + tonality: int, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.KeySignature: return self.__core_classes.dispatch(ttype)(time, key, tonality) # type: ignore @@ -165,11 +165,11 @@ class TimeSignatureFactory: ) def __call__( - self, - time: smt.TimeDtype, - numerator: int, - denominator: int, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + numerator: int, + denominator: int, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.TimeSignature: return self.__core_classes.dispatch(ttype)(time, numerator, denominator) # type: ignore @@ -184,11 +184,11 @@ class ControlChangeFactory: ) def __call__( - self, - time: smt.TimeDtype, - number: int, - value: int, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + number: int, + value: int, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.ControlChange: return self.__core_classes.dispatch(ttype)(time, number, value) # type: ignore @@ -201,10 +201,10 @@ class TempoFactory: __core_classes = CoreClasses(core.TempoTick, core.TempoQuarter, core.TempoSecond) def __call__( - self, - time: smt.TimeDtype, - tempo: float, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + tempo: float, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.Tempo: return self.__core_classes.dispatch(ttype)(time, tempo) # type: ignore @@ -217,10 +217,10 @@ class PedalFactory: __core_classes = CoreClasses(core.PedalTick, core.PedalQuarter, core.PedalSecond) def __call__( - self, - time: smt.TimeDtype, - duration: smt.TimeDtype, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + duration: smt.TimeDtype, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.Pedal: return self.__core_classes.dispatch(ttype)(time, duration) # type: ignore @@ -235,10 +235,10 @@ class PitchBendFactory: ) def __call__( - self, - time: smt.TimeDtype, - value: int, - ttype: smt.GeneralTimeUnit = TimeUnit.tick, + self, + time: smt.TimeDtype, + value: int, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.PitchBend: return self.__core_classes.dispatch(ttype)(time, value) # type: ignore @@ -269,12 +269,15 @@ class TrackFactory: __core_classes = CoreClasses(core.TrackTick, core.TrackQuarter, core.TrackSecond) def __call__( - self, name: str = "", program: int = 0, is_drum: bool = False, + self, + name: str = "", + program: int = 0, + is_drum: bool = False, notes: smt.GeneralNoteList = None, controls: smt.GeneralControlChangeList = None, pitch_bends: smt.GeneralPitchBendList = None, pedals: smt.GeneralPedalList = None, - ttype: smt.GeneralTimeUnit = TimeUnit.tick + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.Track: r""" Create a Track object with the given parameters. @@ -308,20 +311,21 @@ class ScoreFactory: __core_classes = CoreClasses(core.ScoreTick, core.ScoreQuarter, smt.ScoreSecond) def __call__( - self, x: Union[int, str, Path, smt.Score] = 0, - ttype: smt.GeneralTimeUnit = TimeUnit.tick + self, + x: Union[int, str, Path, smt.Score] = 0, + ttype: smt.GeneralTimeUnit = TimeUnit.tick, ) -> smt.Score: if isinstance(x, str) or isinstance(x, Path): return self.from_file(x, ttype) elif isinstance(x, int): return self.from_tpq(x, ttype) - elif isinstance(x, self): # type: ignore + elif isinstance(x, self): # type: ignore return self.from_other(x, ttype) else: raise TypeError(f"Invalid type: {type(x)}") def from_file( - self, path: Union[str, Path], ttype: smt.GeneralTimeUnit = TimeUnit.tick + self, path: Union[str, Path], ttype: smt.GeneralTimeUnit = TimeUnit.tick ) -> smt.Score: assert os.path.isfile(path), f"{path} is not a file" return self.__core_classes.dispatch(ttype).from_file(str(path)) diff --git a/symusic/types.py b/py-symusic/types.py similarity index 92% rename from symusic/types.py rename to py-symusic/types.py index 21e38ac..4a52465 100644 --- a/symusic/types.py +++ b/py-symusic/types.py @@ -25,9 +25,11 @@ class TimeUnit(Protocol): - def __repr__(self) -> str: ... + def __repr__(self) -> str: + ... - def is_time_unit(self) -> bool: ... + def is_time_unit(self) -> bool: + ... class ScoreSecond: @@ -42,9 +44,15 @@ def from_file(cls, *args, **kwargs): GeneralTimeUnit = Union[TimeUnit, str] TimeDtype = Union[int, float] Note = Union[core.NoteTick, core.NoteQuarter, core.NoteSecond] -KeySignature = Union[core.KeySignatureTick, core.KeySignatureQuarter, core.KeySignatureSecond] -TimeSignature = Union[core.TimeSignatureTick, core.TimeSignatureQuarter, core.TimeSignatureSecond] -ControlChange = Union[core.ControlChangeTick, core.ControlChangeQuarter, core.ControlChangeSecond] +KeySignature = Union[ + core.KeySignatureTick, core.KeySignatureQuarter, core.KeySignatureSecond +] +TimeSignature = Union[ + core.TimeSignatureTick, core.TimeSignatureQuarter, core.TimeSignatureSecond +] +ControlChange = Union[ + core.ControlChangeTick, core.ControlChangeQuarter, core.ControlChangeSecond +] Tempo = Union[core.TempoTick, core.TempoQuarter, core.TempoSecond] Pedal = Union[core.PedalTick, core.PedalQuarter, core.PedalSecond] PitchBend = Union[core.PitchBendTick, core.PitchBendQuarter, core.PitchBendSecond] @@ -53,13 +61,27 @@ def from_file(cls, *args, **kwargs): Score = Union[core.ScoreTick, core.ScoreQuarter, ScoreSecond] NoteList = Union[core.NoteTickList, core.NoteQuarterList, core.NoteSecondList] -KeySignatureList = Union[core.KeySignatureTickList, core.KeySignatureQuarterList, core.KeySignatureSecondList] -TimeSignatureList = Union[core.TimeSignatureTickList, core.TimeSignatureQuarterList, core.TimeSignatureSecondList] -ControlChangeList = Union[core.ControlChangeTickList, core.ControlChangeQuarterList, core.ControlChangeSecondList] +KeySignatureList = Union[ + core.KeySignatureTickList, core.KeySignatureQuarterList, core.KeySignatureSecondList +] +TimeSignatureList = Union[ + core.TimeSignatureTickList, + core.TimeSignatureQuarterList, + core.TimeSignatureSecondList, +] +ControlChangeList = Union[ + core.ControlChangeTickList, + core.ControlChangeQuarterList, + core.ControlChangeSecondList, +] TempoList = Union[core.TempoTickList, core.TempoQuarterList, core.TempoSecondList] PedalList = Union[core.PedalTickList, core.PedalQuarterList, core.PedalSecondList] -PitchBendList = Union[core.PitchBendTickList, core.PitchBendQuarterList, core.PitchBendSecondList] -TextMetaList = Union[core.TextMetaTickList, core.TextMetaQuarterList, core.TextMetaSecondList] +PitchBendList = Union[ + core.PitchBendTickList, core.PitchBendQuarterList, core.PitchBendSecondList +] +TextMetaList = Union[ + core.TextMetaTickList, core.TextMetaQuarterList, core.TextMetaSecondList +] TrackList = Union[core.TrackTickList, core.TrackQuarterList, core.TrackSecondList] GeneralNoteList = Union[NoteList, List[Note]] diff --git a/setup.py b/setup.py index 4cde5b8..bf13886 100644 --- a/setup.py +++ b/setup.py @@ -139,8 +139,8 @@ def build_extension(self, ext: CMakeExtension) -> None: long_description=open("README.md", encoding="utf-8").read(), long_description_content_type="text/markdown", license=open("LICENSE", encoding="utf-8").read(), - package_dir={"symusic": "symusic"}, - packages=["symusic"], + package_dir={"symusic": "py-symusic"}, + packages=["py-symusic"], ext_modules=[CMakeExtension("symusic.core", ".")], cmdclass={"build_ext": CMakeBuild}, package_data={"symusic": ["**/*.pyi"]}, @@ -148,5 +148,5 @@ def build_extension(self, ext: CMakeExtension) -> None: install_requires=["numpy"], setup_requires=["pybind11>=2.10"], python_requires=">=3.7", - #extras_require={"test": ["pytest>=6.0"]}, + extras_require={"test": ["pytest-cov", "pytest-xdist[psutil]"]}, ) diff --git a/src/symusic.cpp b/src/symusic.cpp index 1e3ca96..ae80dd3 100644 --- a/src/symusic.cpp +++ b/src/symusic.cpp @@ -78,7 +78,7 @@ py::class_ time_stamp_base(py::module &m, const std::string &name) { .def("shift_time", [](T &self, const unit offset, const bool inplace) { if (inplace) return self.shift_time_inplace(offset); else return self.shift_time(offset); - }, py::arg("offset"), + }, py::arg("offset"), py::arg("inplace")=false, "Shift the event time by offset") .def(py::init(), "Copy constructor", py::arg("other")) .def("copy", &T::copy, "Deep copy", py::return_value_policy::move) @@ -335,7 +335,7 @@ Score& py_sort_score_inplace(Score &self, py::object key, bool reverse) { py_sort_inplace(self.tempos, key, reverse); py_sort_inplace(self.lyrics, key, reverse); py_sort_inplace(self.markers, key, reverse); - for(auto &track: self.tracks) + for(auto &track: self.tracks) py_sort_track_inplace(track, key, reverse); return self; }; @@ -547,4 +547,4 @@ PYBIND11_MODULE(core, m) { core_module(m); -} \ No newline at end of file +} diff --git a/tests/dump.cpp b/tests/dump.cpp index baf34b6..1564ef5 100644 --- a/tests/dump.cpp +++ b/tests/dump.cpp @@ -30,4 +30,4 @@ int main(int argc, char *argv[]) { std::cout << "Usage: ./note_count " << std::endl; } return 0; -} \ No newline at end of file +} diff --git a/tests/note_count.cpp b/tests/note_count.cpp index bb70e33..4cc36e4 100644 --- a/tests/note_count.cpp +++ b/tests/note_count.cpp @@ -49,4 +49,4 @@ int main(int argc, char *argv[]) { std::cout << "Usage: ./note_count " << std::endl; } return 0; -} \ No newline at end of file +} diff --git a/tests/test_read_dump.py b/tests/test_read_dump.py index 5d2f0ba..339a6eb 100644 --- a/tests/test_read_dump.py +++ b/tests/test_read_dump.py @@ -1,4 +1,5 @@ from operator import attrgetter +from pathlib import Path import pytest @@ -7,16 +8,56 @@ @pytest.mark.parametrize("midi_path", MIDI_PATHS, ids=attrgetter("name")) -def test_load_dump(midi_path, tmp_path): +def test_load_dump(midi_path: Path, tmp_path: Path): """Test that a MIDI loaded and saved unchanged is indeed the save as before.""" midi1 = Score(midi_path) dump_path = tmp_path / midi_path.name midi1.dump_midi(dump_path) # Writing it unchanged midi2 = Score(dump_path) # Loading it back - # Sorting the notes, as after dump the order might have changed - for track1, track2 in zip(midi1.instruments, midi2.instruments): + # Sorting MIDI and tracks events, as after dump the order might have changed + midi1.tempos.sort(key=lambda x: (x.time, x.tempo)) + midi2.tempos.sort(key=lambda x: (x.time, x.tempo)) + midi1.markers.sort(key=lambda x: (x.time, x.text)) + midi2.markers.sort(key=lambda x: (x.time, x.text)) + midi1.lyrics.sort(key=lambda x: (x.time, x.text)) + midi2.lyrics.sort(key=lambda x: (x.time, x.text)) + for track1, track2 in zip(midi1.tracks, midi2.tracks): track1.notes.sort(key=lambda x: (x.start, x.pitch, x.end, x.velocity)) track2.notes.sort(key=lambda x: (x.start, x.pitch, x.end, x.velocity)) + track1.controls.sort(key=lambda x: (x.time, x.number, x.value)) + track2.controls.sort(key=lambda x: (x.time, x.number, x.value)) + track1.pitch_bends.sort(key=lambda x: (x.time, x.value)) + track2.pitch_bends.sort(key=lambda x: (x.time, x.value)) - assert midi1 == midi2 + # Check the objects are equal + midi_equals = midi1 == midi2 + + # If not, look for what's different and prints it + if not midi_equals: + track_attrs = ["notes", "controls", "pitch_bends", "pedals"] + for track1, track2 in zip(midi1.tracks, midi2.tracks): + for track_attr in track_attrs: + if getattr(track1, track_attr) != getattr(track2, track_attr): + # For debug + """for i, (obj1, obj2) in enumerate(zip( + getattr(track1, track_attr), getattr(track2, track_attr)) + ): + if obj1 != obj2: + list1 = getattr(track1, track_attr)[i-2:i+2] + list2 = getattr(track2, track_attr)[i-2:i+2] + break""" + print(f"{track_attr} are not equal for {track1.name}") + midi_attrs = [ + "tempos", + "time_signatures", + "key_signatures", + "markers", + "lyrics", + "ticks_per_quarter", + ] + for midi_attr in midi_attrs: + if getattr(midi1, midi_attr) != getattr(midi2, midi_attr): + print(f"{midi_attr} are not equals") + + assert midi_equals