lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using other NoteHeads with \harmonicByFret?


From: Thomas Morley
Subject: Re: Using other NoteHeads with \harmonicByFret?
Date: Fri, 3 Feb 2012 01:18:49 +0100

Hi Peter,

2012/2/2 Peter Crighton <address@hidden>:
> You're right, I should have included an example. I'm sorry.
[...]
> It looks quite good so far, only the dots are not shown in the Staff
> and some of the accidentals overlap with the notehead. (In this
> example only the lower G, but at the piece I'm working on it is also
> the D.)

harmonicDots are not shown by default, you have to enable this with
\set harmonicDots = ##t

I've not a clue why this happens sometimes, would have expected that's
all good or all bad.

Anyway using another property ('after-line-breaking) seems to solve
it. If not recall.

\version "2.14.2"

\paper {
        ragged-right = ##t
}

mixedHarmonicByFret = #(define-music-function (parser location fret
music) (number? ly:music?)
 (_i "Convert @var{music} into mixed harmonics; the resulting notes resemble
harmonics played on a fretted instrument by touching the strings above @var{fret
}.")
 (let* ((fret (number->string fret))
        (pitch (fret->pitch fret)))
       (make-sequential-music
        (list
         #{
           \override TabNoteHead #'stencil =
#(tab-note-head::print-custom-fret-label $fret)
           \override NoteHead #'after-line-breaking = #(lambda (grob)
                        (ly:grob-set-property! grob 'style 'harmonic-mixed)
                        (ly:note-head::print grob))
         #}
         (make-harmonic
           (calc-harmonic-pitch pitch music))
         #{
           \revert TabNoteHead #'stencil
           \revert NoteHead #'after-line-breaking
         #}))))

music = {
 \override StringNumber #'transparent = ##t
 \set harmonicDots = ##t
 \ottava #1
% I added several accidentals!!
 \mixedHarmonicByFret #12 <e,\6>8
 \mixedHarmonicByFret #12 <g\3 b!\2 e'!\1>8.
 \mixedHarmonicByFret #7 <g!\3 b!\2 e'!\1>
 \mixedHarmonicByFret #5 <g!\3 b!\2 e'!\1>
 \mixedHarmonicByFret #7 <g!\3 b!\2 e'!\1>
 \mixedHarmonicByFret #12 <g!\3 b!\2 e'!\1>8 |
}
\score {
 <<
   \new Staff { \clef "G_8" \key e\major \music }
   \new TabStaff { \tabFullNotation \music }
 >>
}

Cheers,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]