lilypond-user
[Top][All Lists]
Advanced

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

Re: Spacing grobs with an invisible object between them (hack)


From: Paolo Prete
Subject: Re: Spacing grobs with an invisible object between them (hack)
Date: Thu, 6 Feb 2020 17:35:55 +0100



On Thu, Feb 6, 2020 at 4:45 PM Aaron Hill <address@hidden> wrote:
On 2020-02-06 6:10 am, Paolo Prete wrote:
> (code)

A few comments on the code:


Good, thanks

Here's the improved version without the noisy syntax and better names (OS = Outside Staff)
I ask you if is it possible to remove the noisy default  #OSSPW param as well, in the function call.

%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.19.45"

#(define OSSPW 3)
#(define OSSPacerColor white)

OSSpacer =  #(define-music-function (pos height width) (number? number? (number? 2))
 #{ \tweak TextScript.color #OSSPacerColor \tweak TextScript.outside-staff-priority #(* 100 pos) -\markup{ \filled-box #'(0 . 3) #(cons 0 height) #0 } #})

setOSPosition = #(define-music-function (obj pos mus) (string? number? ly:music?)
  (if (string=? obj "TextScript")
    #{ \tweak TextScript.outside-staff-priority #(* 110 pos) #mus #}
    #{ \once \override #obj .outside-staff-priority = #(* 110 pos)  #}))

{
\time 2/4
\set Staff.pedalSustainStyle = #'mixed
\once \override TupletBracket.direction = #UP
#(set! OSSPacerColor grey)

%
% Assign a position to each object
%
% Objects above staff
\setOSPosition "Script" 1 {}
\setOSPosition "TupletBracket" 2 {}
\setOSPosition "Slur" 3 {}
\setOSPosition "Staff.OttavaBracket" 4 {}
% Objects below staff
\setOSPosition "DynamicLineSpanner" 1 {}
\setOSPosition "Staff.SustainPedalLineSpanner" 2 {}
\setOSPosition "Staff.SostenutoPedalLineSpanner" 3 {}

\tuplet 3/2 { \ottava #1 c''''

^\OSSpacer 5 4   #OSSPW -\setOSPosition "TextScript" 5 ^\markup { "Espressivo" }
^\OSSpacer 4 2   #OSSPW
^\OSSpacer 3 3   #OSSPW ^(
^\OSSpacer 2 2   #OSSPW
^\OSSpacer 1 0.7 #OSSPW ^>
%------------------------------------------$
%------------------------------------------$
%------------------STAFF-------------------$
%------------------------------------------$
%------------------------------------------$
_\OSSpacer 1 5 #OSSPW \mf  
_\OSSpacer 2 3 #OSSPW \sustainOn
_\OSSpacer 3 4 #OSSPW \sostenutoOn
_\OSSpacer 4 3 #OSSPW -\setOSPosition "TextScript" 4 _\markup { "Use pedal with care!"}

c'''' c'''')\sustainOff\sostenutoOff \ottava #0 }

}



reply via email to

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