[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheme code producing solid 8va line
From: |
Valentin Petzel |
Subject: |
Re: scheme code producing solid 8va line |
Date: |
Fri, 17 Dec 2021 23:23:50 +0100 |
Hello Molly,
The code I gave you first back then was missing a something which made it
behave badly. Harm proposed a corrected and streamlined version, and even more
compact:
#(define (my-callback grob)
(let* ((orig (ly:grob-original grob))
(siblings (ly:spanner-broken-into orig)))
(if (and (> (length siblings) 1) (not (eq? grob (car siblings))))
(ly:grob-set-property! grob 'text #f))))
Cheers,
Valentin
Am Freitag, 17. Dezember 2021, 16:22:52 CET schrieb Molly Preston:
> Someone helped with fixing the 8va so it didn't repeat 8va after the line
> break. However, it is producing a solid line where the 8va is, but only in
> this one place:
>
> \version "2.22.1"
>
>
> upper = {
>
> #(define (my-callback grob)
> (let* (
> ; have we been split?
> (orig (ly:grob-original grob))
> ; if yes, get the split pieces (our siblings)
> (siblings (if (ly:grob? orig)
> (ly:spanner-broken-into orig) '() )))
> (if (and (>= (length siblings) 2)
> (not (eq? (car siblings) grob)))
> (ly:grob-set-property! grob 'text #f)
> (ly:grob-set-property! grob 'stencil (ly:ottava-bracket::print
> grob)))))
>
>
> \time 5/4
> \override Staff.OttavaBracket.after-line-breaking = #my-callback
> dis'''8\( \ottava #1 <dis''' dis''''> 8 < ais'' ais''' >2 ~ < ais''
> ais''' >\) |
> \ottava #0
> \time 6/8
> \tempo \markup { \concat { "Like a lullaby" \hspace
> #0.75 \general-align #Y #DOWN \note {8} #UP
> " = "
> \hspace #0.5
> ca. \hspace #0.5 "100"
> }
> }
>
> % \once \override TextScript.Y-offset = #-5
> \time 6/8
> dis'''4. _\markup {\dynamic mp {\italic dolce } } \( ~
> dis'''8 gis''4 |
>
> }
>
> lower = {
>
> \clef treble
> <gis' cis'' dis'' e'' >2. ~ <gis' cis'' dis'' e'' > 2
> \time 6/8
> fis'8\( b ais dis' ais b \) |
>
> }
>
> \score {
>
> \new PianoStaff {
>
> <<
> \set PianoStaff.instrumentName = #"Piano"
> \new Staff = "upper"{ \upper \autoBeamOff }
> \new Staff = " lower" \lower
>
>
> }
>
>
> \layout {
>
> }
>
> }
>
> I'm not sure if I need to later the scheme code in some way to make it
> dotted again. Any suggestions?
>
> -Molly
signature.asc
Description: This is a digitally signed message part.