cuthbertLab / music21

music21 is a Toolkit for Computational Musicology
https://www.music21.org/
Other
2.12k stars 401 forks source link

TypeError: unhashable type: 'PitchedTimespan' when using ChordReducer #862

Open gulnazaki opened 3 years ago

gulnazaki commented 3 years ago

music21 version

6.7.0

TypeError: unhashable type: 'PitchedTimespan' when using ChordReducer

Steps to reproduce

>>> score = corpus.parse('PMFC_06_Giovanni-05_Donna').measures(1, 13)
>>> r = analysis.reduceChords.ChordReducer()
>>> reduced = r.run(a, closedPosition=True, maximumNumberOfChords=3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...../.local/lib/python3.8/site-packages/music21/analysis/reduceChords.py", line 112, in run
    self.fillMeasureGaps(scoreTree, partwiseTrees)
  File "...../.local/lib/python3.8/site-packages/music21/analysis/reduceChords.py", line 404, in fillMeasureGaps
    toInsert.add(newTimespan)
TypeError: unhashable type: 'PitchedTimespan'
mscuthbert commented 3 years ago

Thanks -- reduceChords is likely to be gone in v7; reduceChordsOld is much slower but has been shown to work significantly better.

mscuthbert commented 3 years ago

it has a reprieve until v8 at least. And the final module will still be called "reduceChords" and will probably have the same interface for a standard/no-configuration run.

jacobtylerwalls commented 3 years ago

Milestones aren't commitments anyway, but wanted to clarify I wasn't announcing "finish the module" for v8, but rather just putting on the radar for potential TLC or quick fixes.