2012/11/27 David Bellows <davebell...@gmail.com>: > Hey everyone. I'm creating a score for classical guitar and I've run into a > problem combining harmonics and regular notes in the same measure in > different voices. If I do something like this: > > \version "2.16.1" > << { \harmonicsOn e'4 f' g' \harmonicsOff} \\ {a4 b c} >> > > then the harmonic noteheads are clear or open, i.e., they are not filled in > like you'd expect with a quarter notes (eighth, sixteenth, etc.). I do not > think this is standard for guitar notation and in any case given some > intricate rhythm stuff going on it's going to make it difficult for the > performer to figure out what to play.
The function \harmonicsOn from /ly/property-init.ly returns these "open" harmonics. It's not hard create a new one: myHarmonicsOn = #(define-music-function (parser location) () (override-head-style '(NoteHead TabNoteHead) 'harmonic-mixed)) \version "2.16.1" << { \myHarmonicsOn e'4 f' g' \harmonicsOff} \\ {a4 b c} >> > > Instead if I do: > \version "2.16.1" > << { \override Staff.NoteHead #'style = #'harmonic-mixed e'4 f' g' \revert > Staff.NoteHead #'style } \\ {a4 b c} >> > > Then the harmonic noteheads are filled in properly but the notes in the > second voice are also displayed as harmonics instead of regular notes. Delete the Staff-context and it will work, too: \version "2.16.1" << { \override NoteHead #'style = #'harmonic-mixed e'4 f' g' \revert NoteHead #'style } \\ { a4 b c } >> > > I actually asked about this several years ago but I ended up moving on to a > different project before I could try out one of the proposed solutions but > now I have and it's got problems as well. Another user suggested creating > the voices separately and then combining them at the end of the score: > > \version "2.16.1" > upper = \relative c' { > \voiceOne > \clef "treble_8" > \override NoteHead #'style = #'harmonic-mixed > g8 a b c b4 > } > > lower = \relative c { > \override NoteHead #'style = #'default > \voiceTwo > \clef "treble_8" > d8 d f e a4 > } > > \score { > \new Staff = "guitar" > << > \context Voice = "upper" { \upper } > \new Voice = "lower" { \lower } > >> > \layout { } > > \midi { > \context { > \Score > } > } > } > > > This works, but as I said, there are issues. As far as I can tell this > requires me to use two voices throughout the entire piece. Most of the > piece only needs one voice and I would prefer to let Lilypond format it as > if it were just one voice. But if I use this method then I think I have to > go through and add invisible rests throughout the piece for the second voice > and then manually change some of the stem directions for the other voice > which kind of defeats the purpose of using Lilypond. > > Or am I missing something with respect to this last option? Or is there > some other way to go about solving my problem? It's possible to define _temporary_ second Voices. HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user