openlilylib / scholarly

ScholarLY, a library for annotating LilyPond scores
GNU General Public License v3.0
24 stars 6 forks source link

Restructure LaTeX export routine #62

Closed uliska closed 6 years ago

uliska commented 6 years ago

I think this should be pretty much in line with the demands of the code in the LaTeX package.

On the one hand this commit is a reflection of my improved Scheme coding knowledge. On the other (and presumably more important) hand this makes fundamental changes and applies several enhancments:

Example file:

\version "2.19.80"

\include "oll-core/package.ily"
\loadModule scholarly.annotate

\setOption scholarly.annotate.export-targets #'(latex)

\new Staff = "Erste Stimme" {
  r16
  \musicalIssue \with {
    author = "Urs Liska"
    message = "Huh?"
    alternative = { c' d' e' }
  }
  NoteHead
  c'8.
  \criticalRemark \with {
    message = "WTF"
  }
  Beam
  d'8 [ e' ]
}

results in the following output:

\musicalIssue[
    grob-type={NoteHead},
    input-file-name={annotations.ly},
    context-id={Erste Stimme},
    location={/home/uliska/git/bfsc/projects/kayser/test/annotations.ly:10:2:2},
    type={musical-issue},
    author={Urs Liska},
    message={Huh?},
    alternative={ c'16 d'16 e'16 },
    beat-string={1 1/4},
    beat-fraction={1/4},
    beat-part={1/16},
    our-beat={1},
    measure-pos={1/16},
    measure-no={1},
    rhythmic-location={1,1/16},
    meter={(4 . 4)},
    beat-string-lilyglyphs={1.\,\crotchet,\,2. \semiquaver}]

\criticalRemark[
    grob-type={Beam},
    input-file-name={annotations.ly},
    context-id={Erste Stimme},
    location={/home/uliska/git/bfsc/projects/kayser/test/annotations.ly:17:2:2},
    type={critical-remark},
    message={WTF},
    beat-string={2},
    beat-fraction={0},
    beat-part={0},
    our-beat={2},
    measure-pos={1/4},
    measure-no={1},
    rhythmic-location={1,1/4},
    meter={(4 . 4)},
    beat-string-lilyglyphs={2.\,\crotchet}]