-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
scope: music21relevant to parsing of music transcription input filesrelevant to parsing of music transcription input filesstatus: laterThis issue or pull request already existsThis issue or pull request already existstype: bugSomething isn't workingSomething isn't working
Description
commit: 9825ee1
brain dump:
the situation.
given:
- a Music21Object
el - a Stream
rootthat possibly contains it at some level - a Music21StreamType
clsfor some Stream type container
I want to know the closest container to el within root's hierarchy of type cls
the problem.
i thought i could use getContextByClass() for this - it seems perfect!
but that method instead seems to be doing much more complicated things like seeking backwards in any containers that directly hold el, or even containers that indirectly hold el.
the actual solution for my needs.
i'm gonna build my own logic on top of containerInHierarchy(), which retrieves the immediate container of el in root.
i can repeat that to build a parent tree from el to root, and then get the first container of type cls.
the wtf that has me still confused.
- given the above commit,
- when i make a stream of only some parts in a multi-part score (and save it to a local variable
harmonic_parts, - and then make another stream of all measures in the parts from the prior stream (and save it to a local variable
scoped_measures, - and then loop through each measure
minscoped_measuresand query each one'sm.getContextByClass(Part), - why does that return
Part2even for measures inPart1?
answer: because harmonic_parts is coming back somewhere in m.contextSites()
- why the heck?
- i think this has something to do with activeSite? like if
m.activeSiteisPart1it'll come back fine, but ifm.activeSiteisharmonic_parts(how the heck did that happen??mis not even inharmonic parts????) then it'll returnharmonic_partswhere it's not supposed to - is this a
music21bug? is this weird behavior like described in https://www.music21.org/music21docs/usersGuide/usersGuide_58_sitesContext.html?
todo for future
- strip this down to a minimal reproduction - no musicxml, just TinyNotation
- identify explicit deeper questions
- raise questions in
music21repo - https://github.com/cuthbertLab/music21
Metadata
Metadata
Assignees
Labels
scope: music21relevant to parsing of music transcription input filesrelevant to parsing of music transcription input filesstatus: laterThis issue or pull request already existsThis issue or pull request already existstype: bugSomething isn't workingSomething isn't working