openlilylib / lilypond-export

LilyPond export API to write Humdrum, MusicXML and more
GNU General Public License v3.0
22 stars 8 forks source link

Grace notes at moment 0 somehow end up in the previous bar #14

Open rshura opened 5 years ago

rshura commented 5 years ago

The following exapmle has a grace note right before the first beat in bar 2.

\version "2.19.58"
\include "oll-core/package.ily"
\loadPackage lilypond-export

music = \new Staff {
  e'4( d')\prall <c' e' g'>4(\prall <c' f' a'>) |
  \appoggiatura{g16} <c f' a'>4 r2.
}

opts.exporter = #exportMusicXML
\score {
  \music
  \layout {
    \FileExport #opts
  }
}

In the XML output, this note appears at the beginning of bar 1 instead of bar 2.

I saw some code in api.scm that changes the bar in some conditions, but I could not follow the logic.

If the grace note is in the middle of the measure then it stays where it should in XML. Only the beginning of the measure seems to be the issue.