Skip to content

Support Harmony (chord symbols) #2

@sirlensalot

Description

@sirlensalot
      toCh (ChNote (c,_)) = case c of
        Nothing -> []
        Just (sp,sc)
          | sc == mixo -> mkHarm KindValueDominant (toRoot sp)
          | otherwise -> mkHarm KindValueMajor (toRoot sp)

      mkHarm k r = [MusicDataHarmony ((mkHarmony mkEditorial) { harmonyHarmonyChord = [mkHarmonyChord (mkHarmonyChordRoot r) (mkKind k)] })]

      toRoot sp = uncurry Root $ over _1 mkRootStep $ over _2 (fmap mkRootAlter) $ case sp of
                    C -> (StepC,Nothing)
                    Cs -> (StepC,Just 1)
                    Db -> (StepD,Just $ -1)
                    D -> (StepD,Nothing)
                    Ds -> (StepD,Just 1)
                    Eb -> (StepE,Just $ -1)
                    E -> (StepE,Nothing)
                    F -> (StepF,Nothing)
                    Fs -> (StepF,Just 1)
                    Gb -> (StepG,Just $ -1)
                    G -> (StepG,Nothing)
                    Gs -> (StepG,Just 1)
                    Ab -> (StepA,Just $ -1)
                    A -> (StepA,Nothing)
                    As -> (StepA,Just 1)
                    Bb -> (StepB,Just $ -1)
                    B -> (StepB,Nothing)

degree system seems interesting , A7#11no3 in musescore produces:

      <harmony print-frame="no">
        <root>
          <root-step>A</root-step>
          </root>
        <kind>dominant</kind>
        <degree>
          <degree-value>11</degree-value>
          <degree-alter>1</degree-alter>
          <degree-type>add</degree-type>
          </degree>
        <degree>
          <degree-value>3</degree-value>
          <degree-alter>0</degree-alter>
          <degree-type>subtract</degree-type>
          </degree>
        </harmony>
 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions