From 12efcdf84357225cbed56ed4eff36861db7fb792 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Fri, 3 Jan 2025 15:30:18 -1000 Subject: [PATCH 1/2] Happy New Year 2025 Update copyright information --- .idea/inspectionProfiles/profiles_settings.xml | 7 +++++++ README.md | 2 +- music21/__init__.py | 10 ++++++---- music21/license.txt | 4 ++-- music21/romanText/translate.py | 13 ++++++++++--- 5 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .idea/inspectionProfiles/profiles_settings.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..dd4c951ef --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index f7dc166eb..bbe725cb0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ `music21` -- A Toolkit for Computer-Aided Musical Analysis and Computational Musicology -Copyright © 2006-2024 [Michael Scott Asato Cuthbert](http://www.trecento.com) +Copyright © 2006-2025 [Michael Scott Asato Cuthbert](http://www.trecento.com) For more information, visit: https://www.music21.org/music21docs/ diff --git a/music21/__init__.py b/music21/__init__.py index 61b0ebf3b..8f27c1f5b 100644 --- a/music21/__init__.py +++ b/music21/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -The music21 Framework is Copyright © 2006-2024 Michael Scott Asato Cuthbert. +The music21 Framework is Copyright © 2006-2025 Michael Scott Asato Cuthbert. Some Rights Reserved Released under the BSD (3-clause) license. See license.txt. @@ -52,7 +52,7 @@ If you have the wrong version there are several options for getting the right one. - - 1. (Best) Upgrade to Python 3, latest (currently 3.12). + - 1. (Best) Upgrade to a recent version of Python 3 (such as 3.13). The great features there will more than make up for the headache of downloading @@ -62,7 +62,9 @@ Try running "python3" instead of "python" - 2. Upgrade pip and setuptools to the latest version - and then "upgrade" music21 to an earlier version. + and then use "upgrade" to downgrade music21 to + an earlier version. + For instance to install version 4 you'd run: $ pip install --upgrade pip setuptools @@ -122,7 +124,7 @@ # individual modules # KEEP ALPHABETICAL unless necessary for load reasons, if so - # put a note. Keep one letter per line. + # put a note. 'articulations', 'bar', diff --git a/music21/license.txt b/music21/license.txt index 286e2bcd0..37d73c6a6 100644 --- a/music21/license.txt +++ b/music21/license.txt @@ -6,7 +6,7 @@ # distributed with this package, particularly the corpus files # which have their own copyrights and licenses. # -# Copyright: music21 is "Copyright © 2006-2024 Michael Scott Asato Cuthbert" +# Copyright: music21 is "Copyright © 2006-2025 Michael Scott Asato Cuthbert" # and is open-source licensed under the # BSD 3-Clause License (beginning with music21 v2.0) # reprinted below. @@ -22,7 +22,7 @@ the BSD license still under effect. --- BSD License -Copyright (c) 2006-2024 Michael Scott Asato Cuthbert +Copyright (c) 2006-2025 Michael Scott Asato Cuthbert All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/music21/romanText/translate.py b/music21/romanText/translate.py index 7579b493b..6539a2896 100644 --- a/music21/romanText/translate.py +++ b/music21/romanText/translate.py @@ -132,6 +132,7 @@ from music21 import bar from music21 import base from music21 import common +from music21.common.types import OffsetQL from music21 import environment from music21 import exceptions21 from music21 import harmony @@ -703,7 +704,13 @@ def translateSingleMeasure(self, measureToken): m.coreElementsChanged() return m - def translateSingleMeasureAtom(self, a, m, *, isLastAtomInMeasure=False): + def translateSingleMeasureAtom( + self, + a: rtObjects.RTAtom, + m: stream.Measure, + *, + isLastAtomInMeasure: bool = False, + ) -> None: ''' Translate a single atom in a measure token. @@ -711,7 +718,7 @@ def translateSingleMeasureAtom(self, a, m, *, isLastAtomInMeasure=False): `m` is a `stream.Measure` object. Uses coreInsert and coreAppend methods, so must have `m.coreElementsChanged()` - called afterwards. + called afterward. ''' if (isinstance(a, rtObjects.RTKey) or (self.foundAKeySignatureSoFar is False @@ -831,7 +838,7 @@ def translateSingleMeasureAtom(self, a, m, *, isLastAtomInMeasure=False): m.coreInsert(self.currentOffsetInMeasure, rtt) # environLocal.warn(f' Got an unknown token: {a}') - def processRTChord(self, a, m, currentOffset): + def processRTChord(self, a: rtObjects.RTChord, m: stream.Measure, currentOffset: OffsetQL) -> None: ''' Process a single RTChord atom. ''' From 0d533d3fc9588f85dc7e8fd62c6400cd26c44358 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Fri, 3 Jan 2025 15:50:33 -1000 Subject: [PATCH 2/2] Fix lint and mypy --- music21/common/enums.py | 6 +++--- music21/romanText/translate.py | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/music21/common/enums.py b/music21/common/enums.py index 5ef9efb6d..f23347ffc 100644 --- a/music21/common/enums.py +++ b/music21/common/enums.py @@ -157,9 +157,9 @@ class OffsetSpecial(StrEnum): * New in v7. ''' - AT_END: str = 'highestTime' - LOWEST_OFFSET: str = 'lowestOffset' - HIGHEST_OFFSET: str = 'highestOffset' + AT_END = 'highestTime' + LOWEST_OFFSET = 'lowestOffset' + HIGHEST_OFFSET = 'highestOffset' class GatherSpanners(BooleanEnum): diff --git a/music21/romanText/translate.py b/music21/romanText/translate.py index 6539a2896..9bb2379a0 100644 --- a/music21/romanText/translate.py +++ b/music21/romanText/translate.py @@ -838,7 +838,12 @@ def translateSingleMeasureAtom( m.coreInsert(self.currentOffsetInMeasure, rtt) # environLocal.warn(f' Got an unknown token: {a}') - def processRTChord(self, a: rtObjects.RTChord, m: stream.Measure, currentOffset: OffsetQL) -> None: + def processRTChord( + self, + a: rtObjects.RTChord, + m: stream.Measure, + currentOffset: OffsetQL + ) -> None: ''' Process a single RTChord atom. ''' @@ -894,7 +899,7 @@ def processRTChord(self, a: rtObjects.RTChord, m: stream.Measure, currentOffset: rn.followsKeyChange = False except roman.RomanNumeralException: # pragma: no cover # environLocal.printDebug(f' cannot create RN from: {a.src}') - rn = note.Note() # create placeholder + rn = roman.RomanNumeral() # create placeholder if self.pivotChordPossible is False: # probably best to find duration