Remove all the double backslashes "\\" They add their own \voice{One,Two,Three,etc}
Le jeu. 18 avr. 2024, à 14 h 39, Gerardo Ballabio <gerardo.balla...@gmail.com> a écrit : > > Hello again, > in fact, Knute's suggestion works well with stems pointing down. But > then I tried also with stems pointing up (that is, using \voiceOne > instead of \voiceTwo) and in that case the stems are slightly > misaligned (see attached example). > My guess is that the notes are aligned on the left, but different note > heads haven't the same width, so the stems don't line up together when > they are on the right. > > Any suggestions? > > Thanks > Gerardo > > %%%%%%%%%% > \version "2.24.1" > > bassDrum = \relative { > \voiceOne > s1 | > s2 b2-> | > s1 | > s2 b2-> | > } > > cymbals = \relative { > \voiceOne > \override NoteHead.style = #'xcircle > s1 | > s2 f'2 | > s1 | > s2 f2 | > } > > tamTam = \relative { > \voiceOne > \override NoteHead.style = #'cross > s1 | > s2 e2 | > s1 | > s2 e2 | > } > > pause = \new Voice { > \clef "varpercussion" > \time 4/4 > R1 | > r2 s2\f | > R1 | > r2 s2 | > } > > percussions = \new Voice \relative { > << > \cymbals > \\ > \tamTam > \\ > \bassDrum > >> > } > > \new Staff > << > \pause > \percussions > >> > %%%%%%%%%% > > Il giorno mer 17 apr 2024 alle ore 23:13 Gerardo Ballabio > <gerardo.balla...@gmail.com> ha scritto: > > > > Thank you Knute and Mats. > > Removing the "\\" aligns the notes on the same stem, but they also get > > the same note head. > > Keeping the "\\" and using \voiceTwo aligns the notes and shows > > different note heads. > > > > Gerardo > > > > Il giorno mer 17 apr 2024 alle ore 13:19 Mats Bengtsson > > <matsboxergr...@gmail.com> ha scritto: > > > > > > On 2024-04-16 21:59, Gerardo Ballabio wrote: > > > > Hello all, > > > > I'm trying to typeset a percussion score with several instruments on > > > > the same staff. When they play simultaneous notes I want to line them > > > > up all on the same stem, like this (output attached, percussion1.pdf): > > > > > > > > %%%%%%%%%% > > > > \version "2.24.1" > > > > > > > > \new Staff \relative { > > > > \clef "varpercussion" > > > > \stemDown > > > > R1 | > > > > r2 <e b' f'>2\f-> | > > > > R1 | > > > > r2 q2-> | > > > > } > > > > %%%%%%%%%% > > > > > > > > But I'd like to write down each part separately, so that I may also > > > > print the single parts without redoing everything. And I also want to > > > > use different note heads for each instrument. > > > > This is the best I could come up with: > > > > > > > > %%%%%%%%%% > > > > \version "2.24.1" > > > > > > > > bassDrum = \relative { > > > > \stemDown > > > > s1 | > > > > s2 b2-> | > > > > s1 | > > > > s2 b2-> | > > > > } > > > > > > > > cymbals = \relative { > > > > \override NoteHead.style = #'xcircle \stemDown > > > > s1 | > > > > s2 f'2 | > > > > s1 | > > > > s2 f2 | > > > > } > > > > > > > > tamTam = \relative { > > > > \override NoteHead.style = #'cross \stemDown > > > > s1 | > > > > s2 e2 | > > > > s1 | > > > > s2 e2 | > > > > } > > > > > > > > pause = \new Voice { > > > > \clef "varpercussion" > > > > \time 4/4 > > > > R1 | > > > > r2 s2\f | > > > > R1 | > > > > r2 s2 | > > > > } > > > > > > > > percussions = \new Voice \relative { > > > > << > > > > \cymbals > > > > \\ > > > > \tamTam > > > > \\ > > > > \bassDrum > > > > >> > > > > } > > > > > > > > \new Staff > > > > << > > > > \pause > > > > \percussions > > > > %%%%%%%%%% > > > > > > > > But as you can see (output attached, percussion2.pdf) the three notes > > > > aren't aligned on the same stem, only two of them are. > > > > > > > > I tried \partCombine, it works nicely with two parts, but if there's a > > > > way to combine three or more I didn't find it. > > > > > > > > Any help is much appreciated. > > > > > > Just remove the "\\" in your definition of percussions: > > > > > > percussions = \new Voice \relative { > > > << > > > \cymbals > > > \tamTam > > > \bassDrum > > > >> > > > } > > > In that way, all three lines of music will belong to the same Voice. > > > > > > When you use the construct << ... \\ ... >>, you explicitly ask LilyPond > > > to create separate voices with separate stems, for the different lines > > > of music, which is not what you want in this particular situation. > > > > > > /Mats > > > -- Pierre-Luc Gauthier