|
From: | Rajesh Baskar |
Subject: | Re: Display Question Mark at center of a measure |
Date: | Tue, 18 Jan 2022 15:40:10 -0800 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
Hi Jean,
Here is the complete code.
\version "2.22.0"
\language english
boxify = #(define-music-function (grob-path) (key-list?)
(define proc (grob-transformer 'stencil (lambda (grob orig)
(grob-interpret-markup grob #{ \markup \override
#'(box-padding . 1.25)
\override #'(thickness . 1) \box \stencil #orig #}))))
#{ \override $grob-path . stencil = #proc #})
#(define (center-stencil stil) (ly:stencil-aligned-to
(ly:stencil-aligned-to stil X CENTER) Y CENTER))
questionMarkMultiMeasureRest = { \override
MultiMeasureRest.stencil = #(grob-transformer 'stencil
(lambda (grob default) (ly:stencil-translate-axis
(center-stencil (ly:text-interface::print grob))
(interval-center (ly:stencil-extent default X)) X)))
\override MultiMeasureRest.text = "?"
\override MultiMeasureRest.font-size = 7
\override MultiMeasureRest.color = "#6A00F4" }
\header {tagline = "" }
\score {\new Staff {
\override Score.SpacingSpanner.strict-note-spacing = ##t
\set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
\override Staff.MeasureCounter.staff-padding = #4.5
\set Staff.midiInstrument = #"Acoustic Grand Piano"
\key c \major \numericTimeSignature \time 4/4 \clef treble
\startMeasureCount
<< \hideNotes b'4 a' g' a'
\new Voice { \questionMarkMultiMeasureRest R1 }
>>
\unHideNotes c''4 b' g'2 \stopMeasureCount \bar "||"}
\layout { \context { \Staff \consists Measure_counter_engraver
\boxify MeasureCounter } } \midi { \tempo 4 =92} }
Le 18/01/2022 à 19:14, Rajesh Baskar a écrit :
Thanks Lukas and Jean for your help.
There is an issue with the below solution. Whenadding << and >> the visual is correct but while playing the score the first measure notes all play together. I'm guessing it's because of << >>. Is there a way to fix this.
Thanks for all the help.
Raj
I cannot reproduce. Can you paste the complete code that
demonstrates the problem?
Thanks,
Jean
[Prev in Thread] | Current Thread | [Next in Thread] |