Hi Martin, You could try the attached, with the commands pedOn, pedRetake and pedOff.
Best, David
Sustain-Pedal-2.pdf
Description: Adobe PDF document
\version "2.19.83" \pointAndClickOff pedOn = #(define-event-function () () #{ -\tweak shorten-pair #'(0 . -1) -\tweak self-alignment-X #LEFT \sustainOn #} ) pedRetake = #(define-event-function () () #{ \sustainOff -\tweak shorten-pair #'(1 . -1) -\tweak self-alignment-X #LEFT \sustainOn #} ) pedOff = #(define-event-function () () #{ -\tweak self-alignment-X #LEFT \sustainOff #} ) rh = \relative c' { \clef treble %\set Dynamics.pedalSustainStyle = #'text <c e a>1_\markup \tiny "pedalSustainStyle = #'text" | <d f b> | <e g c> ~ | q | \bar "|." \break \set Dynamics.pedalSustainStyle = #'mixed <c e a>1_\markup \tiny "pedalSustainStyle = #'mixed" | <d f b> | <e g c> ~ | q | \bar "|." \break \set Dynamics.pedalSustainStyle = #'bracket <c e a>1_\markup \tiny "pedalSustainStyle = #'bracket" | <d f b> | <e g c> ~ | q | \bar "|." } lh = \relative c { \clef bass \repeat unfold 3 { c1 | c | c ~ | c | \bar "|." } } pedalA = { \repeat unfold 3 { s1\sustainOn | s1\sustainOff\sustainOn | s1\sustainOff\sustainOn | s2. s4\sustainOff | } } pedalB = { \repeat unfold 3 { s1\pedOn | s1\pedRetake | s1\pedRetake | s2. s4\pedOff | } } \header { title = "Sustain Pedal Test" } \score { \header { piece = "Default" } \new PianoStaff << \new Staff \rh \new Staff \lh \new Dynamics \pedalA >> \layout {} } \score { \header { piece = "Optimized" } \new PianoStaff << \new Staff \rh \new Staff \lh \new Dynamics \pedalB >> \layout {} }