Replace with red dot

2023-10-02 Thread Rajesh Baskar

Hi,

Can someone please help me? I'm trying to hide the notes and display a 
red dot in the middle. This below should have only 2 measure but it 
prints 3 and there are some errors.


Thanks,
Raj

\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))
redDotMultiMeasureRest = { \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 = 10
   \override MultiMeasureRest.color = "#FF" }
\header {tagline = ##f } \score {\new RhythmicStaff { \override 
Score.SpacingSpanner.strict-note-spacing = ##t
  \set 
Score.proportionalNotationDuration = #(ly:make-moment 1/8)
  \set 
Timing.beamHalfMeasure = ##f
  \override 
Staff.MeasureCounter.staff-padding = #4.5
  \set 
Staff.midiInstrument = #"acoustic grand" \key c \major

\numericTimeSignature \time 3/4 \clef treble
\startMeasureCount \hideNotes
  << { c'2. } \new 
Voice { \redDotMultiMeasureRest R1 } >>
  << { 4 4 4 } \new 
Voice { \redDotMultiMeasureRest R1 } >>

\stopMeasureCount \bar "||"}
 \layout { \context { \RhythmicStaff 
\consists Measure_counter_engraver \boxify MeasureCounter } } }


Re: \markup text outside Lyrics - how?

2023-10-02 Thread Mats Bengtsson

  
  
Why not use text marks,
  http://lilypond.org/doc/v2.25/Documentation/notation/text-marks ?
  They are intended exactly for textual indications that should
  appear at the top of each system, i.e. above the lyrics in your
  case. 

   /Mats

On 2023-10-02 09:09, Michael Gerdau
  wrote:

[moving
  instructional text above notes and outside of lyrics]
  
  
  you could create a Dynamics context before
the staff containing the markup.

  
  
  Thanks Valentin, that works like a charm :)
  
  
  Kind regards,
  
  Michael
  

  




Re: Overwrite key signature with numbers

2023-10-02 Thread David Kastrup
Valentin Petzel  writes:

> Hi Robert,
>
> you could do it like this:
>
> \version "2.23.6"
>
> \layout {
>   \context {
> \Staff
> \override KeySignature.text =
> #(lambda (grob)
>(let* ((alt (ly:grob-property grob 'alteration-alist))
>   (alts (map cdr alt))
>   (tot (* 2 (apply + alts)))
>   (acc (cond ((= tot 0) (markup #:musicglyph 
> "accidentals.natural"))
>  ((> tot 0) (markup #:musicglyph "accidentals.sharp"))
>  (else (markup #:vcenter #:musicglyph 
> "accidentals.flat")
>  (markup #:vcenter #:number (number->string (abs tot)) acc)))
> \override KeySignature.stencil = #ly:text-interface::print
> printKeyCancellation = ##f
>   }
> }
>
> expt = { \key c \major c d e f }
>
> {
>   \clef bass
>   \expt
>   \transpose c cis \expt
>   \transpose c des \expt
>   \transpose c d \expt
>   \transpose c dis \expt
>   \transpose c es \expt
>   \transpose c e \expt
>   \transpose c f \expt
>   \transpose c fis \expt
>   \transpose c ges \expt
>   \transpose c g \expt
>   \transpose c gis \expt
>   \transpose c as \expt
>   \transpose c a \expt
>   \transpose c ais \expt
>   \transpose c bes \expt
>   \transpose c b \expt
> }
>
> Cheers,
> Valentin

To pour some rain on your parade, end the music with a final \expt ...
My revenge for you beating me to the punch line.

-- 
David Kastrup



Re: Overwrite key signature with numbers

2023-10-02 Thread Valentin Petzel
Hi Robert,

you could do it like this:

\version "2.23.6"

\layout {
  \context {
\Staff
\override KeySignature.text =
#(lambda (grob)
   (let* ((alt (ly:grob-property grob 'alteration-alist))
  (alts (map cdr alt))
  (tot (* 2 (apply + alts)))
  (acc (cond ((= tot 0) (markup #:musicglyph 
"accidentals.natural"))
 ((> tot 0) (markup #:musicglyph "accidentals.sharp"))
 (else (markup #:vcenter #:musicglyph 
"accidentals.flat")
 (markup #:vcenter #:number (number->string (abs tot)) acc)))
\override KeySignature.stencil = #ly:text-interface::print
printKeyCancellation = ##f
  }
}

expt = { \key c \major c d e f }

{
  \clef bass
  \expt
  \transpose c cis \expt
  \transpose c des \expt
  \transpose c d \expt
  \transpose c dis \expt
  \transpose c es \expt
  \transpose c e \expt
  \transpose c f \expt
  \transpose c fis \expt
  \transpose c ges \expt
  \transpose c g \expt
  \transpose c gis \expt
  \transpose c as \expt
  \transpose c a \expt
  \transpose c ais \expt
  \transpose c bes \expt
  \transpose c b \expt
}

Cheers,
Valentin

Am Montag, 2. Oktober 2023, 14:21:37 CEST schrieb Robert Mengual:
> Hi, I am trying to overwrite the key signature for my custom music notation
> so that instead of displaying the sharp and flat icons, it shows a given
> number and the alteration. So, for example, E Major would show 4# instead
> of .
> 
> I have been able to get the desired output by hardcodeing it using the
> markup function. However, I am not finding a way to conditionally render
> the number and alteration depending on the key. Could somebody help me?
> 
> Here is my tiny hardcoded example, with a screenshot:
> 
> [image: image.png]
> 
> \version "2.23.6"
> 
> \layout {
> \context {
> \Staff
> \override KeySignature.stencil = #ly:text-interface::print
> \override KeySignature.text = \markup {
> \combine
> \halign #-1 \lower #1 \musicglyph "four"
> \halign #-5 \musicglyph "accidentals.sharp"
> }
> }
> }
> 
> \relative {
> \clef bass
> \key e \major
> cis dis e
> }



signature.asc
Description: This is a digitally signed message part.


Overwrite key signature with numbers

2023-10-02 Thread Robert Mengual
Hi, I am trying to overwrite the key signature for my custom music notation
so that instead of displaying the sharp and flat icons, it shows a given
number and the alteration. So, for example, E Major would show 4# instead
of .

I have been able to get the desired output by hardcodeing it using the
markup function. However, I am not finding a way to conditionally render
the number and alteration depending on the key. Could somebody help me?

Here is my tiny hardcoded example, with a screenshot:

[image: image.png]

\version "2.23.6"

\layout {
\context {
\Staff
\override KeySignature.stencil = #ly:text-interface::print
\override KeySignature.text = \markup {
\combine
\halign #-1 \lower #1 \musicglyph "four"
\halign #-5 \musicglyph "accidentals.sharp"
}
}
}

\relative {
\clef bass
\key e \major
cis dis e
}


Re: \markup text outside Lyrics - how?

2023-10-02 Thread Michael Gerdau

[moving instructional text above notes and outside of lyrics]


you could create a Dynamics context before the staff containing the markup.


Thanks Valentin, that works like a charm :)

Kind regards,
Michael
--
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver