Hello Gabriel,

> I am confused:
> 
> Why is it that I can add (+) 0.25 staff space above the lowest line, but I 
> *cannot subtract* (-) 0.25 staff space below that line?

Because the value “center” identifies the position of the center line from 
which the tick needs to be drawn (e.g. if center is 0, the tick would be on the 
center of the staff line), by turning + into - in the code that sets the value 
“center,” you are ending up the center value to be turned into a positive value 
(as in (- 5 -5) => 10), having the tick end up at the top.

So the fix I would propose is actually to look at the value of “quarter-staff,” 
which finds the value of quarter the staff space. Turning this into a negative 
value will draw the tick downward. So there are two solutions.

You can replace part of the code you have with either of the followings:

%%%  SNIPPET BEGINS 

   (if (>= line-count 2)
       (set! center
               (+ ; WILL FAIL if I change this plus to minus (-)
                (* quarter-staff -1) ;<— This is the changed line!
                ; in the following code,
                ; min WORKS to find the lowest line:
                (* (apply min line-pos) half-staff))))

%%%  SNIPPET ENDS

OR … directly turn the quarter-staff value into a negative value:

%%%  SNIPPET BEGINS
 
 (quarter-staff (* -1/4 staff-space))

%%%  SNIPPET ENDS

Very best,
Yoshi


-- -- --
Yoshiaki Onishi
https://github.com/yoshiakionishi/lilypond-snippets






Reply via email to