On Tue, 15 Oct 2024, Sebastian Menge wrote: > I came up with the following (hardly minimal) example. Lily gives me many > warnings, so I wonder if I could make it better - and easier.
Here's what I get by trying to clean up your code; your code in the first score for comparison, followed by my version. With the first one commented out, the code I wrote compiles without warnings. Visual output is almost identical, save that my version doesn't produce a bunch of extra barlines that look unintentional, and it rearranges the whole and first half notes in the last nonempty bar in a way that I think looks better (and doesn't produce the warning about the collision). The main things going on here are using \\ within << >> to create separate voices (after which it becomes an important constraint to keep ties within-voice); grouping notes into chords wherever the rhythm allows doing that instead of separating every simultaneous note; and then using within-chord ties to indicate which notes are and are not tied, if it isn't the entire chord. I also switched to absolute pitch mode and explicitly wrote all the durations. That change isn't vital to the output, but relative pitch mode, and default "same as last note" durations, make each note dependent on its context within the code, and then it's much harder to rearrange the code without changing its meaning. When dealing with ticklish questions of the detailed coding, it's helpful to limit the context-dependence. \score { \new Staff { \relative c' { \key b \major << {fis1 ~ fis ~ fis ~ fis e fis ~ \time 3/4 fis2. ~ fis ~ fis ~ \time 4/4 fis2 eis} {r2 a2 ~ a1 ais gis ~ gis a gis2. ~ gis ais gis1} {s1 c1 cis b ais b ~ b2. ~ b s2. s1} >> } } } \score { \new Staff { \key b \major << { \tieDown b'2\rest a'2~ | <fis'~ a' c''>1 | <fis'~ ais' cis''>1 | <fis' gis'~ b'>1 | <e' gis' ais'>1 | <fis' a' b'>1 | } \\ { fis'1 s1*5 } >> | << { \time 3/4 \tieNeutral <fis' gis' b'>2.~ | <fis'~ gis' b'>2. | <fis'~ ais'>2. | \time 4/4 fis'2 e'2 | } \\ { \time 3/4 s2.*3 \time 4/4 gis'1 } >> | } } -- Matthew Skala msk...@ansuz.sooke.bc.ca People before tribes. https://ansuz.sooke.bc.ca/