\version "2.20.0" %{ Liste des doigtés par hauteur en demi-tons au-dessus du ton de l'instrument. Allègrement copié depuis https://www.tradschool.com/fr/introduction-musique-irlandaise/fiche-de-doigtes-pour-tin-whistle/ %} \header { title = "Tin Whistle" tagline = "Partition élaborée avec Lilypond" } tinWhistleFingerings = #'((0 . (one two three four five six)) (2 . (one two three four five)) (4 . (one two three four)) (5 . (one two three)) (7 . (one two)) (9 . (one)) (10 . (two three)) (11 . ()) (12 . (two three four five six)) (14 . (one two three four five)) (16 . (one two three four)) (17 . (one two three)) (19 . (one two)) (21 . (two three)) (22 . (one)) (23 . ()) (24 . (one two three four five six))) tinWhistle = #(define-music-function (tone music) (ly:pitch? ly:music?) #{ << \new Voice { $music } \new Dynamics = "diagramme" \with { \override VerticalAxisGroup.nonstaff-relatedstaff-spacing = #'((basic-distance . 0) (minimum-distance . 0) (padding . 1) ; écartement à la portée (stretchability . 0)) } { #(music-map (lambda (m) (if (music-is-of-type? m 'note-event) ; Hauteur de la note jouée, en demi-tons depuis le do médian. (let* ((base-pitch-semitones (ly:pitch-semitones (ly:music-property m 'pitch))) ; Ramenée par rapport à la note donnée (on lui ajoute 12 car en ; LilyPond, un simple `c` est un do une octave en-dessous du do ; central, donc une hauteur de -12. (transposed-pitch-semitones (- base-pitch-semitones (+ 12 (ly:pitch-semitones tone)))) ; Doigté à utiliser, vaut #f s'il n'est pas trouvé dans la liste. (fingerings (assoc-get transposed-pitch-semitones tinWhistleFingerings))) (if (not fingerings) (ly:music-warning m "doigté de tin whistle non trouvé")) (make-music 'SkipEvent 'duration (ly:music-property m 'duration) 'articulations (list (make-music 'TextScriptEvent 'text #{ \markup \center-column { \override #'(size . 0.5) % Dans le cas où le doigté n'est pas trouvé, mettre des % trous ouverts (un avertissement est levé plus haut). \woodwind-diagram #'tin-whistle #`((cc . ,(or fingerings '())) (lh . ()) (rh . ())) % À partir d'une octave au-dessus du ton du Tin whistle, % rajoute le signe plus sous le diagramme. \vspace #-0.6 #(if (>= transposed-pitch-semitones 12) "+" #{ \markup \with-outline "+" \null #}) } #})))) m)) music) } >> #}) melodie = { \key d\major d' e' fis' g' d'' e'' fis'' g'' cis'' b' a' g' d'2~d'2 } \tinWhistle d {\melodie}