Skip to content

Misc - Post #1937 TODOs for FB #1938

Description

@mscuthbert

PR #1937 was a complex enough PR that the misc changes I saw there I wanted to record for later. Just got through features and figuredBass/[a-p].*.py

  • in figuredBass/checker.py these lines seem like they want to use .template().flatten() instead?
    newParts: list[stream.Stream] = [
        allParts[i].flatten().getElementsNotOfClass('GeneralNote').stream()
        for i in range(len(allParts))
    ]
  • rename hiddenFifth to hiddenFifths and same with hiddenOctave, if the logic is the same as parallelFifths/Octaves

  • if music21GeneralNote.isNote -> use isinstance -- now fast enough. isNote is on the chopping block.

  • figuredBass/notation.py -- figure out why "origNumbers" and "numbers" can have strings not just ints.

  • figuredBass/possibility.py -- couldBeItalianA6Resolution -- remove casts on third, fifth -- they might be None! test for that instead.

  • if debug is True, etc.

  • Hash pitch outcomes by nameWithOctave -- old hashablePitch is gone. -- no pitches ARE hashable! so the caches work! (Test at least one)

  • Use the same cache parallelFifthsTable in possibility.py and checker.py -- but should we be using VLQs anyhow?

  • Update this doc in possibilities to note that the bass is often not included

# A possibility is a tuple of pitches, one per part, ordered from the highest
# part to the lowest part (the last element is the bass). 
  • partPairs -- zip to zip strict=True
  • realizerScale: scaleValue -> scaleTonic
  • realizerScale: getPitchNames -- notationString: str = '' -- find similar places (getSamplePitches and getPitches all similar)
  • realizerScale: t.cast(int, maxPitch.octave) -- no -- just maxPitch.implicitOctave
  • segment.Segment - and perhaps others - make a ProtoM21Object -- segment --notationString: str = ''? (but change later in init... -- what happens if notationString is not None and listOfPitches is not None -- listOfPitches vanishes?? --
  • resolveDominantSeventhSegment -- document that major scale will always have tonic, ^4, ^6, etc. same for dim seventh segment.
  • segment -- remove bare inserts added in Add typing to figuredBass #1940
  • realizer -- addLyricsToBassNote -- notationString = '' -- addElement would change bassObject.editorial.notationString slightly, but not in a way I think it would matter? Need to check.
  • realizer -- addElement -- switch to isinstance, which should get rid of the checking. (is Harmony the type we want anyhow? Maybe...but if NoChord() is a Harmony object then we're in trouble... so maybe the union class is still best.)
  • realizer.realize -- switch on .classes should use isinstance.
  • realizer _trimAllMovements -- should probably set movementsAB: dict[...] = {} -- then no problem. Creating one additional empty dict is almost a no-op. THen no need to do the movementsABFinal recasting.
  • Realization -- no point in typing **fbLineOutputs as t.Any. -> None is good enough to get typeChecking, but the class should have typed attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions