Re: Replace with red dot

2023-10-03 Thread Rajesh Baskar
Oh yes. Thank you so much Valentin. Also I will remember to format the 
code better next time.


On 10/3/2023 12:15 AM, Valentin Petzel wrote:

You are doing

<< { c'2. } \new Voice { \redDotMultiMeasureRest R1 } >>

but a 3/4 measure only has length 2. . So do

<< { c'2. } \new Voice { \redDotMultiMeasureRest R2. } >>

instead.

While you are at it: You can directly boxify the stencil using box-stencil
without going the extra way over a markup. Also you could format your code in
a more readable manner (which helps understanding problems) like this:

\version "2.22.0"
\language english
boxify =
#(define-music-function
   (grob-path) (key-list?)
   (define proc
 (grob-transformer 'stencil
   (lambda (grob orig) (box-stencil orig 0.1 1.25
   #{ \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 R2. } >>
 << { 4 4 4 } \new Voice { \redDotMultiMeasureRest R2. } >>
 \stopMeasureCount \bar "||"
   }
   \layout {
 \context {
   \RhythmicStaff
   \consists Measure_counter_engraver
   \boxify MeasureCounter
 }
   }
}

Cheers,
Valentin

Am Dienstag, 3. Oktober 2023, 05:39:53 CEST schrieb 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 } } }

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: Beam issue

2023-09-25 Thread Rajesh Baskar

Thanks William for your help.

On 9/23/2023 1:09 PM, William Rehwinkel wrote:
See 
https://lilypond.org/doc/v2.25/Documentation/notation/setting-automatic-beam-behavior 



In engraving from the Romantic and Classical periods, beams often 
begin midway through the measure in 3/4 time, but modern practice is 
to avoid the false impression of 6/8 time (see Gould, p. 153). Similar 
situations arise in 3/8 time. This behavior is controlled by the 
context property beamHalfMeasure, which has effect only in time 
signatures with 3 in the numerator:


\relative a' {
  \time 3/4
  r4. a8 a a |
  \set Timing.beamHalfMeasure = ##f
  r4. a8 a a |
}

Thanks,
-William

On 9/23/23 14:32, Rajesh Baskar wrote:

Hi,

In a normal musical notation when you have a time signature of 3/4 
and have a dotted note, eighth note, eighth note and an eighth note - 
that the first eighth note should have "no beam". This is how other 
software like MuseScore and Finale works. Why does Lilypond do this? 
I know there is a \noBeam markup but in my case this is be difficult 
to use as I'm dynamically generating the notation.


Any advise will be helpful. See the attached image for illustration.

Thanks,
Raj

\version "2.22.2" \language english \header { tagline = ##f }
\score {\new Staff
 {\set Staff.midiInstrument = #"acoustic grand" \key c \major 
\time 3/4 \clef bass e,4. d,8 c, e, \bar "||"} \layout { \context { 
\Score proportionalNotationDuration = #(ly:make-moment 1/2) } } \midi 
{ \tempo 1 = 72}}





Re: RhythmicStaff with measure counter

2023-09-06 Thread Rajesh Baskar

Thank you so much Jean.

On 9/6/2023 7:57 AM, Jean Abou Samra wrote:

Le mardi 05 septembre 2023 à 19:22 -0700, Rajesh Baskar a écrit :

I'm trying to achieve displaying the measure counter on top of the each
measure on a rhythmic staff.  The below script working fine if you
change the \new RhythmicStaff to \new Staff.

How do I make this script work for rhythmicStaff.



Paul gave the solution. But this also sounds like a use case for
the centered bar numbers feature implemented in 2.24.

\version "2.24"

\language english

\header {
   tagline = ""
}

\score {
   \new RhythmicStaff \with { midiInstrument = "acoustic grand" } {
 \key c \major
 \numericTimeSignature
 \time 4/4
 \startMeasureCount
 c'2 2 4 4 2
 \stopMeasureCount
 \bar "||"
   }
   \layout {
 \context {
   \Score
   \override SpacingSpanner.strict-note-spacing = ##t
   proportionalNotationDuration = #(ly:make-moment 1/8)

   centerBarNumbers = ##t
   barNumberVisibility = #all-bar-numbers-visible
   \override CenteredBarNumber.stencil =
 #(make-stencil-boxer 0.2 1.25 ly:text-interface::print)
 }
   }
   \midi { \tempo 4 =92 }
}





Best,
Jean






Re: RhythmicStaff with measure counter

2023-09-06 Thread Rajesh Baskar

Thank you Paul.

On 9/6/2023 1:49 AM, Paul Hodges wrote:
In the layout you're still adding the Measure_counter_engraver to the 
Staff context; you need to add it to the RhythmicStaff context.


Paul


*From: * Rajesh Baskar 
*To: * Lilypond-User Mailing List 
*Sent: * 06/09/2023 3:22
*Subject: * RhythmicStaff with measure counter

Hi,

I'm trying to achieve displaying the measure counter on top of the
each
measure on a rhythmic staff.  The below script working fine if you
change the \new RhythmicStaff to \new Staff.

How do I make this script work for rhythmicStaff.

Thanks for the help-
Raj


RhythmicStaff with measure counter

2023-09-05 Thread Rajesh Baskar

Hi,

I'm trying to achieve displaying the measure counter on top of the each 
measure on a rhythmic staff.  The below script working fine if you 
change the \new RhythmicStaff to \new Staff.


How do I make this script work for rhythmicStaff.

Thanks for the help-
Raj



\version "2.22.0"
\language english
\header {tagline = "" }
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 #})
\score {\new RhythmicStaff {\override 
Score.SpacingSpanner.strict-note-spacing = ##t

    \set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
    \override Staff.MeasureCounter.staff-padding = #4.5
    \set Staff.midiInstrument = #"acoustic grand" \key c \major 
\numericTimeSignature
    \time 4/4 \startMeasureCount c'2 2 4 4 2 \stopMeasureCount \bar 
"||"}
    \layout { \context { \Staff \consists Measure_counter_engraver 
\boxify MeasureCounter } }

    \midi { \tempo 4 =92}}




Re: Image width issue

2023-02-02 Thread Rajesh Baskar

Hi Jean,

Sorry to bother you again. Can you let me know how to remove the stem ( 
also all the parts of the notes should be replaced with red dot.)


Thank you all your help.
Raj

On 1/31/2023 11:23 AM, Rajesh Baskar wrote:


Hi Jean,

The solution you gave me works very good for whole notes. But if the 
notes have stems then the stems are not removed. Please look at the 
LilyPond like below.


\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 #})

\header {tagline = ##f }
RedDotMarkup = \markup \with-color "#FF" \vcenter \fontsize #10 
\musicglyph "dots.dot"

RedDot =
  \tweak text \RedDotMarkup
  \tweak stencil
    #(grob-transformer
  'stencil
  (lambda (grob original)
    (ly:stencil-outline
 (ly:text-interface::print grob)
 original)))
  \tweak staff-position #0
  \etc
\score {\new Staff { \override 
Score.SpacingSpanner.strict-note-spacing = ##t
 \set Score.proportionalNotationDuration = 
#(ly:make-moment 1/8)

 \override Staff.MeasureCounter.staff-padding = #4.5
 \set Staff.midiInstrument = #"acoustic grand"
 \key c \major \numericTimeSignature \time 4/4
 \clef bass \startMeasureCount f4 g a bf \once 
\hide Accidental\RedDot bf4  \RedDot c'

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

On 1/13/2023 3:25 PM, Jean Abou Samra wrote:

Le 14/01/2023 à 00:22, Rajesh Baskar a écrit :


Hi Jean,

I don't think I saw your response.Here is the question again - The 
solution that you gave makes the 1st image match the width of the 
2nd image by reducing it. Can the 2nd images width match the 1st 
images width by increasing it.





Why not, as I said, read the response I gave to this on

https://lists.gnu.org/archive/html/lilypond-user/2023-01/msg00228.html



Why we need this is when there are a lot of notes hidden then this 
difference between the 2 images looks really bad in our app.





I'm curious, could you tell more about what you're using LilyPond for 
in this app?


Regards,
Jean


Re: Image width issue

2023-01-31 Thread Rajesh Baskar

Hi Jean,

The solution you gave me works very good for whole notes. But if the 
notes have stems then the stems are not removed. Please look at the 
LilyPond like below.


\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 #})

\header {tagline = ##f }
RedDotMarkup = \markup \with-color "#FF" \vcenter \fontsize #10 
\musicglyph "dots.dot"

RedDot =
  \tweak text \RedDotMarkup
  \tweak stencil
    #(grob-transformer
  'stencil
  (lambda (grob original)
    (ly:stencil-outline
 (ly:text-interface::print grob)
 original)))
  \tweak staff-position #0
  \etc
\score {\new Staff { \override Score.SpacingSpanner.strict-note-spacing 
= ##t
 \set Score.proportionalNotationDuration = 
#(ly:make-moment 1/8)

 \override Staff.MeasureCounter.staff-padding = #4.5
 \set Staff.midiInstrument = #"acoustic grand"
 \key c \major \numericTimeSignature \time 4/4
 \clef bass \startMeasureCount f4 g a bf \once 
\hide Accidental\RedDot bf4  \RedDot c'

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

On 1/13/2023 3:25 PM, Jean Abou Samra wrote:

Le 14/01/2023 à 00:22, Rajesh Baskar a écrit :


Hi Jean,

I don't think I saw your response.Here is the question again - The 
solution that you gave makes the 1st image match the width of the 2nd 
image by reducing it. Can the 2nd images width match the 1st images 
width by increasing it.





Why not, as I said, read the response I gave to this on

https://lists.gnu.org/archive/html/lilypond-user/2023-01/msg00228.html



Why we need this is when there are a lot of notes hidden then this 
difference between the 2 images looks really bad in our app.





I'm curious, could you tell more about what you're using LilyPond for 
in this app?


Regards,
Jean


Re: Changes to png file while using \omit Accidental

2023-01-31 Thread Rajesh Baskar

Thanks David for your detailed explanation.

On 1/31/2023 7:15 AM, David Wright wrote:

On Mon 30 Jan 2023 at 20:52:05 (-0800), Rajesh Baskar wrote:

You can see in
the mage attached that Lilypond generates them a bit differently. The
line dividing the two measures is thicker

You'll also notice that the stems of the last note in each measure are
apparently thicker than the others.

This isn't LilyPond's fault, but the fact that you've chosen to
generate a PNG raster image of the output. Were you to generate
a PDF, you would see the same phenomenon on your monitor at low
magnifications, like 120%, because the screen is a raster device,
but increasing the magnification would quickly eliminate the
effect, as seen at 2000%. (Screen is 443x249 mm showing 1600x900.)

While we're about it, here's your Melody expanded 8x, and
Lilypond's flat at 8000% (rotated to use the screen area).

Cheers,
David.

Re: Changes to png file while using \omit Accidental

2023-01-31 Thread Rajesh Baskar

Thanks Jean, that was a simple solution, and sorry for my ignorance.

On 1/30/2023 9:10 PM, Jean Abou Samra wrote:

On 31/01/2023 05:52, Rajesh Baskar wrote:

Hello Experts,

I'm facing a unique issue or it would be because of my limited knowledge of 
Lilypond. I have 2 identical Lilypond files, the only difference being that one 
has \omit Accidental in it. You can see in the mage attached that Lilypond 
generates them a bit differently. The line dividing the two measures is thicker 
and it is moved a bit to the right. Any ideas as to how to fix it, so the the 
2nd image is identical to the first, but just without the accidentals.


\omit is the wrong tool if you want the object to still affect
spacing as before. You want \hide for that. See


https://lilypond.org/doc/v2.24/Documentation/notation/visibility-of-objects#making-objects-transparent


Changes to png file while using \omit Accidental

2023-01-30 Thread Rajesh Baskar

Hello Experts,

I'm facing a unique issue or it would be because of my limited knowledge 
of Lilypond. I have 2 identical Lilypond files, the only difference 
being that one has \omit Accidental in it. You can see in the mage 
attached that Lilypond generates them a bit differently. The line 
dividing the two measures is thicker and it is moved a bit to the right. 
Any ideas as to how to fix it, so the the 2nd image is identical to the 
first, but just without the accidentals.


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 #}) \header {tagline = 
##f} \score {\new Staff { \override 
Score.SpacingSpanner.strict-note-spacing = ##t \set 
Score.proportionalNotationDuration = #(ly:make-moment 1/8) \override 
Staff.MeasureCounter.staff-padding = #4.5 \set Staff.midiInstrument = 
#"acoustic grand" \key c \major \numericTimeSignature \time 4/4 \clef 
bass \startMeasureCount f4 g a bf bf4 c' f2 \stopMeasureCount \bar "||"} 
\layout { \context { \Staff \consists Measure_counter_engraver \boxify 
MeasureCounter } } }


\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 #}) \header {tagline = 
##f} \score {\new Staff { \override 
Score.SpacingSpanner.strict-note-spacing = ##t \set 
Score.proportionalNotationDuration = #(ly:make-moment 1/8) \override 
Staff.MeasureCounter.staff-padding = #4.5 \set Staff.midiInstrument = 
#"acoustic grand" \key c \major \numericTimeSignature \time 4/4 \clef 
bass \startMeasureCount \omit Accidental f4 g a bf bf4 c' f2 
\stopMeasureCount \bar "||"} \layout { \context { \Staff \consists 
Measure_counter_engraver \boxify MeasureCounter } } }





Re: Image width issue

2023-01-13 Thread Rajesh Baskar

Jean,

Really sorry, I see your answer in the link below, thanks for all the 
trouble.


You were a great help, thanks,

Raj

On 1/13/2023 3:25 PM, Jean Abou Samra wrote:

Le 14/01/2023 à 00:22, Rajesh Baskar a écrit :


Hi Jean,

I don't think I saw your response.Here is the question again - The 
solution that you gave makes the 1st image match the width of the 2nd 
image by reducing it. Can the 2nd images width match the 1st images 
width by increasing it.





Why not, as I said, read the response I gave to this on

https://lists.gnu.org/archive/html/lilypond-user/2023-01/msg00228.html



Why we need this is when there are a lot of notes hidden then this 
difference between the 2 images looks really bad in our app.





I'm curious, could you tell more about what you're using LilyPond for 
in this app?


Regards,
Jean





Re: Image width issue

2023-01-13 Thread Rajesh Baskar

Thanks Jean, really appreciate it.

On 1/13/2023 12:00 PM, Jean Abou Samra wrote:




Le 13 janv. 2023 à 20:54, Rajesh Baskar  a écrit :

Hi Jean,

I would greatly appreciate if you could help me out on the below request.



Did you not receive my reply on this?

You can always find it in the list archives: 
https://lists.gnu.org/archive/html/lilypond-user/2023-01/msg00228.html







Re: Image width issue

2023-01-11 Thread Rajesh Baskar

Hi Jean,

Thanks for your help this works. But I have a question, this solution 
makes the 1st image match the width of the 2nd image by reducing it. Can 
the 2nd images width match the  1st images width by increasing it.


Thanks once again for all the help.
Raj

On 1/11/2023 2:34 AM, Jean Abou Samra wrote:

Le 11/01/2023 à 01:38, Rajesh Baskar a écrit :


Hi Jean,

I don't know if I'm doing this wrong as suggested by you, but I'm 
still not getting the results.





The main point is not using \tweak transparent ##t, but using the same
drawing for the note heads in both cases so that they have the same 
width.

You should replace this line:



 \tweak transparent ##t b,



with

\tweak transparent ##t \RedDot b,

(moving the definition of RedDot so it's defined at the
point you use it, of course).





Re: Image width issue

2023-01-10 Thread Rajesh Baskar

Hi Jean,

I don't know if I'm doing this wrong as suggested by you, but I'm still 
not getting the results.


\version "2.22.0" \language english \header {tagline = ##f} \score {\new 
Staff \with {\omit TimeSignature}

   {\set Staff.midiInstrument = #"Acoustic Grand"
    \key c \major \time 5/1 \clef bass g,1 a,
 \tweak transparent ##t b,
 c d \bar "||"}
   \layout {\context { \Score proportionalNotationDuration 
= #(ly:make-moment 1/2) } } \midi { \tempo 1 = 72}}



\version "2.22.0"
\language english
RedDotMarkup = \markup \with-color "#FF" \vcenter \fontsize #-1 
\musicglyph "dots.dot"

RedDot =
  \tweak text \RedDotMarkup
  \tweak stencil #ly:text-interface::print
  \tweak staff-position #0
  \etc

\header {
  tagline = ##f
}

\score {
  \new Staff \with { \omit TimeSignature }
  {
    \set Staff.midiInstrument = #"acoustic grand"
    \key c \major
    \time 5/1
    \clef bass
    g,1 a,
    \RedDot b,
    c d
    \bar "||"
  }
  \layout {
    \context {
  \Score proportionalNotationDuration = #(ly:make-moment 1/2)
    }
  }
}

issue
On 1/10/2023 1:58 PM, Jean Abou Samra wrote:

\tweak transparent ##t

Image width issue

2023-01-10 Thread Rajesh Baskar

Hi,

I have 2 staffs, one with the 3rd note hidden and another replacing the 
3rd note with a red dot. But the 2 staffs are not having the same width. 
What do I need to do make the 2nd staff the same width as the 1st staff. 
Please see the image for details and thank you all so much for the help.


Raj


\version "2.22.0" \language english \header {tagline = ##f} \score {\new 
Staff \with {\omit TimeSignature}

   {\set Staff.midiInstrument = #"Acoustic Grand Piano"
    \key c \major \time 5/1 \clef bass g,1 a, \hideNotes b, 
\unHideNotes c d \bar "||"}
   \layout {\context { \Score proportionalNotationDuration 
= #(ly:make-moment 1/2) } } \midi { \tempo 1 = 72}}


\version "2.22.2" \language english
RedDotMarkup = \markup \vcenter \with-color "#FF" \fontsize #-1 
\musicglyph "dots.dot"
RedDot = \tweak text \RedDotMarkup \tweak stencil 
#ly:text-interface::print \tweak staff-position #0 \etc

\header { tagline = ##f } \score {\new Staff \with {\omit TimeSignature }
  {\set Staff.midiInstrument = 
#"Acoustic Grand Piano"
    \key c \major \time 5/1 \clef bass g,1 a, \RedDot b, c d \bar 
"||"}
    \layout { \context { \Score proportionalNotationDuration = 
#(ly:make-moment 1/2) } } }



issue

Re: Hide Notes but display Accidental

2022-11-18 Thread Rajesh Baskar

Hi Lukas,

Thanks for your help, this really worked and also thanks for the other 
recommendations.


On 11/17/2022 11:55 PM, Lukas-Fabian Moser wrote:

Hi Raj,

probably easiest:

\version "2.22.0"

\language english

\header {
  tagline = ##f
}

\score {
  \new Staff \with { \omit TimeSignature } {
    \set Staff.midiInstrument = "Acoustic Grand Piano"
    \key c \major
    \time 5/1
    \clef bass

    \hideNotes
    \undo \hide Accidental  % <---

    f1 g a bf c' \bar "||"
  }
  \layout {
    \context {
  \Score
  proportionalNotationDuration = #(ly:make-moment 1/2)
    }
  }
  \midi { \tempo 1 = 72}
}

I also took the liberty of making some other changes I would recommend.

Lukas


Re: Hide Notes but display Accidental

2022-11-18 Thread Rajesh Baskar

Thanks that worked like a charm.

On 11/17/2022 11:02 PM, Rip _Mus wrote:

\version "2.22.0"
\include "english.ly "

newHideNotes = {
\override NoteHead.transparent = ##t
\override NoteHead.no-ledgers = ##t %optional
\override Stem.transparent = ##t
}

\header { tagline = "" }
\score {
\new Staff
\with {\remove "Time_signature_engraver" }
{
\set Staff.midiInstrument = #"Acoustic Grand Piano"

\key c \major \time 5/1 \clef bass

\newHideNotes

f1 g a bf c' \bar "||"}

\layout {
\context {
\Score proportionalNotationDuration = #(ly:make-moment 1/2)
}
 }
\midi { \tempo 1 = 72}
}

Hide Notes but display Accidental

2022-11-17 Thread Rajesh Baskar

Hi Everyone,

I want to hide all the notes but display it's accidental. I can do the 
opposite of it by using \hidenotes and \omit Accidental. I want to 
achieve something like the below image. Please help.


Image



\version "2.22.0" \include "english.ly" \header { tagline = "" } \score 
{\new Staff \with {\remove "Time_signature_engraver" } {\set 
Staff.midiInstrument = #"Acoustic Grand Piano"

    \key c \major \time 5/1 \clef bass

    \hideNotes  f1 g a bf c' \bar "||"}
\layout { \context { \Score proportionalNotationDuration = 
#(ly:make-moment 1/2) } }

\midi { \tempo 1 = 72}}

Thanks,

Raj


RE: Show ledger line with hidden staff

2022-11-15 Thread Rajesh Baskar
Hi Jean,

Thank you so much, that worked.


From: Jean Abou Samra<mailto:j...@abou-samra.fr>
Sent: Monday, November 14, 2022 11:01 PM
To: Rajesh Baskar<mailto:rajes...@hotmail.com>; 
lilypond-user@gnu.org<mailto:lilypond-user@gnu.org>
Subject: Re: Show ledger line with hidden staff

Le 14/11/2022 à 21:29, Rajesh Baskar a écrit :
>
> Hi,
>
> I'm trying to display just the notes without the staff lines but I
> need the ledger line to be displayed. I know you can use \stopStaff or
> \remove "Staff_symbol_engraver" but that removes the ledger line as
> well. Please advise and thanks in advance.
>
>
>
> \version "2.22.0" \include "english.ly" \header { tagline = "" }
> \score {\new Staff \with {\remove Time_signature_engraver
>   \hide Clef
>   \hide BarLine
>   \remove "Staff_symbol_engraver"
>
> }
>
> {\set Staff.midiInstrument = #"Acoustic Grand Piano"
>  \key c \major \time 4/4 \clef treble
>
> \stopStaff  c'1
> }
>\layout { indent = #0 line-width = #25 }
>
> \midi { \tempo 4 = 168}}
>




Remove \stopStaff and \remove "Staff_symbol_engraver", and add

\hide StaffSymbol

This works because the ledger lines are displayed by a separate
grob (LedgerLineSpanner).

Best,
Jean





Show ledger line with hidden staff

2022-11-14 Thread Rajesh Baskar

Hi,

I'm trying to display just the notes without the staff lines but I need 
the ledger line to be displayed. I know you can use \stopStaff or 
\remove "Staff_symbol_engraver" but that removes the ledger line as 
well. Please advise and thanks in advance.




\version "2.22.0" \include "english.ly" \header { tagline = "" }
\score {\new Staff \with {\remove Time_signature_engraver
  \hide Clef
  \hide BarLine
  \remove "Staff_symbol_engraver"

}

    {\set Staff.midiInstrument = #"Acoustic Grand Piano"
 \key c \major \time 4/4 \clef treble

\stopStaff  c'1
    }
   \layout { indent = #0 line-width = #25 }

    \midi { \tempo 4 = 168}}


Thanks,

Raj


RE: Alignment help

2022-08-17 Thread Rajesh Baskar
Thanks Aaron that worked.

From: Aaron Hill<mailto:lilyp...@hillvisions.com>
Sent: Wednesday, August 17, 2022 12:49 PM
To: Rajesh Baskar<mailto:rajes...@hotmail.com>
Cc: lilypond-user@gnu.org<mailto:lilypond-user@gnu.org>
Subject: Re: Alignment help

On 2022-08-17 12:30 pm, Rajesh Baskar wrote:
> I'm trying to replace some of the notes with a question mark and I
> achieved this with this group's help sometime back. Here is the

To get the alignment, you need to do a few things.  The markup itself
needs to be vertically centered, and then the staff-position of the note
can be forced to be on the middle line:


\version "2.22.0"
\language english

questionMarkMarkup =
\markup \vcenter \fontsize #7 \with-color "#6A00F4" "?"

questionMark =
\tweak text \questionMarkMarkup
\tweak stencil #ly:text-interface::print
\tweak staff-position #0
\etc

{
   \cadenzaOn \clef bass
   g,1
   \questionMark a,
   \questionMark b,
   \questionMark c
   d
}



-- Aaron Hill



Alignment help

2022-08-17 Thread Rajesh Baskar
Hi,

I'm trying to replace some of the notes with a question mark and I achieved 
this with this group's help sometime back. Here is the Lilypond file -

\version "2.22.0" \language english
questionMark = \markup {\fontsize #7 \with-color "#6A00F4" "?"}
\header {tagline = ""}
\score {\new Staff \with {\remove "Time_signature_engraver" }
{\set Staff.midiInstrument = #"Acoustic Grand Piano"
 \key c \major \time 5/1 \clef bass
 g,1
 \omit Accidental \override
 NoteHead.stencil = #(lambda (grob)
   (grob-interpret-markup grob questionMark)) a,
  b,
  c
  d \bar "||"}

}


This generates a staff with the question mark in an ascending pattern as shown 
in this image.

[cid:9b97dfb1-a009-46b4-83a4-8b98eb74d53b]

But I want the question mark to be within the staff, like the below image.

[cid:1a71965f-da9d-419e-bf96-02cfd55c95db]

Can someone help me with aligning the question mark?

Thanks,
Raj


Red dot before all notes

2022-02-17 Thread Rajesh Baskar

Hi,

I'm trying to get a red dot placed before each note. I have tried using 
\tweak and


\set fingeringOrientations = #'(left)

\finger  \markup \with-color "#FF"  "."

But nothing seems to give the desired results.

The below image is what I'm trying to get.


\version "2.22.0" \include "english.ly" \header { tagline = "" } \score 
{\new Staff \with {\remove "Time_signature_engraver" } {\set 
Staff.midiInstrument = #"Acoustic Grand Piano" \key c \major \time 5/1 
\clef treble c'1 d' e' f' g' \bar "||"} \layout { } \midi { \tempo 4 = 
168}}


Thanks for all the help,

Raj





Re: Display Question Mark at center of a measure

2022-01-19 Thread Rajesh Baskar
Hi Jean,

Thank you so much for a detailed explanation and the solution. Both of the 
below solution works flawlessly.

Raj


From: Jean Abou Samra 
Sent: Tuesday, January 18, 2022 4:11 PM
To: Rajesh Baskar ; Lukas-Fabian Moser ; 
lilypond-user@gnu.org 
Subject: Re: Display Question Mark at center of a measure

Le 19/01/2022 à 00:40, Rajesh Baskar a écrit :
>
> Hi Jean,
>
> Here is the complete code.
>


Yes. Here is a simplified example:

\version "2.22.1"

\score {
   {
 \startMeasureCount
 <<
   \hideNotes b'4 a' g' a'
   \new Voice { R1 }
 >>
 \stopMeasureCount
   }
   \midi { }
   \layout { }
}

What's happening here is that you are not
telling LilyPond about the delimitation between
your voices. Since the b'4, a', etc. are not
grouped in any way, they form individual expressions.
In other words, the indentation is misleading and
this is interpreted as

\version "2.22.1"

\score {
   {
 \startMeasureCount
 <<
   \hideNotes
   b'4
   a'
   g'
   a'
   \new Voice { R1 }
 >>
 \stopMeasureCount
   }
   \midi { }
   \layout { }
}

Because there is \startMeasureCount at the
beginning, a new Voice is started. Then you have
this polyphonic construction, which spans a new
Voice for each of the notes and a last one
for the \new Voice { R1 }. This puts all of
the notes in parallel at the same moment.
Because \hideNotes happens in the voice that
is continued from the beginning, it applies
in this voice before the voices for the notes
are branched off, so \hideNotes still affects
them even though the construct is not doing
what you want. The solution is simple: group
the notes with braces. To end the \hideNotes,
either create a new voice explicitly instead
of continuing the main one, so that \hideNotes
will not bleed over the following music, or
insert \unHideNotes at the end.

\version "2.22.1"

\score {
   {
 \startMeasureCount
 <<
   \new Voice { \hideNotes b'4 a' g' a' }
   \new Voice { R1 }
 >>
 \stopMeasureCount
 c'1
   }
   \midi {}
   \layout {}
}

or

\version "2.22.1"

\score {
   {
 \startMeasureCount
 <<
   { \hideNotes b'4 a' g' a' \unHideNotes }
   \new Voice { R1 }
 >>
 \stopMeasureCount
 c'1
   }
   \midi {}
   \layout {}
}

Best,
Jean


Re: Display Question Mark at center of a measure

2022-01-18 Thread Rajesh Baskar

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} }


On 1/18/2022 10:40 AM, Jean Abou Samra wrote:

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


Re: Display Question Mark at center of a measure

2022-01-18 Thread Rajesh Baskar

Thanks Lukas and Jean for your help.

There is an issue with the below solution. When adding <<  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

On 1/14/2022 1:39 AM, Lukas-Fabian Moser wrote:

Hi Rajesh,

Am 14.01.22 um 01:44 schrieb Rajesh Baskar:
I'm tying to display a question mark at the center of the 1st measure 
in a 2 measure score.


I have got this working with hard-coding the offset (3 . 4.5) but 
this will not work when the number of notes in a measure is larger 
than 3. Is there a way to get this to work dynamically where the 
question mark moves to the center of the measure irrespective of the 
length of a measure.


Please try to remove everything in your examples not actually related 
to the problem at hand (here, for example, everything having to do 
with MIDI, proportional notation, boxed measure counters etc.).


What comes to mind is that your question mark is exactly in the 
position where you would normally expect a whole bar rest. So how about:


\version "2.22.0"

#(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"
}

\new Staff {
  \clef bass
  <<
    { \hideNotes b2 c }
    \new Voice {
  \questionMarkMultiMeasureRest
  R1
    }
  >>
  \unHideNotes a2 c'4 g
}

One could of course wrap the simultaenous addition of the tweaked full 
bar rest in a music function.


The reason I'm using such a comparatively complex stencil override is 
that the default positioning of the MultiMeasureRest (which is what we 
want here) is handled in the default stencil; if we overwrite that 
function completely, we don't get the nice centered alignment we want.


Lukas


Display Question Mark at center of a measure

2022-01-13 Thread Rajesh Baskar

Hi,

I'm tying to display a question mark at the center of the 1st measure in 
a 2 measure score.


I have got this working with hard-coding the offset (3 . 4.5) but this 
will not work when the number of notes in a measure is larger than 3. Is 
there a way to get this to work dynamically where the question mark 
moves to the center of the measure irrespective of the length of a measure.


Thanks for all the help.
Dav.


\version "2.22.0"
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 #})

\include "english.ly" \header {tagline = "" }
\score {\new Staff {
  \override Score.SpacingSpanner.strict-note-spacing = ##t
  \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
  \set Staff.midiInstrument = #"Acoustic Grand Piano"
  \key c \major \numericTimeSignature
  \time 4/4
  \clef bass
  \override TextScript.font-size = #7
 -\markup {\with-color "#6A00F4" "?" }
  \override TextScript.extra-offset = #'(3 . 4.5)

  \override Staff.MeasureCounter.staff-padding = #4.5
  \startMeasureCount
  \hideNotes b2 c
  \unHideNotes a c'4 g
   \stopMeasureCount
  \bar "||"}
    \layout {
  \context {
 \Staff
 \consists Measure_counter_engraver
 \boxify MeasureCounter
    }
    }
    \midi { \tempo 4 =92}
}




Re: Hide and replace a note with text

2021-12-08 Thread Rajesh Baskar

Thanks that works well.

On 12/8/2021 12:15 PM, Leo Correia de Verdier wrote:

\once \omit Accidental

Re: Hide and replace a note with text

2021-12-08 Thread Rajesh Baskar
Thanks Lukas, it works, but for the accidentals. If you see the example 
code below, is there a way to hide the sharp/flat signs also?


\version "2.22.0"

\language english

questionMark = \markup \general-align #Y #CENTER {
  \fontsize #7 \with-color "#6A00F4" "?"
}

\new Staff \with {
  \omit TimeSignature
}
{
  \cadenzaOn
  \key c \major
  \clef bass
  f1 g
  a
   % comment to center the question mark
  % on the actual notehead position:
  \once \override NoteHead.Y-offset = 0
  \once \override NoteHead.stencil =
  #(lambda (grob) (grob-interpret-markup grob questionMark))
  bf
  c'
  \bar "||"
}

On 12/8/2021 11:30 AM, Lukas-Fabian Moser wrote:
PS. I made some other changes to your code, maybe some of them turn 
out to be helpful.


Am 08.12.21 um 20:29 schrieb Lukas-Fabian Moser:

Hi Dav,

Am 08.12.21 um 19:50 schrieb Rajesh Baskar:
Can you hide and replace a note with a question mark? I kind of 
achieved this with the below example. But the question mark is not 
in place of the note, it appears below the staff. I can use 
\override TextScript.extra-offset = #'(0 . 4.275) to achieve this 
but I don't want to hard code the offset as the note to hide can 
appear anywhere on the staff.


You can exchange the note head by a markup:

\version "2.22.0"

\language english

questionMark = \markup \general-align #Y #CENTER {
  \fontsize #7 \with-color "#6A00F4" "?"
}

\new Staff \with {
  \omit TimeSignature
}
{
  \cadenzaOn
  \key c \major
  \clef bass
  f1 g
  % comment to center the question mark
  % on the actual notehead position:
  \once \override NoteHead.Y-offset = 0
  \once \override NoteHead.stencil =
  #(lambda (grob) (grob-interpret-markup grob questionMark))
  a
  bf c'
  \bar "||"
}

If you want to do this more often, you might define a shorthand (that 
then should also contain a "\once \omit Stem" etc.)


Lukas

Hide and replace a note with text

2021-12-08 Thread Rajesh Baskar

Hi,

Can you hide and replace a note with a question mark? I kind of achieved 
this with the below example. But the question mark is not in place of 
the note, it appears below the staff. I can use \override 
TextScript.extra-offset = #'(0 . 4.275) to achieve this but I don't want 
to hard code the offset as the note to hide can appear anywhere on the 
staff.


 \version "2.22.0" \include "english.ly"
 \header { tagline = "" }
 \score {\new Staff \with {\remove "Time_signature_engraver" }
 {\set Staff.midiInstrument = #"Acoustic Grand Piano"
  \key c \major \time 5/1 \clef bass f1 g
    \hideNotes a-\markup {\fontsize #7 \with-color "#6A00F4" "?" }
    \unHideNotes
    bf c' \bar "||"}  \layout { }
    \midi { \tempo 4 = 168}}


Thanks for the help.

Dav




Re: Box around MeasureCounter

2021-11-22 Thread Rajesh Baskar

Aaron,

I had another question. The MeasureCounter boxify function does not work 
if we change the staff to Rhythmic staff.


\version "2.22.0"

boxify =
#(define-music-function
  (grob-path) (key-list?)
  (define proc (grob-transformer 'stencil
   (lambda (grob orig) (grob-interpret-markup grob #{
    \markup \override #'(box-padding . 0.25)
    \override #'(thickness . 2)
    \box \stencil #orig #}
  #{ \override $grob-path . stencil = #proc #})
\include "english.ly" \header {tagline = "" }
\score {\new RhythmicStaff {
  \override Score.SpacingSpanner.strict-note-spacing = ##t
  \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
  \set Staff.midiInstrument = #"Grand Piano"
  \key c \major \numericTimeSignature
  \time 4/4
  \clef treble
  \startMeasureCount
  \hideNotes b2 c
  \unHideNotes a c'4 g
   \stopMeasureCount
  \bar "||"}
    \layout {
  \context {
 \Staff
 \consists Measure_counter_engraver
    \boxify MeasureCounter
    }
        }
    \midi { \tempo 4 =92}
}

On 11/18/2021 11:43 AM, Rajesh Baskar wrote:


Aaron,

Thank you so much, this worked perfectly.


On 11/17/2021 7:50 PM, Aaron Hill wrote:


\version "2.20.0"

boxify =
#(define-music-function
  (grob-path) (key-list?)
  (define proc (grob-transformer 'stencil
   (lambda (grob orig) (grob-interpret-markup grob #{
    \markup \override #'(box-padding . 0.25)
    \override #'(thickness . 2)
    \box \stencil #orig #}
  #{ \override $grob-path . stencil = #proc #})

\new Staff
\with {
  \consists Measure_counter_engraver
  \boxify MeasureCounter
}
{
  \boxify Staff.Clef
  \startMeasureCount
  fis'4 g'8 a' \once \boxify Accidental bes'2 cis''4 d''2.
  \stopMeasureCount
}


Re: Box around MeasureCounter

2021-11-18 Thread Rajesh Baskar

Aaron,

Thank you so much, this worked perfectly.


On 11/17/2021 7:50 PM, Aaron Hill wrote:


\version "2.20.0"

boxify =
#(define-music-function
  (grob-path) (key-list?)
  (define proc (grob-transformer 'stencil
   (lambda (grob orig) (grob-interpret-markup grob #{
    \markup \override #'(box-padding . 0.25)
    \override #'(thickness . 2)
    \box \stencil #orig #}
  #{ \override $grob-path . stencil = #proc #})

\new Staff
\with {
  \consists Measure_counter_engraver
  \boxify MeasureCounter
}
{
  \boxify Staff.Clef
  \startMeasureCount
  fis'4 g'8 a' \once \boxify Accidental bes'2 cis''4 d''2.
  \stopMeasureCount
}


Box around MeasureCounter

2021-11-17 Thread Rajesh Baskar
Hi,
Does anyone know how to add a box around a measure counter? I have included two 
images below, one is the image that is generated using the below lilypond code 
and the other on is what I’m trying to achieve.

Thanks

\version "2.22.0" \include "english.ly" \header {tagline = "" }
\score {\new Staff {
  \override Score.SpacingSpanner.strict-note-spacing = ##t
  \set Score.proportionalNotationDuration = #(ly:make-moment 1/4)
  \set Staff.midiInstrument = #"Acoustic Grand Piano"
  \key c \major \numericTimeSignature
  \time 4/4
  \clef treble
  \override TextScript.extra-offset = #'(3 . 4.8)
  \override TextScript.font-size = #7 -\markup {\with-color "#6A00F4" "?" }
  \override Staff.MeasureCounter.staff-padding = #2
  \startMeasureCount
  \hideNotes b'2 c''
  \unHideNotes d'' d''4 g'
  \bar "||"}
\layout {
  \context {
\Staff
 \consists Measure_counter_engraver
}
}
\midi { \tempo 4 =92}
}
[cid:image002.png@01D7DBBF.95997E60]

Example of Measure Counter with box

[cid:image006.png@01D7DBBF.95997E60]