Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def _filtered_warning(self, msg, *args, **kw):
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
# 'literal' makes single backticks render as inline code, like Markdown.
default_role = 'literal'

# If true, '()' will be appended to :func: etc. cross-reference text.
# add_function_parentheses = True
Expand Down
3 changes: 0 additions & 3 deletions music21/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
but I don't want to have lots of 2.0.0-alpha2, etc., I'd rather call it 2.0.2, and tell users
to wait for 2.1. Even numbered first decimal releases (e.g. 5.4) are also beta.


Q: Why is this here and not in music21/__init__.py?

A: Keeping the information here makes it available to package managers and others who
Expand All @@ -32,10 +31,8 @@
package managers in various Linux distributions - work with Music21 without
complaint.


Thanks to Andrew Hankinson for suggesting this way of dealing with versions to begin with.


Changing Versions
==================

Expand Down
11 changes: 0 additions & 11 deletions music21/abcFormat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ def getKeySignatureObject(self) -> t.Union[key.Key,
Return a music21 :class:`~music21.key.KeySignature` or :class:`~music21.key.Key`
object for this metadata tag.


>>> am = abcFormat.ABCMetadata('K:G')
>>> am.preParse()
>>> ks = am.getKeySignatureObject()
Expand Down Expand Up @@ -772,7 +771,6 @@ def getDefaultQuarterLength(self) -> float:
>>> am.getDefaultQuarterLength()
0.5


If taking from meter, find the "fraction" and if < 0.75 use sixteenth notes.
If >= 0.75 use eighth notes.

Expand All @@ -786,13 +784,11 @@ def getDefaultQuarterLength(self) -> float:
>>> am.getDefaultQuarterLength()
0.5


>>> am = abcFormat.ABCMetadata('M:6/8')
>>> am.preParse()
>>> am.getDefaultQuarterLength()
0.5


Meter is only used for default length if there is no L:

>>> x = 'L:1/4\nM:3/4\n\nf'
Expand Down Expand Up @@ -1061,7 +1057,6 @@ def updateRatio(
>>> at.numberNotesActual, at.numberNotesNormal
(2, 3)


Some other types:

>>> for n in 1, 2, 3, 4, 5, 6, 7, 8, 9:
Expand Down Expand Up @@ -1478,7 +1473,6 @@ def getPitchName(
>>> an.getPitchName('{c}')
('C5', None)


Given an active KeySignature object, the pitch name might
change:

Expand Down Expand Up @@ -2765,7 +2759,6 @@ def __add__(self, other):

Used in polyphonic metadata merge


>>> abcStr = 'M:6/8\\nL:1/8\\nK:G\\n'
>>> ah1 = abcFormat.ABCHandler()
>>> junk = ah1.process(abcStr)
Expand Down Expand Up @@ -2799,14 +2792,12 @@ def definesReferenceNumbers(self):
Return True if this token structure defines more than 1 reference number,
usually implying multiple pieces encoded in one file.


>>> abcStr = 'X:5\\nM:6/8\\nL:1/8\\nK:G\\nB3 A3 | G6 | B3 A3 | G6 ||'
>>> ah = abcFormat.ABCHandler()
>>> junk = ah.process(abcStr)
>>> ah.definesReferenceNumbers() # only one returns False
False


>>> abcStr = 'X:5\\nM:6/8\\nL:1/8\\nK:G\\nB3 A3 | G6 | B3 A3 | G6 ||\\n'
>>> abcStr += 'X:6\\nM:6/8\\nL:1/8\\nK:G\\nB3 A3 | G6 | B3 A3 | G6 ||'
>>> ah = abcFormat.ABCHandler()
Expand Down Expand Up @@ -2941,7 +2932,6 @@ def getReferenceNumber(self):
If tokens are processed, get the first
reference number defined.


>>> abcStr = 'X:5\\nM:6/8\\nL:1/8\\nK:G\\nB3 A3 | G6 | B3 A3 | G6 ||'
>>> ah = abcFormat.ABCHandler()
>>> junk = ah.process(abcStr)
Expand Down Expand Up @@ -3489,7 +3479,6 @@ def extractReferenceNumber(strSrc: str, number: int) -> str:
music21.abcFormat.ABCFileException: cannot find requested
reference number in source file: 99


If the same number is defined twice in one file (should not be) only
the first data is returned.

Expand Down
2 changes: 0 additions & 2 deletions music21/alpha/analysis/aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ def setupDistanceMatrix(self):
>>> target0 = converter.parse('tinyNotation: C4 D C E')
>>> source0 = converter.parse('tinyNotation: C4 D C')


>>> sa0 = alpha.analysis.aligner.StreamAligner(target0, source0)
>>> sa0.setupDistanceMatrix()
>>> sa0.distanceMatrix.size
Expand Down Expand Up @@ -424,7 +423,6 @@ def getOpFromLocation(self, i, j):
[6, 4, 2, 0],
[8, 6, 4, 2]])


>>> sa.getOpFromLocation(4, 3)
<ChangeOps.Insertion: 0>

Expand Down
6 changes: 0 additions & 6 deletions music21/alpha/analysis/fixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> omrStream1[1]
<music21.note.Note A#>


TEST 2, no changes in OMR stream

>>> omrStream2 = stream.Stream()
Expand All @@ -126,7 +125,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> omrStream1[1]
<music21.note.Note A#>


TEST 3 (case 1)

>>> midiNote3 = note.Note('A4')
Expand All @@ -142,7 +140,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> fixer3.fix()
>>> omrNote3.pitch.accidental


TEST 4 (case 2-1) e.g MIDI = g#, ground truth = a-, OMR = an

>>> midiNote4 = note.Note('G#4')
Expand All @@ -159,7 +156,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> omrNote4.pitch.accidental
<music21.pitch.Accidental flat>


TEST 5 (case 2-2) e.g midi = g-, gt = f#, omr = fn

>>> midiNote5 = note.Note('G-4')
Expand All @@ -176,7 +172,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> omrNote5.pitch.accidental
<music21.pitch.Accidental sharp>


TEST 6.1 (case 3) e.g. midi = g#, gt = g#, omr = gn or omr = g-

>>> midiNote6_1 = note.Note('G#4')
Expand All @@ -201,7 +196,6 @@ class EnharmonicFixer(OMRMidiFixer):
>>> omrNote6_2.pitch.accidental
<music21.pitch.Accidental sharp>


TEST 7 (case 4-1, 4-2) notes are on different step, off by an interval of 2:
* 4-1: e.g. midi = g#, gt = a-, omr = a#
* 4-2: e.g. midi = a-, gt = g#, omr = g-
Expand Down
2 changes: 0 additions & 2 deletions music21/analysis/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ def getSolution(self, sStream):
Note that all alternative solutions are returned as Key objects and stored
on a list found at Key.alternateInterpretations.


>>> s = corpus.parse('bach/bwv66.6')
>>> p = analysis.discrete.KrumhanslSchmuckler()
>>> p.getSolution(s) # this seems correct
Expand Down Expand Up @@ -1332,7 +1331,6 @@ def analyzeStream(
>>> analysis.discrete.analyzeStream(s, 'span')
<music21.interval.Interval m21>


Note that the same results can be obtained by calling "analyze" directly on the stream object:
>>> s.analyze('key')
<music21.key.Key of f# minor>
Expand Down
2 changes: 0 additions & 2 deletions music21/analysis/patel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ def nPVI(streamForAnalysis):
Algorithm to give the normalized pairwise variability index
(Low, Grabe, & Nolan, 2000) of the rhythm of a stream.


Used by Aniruddh D. Patel to argue for national differences between musical
themes. First encountered it in a presentation by Patel, Chew, Francois,
and Child at MIT.


n.b. -- takes the distance between each element, including clefs, keys, etc.
use .notesAndRests etc. to filter out elements that are not useful (though this will skip
zero length objects)
Expand Down
2 changes: 0 additions & 2 deletions music21/analysis/pitchAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def pitchAttributeCount(s, pitchAttr='name'):
9: 17
11: 14


List in most common order:

>>> nameCount = analysis.pitchAnalysis.pitchAttributeCount(bach, 'name')
Expand All @@ -41,7 +40,6 @@ def pitchAttributeCount(s, pitchAttr='name'):
A: 17
F#: 15


>>> nameOctaveCount = analysis.pitchAnalysis.pitchAttributeCount(bach, 'nameWithOctave')
>>> for n in sorted(nameOctaveCount):
... print(f'{n:>3s}: {nameOctaveCount[n]:2d}')
Expand Down
2 changes: 0 additions & 2 deletions music21/analysis/windowed.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def analyze(self, windowSize, windowType='overlap'):
minus the window size plus one. If we have 20 1/4 windows, then the results lists
will be of length 20 for window size 1, 19 for window size 2, 18 for window size 3, etc.


>>> s = corpus.parse('bach/bwv66.6')
>>> p = analysis.discrete.Ambitus()
>>> wa = analysis.windowed.WindowedAnalysis(s.flatten(), p)
Expand Down Expand Up @@ -259,7 +258,6 @@ def process(self,

If `includeTotalWindow` is True, the largest window size will always be added.


>>> s = corpus.parse('bach/bwv324')
>>> ksAnalyzer = analysis.discrete.KrumhanslSchmuckler()

Expand Down
3 changes: 0 additions & 3 deletions music21/audioSearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ def prepareThresholds(useScale=None):
scale + octave repetition. If useScale is a ChromaticScale, `prepareThresholds`
will return a 12-element list. If it's a diatonic scale, it'll have 7 elements.


>>> pitchThresholds, pitches = audioSearch.prepareThresholds(scale.MajorScale('A3'))
>>> for i in range(len(pitchThresholds)):
... print(f'{pitches[i]} < {pitchThresholds[i]:.2f} < {pitches[i + 1]}')
Expand Down Expand Up @@ -573,7 +572,6 @@ def smoothFrequencies(
>>> audioSearch.smoothFrequencies(inputPitches, smoothLevels=28)[:5]
[432, 432, 432, 432, 432]


If inPlace is True then the list is modified in place and nothing is returned:

>>> audioSearch.smoothFrequencies(inputPitches, inPlace=True)
Expand Down Expand Up @@ -837,7 +835,6 @@ def notesAndDurationsToStream(
contains the notes, etc. Does not run :meth:`~music21.stream.base.Stream.makeNotation`
on the Score.


>>> durationList = [20, 19, 10, 30, 6, 21]
>>> n = note.Note
>>> noteList = [n('C#4'), n('D5'), n('B4'), n('F#5'), n('C5'), note.Rest()]
Expand Down
1 change: 0 additions & 1 deletion music21/audioSearch/scoreFollower.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def silencePeriodDetection(self, notesList):
>>> ScF.silencePeriodCounter
1


>>> ScF = scoreFollower.ScoreFollower(scoreStream=scNotes)
>>> notesList = []
>>> notesList.append(note.Rest())
Expand Down
Loading
Loading