lilypond-user
[Top][All Lists]
Advanced

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

Re: Writing a fingering chart for French Horn


From: Thomas Morley
Subject: Re: Writing a fingering chart for French Horn
Date: Sat, 17 Aug 2013 21:41:46 +0200

Hi Tommaso,

2013/8/17 Tommaso Gordini <address@hidden>:
> Hello to all,
> this is my first post on lilypond-user.

Welcome!

> I'm translating a practical guide to French horn and I have a problem that I
> could not solve.
> I have to write a French Horn fingering card. Many notes admit alternative
> combinations, and they are written one below the other. Below I attack the
> best code that I could find.
>
> Now I ask you: can you give me some advice to improve it? The position of
> the numbers is correct, or you think it is better to hit them under each
> note? In a scheme like this, you would put the notes centered in the bar, or
> the'd leave as they are?
>
> The result now I do, but I see that as early as the second pentagram numbers
> are no longer lined up as in the first.
>
> I ask you some help, and you can modify my code and show me how to do.
>
> Thank you!
> Tommy

Actually, I don't understand what you're asking.

Anyway, I rewrote part of your code to avoid retyping the same things
again and again.
Note that I used \center-column instead of \column.
The argument of \fingerChart will be spilt at "+"
i.e. \fingerChart "1+2" will return a center-columned markup with two
lines: the first containg "1", the second "2".

You'll need a newer devel-version to make full use of it.
The Text_align_engraver will work with 2.16.2, though. It is from:
http://lsr.dsi.unimi.it/LSR/Item?id=637
(click on the image)
Because I don't know French Horn, I doubt I'll be of more use.

\version "2.17.24"

% from:
% http://lsr.dsi.unimi.it/LSR/Item?id=637
#(define (Text_align_engraver ctx)
  (let ((scripts '())
        (note-column #f))

    `((acknowledgers
       (note-column-interface
        . ,(lambda (trans grob source)
             ;; cache NoteColumn in this Voice context
             (set! note-column grob)))

       (text-script-interface
        . ,(lambda (trans grob source)
             ;; whenever a TextScript is acknowledged,
             ;; add it to `scripts' list
             (set! scripts (cons grob scripts)))))

      (stop-translation-timestep
       . ,(lambda (trans)
            ;; if any TextScript grobs exist,
            ;; set NoteColumn as X-parent
            (and (pair? scripts)
                 (for-each (lambda (script)
                             (set! (ly:grob-parent script X) note-column))
                           scripts))
            ;; clear scripts ready for next timestep
            (set! scripts '()))))))

fingerChart =
#(define-scheme-function (parser location arg)(string?)
#{
    \markup
       \override #'(baseline-skip . 2)
       \finger
       \center-column {
        $(string-split arg #\+)
       }
#})

global = {
    \key c \major
    \clef "bass"
}


hornF = \relative c' {
    \global
    \transposition f

    % Qui segue la musica.

    f,,1
    fis_\fingerChart "1 - 2 - 3"
    g_\fingerChart  "1 - 3"
    gis_\fingerChart "2 - 3"
    a_\fingerChart "1 - 2+3"
    ais_\fingerChart "1"
    b_\fingerChart "2"
    c_\fingerChart "0"
    cis_\fingerChart "1 - 2 - 3"
    d_\fingerChart "1 - 3"
    dis_\fingerChart "2 - 3"
    e_\fingerChart "1 - 2+3"
    f_\fingerChart  "1"
    fis_\fingerChart "2+(1 - 2 - 3)"
    g_\fingerChart "0+1 - 3"
    gis_\fingerChart "2 - 3"
    a_\fingerChart "1 - 2+3"
    ais_\fingerChart "(1 - 2 - 3)"
    b_\fingerChart "2+1 - 3"

    \break
    \clef "treble"

    \bar "||"
}


hornB = \relative c' {
    \global

    \transposition f

    % Qui segue la musica.

    f,,1_\fingerChart "0"
    fis
    g
    gis
    a
    ais
    b_\fingerChart "1 - 2 - 3"
    c_\fingerChart "1 - 3"
    cis_\fingerChart "2 - 3"
    d_\fingerChart "1 - 2+3"
    dis_\fingerChart "1"
    e_\fingerChart "2"
    f_\fingerChart "0"
    fis
    g
    gis
    a
    ais
    b

    \clef "treble"

    \bar "||"
}


hornFPart =
\new Staff
  \with {
        instrumentName = "Fa"
        shortInstrumentName = "Fa"
  }
  \hornF

hornBPart =
\new Staff
  \with {
        instrumentName = \markup { "Si"\flat }
        shortInstrumentName = \markup { "Si"\flat }
  }
  \hornB

\score {
  <<
    \hornFPart
    \hornBPart
  >>

  \layout {
    \context {
      \Score
      \remove "Bar_number_engraver"
    }
  \context {
    \Voice
    \consists #Text_align_engraver
    \override TextScript #'X-offset =
      #ly:self-alignment-interface::aligned-on-x-parent
    \override TextScript #'self-alignment-X = #CENTER
  }
  }
}


HTH,
  Harm



reply via email to

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