Skip to content

Commit

Permalink
delete notation (#161)
Browse files Browse the repository at this point in the history
* delete notation

* delete unused code

* update deps
  • Loading branch information
tandav authored Feb 8, 2024
1 parent 66c6ab2 commit 2023aed
Show file tree
Hide file tree
Showing 44 changed files with 3 additions and 1,506 deletions.
11 changes: 3 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ dependencies = [
"mido>=1.3.0",
"svg.py",
"numpy",
"PyYAML",
"pydantic>=2.5",
]

[project.optional-dependencies]
dev = [
"bumpver==2023.1129",
"hypothesis==6.97.1",
"hypothesis==6.98.1",
"pre-commit==3.6.0",
"pytest==7.4.4",
"pytest-asyncio==0.23.3",
"pytest-asyncio==0.23.4",
"pytest-cov==4.1.0", # https://github.com/pytest-dev/pytest/issues/11868#issuecomment-1913516238
]

Expand All @@ -34,7 +32,7 @@ rtmidi = [
[project.urls]
source = "https://github.com/tandav/musiclib"
# docs = "https://tandav.github.io/musiclib"
issues = "https://notes.tandav.me/notes/?tags=musictool"
issues = "https://gitlab.tandav.me/tandav/notes/-/issues/?label_name=musiclib"
"release notes" = "https://github.com/tandav/musiclib/releases"

# ==============================================================================
Expand Down Expand Up @@ -67,9 +65,6 @@ tag = true
"src/musiclib/__init__.py" = [
"^__version__ = '{pep440_version}'",
]
"tests/midi/data/notation/*/*.txt" = [
"^musiclib_version {pep440_version}",
]

# ==============================================================================

Expand Down
301 changes: 0 additions & 301 deletions src/musiclib/midi/notation.py

This file was deleted.

14 changes: 0 additions & 14 deletions src/musiclib/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@

@functools.total_ordering
class Note(Cached):
"""
abstract note, no octave/key
kinda music theoretic pitch-class
"""

def __init__(self, name: str) -> None:
"""param name: one of CdDeEFfGaAbB"""
self.name = name
self.i = _note_i[name]
self.is_black = _is_black[name]
Expand Down Expand Up @@ -79,12 +73,6 @@ def __sub__(self, other: int) -> Note:
...

def __sub__(self, other: Note | AbstractInterval | int) -> AbstractInterval | Note:
"""
kinda constraint (maybe it will be changed later):
if you're computing distance between abstract notes - then self considered above other
G - C == 7 # C0 G0
C - G == 5 # G0 C1
"""
if isinstance(other, Note):
if other.i <= self.i:
return AbstractInterval(self.i - other.i)
Expand Down Expand Up @@ -146,7 +134,6 @@ def __sub__(self, other: SpecificNote) -> int:
def __sub__(self, other: int) -> SpecificNote:
...

# @functools.cache
def __sub__(self, other: SpecificNote | int) -> int | SpecificNote:
if isinstance(other, SpecificNote): # distance between notes
return self.i - other.i
Expand All @@ -155,7 +142,6 @@ def __sub__(self, other: SpecificNote | int) -> int | SpecificNote:
raise TypeError(f'SpecificNote.__sub__ supports only SpecificNote | int, got {type(other)}')

def __add__(self, other: int) -> SpecificNote:
"""C + 7 = G"""
return SpecificNote.from_i(self.i + other)

def __getnewargs__(self) -> tuple[Note, int]:
Expand Down
7 changes: 0 additions & 7 deletions src/musiclib/util/typeguards.py

This file was deleted.

Loading

0 comments on commit 2023aed

Please sign in to comment.