Hey Aaron, Before I respond to the rest of your email, I think it's worth going over something I didn't emphasize enough in my first email. I've attached a new pdf with instrument labels this time to make it easier to follow.
The staves that continue to be printed appear to only happen when the last note in that staff is an actual printed note. If it's a rest or a space then the extra staves are not printed. Further experimentation and it looks like the extra staves are only printed if the final note is less than a quarter note (!). You can see this in two spots with Piano 4 and Piano 5 on page 3. I've attached the .ly file as well. Maybe something to do with the time signature as well? This looks like a bug maybe? > I would have thought it fairly trivial* to keep track of bar lines. You need only add up the durations of the notes you have emitted ... Of course, you might have notes that overlap the bar line, and perhaps you are leveraging LilyPond's ability to automatically split notes.... For the purposes of inserting bar checks, you would skip it since the next note does not start the measure. I've thought more about it and perhaps it would be fairly easy. I do, as you mentioned here, use Lilypond's feature to automatically split notes across bar lines. Skipping where there isn't natural bar line seems doable. But I guess my question is whether this would actually help the situation? > One thing to consider: if your music is really fluid, perhaps writing things with \cadenzaOn makes sense. Here there are no measures, and you can emit bar lines whenever you see fit. I use the bar lines mainly for aesthetic reasons. The software will eventually be online and civilians will be able to use it to generate audio files and sheet music (and lots of other stuff). I want the evenly spaced bar lines because I think it looks cooler. And for algorithms where everything fits neatly into measures then doing this the default Lilypond way works (ie, I don't want to have to have too create and maintain too many different printing options). I think easier for me is to give the user the option to use the "s128" option before the ending bar line if the printing looks funky and by default not use it for the algorithms that are designed to fit neatly. > Then again, it is entirely possible that your intentionally misaligned > systems are just running afoul of some limitation of LilyPond. I certainly have never tried pushing this aspect of the software. That could be. On Sun, May 19, 2019 at 6:06 AM Aaron Hill <[email protected]> wrote: > > On 2019-05-18 10:46 pm, David Bellows wrote: > >> Maybe use bar checks? > > > > Given that a lot of the music isn't generated to fit any particular > > time signature (ie, the bar lines are often there just to break things > > up to ease reading), I would get tons of bar check errors. Plus, > > keeping track of when bars should be inserted in my software seems > > like it would be a huge chore. Is this something you think would solve > > the problem? > > I would have thought it fairly trivial* to keep track of bar lines. You > need only add up the durations of the notes you have emitted and, when > the running count equals a whole measure, you know there is spot for a > bar check. Of course, you might have notes that overlap the bar line, > and perhaps you are leveraging LilyPond's ability to automatically split > notes. In this case, you would see that the durations exceed a whole > measure by some fraction. For the purposes of inserting bar checks, you > would skip it since the next note does not start the measure. > > (* Let's assume that 1/128 notes are the shortest duration your program > generates. Then each instance of that duration could simply add one to > a counter. 1/64 notes add two; 1/32 add four; etc. Depending on how > many 1/128 notes make up the desired length of a measure, you subtract > that amount from the running total when it is equal or greater. And > anytime the counter is zero, you emit a bar check before the next note. > Of course the amounts to add get a little more interesting with tuplets > and unusually scaled durations. A more general-purpose rational > representation could be useful.) > > I have not checked exactly, but perhaps your final measures on each line > are not precisely aligned to a whole measure. You can of course say > \bar "|." early, but maybe you need to use \partial on the final measure > as well. Granted, this would require that your software cache notes > before writing them so you can tell if you are going to have a short > measure. > > One thing to consider: if your music is really fluid, perhaps writing > things with \cadenzaOn makes sense. Here there are no measures, and you > can emit bar lines whenever you see fit. (In fact, you *have* to emit > bar lines if you want the music to be able to break across a lines.) > But I am unsure if this is strictly speaking necessary to get your setup > working. > > \stopStaff should be helpful to ensure that the StaffSymbol does not run > past a point; but maybe you need to play around with break-alignment to > resolve the issue of those pesky extra clefs showing up. Then again, it > is entirely possible that your intentionally misaligned systems are just > running afoul of some limitation of LilyPond. I certainly have never > tried pushing this aspect of the software. > > > -- Aaron Hill > > _______________________________________________ > lilypond-user mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/lilypond-user
\version "2.19.83"
\language "english"
\pointAndClickOff
scoreinfo = {\time 4/4 \tempo "andante" 4 = 90}
voice_oneone = {\key c \major r64 r128 r4 r4 ds''1\p fs'64\ffff g''''4.\pp cs''''64\fff fs''''1\ffff gs''''2\pp c'''''32\fff r32 \bar "|." }
voice_twoone = {\key c \major e,,64\mp cs128\ppp g4 gs4\fff r1 r64 r4. r64 r1 r2 r32 b,,32\p \bar "|." }
voice_onetwo = {\key c \major r1 fs'''4\ppp fs''4\ppppp r64 r1. e''''\breve\ppp r1 r2.. d''4.\fffff r4 gs''''8\mf r2... \bar "|." }
voice_twotwo = {\key c \major d,1\ppp r4 r4 g64\pp g,,1.\mp r\breve d1\p e,2..\ppppp r4. d,4\fff r8 a,2...\p \bar "|." }
voice_onethree = {\key c \major r4. r1 g'1.\pp ds'8\ppp r2... r1. cs'4.\fff r8 r4. fs'''2.\mf r128 as''64\ff \bar "|." }
voice_twothree = {\key c \major e4.\mp r1 r1. r8 e,2... r1. r4. r8 e4.\f r2. r128 r64 \bar "|." }
voice_onefour = {\key c \major cs''2\mf e'''2.\ppppp as''2\pppp f''64\mp r32 a''''1.\pppp a'''4.\ppp a'''2\ppppp r8 fs''2\ffff e'2\ff cs''''4\ppppp cs''''4\ppppp \bar "|." }
voice_twofour = {\key c \major r2 r2. r2 r64 b,32\pppp r1. r4. r2 g8\ffff r2 r2 r4 r4 \bar "|." }
voice_onefive = {\key c \major cs''''128\mf r32 r2 gs''''4\mp r4.. r8 r8 f'''4\ppppp r4.. r64 gs'''\breve\p cs'''4\mf \bar "|." }
voice_twofive = {\key c \major r128 r32 as2 r4 gs4..\ff as,,,8\mf b,,,8\fff r4 r4.. c64\ppppp r\breve r4 \bar "|." }
\paper {#(set-paper-size "letter") short-indent = 5\mm}
\score { <<
\new PianoStaff \with { instrumentName = #"Piano 1" shortInstrumentName = #"Pn 1" } <<
\new Staff = "upper" <<
\scoreinfo \clef "treble" \voice_oneone >>
\new Staff = "lower" << \scoreinfo\clef bass \voice_twoone >>
>>
\new PianoStaff \with { instrumentName = #"Piano 2" shortInstrumentName = #"Pn 2" } <<
\new Staff = "upper" <<
\scoreinfo \clef "treble" \voice_onetwo >>
\new Staff = "lower" << \scoreinfo\clef bass \voice_twotwo >>
>>
\new PianoStaff \with { instrumentName = #"Piano 3" shortInstrumentName = #"Pn 3" } <<
\new Staff = "upper" <<
\scoreinfo \clef "treble" \voice_onethree >>
\new Staff = "lower" << \scoreinfo\clef bass \voice_twothree >>
>>
\new PianoStaff \with { instrumentName = #"Piano 4" shortInstrumentName = #"Pn 4" } <<
\new Staff = "upper" <<
\scoreinfo \clef "treble" \voice_onefour >>
\new Staff = "lower" << \scoreinfo\clef bass \voice_twofour >>
>>
\new PianoStaff \with { instrumentName = #"Piano 5" shortInstrumentName = #"Pn 5" } <<
\new Staff = "upper" <<
\scoreinfo \clef "treble" \voice_onefive >>
\new Staff = "lower" << \scoreinfo\clef bass \voice_twofive >>
>>
>>
\layout{ragged-bottom = ##t
\context { \Score \remove "Timing_translator" \remove "Default_bar_line_engraver"}
\context { \Staff \consists "Timing_translator" \consists "Default_bar_line_engraver"}
\context { \Voice \remove "Note_heads_engraver" \consists "Completion_heads_engraver" \remove "Rest_engraver" \consists "Completion_rest_engraver" completionUnit = #(ly:make-moment 2/4)}}
}
test.pdf
Description: Adobe PDF document
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
