|
From: | Jean Abou Samra |
Subject: | Re: Arpeggio - bracket > curly bracket |
Date: | Wed, 19 Jan 2022 14:17:32 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 |
Le 19/01/2022 à 13:58, Thomas Scharkowski a écrit :
Am 19.01.2022 um 13:09 schrieb Jean Abou Samra <jean@abou-samra.fr>: Le 19/01/2022 à 09:46, Thomas Scharkowski a écrit :Hallo, I’d like to replace the arpeggioBracket by a curly bracket / brace. Thank your for your help!Here's a stencil callback reading the vertical start and end positions of the arpeggio and printing a bracket accordingly: \version "2.22.1" arpeggioBrace = \tweak stencil #(lambda (grob) (let* ((positions (ly:grob-property grob 'positions)) (layout (ly:grob-layout grob)) (scale (ly:output-def-lookup layout 'output-scale)) (factor (/ scale (ly:pt 1))) (len (* factor (+ 0.5 (interval-length positions)))) (brace-markup (make-left-brace-markup len)) (brace-stencil (grob-interpret-markup grob brace-markup))) (ly:stencil-translate-axis brace-stencil (interval-center positions) Y))) \arpeggio \relative { \clef bass <e g b g'>\arpeggioBrace } Best, JeanThank you Jean, This is very nice! How can I use this for connected arpeggios through voices?
These are a bit special because they are not created from the \arpeggio events. Use \override rather than \tweak in this case. \version "2.22.1" spanArpeggioBrace = \once \override PianoStaff.Arpeggio.stencil = #(lambda (grob) (let* ((positions (ly:grob-property grob 'positions)) (layout (ly:grob-layout grob)) (scale (ly:output-def-lookup layout 'output-scale)) (factor (/ scale (ly:pt 1))) (len (* factor (+ 0.5 (interval-length positions)))) (brace-markup (make-left-brace-markup len)) (brace-stencil (grob-interpret-markup grob brace-markup))) (ly:stencil-translate-axis brace-stencil (interval-center positions) Y))) \new PianoStaff \with { connectArpeggios = ##t } << \new Staff \relative { \spanArpeggioBrace % Looks better a bit closer to the notes? \once \override PianoStaff.Arpeggio.padding = 0.1 % A bit of padding to the left? \once \override PianoStaff.Arpeggio.extra-spacing-width = #'(-1 . 0) g'\arpeggio } \new Staff \relative { \clef bass <e g b>\arpeggio } >> Best, Jean
[Prev in Thread] | Current Thread | [Next in Thread] |