New LSR snippet 1187 "New pitch language"

2024-05-01 Thread Thomas Morley
To the author of the new LSR snippet 1187 "New pitch language"
https://lsr.di.unimi.it/LSR/Item?u=1&id=1187

You add your new language to "nederlands", thus
\language "alpha"
returns a warning:
warning: Could not find language `alpha'.  Ignoring.
Please fix or delete that line.

Furthermore, I think we should not advice how to change an internal
Frescobaldi-file in such a snippet.
But that's only me. Others?

Cheers,
  Harm



Re: Organ pedal marks in various styles, including pedal glides: new snippet 1184

2024-04-09 Thread Fernando Gil
This is extremely helpful, thank you so much!

El mar, 9 abr 2024 a las 6:40, Rudolf Cardinal ()
escribió:

> Dear Lilypond users with an interest in organ music,
>
> Lilypond's standard commands for organ pedal marks are: \lheel, \ltoe,
> \rheel, \rtoe. However, there are several recognized ways of displaying
> pedal marks visually. I struggled a little to get Lilypond's organ pedal
> marks into a style that I was most familiar with. I note previous
> discussion about this and related issues at e.g.
>
>-
>https://lists.gnu.org/archive/html/lilypond-user/2010-12/msg00387.html,
>re: organ pedalboard fingerings;
>-
>https://lists.gnu.org/archive/html/lilypond-user/2007-12/msg00333.html,
>organ pedal marks and substitution;
>-
>https://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00683.html,
>organ pedal foot substitution;
>-
>https://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00713.html,
>globally change organ pedal articulations;
>-
>https://lists.gnu.org/archive/html/lilypond-user/2016-05/msg00206.html,
>question about same-foot organ pedal substitutions;
>-
>https://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00087.html,
>follow-up: organ pedal toe-to-heel-shift.
>
>
> I've created a snippet to address this. It allows you to pick the pedal
> mark style:
>
>- Lilypond default with outward-pointing toes and outward-pointing
>heels;
>- "modern" with inward toes and circle heels (e.g. Trevor 1971, "The
>Oxford Organ Method");
>- "traditional" with upward toes and downward heels (e.g. Bach/Novello
>1948).
>
>
> After choosing the style, you can use standard pedal commands.
>
> The snippet also defines some new pedal indicator commands, including for
> heel/toe transitions; foot slide marks (for sliding a foot forward/backward
> on a pedal); "foot behind"/"foot in front" marks, for crossing feet; "foot
> forward/backward" marks, for when feet are adjacent; and "foot
> substitution" (foot change, foot transition) marks, for swapping feet
> whilst pressing a single pedal. These augmented marks follow Trevor (1971,
> as above), and can be used with any of the pedal mark styles.
>
> Finally, it defines an engraver allowing foot glide/glissando marks using
> the standard "\glide" command.
>
> The snippet is at https://lsr.di.unimi.it/LSR/Item?id=1184. It includes a
> demonstration, but that can be chopped off to provide a file for inclusion
> by any other music, as described in the snippet.
>
> Many thanks to Thomas "Harm" Morley for feedback, and to all those who
> maintain Lilypond and the Lilypond Snippet Repository, including Sebastiano
> Vigna and Werner Lemberg.
>
> all the best,
> Rudolf.
>
>


Organ pedal marks in various styles, including pedal glides: new snippet 1184

2024-04-09 Thread Rudolf Cardinal
Dear Lilypond users with an interest in organ music,

Lilypond's standard commands for organ pedal marks are: \lheel, \ltoe, \rheel, 
\rtoe. However, there are several recognized ways of displaying pedal marks 
visually. I struggled a little to get Lilypond's organ pedal marks into a style 
that I was most familiar with. I note previous discussion about this and 
related issues at e.g.

  *
https://lists.gnu.org/archive/html/lilypond-user/2010-12/msg00387.html, re: 
organ pedalboard fingerings;
  *
https://lists.gnu.org/archive/html/lilypond-user/2007-12/msg00333.html, organ 
pedal marks and substitution;
  *
https://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00683.html, organ 
pedal foot substitution;
  *
https://lists.gnu.org/archive/html/lilypond-user/2016-02/msg00713.html, 
globally change organ pedal articulations;
  *
https://lists.gnu.org/archive/html/lilypond-user/2016-05/msg00206.html, 
question about same-foot organ pedal substitutions;
  *
https://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00087.html, 
follow-up: organ pedal toe-to-heel-shift.

I've created a snippet to address this. It allows you to pick the pedal mark 
style:

  *
Lilypond default with outward-pointing toes and outward-pointing heels;
  *
"modern" with inward toes and circle heels (e.g. Trevor 1971, "The Oxford Organ 
Method");
  *
"traditional" with upward toes and downward heels (e.g. Bach/Novello 1948).

After choosing the style, you can use standard pedal commands.

The snippet also defines some new pedal indicator commands, including for 
heel/toe transitions; foot slide marks (for sliding a foot forward/backward on 
a pedal); "foot behind"/"foot in front" marks, for crossing feet; "foot 
forward/backward" marks, for when feet are adjacent; and "foot substitution" 
(foot change, foot transition) marks, for swapping feet whilst pressing a 
single pedal. These augmented marks follow Trevor (1971, as above), and can be 
used with any of the pedal mark styles.

Finally, it defines an engraver allowing foot glide/glissando marks using the 
standard "\glide" command.

The snippet is at https://lsr.di.unimi.it/LSR/Item?id=1184. It includes a 
demonstration, but that can be chopped off to provide a file for inclusion by 
any other music, as described in the snippet.

Many thanks to Thomas "Harm" Morley for feedback, and to all those who maintain 
Lilypond and the Lilypond Snippet Repository, including Sebastiano Vigna and 
Werner Lemberg.

all the best,
Rudolf.



Re: Snippet: Adding indicators to staves which split after a break

2024-03-25 Thread Kevin Pye
>> The easy question. The fourth line of the snippet reads:
>>(PI_OVER_180 (/ (atan2 1 1) 34))
>> Surely that “34” should be “45”.
>
> Did you try changing it?  ;)

Yes. It breaks things slightly. I need to dive further down the rabbit-hole to 
work out why.

>> The more difficult question. This snippet adds two arrows to the bar line at 
>> the end of the staff. I have a case where there is a key change at the end 
>> of the staff where I'd like to put the indicator, and so the bar line is not 
>> at the end of the staff. The snippet dutifully adds arrows to the bar line, 
>> which conflict with the new key signature. Is there a way to move the arrows 
>> to the end of the staff, rather than on the bar line?
>
> I have a modified version (included below) which handles TimeSignature 
> — you can likely adjust it to handle KeySignature as you want it to!
[script deleted]
> Hope this helps!
I'm sure it will; it should be a good exercise in improving my almost 
non-existent Scheme skills.

Thanks,

Kevin.



Re: Snippet: Adding indicators to staves which split after a break

2024-03-25 Thread Kieren MacMillan
Hi Kevin,

> I have two questions about this snippet:

You forgot to include the snippet or a link! :)
But I assume you mean 
https://lilypond.org/doc/v2.25/Documentation/snippets/vocal-music_003a-adding-indicators-to-staves-which-get-split-after-a-break

> The easy question. The fourth line of the snippet reads:
>(PI_OVER_180 (/ (atan2 1 1) 34))
> Surely that “34” should be “45”.

Did you try changing it?  ;)

> The more difficult question. This snippet adds two arrows to the bar line at 
> the end of the staff. I have a case where there is a key change at the end of 
> the staff where I'd like to put the indicator, and so the bar line is not at 
> the end of the staff. The snippet dutifully adds arrows to the bar line, 
> which conflict with the new key signature. Is there a way to move the arrows 
> to the end of the staff, rather than on the bar line?

I have a modified version (included below) which handles TimeSignature — you 
can likely adjust it to handle KeySignature as you want it to!

Hope this helps!
Kieren.

p.s. It would be amazing if this were more automatic (i.e., it handled all 
possible end-of-staff grobs/situations), adjustable (e.g., had parameters for 
arrow angle, padding, etc.), and built into Lilypond basecode — I just don’t 
have time to climb the various learning curves and put together a patch 
currently.  :(
_____

  SNIPPET BEGINS
\version "2.25.11"

\layout {
  \context {
\Score
\remove Bar_number_engraver
  }
}

#(define-markup-command (arrow-at-angle layout props angle length fill)
  (number? number? boolean?)
  (ly:stencil-rotate
(interpret-markup layout props
  (markup #:concat (#:draw-line (cons length 0)
#:hspace -0.1
#:arrow-head X RIGHT fill)))
angle -1 0))

arrowUpMarkup = \markup \concat { \hspace #0.375 \override #'(thickness . 1.5) 
\arrow-at-angle #30 #(sqrt 4) ##t }
arrowDownMarkup = \markup \concat { \hspace #0.375 \override #'(thickness . 
1.5) \arrow-at-angle #-30 #(sqrt 4) ##t }

staffSplitMarkup =
\markup
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \combine
\raise #0.4 \arrowUpMarkup
\lower #0.4 \arrowDownMarkup

staffSplit = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob staffSplitMarkup)
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )

staffConvergeDown = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob #{
  \markup
\with-dimensions #'(0 . 0) #'(0 . 0)
\arrowDownMarkup #})
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )

staffConvergeUp = #(define-music-function (grob-name) (string?)
  #{ { \once \override Staff.$grob-name #'stencil =
  #(grob-transformer 'stencil (lambda (grob orig)
(if (= LEFT (ly:item-break-dir grob))
  (ly:stencil-combine-at-edge
orig X RIGHT
(grob-interpret-markup grob #{
  \markup
\with-dimensions #'(0 . 0) #'(0 . 0)
\arrowUpMarkup #})
(if (equal? "TimeSignature" grob-name) 0.5 0))
  orig)))
\break } #} )


upper = {
  c'1 \break
  c'1 \staffConvergeDown "BarLine" \break
  c'1 \staffConvergeDown "TimeSignature" \time 3/2 \break
  c'1.
}

lower = {
  c'1 \break
  c'1 \staffConvergeUp "BarLine" \break
  c'1 \staffConvergeUp "TimeSignature" \break
  c'1. \break
}

\new ChoirStaff <<
  \new Staff \upper
  \new Staff \lower
>>
  SNIPPET ENDS
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Snippet: Adding indicators to staves which split after a break

2024-03-25 Thread Kevin Pye
I have two questions about this snippet:

The easy question. The fourth line of the snippet reads:
   (PI_OVER_180 (/ (atan2 1 1) 34))
Surely that “34” should be “45”.

The more difficult question. This snippet adds two arrows to the bar line at 
the end of the staff. I have a case where there is a key change at the end of 
the staff where I'd like to put the indicator, and so the bar line is not at 
the end of the staff. The snippet dutifully adds arrows to the bar line, which 
conflict with the new key signature. Is there a way to move the arrows to the 
end of the staff, rather than on the bar line?

Thanks,

Kevin.


Re: snippet

2024-03-12 Thread Raphael Mankin




On 11/03/2024 16:54, Gian Paolo Renello wrote:

HI,
I searched on lilypond site a way to rewrite a SATB on 2 staves, but i 
am not able to got it...

Does any one have a clue on it?
Thanks a lot
Gian Paolo
Here is the image i got form the score.


Look at \partCombine.  I use it to generate a short score (2 staffs), 
full score (4 staffs) and separate parts.


e.g.
  <<
\new Staff \with {
  instrumentName = "Descant/Treble"
  midiInstrument = "recorder"
} <<  \tempomark
  \partCombine
  { \sopranoRecorder }
  {  \transpose c' c \altoRecorder } >>
\new Staff = "right" \with {
  instrumentName = "Tenor/Bass"
} {
  <<
\partCombine
\tenorRecorder
{ \transpose c c'  \bassRecorder }
  >>
}
  >>


--
https://saturday-october-seven.com/



Re: snippet

2024-03-11 Thread Jakob Pedersen

Hello Gian,

I believe this is what you are looking for: 
https://lilypond.org/doc/v2.24/Documentation/learning/satb-vocal-score


Looking at your example, you might need to look at 
https://lilypond.org/doc/v2.24/Documentation/notation/multiple-voices, 
as you have more than two voices per staff in your example.


Best wishes,
Jakob

On 11.03.2024 17.54, Gian Paolo Renello wrote:

HI,
I searched on lilypond site a way to rewrite a SATB on 2 staves, but i 
am not able to got it...

Does any one have a clue on it?
Thanks a lot
Gian Paolo
Here is the image i got form the score.


Re: LyricExtender snippet: still the best way?

2023-06-22 Thread Jean Abou Samra



> Le 22 juin 2023 à 19:03, Kieren MacMillan  a 
> écrit :
> 
> Now… Is there any benefit to this — or something similar — being rolled into 
> the main codebase? If so, maybe it’s the perfect size for my first MR 
> [finally!]?


It should be rather easy, but the lyric extender code is in C++ 
(lily/lyric-extender.cc), so be prepared for that.

Cheers,

Jean





Re: LyricExtender snippet: still the best way?

2023-06-22 Thread Kieren MacMillan
Hi Jean,

> Indeed, you can put it in stencil:

I just *knew* grob-transformer would be the thing!

Now… Is there any benefit to this — or something similar — being rolled into 
the main codebase? If so, maybe it’s the perfect size for my first MR 
[finally!]?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: LyricExtender snippet: still the best way?

2023-06-22 Thread Jean Abou Samra
Le jeudi 22 juin 2023 à 09:14 -0400, Kieren MacMillan a écrit :

> Hi all,
> 
> The callback shown in this snippet is something that is automatically 
> included in all my engravings that include lyrics; it is designed to remove 
> LyricExtenders that fall below a minimum-length threshold.
> 
> Is the given code still the best way to accomplish what I want?
> In particular, I know after-line-breaking isn’t always the optimal place to 
> put callbacks — is there a better place for this one?


Indeed, you can put it in stencil:

```
\version "2.25.5"

extenderMinLength =
\override LyricExtender.stencil =
  #(grob-transformer
'stencil
(lambda (grob orig)
  (if (and (ly:stencil? orig)
   (< (interval-length (ly:stencil-extent orig X))
  (ly:grob-property grob 'minimum-length))
   (null? (ly:spanner-broken-into (ly:grob-original grob
  empty-stencil
  orig)))
  
\layout {
  indent = 0
  \context {
\Lyrics
\extenderMinLength
\override LyricExtender.minimum-length = #3
  }
}

mel = { g'2 ~ 4 4 ~ 2 ~ 4 4 4 ~ 16 8. ~ 8 8 4 ~ 4 r r2 }
lyr = \lyricmode { These __ are __ lyr -- ic __ ex -- ten -- ders. __ }

test =
  <<
\new Staff \new Voice = "melody" \mel
\addlyrics \lyr
  >>

\score {
  \test
}

\score {
  \layout { ragged-right = ##f }
  \test
}
```


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


LyricExtender snippet: still the best way?

2023-06-22 Thread Kieren MacMillan
Hi all,

The callback shown in this snippet is something that is automatically included 
in all my engravings that include lyrics; it is designed to remove 
LyricExtenders that fall below a minimum-length threshold.

Is the given code still the best way to accomplish what I want?
In particular, I know after-line-breaking isn’t always the optimal place to put 
callbacks — is there a better place for this one?

Thanks,
Kieren.

%%%  SNIPPET BEGINS
\version "2.25.2"

#(define (conditional-kill-lyric-extender-callback . args)
  (lambda (grob)
   (let* ((orig (ly:grob-original grob))
  (siblings (ly:spanner-broken-into orig))
  (minimum-length
   (if (null? args)
(ly:grob-property grob 'minimum-length 0)
(car args)))
  (X-extent (ly:stencil-extent (ly:grob-property grob 'stencil 
empty-stencil) X))
  (natural-length (- (cdr X-extent) (car X-extent
(if (and (> minimum-length natural-length)
 (<= (length siblings) 1)) ;; never kill a broken extender
 (ly:grob-suicide! grob)

\layout {
  indent = 0
  \context {
\Lyrics
\override LyricExtender.minimum-length = #3
\override LyricExtender.after-line-breaking = 
#(conditional-kill-lyric-extender-callback)
  }
}

mel = { g'2 ~ 4 4 ~ 2 ~ 4 4 4 ~ 16 8. ~ 8 8 4 ~ 4 r r2 }
lyr = \lyricmode { These __ are __ lyr -- ic __ ex -- ten -- ders. __ }

test =
  <<
\new Staff \new Voice = "melody" \mel
\addlyrics \lyr
  >>

\score {
  \test
}

\score {
  \layout { ragged-right = ##f }
  \test
}
%%%  SNIPPET ENDS

__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: question to generating random pitches snippet

2023-06-13 Thread Stefan Thomas
Dear Jean,
thanks for Your answer. I understand now!

Am Di., 13. Juni 2023 um 16:43 Uhr schrieb Jean Abou Samra <
j...@abou-samra.fr>:

> Le mardi 13 juin 2023 à 16:34 +0200, Stefan Thomas a écrit :
>
> Exactly. Sorry I've forgotten to send the link.
>
>
> The snippet contains the expression
>
> (random 12 random-state)
>
> meaning that a random pitch between c' and 11 steps higher (i.e., g'') is
> chosen. You can change that to, e.g.,
>
> (random 15)
>
> to have a pitch between c' and c''' , or
>
> (+ -7 (random 15))
>
> for a pitch between c and c' .
>


Re: question to generating random pitches snippet

2023-06-13 Thread Jean Abou Samra
Le mardi 13 juin 2023 à 16:43 +0200, Jean Abou Samra a écrit :
> Le mardi 13 juin 2023 à 16:34 +0200, Stefan Thomas a écrit :
> > Exactly. Sorry I've forgotten to send the link.
> 
> The snippet contains the expression
> 
> (random 12 random-state)
> 
> meaning that a random pitch between c' and 11 steps higher (i.e., g'') is 
> chosen. You can change that to, e.g.,
> 
> (random 15)
> 
> to have a pitch between c' and c''' , or
> 
> (+ -7 (random 15))
> 
> for a pitch between c and c' .


I've just improved the snippet in LSR so that it's easy to specify a different 
interval of pitches.

https://lsr.di.unimi.it/LSR/Item?id=274


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


Re: question to generating random pitches snippet

2023-06-13 Thread Jean Abou Samra
Le mardi 13 juin 2023 à 16:34 +0200, Stefan Thomas a écrit :
> Exactly. Sorry I've forgotten to send the link.

The snippet contains the expression

(random 12 random-state)

meaning that a random pitch between c' and 11 steps higher (i.e., g'') is 
chosen. You can change that to, e.g.,

(random 15)

to have a pitch between c' and c''' , or

(+ -7 (random 15))

for a pitch between c and c' .


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


Re: question to generating random pitches snippet

2023-06-13 Thread Stefan Thomas
Exactly. Sorry I've forgotten to send the link.

Am Di., 13. Juni 2023 um 16:15 Uhr schrieb Kenneth Flak <
kennethf...@protonmail.com>:

>
> On 13 Jun 2023  16:12, Jean Abou Samra wrote:
> >Le mardi 13 juin 2023 à 15:56 +0200, Stefan Thomas a écrit :
> >> Dear community,
> >> I discovered the snippet that lets you generate random pitches in
> Lilypond.
> >> How does Lilypond "know" what are the lowest, what are the highest
> pitches?
> >> How could I change that?
> >
> >
> >
> >Which snippet are you talking about?
>
>
> Maybe this one?
>
>
> https://lilypond.org/doc/v2.25/Documentation/snippets/pitches_003a-generating-random-notes.html
>
>


Re: question to generating random pitches snippet

2023-06-13 Thread Kenneth Flak


On 13 Jun 2023  16:12, Jean Abou Samra wrote:
>Le mardi 13 juin 2023 à 15:56 +0200, Stefan Thomas a écrit :
>> Dear community,
>> I discovered the snippet that lets you generate random pitches in Lilypond.
>> How does Lilypond "know" what are the lowest, what are the highest pitches?
>> How could I change that?
>
>
>
>Which snippet are you talking about?


Maybe this one?

https://lilypond.org/doc/v2.25/Documentation/snippets/pitches_003a-generating-random-notes.html




Re: question to generating random pitches snippet

2023-06-13 Thread Jean Abou Samra
Le mardi 13 juin 2023 à 15:56 +0200, Stefan Thomas a écrit :
> Dear community,
> I discovered the snippet that lets you generate random pitches in Lilypond.
> How does Lilypond "know" what are the lowest, what are the highest pitches?
> How could I change that?



Which snippet are you talking about?


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


question to generating random pitches snippet

2023-06-13 Thread Stefan Thomas
Dear community,
I discovered the snippet that lets you generate random pitches in Lilypond.
How does Lilypond "know" what are the lowest, what are the highest pitches?
How could I change that?
Thanks for Your help
Stefan


Re: Snippet: automatic reminder text for mutes/techniques

2023-01-26 Thread Saul Tobin
I assumed that if the instrument is playing continuously, no reminder text
is needed. Did you have a scenario in mind where reminders would be useful
even without measures of rest?

Or, did you mean that instead of rests you are using spacers? I think this
snippet should work fine for that use case.

On Thu, Jan 26, 2023 at 6:10 PM Andrew Bernard 
wrote:

> What if you don't have any rests?
>
>
> Andrew
>
>
> On 27/01/2023 1:00 pm, Saul Tobin wrote:
> >
> > Attached is a snippet that keeps track of these instructions and
> > automatically prints reminder text after a set number of measures of
> rest.
> >
>
>


Re: Snippet: automatic reminder text for mutes/techniques

2023-01-26 Thread Andrew Bernard

What if you don't have any rests?


Andrew


On 27/01/2023 1:00 pm, Saul Tobin wrote:


Attached is a snippet that keeps track of these instructions and 
automatically prints reminder text after a set number of measures of rest.






Snippet: automatic reminder text for mutes/techniques

2023-01-26 Thread Saul Tobin
Hi all,

I have always felt one of the more annoying proofreading tasks for
instrumental music is ensuring that technique instructions such as mutes
are properly cancelled.

Attached is a snippet that keeps track of these instructions and
automatically prints reminder text after a set number of measures of rest.

Is this something you would find useful?

Saul


reminder-engraver.ly
Description: Binary data


Re: Error when compiling snippet "Parenthesize a group of notes using a Scheme function"

2022-12-16 Thread Robin Bannister

Kieren MacMillan wrote:

Hi Joseph,

If you use convert-ly on your files, it will update ParenthesesItem to 
Parentheses, which will eliminate the error.



Yes, but:

The LSR snippets don't have a \version statement.
If convert-ly doesn't help, insert the line
\version "2.22.0"
and try again.


Cheers,
Robin





Re: Error when compiling snippet "Parenthesize a group of notes using a Scheme function"

2022-12-16 Thread Carl Sorensen
On Fri, Dec 16, 2022 at 11:48 AM Joseph Srednicki 
wrote:

> I am running Lilypond 2.24.0 on Windows 11.
>
> I am trying the use the snippet entitled "Parenthesize a group of notes
> using a Scheme function" located at
> https://lsr.di.unimi.it/LSR/Snippet?id=902.
>
> I receive the following errors:
>
>
> :/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:12:19
> : error: bad grob property path
> \once \override
> ParenthesesItem.stencils = #(lambda (grob)
>
>
> C:/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:18:19
> : error: bad grob property path
> \once \override
> ParenthesesItem.stencils = #(lambda (grob)
>
>
> C:/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:25:13
> : error: bad grob property path
> \override
> ParenthesesItem.font-size = #5
>

Have you used convert-ly?

https://lilypond.org/doc/v2.24/Documentation/usage/updating-files-with-convert_002dly

ParenthesesItem changed to Parentheses in 2.24

HTH,

Carl

>


Re: Error when compiling snippet "Parenthesize a group of notes using a Scheme function"

2022-12-16 Thread Kieren MacMillan
Hi Joseph,

If you use convert-ly on your files, it will update ParenthesesItem to 
Parentheses, which will eliminate the error.

Hope that helps!
Kieren.



Error when compiling snippet "Parenthesize a group of notes using a Scheme function"

2022-12-16 Thread Joseph Srednicki
I am running Lilypond 2.24.0 on Windows 11.
I am trying the use the snippet entitled "Parenthesize a group of notes using a 
Scheme function" located at https://lsr.di.unimi.it/LSR/Snippet?id=902.
I receive the following errors:
:/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:12:19:
 error: bad grob property path \once \override  ParenthesesItem.stencils = 
#(lambda (grob)
C:/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:18:19:
 error: bad grob property path \once \override  ParenthesesItem.stencils = 
#(lambda (grob)
C:/Users/jossr/AppData/Local/Temp/frescobaldi-ml8etqod/tmp7uoisrq_/document.ly:25:13:
 error: bad grob property path \override  ParenthesesItem.font-size = #5
My knowledge of Scheme is rudimentary and limited to reading the documentation 
and writing some simple functions. I also searched the archive to see if 
someone else had reported this issue but did not find anything.
Thanks.

Re: Snippet doesn't work in unstable version

2022-07-21 Thread Thomas Morley
Am Mi., 20. Juli 2022 um 18:43 Uhr schrieb Martín Rincón Botero <
martinrinconbot...@gmail.com>:

> Hello,
>
> I grabbed this snippet a while ago from somewhere™ which puts a box
> around music (an "improvisation box"). It works perfectly in Lilypond
> 2.22.1, but not in Lilypond 2.23.3+. Does somebody know how to make it work
> in more recent versions? This is the snippet:
>

Probably better and more inline with what's done internally, let the
classes-entry be done automatically:

#(define (add-grob-definition grob-name grob-entry)
   (let* ((meta-entry   (assoc-get 'meta grob-entry))
  (class(assoc-get 'class meta-entry))
  (ifaces-entry (assoc-get 'interfaces meta-entry)))
 ;; change ly:grob-properties? to list? to work from 2.19.12 back to at
least 2.18.2
 (set-object-property! grob-name 'translation-type? ly:grob-properties?)
 (set-object-property! grob-name 'is-grob? #t)
 (set! ifaces-entry (append (case class
  ((Item) '(item-interface))
  ((Spanner) '(spanner-interface))
  ((Paper_column) '((item-interface

 paper-column-interface)))
  ((System) '((system-interface
   spanner-interface)))
  (else '(unknown-interface)))
  ifaces-entry))
 (set! ifaces-entry (uniq-list (sort ifaces-entry symbol

Re: Snippet doesn't work in unstable version

2022-07-20 Thread Thomas Morley
Am Mi., 20. Juli 2022 um 18:43 Uhr schrieb Martín Rincón Botero <
martinrinconbot...@gmail.com>:

> Hello,
>
> I grabbed this snippet a while ago from somewhere™ which puts a box
> around music (an "improvisation box"). It works perfectly in Lilypond
> 2.22.1, but not in Lilypond 2.23.3+. Does somebody know how to make it work
> in more recent versions? This is the snippet:
>
> \version "2.19.15"
>
> \header {
>   tagline = ##f
> }
>
> #(define-event-class 'music-boxer-event 'span-event)
>
> #(define-event-class 'box-event 'music-event)
>
> #(define (add-grob-definition grob-name grob-entry)
>(let* ((meta-entry   (assoc-get 'meta grob-entry))
>   (class(assoc-get 'class meta-entry))
>   (ifaces-entry (assoc-get 'interfaces meta-entry)))
>  ;; change ly:grob-properties? to list? to work from 2.19.12 back to
> at least 2.18.2
>  (set-object-property! grob-name 'translation-type?
> ly:grob-properties?)
>  (set-object-property! grob-name 'is-grob? #t)
>  (set! ifaces-entry (append (case class
>   ((Item) '(item-interface))
>   ((Spanner) '(spanner-interface))
>   ((Paper_column) '((item-interface
>
>  paper-column-interface)))
>   ((System) '((system-interface
>spanner-interface)))
>   (else '(unknown-interface)))
>   ifaces-entry))
>  (set! ifaces-entry (uniq-list (sort ifaces-entry symbol  (set! ifaces-entry (cons 'grob-interface ifaces-entry))
>  (set! meta-entry (assoc-set! meta-entry 'name grob-name))
>  (set! meta-entry (assoc-set! meta-entry 'interfaces
> ifaces-entry))
>  (set! grob-entry (assoc-set! grob-entry 'meta meta-entry))
>  (set! all-grob-descriptions
>(cons (cons grob-name grob-entry)
>  all-grob-descriptions
>
> #(define (make-box thick padding xext yext)
>(let ((xext (interval-widen xext padding))
>  (yext (interval-widen yext padding)))
>(ly:stencil-add
> (make-filled-box-stencil xext (cons (- (car yext) thick) (car yext)))
> (make-filled-box-stencil xext (cons (cdr yext) (+ (cdr yext) thick)))
> (make-filled-box-stencil (cons (cdr xext) (+ (cdr xext) thick)) yext)
> (make-filled-box-stencil (cons (- (car xext) thick) (car xext))
> yext
>
> #(define (music-boxer-stencil grob)
>(let* ((elts (ly:grob-object grob 'elements))
>   (refp-X (ly:grob-common-refpoint-of-array grob elts X))
>   (X-ext (ly:relative-group-extent elts refp-X X))
>   (refp-Y (ly:grob-common-refpoint-of-array grob elts Y))
>   (Y-ext (ly:relative-group-extent elts refp-Y Y))
>   (padding (ly:grob-property grob 'padding 0.3))
>   (stil (make-box 0.1 padding X-ext Y-ext))
>   (offset (ly:grob-relative-coordinate grob refp-X X)))
>  (ly:stencil-translate-axis stil (- offset) X)))
>
> #(define box-stil music-boxer-stencil)
>
> #(add-grob-definition
>   'Box
>   `(
>  (stencil . ,box-stil)
>  (meta . ((class . Item)
>
;; add:
   (classes . (Item))

>   (interfaces . ())
>
> #(add-grob-definition
>   'MusicBoxer
>   `(
>  (stencil . ,music-boxer-stencil)
>  (meta . ((class . Spanner)
>
;; add:
  (classes . (Spanner))

>   (interfaces . ())
>
>
> #(define box-types
>'(
>   (BoxEvent
>. ((description . "A box encompassing music at a single timestep.")
>   (types . (general-music box-event music-event event))
>   ))
>   ))
>
> #(define music-boxer-types
>'(
>   (MusicBoxerEvent
>. ((description . "Used to signal where boxes encompassing music
> start and stop.")
>   (types . (general-music music-boxer-event span-event event))
>   ))
>   ))
>
>
> #(set!
>   music-boxer-types
>   (map (lambda (x)
>  (set-object-property! (car x)
>'music-description
>(cdr (assq 'description (cdr x
>  (let ((lst (cdr x)))
>(set! lst (assoc-set! lst 'name (car x)))
>(set! lst (assq-remove! lst 'description))
>(hashq-set! music-name-to-property-table (car x) lst)
>(cons (car x) lst)))
> music-boxer-types))
>
> #(set!
>   box-types
>   (map 

Snippet doesn't work in unstable version

2022-07-20 Thread Martín Rincón Botero
Hello,

I grabbed this snippet a while ago from somewhere™ which puts a box around 
music (an "improvisation box"). It works perfectly in Lilypond 2.22.1, but not 
in Lilypond 2.23.3+. Does somebody know how to make it work in more recent 
versions? This is the snippet:

\version "2.19.15"
\header {
tagline = ##f
}

#(define-event-class 'music-boxer-event 'span-event)
#(define-event-class 'box-event 'music-event)
#(define (add-grob-definition grob-name grob-entry)
(let* ((meta-entry (assoc-get 'meta grob-entry))
(class (assoc-get 'class meta-entry))
(ifaces-entry (assoc-get 'interfaces meta-entry)))
;; change ly:grob-properties? to list? to work from 2.19.12 back to at least 
2.18.2
(set-object-property! grob-name 'translation-type? ly:grob-properties?)
(set-object-property! grob-name 'is-grob? #t)
(set! ifaces-entry (append (case class
((Item) '(item-interface))
((Spanner) '(spanner-interface))
((Paper_column) '((item-interface
paper-column-interface)))
((System) '((system-interface
spanner-interface)))
(else '(unknown-interface)))
ifaces-entry))
(set! ifaces-entry (uniq-list (sort ifaces-entry symbol1
\musicBoxerStart d8-4 g,-0 d' g, d'-4 g,-0 d' \musicBoxerEnd g,
}

%2
\repeat volta 2 {
\box 1\f\fermata
\musicBoxerStart g8-3 d-0 g d g8-4 d-0 g \musicBoxerEnd d\accent
}
}

\score {
\new Staff \melody
}

It should produce:

It produces instead: fatal error: meta.classes must be non-empty list, found #f
Something seems to have changed in the meanwhile. It would be nice to update 
this snippet to work in more recent versions.
Regards,
Martín.

--
www.martinrinconbotero.com 
(https://link.getmailspring.com/link/cag9pzzwc2adlw9vcaudzy2hf0rx7envupae6o4to06ykkwp...@mail.gmail.com/0?redirect=http%3A%2F%2Fwww.martinrinconbotero.com&recipient=bGlseXBvbmQtdXNlckBnbnUub3Jn)



Re: Problem with a snippet "shorthand for triplets [0.21429]"

2022-06-29 Thread mark damerell
Thank you who replied. Sometime "soon" I will update
Lilypond but I will not reply further unless this fails...


Re: Problem with a snippet "shorthand for triplets [0.21429]"

2022-06-27 Thread David Kastrup
Aaron Hill  writes:

> On 2022-06-27 6:18 am, Jean Abou Samra wrote:
>> The LSR runs LilyPond 2.22 and you have 2.18. You need to upgrade
>> LilyPond. Frescobaldi makes it easy to use several versions in
>> parallel.
>
> As far as I can see, the LSR only notes the current version in
> Contributing [1].
>
> [1]: https://lsr.di.unimi.it/LSR/html/contributing.html
>
> Would it be possible to have this information displayed prominently on
> the search page itself?  Unless users are following the mailing list
> threads, they would not be aware of the recent upgrade to 2.22.

Does anybody remember the rationale why the snippets don't contain
\version statements?

-- 
David Kastrup



Re: Problem with a snippet "shorthand for triplets [0.21429]"

2022-06-27 Thread Aaron Hill

On 2022-06-27 6:18 am, Jean Abou Samra wrote:

The LSR runs LilyPond 2.22 and you have 2.18. You need to upgrade
LilyPond. Frescobaldi makes it easy to use several versions in
parallel.


As far as I can see, the LSR only notes the current version in 
Contributing [1].


[1]: https://lsr.di.unimi.it/LSR/html/contributing.html

Would it be possible to have this information displayed prominently on 
the search page itself?  Unless users are following the mailing list 
threads, they would not be aware of the recent upgrade to 2.22.



-- Aaron Hill



Re: Problem with a snippet "shorthand for triplets [0.21429]"

2022-06-27 Thread Jean Abou Samra




Le 27/06/2022 à 13:26, mark damerell a écrit :

It came from:
%% http://lsr.di.unimi.it/LSR/Item?id=328

Here is part of it:

% First version, with a single argument, i.e. the
% syntax is \triplet{ c d e }
triplet = #(define-music-function (music) (ly:music?)
  #{ \tuplet 3/2 $music #})

\score{
  \relative c'{
    c4 \triplet {c d e}
  }
}

This produces:

GNU LilyPond 2.18.2
Processing `/home/rmd/Music/holycity/trips.ly '
Parsing.../usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23: 
In expression (apply (ly:music-function-extract fun) parser ...):
/usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23: Wrong 
number of arguments to #


Compilation exited abnormally with code 1 at Mon Jun 27 12:18:38

Please any advice? thank you.



The LSR runs LilyPond 2.22 and you have 2.18. You need to upgrade 
LilyPond. Frescobaldi makes it easy to use several versions in parallel.


Alternatively, replace "music" with the legacy syntax "parser location 
music".


Jean




Problem with a snippet "shorthand for triplets [0.21429]"

2022-06-27 Thread mark damerell
It came from:
%% http://lsr.di.unimi.it/LSR/Item?id=328

Here is part of it:

% First version, with a single argument, i.e. the
% syntax is \triplet{ c d e }
triplet = #(define-music-function (music) (ly:music?)
  #{ \tuplet 3/2 $music #})

\score{
  \relative c'{
c4 \triplet {c d e}
  }
}

This produces:

GNU LilyPond 2.18.2
Processing `/home/rmd/Music/holycity/trips.ly'
Parsing.../usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23:
In expression (apply (ly:music-function-extract fun) parser ...):
/usr/share/lilypond/2.18.2/scm/ly-syntax-constructors.scm:56:23: Wrong
number of arguments to #

Compilation exited abnormally with code 1 at Mon Jun 27 12:18:38

Please any advice? thank you.


Re: Snippet

2022-04-22 Thread Jacques Menu
THANKS A LOT, Jean, that’s precisely what I’ve been struggling with for xml2ly 
these days…, solved!

I’ll use your solution this way:

\score {
  \context Staff = "staff1" {
c1
\mergeFullBarRests {
  \compressEmptyMeasures
  R1  R1  R1 % NO '|' bar mark here!
  \bar "||"
  | % bar mark is optional here
}
  }
}

JM

> Le 22 avr. 2022 à 09:35, Martín Rincón Botero  
> a écrit :
> 
> Thank you!
> 
> On abr. 21 2022, at 9:10 pm, Jean Abou Samra  wrote:
> Le 21/04/2022 à 19:50, Martín Rincón Botero a écrit :
> > Would it be possible to update it to work on Lilypond 2.22.1?
> 
> 
> The code contains spurious Unicode "zero-width space" characters, one among
> the newlines between the end of append-merge and "mergeSkips =", and another
> between the end of \mergeFullBarRests and \score. Try removing these.
> Updated
> snippet:
> 
> \version "2.22.2"
> 
> #(define (append-merge x l r)
> "Add x to the head of list l, merging skips,
> and if r is true also merging full measure rests."
>   (if (and (pair? l)
>(ly:music? x)
>(ly:music? (car l))
>(or (and (music-is-of-type? x 'skip-event)
> (music-is-of-type? (car l) 'skip-event))
>(and r
> (music-is-of-type? x 'multi-measure-rest)
> (music-is-of-type? (car l) 'multi-measure-rest)))
>(not (pair? (ly:music-property (car l) 'articulations
>  (let ((total
> (ly:moment-add
> (ly:music-duration-length (car l))
> (ly:music-duration-length x)
> )))
>(set! (ly:music-property x 'duration)
>   (make-duration-of-length total))
>(cons x (cdr l)))
> (cons x l)))
> 
> mergeSkips = #(define-music-function
>  (parser location rests-also music) ((boolean?) ly:music?)
>  "Merge successive skips in sequential music,
>   optionally merge full-measure rests as well."
>  (music-map
>(lambda (m)
>   (if (music-is-of-type? m 'sequential-music)
> (ly:music-set-property! m
>'elements
>(fold-right (lambda (x l)
>  (append-merge x l rests-also))
>  '()
>  (ly:music-property m 'elements
>  m)
>music))
> 
> mergeFullBarRests = #(define-music-function
>  (parser location music) (ly:music?)
>  #{ \mergeSkips ##t $music #})
> 
> \score {
>   \mergeFullBarRests {
> \context Staff = "staff1" {
>   \compressEmptyMeasures
>   c1 R1 R1 R1
> }
>   }
>   }
> 
> 
> Best,
> Jean
> 



Re: Snippet

2022-04-22 Thread Martín Rincón Botero
Thank you!

On abr. 21 2022, at 9:10 pm, Jean Abou Samra  wrote:
> Le 21/04/2022 à 19:50, Martín Rincón Botero a écrit :
> > Would it be possible to update it to work on Lilypond 2.22.1?
>
>
> The code contains spurious Unicode "zero-width space" characters, one among
> the newlines between the end of append-merge and "mergeSkips =", and another
> between the end of \mergeFullBarRests and \score. Try removing these.
> Updated
> snippet:
>
> \version "2.22.2"
> #(define (append-merge x l r)
> "Add x to the head of list l, merging skips,
> and if r is true also merging full measure rests."
> (if (and (pair? l)
> (ly:music? x)
> (ly:music? (car l))
> (or (and (music-is-of-type? x 'skip-event)
> (music-is-of-type? (car l) 'skip-event))
> (and r
> (music-is-of-type? x 'multi-measure-rest)
> (music-is-of-type? (car l) 'multi-measure-rest)))
> (not (pair? (ly:music-property (car l) 'articulations
> (let ((total
> (ly:moment-add
> (ly:music-duration-length (car l))
> (ly:music-duration-length x)
> )))
> (set! (ly:music-property x 'duration)
> (make-duration-of-length total))
> (cons x (cdr l)))
> (cons x l)))
>
> mergeSkips = #(define-music-function
> (parser location rests-also music) ((boolean?) ly:music?)
> "Merge successive skips in sequential music,
> optionally merge full-measure rests as well."
> (music-map
> (lambda (m)
> (if (music-is-of-type? m 'sequential-music)
> (ly:music-set-property! m
> 'elements
> (fold-right (lambda (x l)
> (append-merge x l rests-also))
> '()
> (ly:music-property m 'elements
> m)
> music))
>
> mergeFullBarRests = #(define-music-function
> (parser location music) (ly:music?)
> #{ \mergeSkips ##t $music #})
>
> \score {
> \mergeFullBarRests {
> \context Staff = "staff1" {
> \compressEmptyMeasures
> c1 R1 R1 R1
> }
> }
> }
>
>
> Best,
> Jean
>



Re: Snippet

2022-04-21 Thread Jean Abou Samra

Le 21/04/2022 à 19:50, Martín Rincón Botero a écrit :

Would it be possible to update it to work on Lilypond 2.22.1?



The code contains spurious Unicode "zero-width space" characters, one among
the newlines between the end of append-merge and "mergeSkips =", and another
between the end of \mergeFullBarRests and \score. Try removing these. 
Updated

snippet:

\version "2.22.2"

#(define (append-merge x l r)
"Add x to the head of list l, merging skips,
and if r is true also merging full measure rests."
  (if (and (pair? l)
   (ly:music? x)
   (ly:music? (car l))
   (or (and (music-is-of-type? x 'skip-event)
    (music-is-of-type? (car l) 'skip-event))
   (and r
    (music-is-of-type? x 'multi-measure-rest)
    (music-is-of-type? (car l) 'multi-measure-rest)))
   (not (pair? (ly:music-property (car l) 'articulations
 (let ((total
    (ly:moment-add
    (ly:music-duration-length (car l))
    (ly:music-duration-length x)
    )))
   (set! (ly:music-property x 'duration)
  (make-duration-of-length total))
   (cons x (cdr l)))
    (cons x l)))

mergeSkips = #(define-music-function
 (parser location rests-also music) ((boolean?) ly:music?)
 "Merge successive skips in sequential music,
  optionally merge full-measure rests as well."
 (music-map
   (lambda (m)
  (if (music-is-of-type? m 'sequential-music)
    (ly:music-set-property! m
   'elements
   (fold-right (lambda (x l)
 (append-merge x l rests-also))
 '()
 (ly:music-property m 'elements
 m)
   music))

mergeFullBarRests = #(define-music-function
 (parser location music) (ly:music?)
 #{ \mergeSkips ##t $music #})

\score {
  \mergeFullBarRests {
\context Staff = "staff1" {
  \compressEmptyMeasures
  c1 R1 R1 R1
}
  }
  }


Best,
Jean




Snippet

2022-04-21 Thread Martín Rincón Botero
Hello,

I have this snippet that combines subsequent multimeasure rests into a 
multiplied one that Lilypond can compress, that I grabbed from somewhere a 
while ago. It used to work without errors, if I remember well, in Lilypond 
2.20. In 2.22.1 it still "works" but throws an error for the first line of the 
snippet, namely:
syntax error, unexpected SYMBOL, expecting '.' or '='

​#(define (append-merge x l r)
It seems that something changed in 2.22 that makes the snippet misbehave. 
Here's the snippet:
#(define (append-merge x l r)
"Add x to the head of list l, merging skips,
and if r is true also merging full measure rests."
(if (and (pair? l)
(ly:music? x)
(ly:music? (car l))
(or (and (music-is-of-type? x 'skip-event)
(music-is-of-type? (car l) 'skip-event))
(and r
(music-is-of-type? x 'multi-measure-rest)
(music-is-of-type? (car l) 'multi-measure-rest)))
(not (pair? (ly:music-property (car l) 'articulations
(let ((total
(ly:moment-add
(ly:music-duration-length (car l))
(ly:music-duration-length x)
)))
(set! (ly:music-property x 'duration)
(make-duration-of-length total))
(cons x (cdr l)))
(cons x l)))

​
mergeSkips = #(define-music-function
(parser location rests-also music) ((boolean?) ly:music?)
"Merge successive skips in sequential music,
optionally merge full-measure rests as well."
(music-map
(lambda (m)
(if (music-is-of-type? m 'sequential-music)
(ly:music-set-property! m
'elements
(fold-right (lambda (x l)
(append-merge x l rests-also))
'()
(ly:music-property m 'elements
m)
music))

mergeFullBarRests = #(define-music-function
(parser location music) (ly:music?)
#{ \mergeSkips ##t $music #})
​
\score {
\mergeFullBarRests {
\context Staff = "staff1" {
\compressEmptyMeasures
c1 R1 R1 R1
}
}
}

Would it be possible to update it to work on Lilypond 2.22.1?
Regards,
Martín.


Re: Snippet only as PDF

2022-02-27 Thread Bophead 2000
Hi Jean,

That works fine for PDF and EPS output already, but not for SVG. So I added

#(ly:set-option 'backend 'svg)

afterwards and that made the Lilypond command line options for SVG output
work. I guess that overrides the EPS-backend defined in “
lilypond-book-preamble.ly”.

I will try to modify the “lilypond-book-preamble.ly” file accordingly, save
it under a different name and call that new file instead. Would the EPS and
PDF output still work properly then?

So far you have helped me a lot already, the SVG output is not really
needed in the moment, but it interests me still how to achieve it correctly.

Merci Beaucoup

Bophead

On Sun, Feb 27, 2022 at 5:35 PM Jean Abou Samra  wrote:

> Le 27/02/2022 à 10:40, Bophead 2000 a écrit :
> > What is the simplest way to get snippets cut down to only content as
> > only one file – be it PDF, EPS or SVG?
>
> Add
>
> #(ly:set-option 'aux-files #f)
>
> Best,
> Jean
>
>


Re: Snippet only as PDF

2022-02-27 Thread Jean Abou Samra

Le 27/02/2022 à 10:40, Bophead 2000 a écrit :
What is the simplest way to get snippets cut down to only content as 
only one file – be it PDF, EPS or SVG?


Add

#(ly:set-option 'aux-files #f)

Best,
Jean




Re: Snippet only as PDF

2022-02-27 Thread David Wright
On Sun 27 Feb 2022 at 14:16:32 (+0100), Bophead 2000 wrote:

> > > I want to produce lilypond snippets to be used within a text – but only in
> > > one graphics file format (PDF, EPS or SVG). In the moment I am using a
> > > method I copied from the examples in the HTML-manuals putting the
> > > following in front of the music:
> > >
> > > \include "lilypond-book-preamble.ly <http://lilypond-book-preamble.ly>"

[ … ]

> > > So far everything is working but what annoys me are all those files that I
> > > don’t need: tex, texi etc. (I am not using LaTeX) cluttering my folders.
> > > (Don’t get me wrong – those files may be useful and necessary if using
> > > LaTeX, but I am using ConTeXt so I have no use for them.)
> > >
> > > So my question is:
> > >
> > > What is the simplest way to get snippets cut down to only content as only
> > > one file – be it PDF, EPS or SVG?

> Back to pure Lilypond:
> 
> Nonetheless I would still like to know if there is a way to render a
> snippet cut to its pure musical content in only one file format. Me and
> others might have a use for such snippets as graphics for other programs as
> well that do not integrate Lilypond as well as ConTeXt.
> 
> (From ConTeXt I am used to “--purgeall” to get rid of all the auxiliary
> files. But something like that doesn’t seem to to exist for Lilypond as
> there is an intention behind all those files).

Hraban, as a ConTeXt user, may have more idea of your workflow.
My scripts merely remove the excess files, using constructs
like "${Sourcefilename/%.ly/.log}" to generate their names.

(Actually they don't remove the files, but move them to a nonce
directory under /tmp, so that they could be inspected if required.
/tmp is cleaned automatically.)

Cheers,
David.



Re: Snippet only as PDF

2022-02-27 Thread Henning Hraban Ramm

Hi Bophead,

Am 27.02.22 um 14:16 schrieb Bophead 2000:

Hi Hraban,

I have seen that page in ConTeXtgarden. But as far as I understood the 
“filter” module works only in ConTeXt MkIV and the workaround to use it 
in ConTeXt LMTX has a security flaw (cannot remember where I read the 
latter). That is why I have not tried it yet. I wanted something that 
works with LMTX as well.


The filter module works with LMTX, and if something doesn’t work, Aditya 
is usually quick to fix it.


But I will look into that as in the moment I switched back to MkIV 
anyway to be able to use Dan Kreiders MusFrets font 
(https://www.notationcentral.com/product/musfrets/ 
) properly (it is 
working with ligatures and colr/cpal font features and not displayed 
properly in most PDF readers if rendered with LMTX).


Please raise that issue on the ConTeXt mailing list – if something 
doesn’t work with LMTX that does work with MkIV, it’s something Hans 
will usually fix quickly (even if at the moment he’s busy working on the 
math enhancements).



Grüße aus München


Grüße aus Limburg/Lahn ;)

Hraban




Re: Re: Snippet only as PDF

2022-02-27 Thread Bophead 2000
Hi Hraban,

I have seen that page in ConTeXtgarden. But as far as I understood the
“filter” module works only in ConTeXt MkIV and the workaround to use it in
ConTeXt LMTX has a security flaw (cannot remember where I read the latter).
That is why I have not tried it yet. I wanted something that works with
LMTX as well.

But I will look into that as in the moment I switched back to MkIV anyway
to be able to use Dan Kreiders MusFrets font (
https://www.notationcentral.com/product/musfrets/) properly (it is working
with ligatures and colr/cpal font features and not displayed properly in
most PDF readers if rendered with LMTX).

And of course I am willing to improve the ConTeXt-LilyPond integration
together.

Back to pure Lilypond:

Nonetheless I would still like to know if there is a way to render a
snippet cut to its pure musical content in only one file format. Me and
others might have a use for such snippets as graphics for other programs as
well that do not integrate Lilypond as well as ConTeXt.

(From ConTeXt I am used to “--purgeall” to get rid of all the auxiliary
files. But something like that doesn’t seem to to exist for Lilypond as
there is an intention behind all those files).

Grüße aus München

Bophead

> Hi Bophead,
>
> welcome, fellow ConTeXt user!
> Do you know https://wiki.contextgarden.net/LilyPond ?
> I’m using only parts of lilypond-book-preamble.ly
>
> Maybe we can improve the ConTeXt-LilyPond integration together.
>
> Hraban
>
> Am 27.02.22 um 10:40 schrieb Bophead 2000:
>
> Hello all,
>
>
> I want to produce lilypond snippets to be used within a text – but only in
> one graphics file format (PDF, EPS or SVG). In the moment I am using a
> method I copied from the examples in the HTML-manuals putting the
> following in front of the music:
>
> 
>
> \include "lilypond-book-preamble.ly <http://lilypond-book-preamble.ly>"
>
> \paper {
>indent = 0\mm
>line-width = 160\mm
>line-width = #(- line-width (* mm  3.00) (* mm 1))
>line-width = 160\mm - 2.0 * 10.16\mm
>line-width = #(- line-width (* mm  3.00) (* mm 1))
> }
>
> \layout {}
>
> 
>
>
> So far everything is working but what annoys me are all those files that I
> don’t need: tex, texi etc. (I am not using LaTeX) cluttering my folders.
> (Don’t get me wrong – those files may be useful and necessary if using
> LaTeX, but I am using ConTeXt so I have no use for them.)
>
> So my question is:
>
>
> What is the simplest way to get snippets cut down to only content as only
> one file – be it PDF, EPS or SVG?
>
> Thanks in advance
> Bophead
>
>


Re: Snippet only as PDF

2022-02-27 Thread Henning Hraban Ramm

Hi Bophead,

welcome, fellow ConTeXt user!
Do you know https://wiki.contextgarden.net/LilyPond ?
I’m using only parts of lilypond-book-preamble.ly

Maybe we can improve the ConTeXt-LilyPond integration together.

Hraban

Am 27.02.22 um 10:40 schrieb Bophead 2000:

Hello all,

I want to produce lilypond snippets to be used within a text – but only 
in one graphics file format (PDF, EPS or SVG).


In the moment I am using a method I copied from the examples in the 
HTML-manuals putting the following in front of the music:




\include "lilypond-book-preamble.ly "

\paper {
   indent = 0\mm
   line-width = 160\mm
   line-width = #(- line-width (* mm  3.00) (* mm 1))
   line-width = 160\mm - 2.0 * 10.16\mm
   line-width = #(- line-width (* mm  3.00) (* mm 1))
}

\layout {}



So far everything is working but what annoys me are all those files that 
I don’t need: tex, texi etc. (I am not using LaTeX) cluttering my 
folders. (Don’t get me wrong – those files may be useful and necessary 
if using LaTeX, but I am using ConTeXt so I have no use for them.)


So my question is:

What is the simplest way to get snippets cut down to only content as 
only one file – be it PDF, EPS or SVG?


Thanks in advance
Bophead





Snippet only as PDF

2022-02-27 Thread Bophead 2000
Hello all,

I want to produce lilypond snippets to be used within a text – but only in
one graphics file format (PDF, EPS or SVG).

In the moment I am using a method I copied from the examples in the
HTML-manuals putting the following in front of the music:



\include "lilypond-book-preamble.ly"

\paper {
  indent = 0\mm
  line-width = 160\mm
  line-width = #(- line-width (* mm  3.00) (* mm 1))
  line-width = 160\mm - 2.0 * 10.16\mm
  line-width = #(- line-width (* mm  3.00) (* mm 1))
}

\layout {}



So far everything is working but what annoys me are all those files that I
don’t need: tex, texi etc. (I am not using LaTeX) cluttering my folders.
(Don’t get me wrong – those files may be useful and necessary if using
LaTeX, but I am using ConTeXt so I have no use for them.)

So my question is:

What is the simplest way to get snippets cut down to only content as only
one file – be it PDF, EPS or SVG?

Thanks in advance
Bophead


Re: Improving this "Markup anywhere" snippet

2022-02-15 Thread Lukas-Fabian Moser

Hi Colin,

I wonder whether any of you Lilypond wizards could help me work out 
how to improve my Lilypond scores.
Most of my embellishments come from reading/copying bits of code from 
this forum - but I admit I don't always fully understand why things 
work. However, I have this 'snippet' which I call "Markup anywhere", 
which basically allows a markup to be added without disrupting any of 
the positioning of other items.
What I would like is to know how it can be improved - so that I can 
use it without copying large chunks of code whenever it is required. 
The amended markup is demonstrated here:-


c1^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)
                \translate #'(-10.0 . -4.0)
                \override #'(font-name ."Tahoma bold italic")
                \fontsize #-2 \with-color #(x11-color "LimeGreen")
                \box \box \whiteout
              "Put your text here"

Could this be streamlined and generalised somehow, and yet still be 
able to accept various variable to alter position/colour etc
\null \with-dimensions ... seems strange: \null produces an empty 
markup, and _then_ the actual command begins. So you can simplify to


\markup \with-dimensions-from \null \translate .


Just as a side note - why does the \whiteout not work perfectly?


For the whiteout, try specyfing

\override TextScript.layer = 1000

in the music or in the \layout { } block to make sure that text scripts 
are put in the foreground and do not lie under other layout objects.


Does this help already?

Lukas





Improving this "Markup anywhere" snippet

2022-02-15 Thread Colin Baguley
I wonder whether any of you Lilypond wizards could help me work out how to
improve my Lilypond scores.
Most of my embellishments come from reading/copying bits of code from this
forum - but I admit I don't always fully understand why things work.
However, I have this 'snippet' which I call "Markup anywhere", which
basically allows a markup to be added without disrupting any of the
positioning of other items.
What I would like is to know how it can be improved - so that I can use it
without copying large chunks of code whenever it is required. The amended
markup is demonstrated here:-

c1^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)
\translate #'(-10.0 . -4.0)
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "LimeGreen")
\box \box \whiteout
  "Put your text here"

Could this be streamlined and generalised somehow, and yet still be able to
accept various variable to alter position/colour etc

I've attached a lilypond file which demonstrates what I mean.

Just as a side note - why does the \whiteout not work perfectly?

Thank you for reading this and I appreciate any thoughts, amendments, and
suggestions.

Colin Baguley
\version "2.22.1"

\header {
  title = "Please improve this"
}
global = {
  \time 4/4
  \key c \major
}

melody = \relative c'' {
  \global
c4 d e 
f^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -4.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "LimeGreen")
\box \box \whiteout
  "This markup can be placed anywhere without affecting any other placement" }
| g f e d | c b a2 | c4 d e f | g f e d | c b 
a2^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(0.0 . -4.5)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "red")
\box \whiteout
  "But I'm sure the code be improved - and yet still allow variables in position/colour etc" }
c4 d e f | g f e d | c b a2  c4 d e f | g f e d
 c^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -6.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "Blue")
   \whiteout
  "you can see I'm copy & pasting big chunks of code, and altering it a bit"}
b a2 c4 d e f | g f e d | 
c_\markup {\italic \bold \box {\column
	  {
	  \line {an ordinary markup}
	  \line {pushes my lyric line}
	  \line {down}
	  } } }
b a2 c4 d 
e^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -8.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "brown")
   \whiteout
  "but this allows me to put odd comments in without moving anything else"} 
\f f,  \p g f e d | c \ff b \ppp a2 
}

words = \lyricmode {
  \repeat unfold 6 { one two three four five six se -- ven eight nine ten}
}

\score {
  <<
\new Staff { \melody }
\addlyrics { \words }
  >>
  \layout { }
}


Re: [OT] Re: Snippet does not work properly ?

2021-02-10 Thread Freeman Gilmore
On Tue, Feb 9, 2021 at 5:04 PM David Wright 
wrote:

> On Tue 09 Feb 2021 at 14:22:39 (-0500), Freeman Gilmore wrote:
> > On Sun, Feb 7, 2021 at 6:18 PM Thomas Morley wrote:
> > > Am So., 7. Feb. 2021 um 22:48 Uhr schrieb Freeman Gilmore:
> > >
> > >> I am trying to open this in Frescobaldi.
> > >>
> > >> Custom tuning and MIDI rendering
> > >>
> > >> http://lsr.di.unimi.it/LSR/Item?id=785
> > >>
> > >> [image: image.png]
> > >>
> > >> But it engraves this:
> > >>
> > >> [image: image.png]
> > >>
> > >> With lots of errors.It looks to me like I am missing a file?   Any
> > >> ideas?
> > >>
> > >> Thank you, ƒg
> > >>
> > >
> > > The LSR still runs 2.18.2, though convert-ly does not work in this
> case.
> > > ly:load can't be used for that purpose any more.
> > > Attached you'll find a version likely workinf for 2.20.0 and upstream.
> > >
> > > Cheers,
> > >   Harm
> > >
> > Is there a version of Microtonal notation and theory of harmony
> > ,
> > http://*lsr*.di.unimi.it/*LSR*/Item?id=786,
> > that will work with \version "2.20.0"
> >
> > Thank you, ƒg
>
> I don't know whether this is affected by the fact that the
> two images were attached inline, but they are bloating this
> conversation by about 150KB for each exchange. One would
> normally snip them when they cease to have relevance.

Good point, thank you, ƒg

>
> (Obviously mail clients can influence this behaviour too.)
>
> Cheers,
> David.
>


[OT] Re: Snippet does not work properly ?

2021-02-09 Thread David Wright
On Tue 09 Feb 2021 at 14:22:39 (-0500), Freeman Gilmore wrote:
> On Sun, Feb 7, 2021 at 6:18 PM Thomas Morley wrote:
> > Am So., 7. Feb. 2021 um 22:48 Uhr schrieb Freeman Gilmore:
> >
> >> I am trying to open this in Frescobaldi.
> >>
> >> Custom tuning and MIDI rendering
> >>
> >> http://lsr.di.unimi.it/LSR/Item?id=785
> >>
> >> [image: image.png]
> >>
> >> But it engraves this:
> >>
> >> [image: image.png]
> >>
> >> With lots of errors.It looks to me like I am missing a file?   Any
> >> ideas?
> >>
> >> Thank you, ƒg
> >>
> >
> > The LSR still runs 2.18.2, though convert-ly does not work in this case.
> > ly:load can't be used for that purpose any more.
> > Attached you'll find a version likely workinf for 2.20.0 and upstream.
> >
> > Cheers,
> >   Harm
> >
> Is there a version of Microtonal notation and theory of harmony
> ,
> http://*lsr*.di.unimi.it/*LSR*/Item?id=786,
> that will work with \version "2.20.0"
> 
> Thank you, ƒg

I don't know whether this is affected by the fact that the
two images were attached inline, but they are bloating this
conversation by about 150KB for each exchange. One would
normally snip them when they cease to have relevance.

(Obviously mail clients can influence this behaviour too.)

Cheers,
David.



Re: Unapproved LSR-snippet "Generating scores within a function"

2020-07-02 Thread Thomas Morley
Am Do., 2. Juli 2020 um 12:16 Uhr schrieb Valentin Petzel :
>
> Hello,
>
> While I cannot help you with this, I noticed that this snippet must have been
> done in an older version of lilypond, thus it uses older music function calls.
> I’ve updated the snippet to 2.20, so now it compiles at least locally.
>
> Regards,
> Valentin

Hi Valentin,

the LSR currently runs 2.18.2.
Upgrading it to 2.20.0 is on TODO.

Thanks,
  Harm



Re: Unapproved LSR-snippet "Generating scores within a function"

2020-07-02 Thread Valentin Petzel
Hello,

While I cannot help you with this, I noticed that this snippet must have been 
done in an older version of lilypond, thus it uses older music function calls. 
I’ve updated the snippet to 2.20, so now it compiles at least locally.

Regards,
Valentin%% LSR originally contributed by Gilles Thibault:
%% https://lists.gnu.org/archive/html/lilypond-user-fr/2011-11/msg00141.html
%% See also http://lsr.di.unimi.it/LSR/Item?id=630
%% and https://lists.gnu.org/archive/html/lilypond-user/2015-04/msg00311.html

\version "2.20"

duo =
#(define-music-function (nr) (number?)
   (let* ((s (number->string nr))
  (h (make-module))
  (m (ly:make-score
  #{<<
\new Staff { \global \clarI }
\new Staff { \global \clarII }
>>
  #})))
 (module-define! h 'piece (markup #:concat ("Duo n." s)))
 (ly:score-set-header! m h)
 (collect-scores-for-book m)
 (make-music 'Music 'void #t)))

%% Duo 1
global = { \key c \major \time 4/4 }
clarI = { e'1}
clarII = { c'1}
\duo #1

%% Duo 2
global = { \key d \minor \time 3/4 }
clarI = { f'2.}
clarII = { d'2.}
\duo #2

%% Duo 3
global = { \key e \minor \time 2/4 }
clarI = { g'2}
clarII = { e'2}
\duo #3

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


Re: Snippet "Clef change and repeat barline"

2020-06-29 Thread Pierre Perol-Schneider
Hi Harm,

Le lun. 29 juin 2020 à 09:59, Thomas Morley  a
écrit :

> Hi Pierre,
>
> I've now approved it as
> lsr.di.unimi.it/LSR/Item?u=1&id=1116
> with some slight changes.
>
> I deleted another instance of \hideNotes and changed
>   \once\override Staff.Clef.space-alist =
>   #'((key-cancellation minimum-space . 3)
>  (key-signature minimum-space . 3))
> to
>   \once\override Staff.Clef.space-alist.key-cancellation =
> #'(minimum-space . 3)
>   \once\override Staff.Clef.space-alist.key-signature = #'(minimum-space .
> 3)
>
> Although your original syntax is ok in this case (no programming error
> resulting) it throws away the other default settings for
> Clef.space-alist.
> I think we should demonstrate how to update certain settings. Instead
> of confusing the user by replacing the whole alist, which will work
> here but probably not in other cases.
> WDYT?
>

Fine! Actually I never noticed the effects of my syntax...


> P.S.
> Did you approve
> http://lsr.di.unimi.it/LSR/Item?u=1&id=1005
> yourself?
> It somehow vanished from my TODO-list and I forgot about it. Sorry for
> that!
>

Not impossible, but actually I don't remember. Maybe...
(Normally I don't think I'd do that without asking you first.)
As far as I remember, it was approved a long time ago. I simply deleted the
commentary lines as soon as I got Fuka's editor agreement.

Cheers,
Pierre


Re: Snippet "Clef change and repeat barline"

2020-06-29 Thread Thomas Morley
Am So., 28. Juni 2020 um 09:37 Uhr schrieb Pierre Perol-Schneider
:
>
> Hi Harm,
>
> Le sam. 27 juin 2020 à 10:39, Thomas Morley  a 
> écrit :
>  ...
>>
>> Some Remarks:
>> (a) Your override
>> \once\override Staff.TimeSignature.space-alist =
>> #'((first-note . (fixed-space . 0)))
>> will replace the default space-alist with your setting, i.e. the other
>> default settings (see IR) are thrown away, causing:
>> programming error: No spacing entry from TimeSignature to `right-edge'
>> You rather want to update a single entry of said space-alist. Thus
>> \once\override Staff.TimeSignature.space-alist.first-note = #'(fixed-space . 
>> 0)
>> is preferable.
>
>
> Ok
>
>> (b) Is there any reason for
>> \once\hideNotes
>> ?
>> Deleting it seems to make no difference
>
>
> No clue...:( Probably a forgotten trial...
>
>>
>> (c) I'd not use two different overrides in the snippet to adjust
>> spacing. Thus I'd replace
>> \once\override Staff.Clef.X-offset = #.5
>> by
>> \once\override Staff.BarLine.space-alist.clef = #'(extra-space . 0.5)
>
>
> Hum, that seems a little short to me: I'd go for #'(extra-space . 0.7)
>
>>
>> (d) I'd replace the namings "Default output:"/"Traditional output:"
>> by
>> "Current default LilyPond"/"Following E.Gould"
>> I always have difficulties with "traditional", because different
>> people may not agree with what's traditional at all.
>> And I'd say it's closer to the snippets description.
>
>
> Ok, I fully agree.
> I've also re-adjust  the the after clef space.
> Thank you very much Harm.
>
> Cheers,
> Pierre
>
> PS. LSR #1110 has been deleted.


Hi Pierre,

I've now approved it as
lsr.di.unimi.it/LSR/Item?u=1&id=1116
with some slight changes.

I deleted another instance of \hideNotes and changed
  \once\override Staff.Clef.space-alist =
  #'((key-cancellation minimum-space . 3)
 (key-signature minimum-space . 3))
to
  \once\override Staff.Clef.space-alist.key-cancellation = #'(minimum-space . 3)
  \once\override Staff.Clef.space-alist.key-signature = #'(minimum-space . 3)

Although your original syntax is ok in this case (no programming error
resulting) it throws away the other default settings for
Clef.space-alist.
I think we should demonstrate how to update certain settings. Instead
of confusing the user by replacing the whole alist, which will work
here but probably not in other cases.
WDYT?

Thanks,
  Harm

P.S.
Did you approve
http://lsr.di.unimi.it/LSR/Item?u=1&id=1005
yourself?
It somehow vanished from my TODO-list and I forgot about it. Sorry for that!



Re: Snippet "Clef change and repeat barline"

2020-06-28 Thread Pierre Perol-Schneider
Hi Harm,

Le sam. 27 juin 2020 à 10:39, Thomas Morley  a
écrit :
 ...

> Some Remarks:
> (a) Your override
> \once\override Staff.TimeSignature.space-alist =
> #'((first-note . (fixed-space . 0)))
> will replace the default space-alist with your setting, i.e. the other
> default settings (see IR) are thrown away, causing:
> programming error: No spacing entry from TimeSignature to `right-edge'
> You rather want to update a single entry of said space-alist. Thus
> \once\override Staff.TimeSignature.space-alist.first-note = #'(fixed-space
> . 0)
> is preferable.
>

Ok

(b) Is there any reason for
> \once\hideNotes
> ?
> Deleting it seems to make no difference
>

No clue...:( Probably a forgotten trial...


> (c) I'd not use two different overrides in the snippet to adjust
> spacing. Thus I'd replace
> \once\override Staff.Clef.X-offset = #.5
> by
> \once\override Staff.BarLine.space-alist.clef = #'(extra-space . 0.5)
>

Hum, that seems a little short to me: I'd go for #'(extra-space . 0.7)


> (d) I'd replace the namings "Default output:"/"Traditional output:"
> by
> "Current default LilyPond"/"Following E.Gould"
> I always have difficulties with "traditional", because different
> people may not agree with what's traditional at all.
> And I'd say it's closer to the snippets description.
>

Ok, I fully agree.
I've also re-adjust  the the after clef space.
Thank you very much Harm.

Cheers,
Pierre

PS. LSR #1110 has been deleted.


Re: Snippet "Clef change and repeat barline"

2020-06-27 Thread Thomas Morley
Am Fr., 26. Juni 2020 um 12:06 Uhr schrieb Pierre Perol-Schneider
:
>
> Hi Harm,
> Thank you for your suggestion. Definitly better.
> Ultimately, I've created a new snippet: 
> http://lsr.di.unimi.it/LSR/Item?u=1&id=1116
> If you're ok with it, I'll delete snippet #1110
> Cheers,
> Pierre

Hi Pierre,

in general, much better.

Some Remarks:
(a) Your override
\once\override Staff.TimeSignature.space-alist =
#'((first-note . (fixed-space . 0)))
will replace the default space-alist with your setting, i.e. the other
default settings (see IR) are thrown away, causing:
programming error: No spacing entry from TimeSignature to `right-edge'
You rather want to update a single entry of said space-alist. Thus
\once\override Staff.TimeSignature.space-alist.first-note = #'(fixed-space . 0)
is preferable.
(b) Is there any reason for
\once\hideNotes
?
Deleting it seems to make no difference
(c) I'd not use two different overrides in the snippet to adjust
spacing. Thus I'd replace
\once\override Staff.Clef.X-offset = #.5
by
\once\override Staff.BarLine.space-alist.clef = #'(extra-space . 0.5)
(d) I'd replace the namings "Default output:"/"Traditional output:"
by
"Current default LilyPond"/"Following E.Gould"
I always have difficulties with "traditional", because different
people may not agree with what's traditional at all.
And I'd say it's closer to the snippets description.

Thanks,
  Harm



Re: Snippet "Clef change and repeat barline"

2020-06-26 Thread Pierre Perol-Schneider
Hi Harm,
Thank you for your suggestion. Definitly better.
Ultimately, I've created a new snippet:
http://lsr.di.unimi.it/LSR/Item?u=1&id=1116
If you're ok with it, I'll delete snippet #1110
Cheers,
Pierre

Le jeu. 25 juin 2020 à 22:21, Thomas Morley  a
écrit :

> Am Do., 25. Juni 2020 um 10:55 Uhr schrieb Pierre Perol-Schneider
> :
> >
> > Hi Harm,
> >
> > Le mer. 24 juin 2020 à 23:26, Thomas Morley 
> a écrit :
> >>
> >> To the author of said snippet.
> >> lsr.di.unimi.it/LSR/Item?u=1&id=1110
> >>
> >> I will not approve it in it's current state.
> >
> >
> > Ok.
> >
> >> This sounds like default LilyPond being wrong in this regard. If so,
> >> it's a bug, needed to be reported, probably discussed and finally
> >> fixed.
> >
> >
> > Ok, will do.
> >
> >>
> >> Tbh, I don't think LilyPond is wrong. Ofcourse I'd could be proven
> wrong.
> >
> >
> > See: E. Gould/ Behind bars (ed. 2011, pp. 234-235)
> > (and:
> http://lilypond-french-users.1298960.n2.nabble.com/Clef-apres-signe-de-reprise-td7589673.html
> )
> >
> > Cheers,
> > Pierre
>
> Hi Pierre,
>
> ok, I'm convinced.
> Please change the description to something at the lines of:
> "According to Elaine Gould, Behind Bars, pp ..., changes of  ...
> should be printed after the closing repeat-sign.
> This is currently not the default in Lily.
> This snippet provides a manual workaround."
>
> Syntax, wording, grammar could surely be improved...
>
> Nevertheless, I don't think it should be doc-tagged.
> If it's an issue then an entry in "known issues and warnings" seems to
> be more appropriate, imho.
>
> And thanks for the bug-report, cheers,
>   Harm
>


Re: Snippet "Clef change and repeat barline"

2020-06-25 Thread Thomas Morley
Am Do., 25. Juni 2020 um 10:55 Uhr schrieb Pierre Perol-Schneider
:
>
> Hi Harm,
>
> Le mer. 24 juin 2020 à 23:26, Thomas Morley  a 
> écrit :
>>
>> To the author of said snippet.
>> lsr.di.unimi.it/LSR/Item?u=1&id=1110
>>
>> I will not approve it in it's current state.
>
>
> Ok.
>
>> This sounds like default LilyPond being wrong in this regard. If so,
>> it's a bug, needed to be reported, probably discussed and finally
>> fixed.
>
>
> Ok, will do.
>
>>
>> Tbh, I don't think LilyPond is wrong. Ofcourse I'd could be proven wrong.
>
>
> See: E. Gould/ Behind bars (ed. 2011, pp. 234-235)
> (and: 
> http://lilypond-french-users.1298960.n2.nabble.com/Clef-apres-signe-de-reprise-td7589673.html)
>
> Cheers,
> Pierre

Hi Pierre,

ok, I'm convinced.
Please change the description to something at the lines of:
"According to Elaine Gould, Behind Bars, pp ..., changes of  ...
should be printed after the closing repeat-sign.
This is currently not the default in Lily.
This snippet provides a manual workaround."

Syntax, wording, grammar could surely be improved...

Nevertheless, I don't think it should be doc-tagged.
If it's an issue then an entry in "known issues and warnings" seems to
be more appropriate, imho.

And thanks for the bug-report, cheers,
  Harm



Re: Snippet "Clef change and repeat barline"

2020-06-25 Thread Pierre Perol-Schneider
Le mer. 24 juin 2020 à 23:26, Thomas Morley  a
écrit :
 ...

> Please check whether there's an issue about it already, if not report
> it on the bug-list.
>

Done:
http://lilypond.1069038.n5.nabble.com/Clef-change-and-repeat-sign-td234226.html

Cheers,
Pierre


Re: Snippet "Clef change and repeat barline"

2020-06-25 Thread Pierre Perol-Schneider
Hi Harm,

Le mer. 24 juin 2020 à 23:26, Thomas Morley  a
écrit :

> To the author of said snippet.
> lsr.di.unimi.it/LSR/Item?u=1&id=1110
>
> I will not approve it in it's current state.
>

Ok.

This sounds like default LilyPond being wrong in this regard. If so,
> it's a bug, needed to be reported, probably discussed and finally
> fixed.
>

Ok, will do.


> Tbh, I don't think LilyPond is wrong. Ofcourse I'd could be proven wrong.
>

See: E. Gould/ Behind bars (ed. 2011, pp. 234-235)
(and:
http://lilypond-french-users.1298960.n2.nabble.com/Clef-apres-signe-de-reprise-td7589673.html
)

Cheers,
Pierre


Snippet "Clef change and repeat barline"

2020-06-24 Thread Thomas Morley
To the author of said snippet.
lsr.di.unimi.it/LSR/Item?u=1&id=1110

I will not approve it in it's current state.

It shows how to change BreakAlignment.break-align-orders, ok, though
this is covered in the docs already.
It's description says "Here's a workaround to get a traditional output
when clef changes after a repeat barline!"
This sounds like default LilyPond being wrong in this regard. If so,
it's a bug, needed to be reported, probably discussed and finally
fixed.
Please check whether there's an issue about it already, if not report
it on the bug-list.


Tbh, I don't think LilyPond is wrong. Ofcourse I'd could be proven wrong.

Cheers,
  Harm



Unapproved LSR-snippet "Generating scores within a function"

2020-06-24 Thread Thomas Morley
Hi,

said snippet waits to be approved.
Alas, I think it will never work in the jail the lsr is running in.

Could someone with experience in running LilyPond in a jail could have
a look at the code:
https://lsr.di.unimi.it/form.php?type=snippet;id=;rld=m_snippet
?

Thanks,
  Harm



Crash due to internal memory limits (?) in lilypond (was: Crash with bars-per-line-engraver as of LSR snippet id=838)

2020-04-10 Thread Michael Gerdau
> I doubt it's caused by any custom-engraver.
> At least on my machine this code:
> 
> \paper {
>   systems-per-page = #5
> }
> 
> music = \absolute {
> \repeat unfold 2000 {
>   d'8 f' a' g'  d' f' b' d' d'8 f' a' g'  d' f' b' d' \break
> }
> }
> 
> \new Staff { \music }
> 
> already fails with:
> [...]
> Preprocessing graphical objects...terminate called after throwing an
> instance of 'std::bad_alloc'
>   what():  St9bad_alloc
> Aborted (core dumped)
> 
> on Ubuntu 64-bit 18.04 for any tested version (2.18.2 up to current master)

I've played with it a bit more and indeed I don't need a custom-engraver
either. The problem only surfaces earlier with it.

The code below works or crashes, depending on which line I activate:
snip --- snip --- snip --- snip --- snip
\version "2.19.83"

music = \absolute {
  \repeat unfold 1 {
 %d'1 % works
 %d'2 f' % works
 d'4 f' a' g' % crashes
 %d'8 f' a' g'   d' f' b' d' % crashes
  }
}

{ \music }
snip --- snip --- snip --- snip --- snip

My system is a current ArchLinux 64 bit with 64GB RAM installed.
Running under WSL Debian on Win10 Pro on the same machine gives a
similar result. It only takes longer.

Could someone knowledgeable w/r to the way lilyponds internals work
explain what is happening and if/how this can be avoided?

For my practical case I can split my rather large music file into chunks
and combine the fragments later outside of LP, but IMO this should not
be required.

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



signature.asc
Description: OpenPGP digital signature


Re: Crash with bars-per-line-engraver as of LSR snippet id=838

2020-04-09 Thread Thomas Morley
Am Mi., 8. Apr. 2020 um 16:13 Uhr schrieb Michael Gerdau :
>
> Hi Kieren,
>
> >> I'm playing with the bars-per-line-engraver as of LSR
> >> http://lsr.di.unimi.it/LSR/Item?id=838
> >>
> >> When I increase the number of bars in my piece beyond a certain amount
> >> (3500-4000 in my MWE) lilypond crashes with an access violation under 
> >> linux.
> >
> > Does that also happen with David Kastrup’s "bar-keeper" engraver?
> > 
>
> Thank you for that suggestion. I had saved the code back then but forgot
> about it. Unfortunately it crashes likewise for me. See attached MWE.
>
> Kind regards,
> Michael
> --
>  Michael Gerdau   email: m...@qata.de
>  GPG-keys available on request or at public keyserver

I doubt it's caused by any custom-engraver.
At least on my machine this code:

\paper {
  systems-per-page = #5
}

music = \absolute {
\repeat unfold 2000 {
  d'8 f' a' g'  d' f' b' d' d'8 f' a' g'  d' f' b' d' \break
}
}

\new Staff { \music }

already fails with:
[...]
Preprocessing graphical objects...terminate called after throwing an
instance of 'std::bad_alloc'
  what():  St9bad_alloc
Aborted (core dumped)

on Ubuntu 64-bit 18.04 for any tested version (2.18.2 up to current master)

Cheers,
  Harm



Re: Crash with bars-per-line-engraver as of LSR snippet id=838

2020-04-08 Thread Michael Gerdau
Hi Kieren,

>> I'm playing with the bars-per-line-engraver as of LSR
>> http://lsr.di.unimi.it/LSR/Item?id=838
>>
>> When I increase the number of bars in my piece beyond a certain amount
>> (3500-4000 in my MWE) lilypond crashes with an access violation under linux.
> 
> Does that also happen with David Kastrup’s "bar-keeper" engraver?
> 

Thank you for that suggestion. I had saved the code back then but forgot
about it. Unfortunately it crashes likewise for me. See attached MWE.

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver
%\version "2.20.0"
\version "2.19.83"

#(define (index-list? x)
   (and (list? x)
(every index? x)))

#(define (index-pattern numbers)
   "Convert an `index pattern' into a circular list.  Zeros are removed,
with the last zero preceding the part of the list that should become
circular.  If that list part is empty, the resulting list has no circular
end.  Without any zero, the whole list is turned into a circular one."
   (define (creverse! x y)
 "Reverse both x and y, make y circular and append to x."
 (if (pair? y)
 (let* ((rev-y (reverse! y))
(rev-x (reverse! x rev-y)))
   (set-cdr! y rev-y)
   rev-x)
 (reverse! x y)))
   (let loop ((non-reps '()) (reps '()) (rest numbers))
 (cond ((null? rest) (creverse! non-reps reps))
   ((zero? (car rest))
(loop (append! reps non-reps) '() (cdr rest)))
   ((index? (car rest))
(loop non-reps (cons (car rest) reps) (cdr rest)))
   (else (ly:input-warning (*location*)
   (_ "Not an index: ~a") (car rest))
 (loop non-reps reps (cdr rest))


bar-keeper =
#(define-scheme-function (numbers) (index-list?)
   "Create a context mod for consisting a Timing-level engraver
breaking after bar group lengths specified in the list.  If the list
is exhausted, it starts over from the start or from after a 0 marker
contained in the list.  If the list @emph{ends} address@hidden, line
breaking reverts to normal after using up the list."
   (ly:make-context-mod
`((consists
   ,(lambda (c)
  (let ((target #f) (numbers (index-pattern numbers)))
(make-engraver
 (acknowledgers
  ((paper-column-interface eng grob from)
   (and (pair? numbers)
(ly:grob-property grob 'non-musical #f)
(let ((bar (ly:context-property (ly:translator-context eng)
'internalBarNumber)))
  (if (not target)
  (set! target bar)
  (set! (ly:grob-property grob 'line-break-permission)
(and (>= bar (+ target (car numbers)))
 (begin
   (set! target (+ target (car numbers)))
   (set! numbers (cdr numbers))
   'force)))

\paper {
  systems-per-page = #5
}
% \repeat unfold 3500 works with 2.19.83 and crashes with 2.20.0
% \repeat unfold 4000 crashed with both 2.19.83 and 2.20.0
music = \absolute { \repeat unfold 4000 { d'8 f' a' g'  d' f' b' d' } }

\score {
  \new Score \with \bar-keeper 2
  \new Staff { \music }
}


signature.asc
Description: OpenPGP digital signature


Re: Crash with bars-per-line-engraver as of LSR snippet id=838

2020-04-08 Thread Kieren MacMillan
Hi Michael,

> I'm playing with the bars-per-line-engraver as of LSR
> http://lsr.di.unimi.it/LSR/Item?id=838
> 
> When I increase the number of bars in my piece beyond a certain amount
> (3500-4000 in my MWE) lilypond crashes with an access violation under linux.

Does that also happen with David Kastrup’s "bar-keeper" engraver?


Thanks,
Kieren.


Re: Crash with bars-per-line-engraver as of LSR snippet id=838

2020-04-08 Thread Mats Bengtsson
I can confirm the segmentation fault in the "Drawing systems" phase, 
using 2.20.0 in Ubuntu.


   /Mats

On 2020-04-08 09:41, Michael Gerdau wrote:

Hi list,

I'm playing with the bars-per-line-engraver as of LSR
http://lsr.di.unimi.it/LSR/Item?id=838

When I increase the number of bars in my piece beyond a certain amount
(3500-4000 in my MWE) lilypond crashes with an access violation under linux.

I have this problem with both 2.19.83 and 2.20.0. However on 2.19.83 the
crash happens later, i.e. it can process a larger number of bars.

Before I'm reporting a bug could others please verify that I'm not doing
something stupid?

MWE is attached.

Kind regards,
Michael





Crash with bars-per-line-engraver as of LSR snippet id=838

2020-04-08 Thread Michael Gerdau
Hi list,

I'm playing with the bars-per-line-engraver as of LSR
http://lsr.di.unimi.it/LSR/Item?id=838

When I increase the number of bars in my piece beyond a certain amount
(3500-4000 in my MWE) lilypond crashes with an access violation under linux.

I have this problem with both 2.19.83 and 2.20.0. However on 2.19.83 the
crash happens later, i.e. it can process a larger number of bars.

Before I'm reporting a bug could others please verify that I'm not doing
something stupid?

MWE is attached.

Kind regards,
Michael
-- 
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver
%\version "2.20.0"
\version "2.19.83"

%% http://lsr.di.unimi.it/LSR/Item?id=838
%LSR completed by P.P.Schneider on Feb. 2014 for v2.18
#(define ((bars-per-line-engraver bar-list) context)
  (let* ((working-copy bar-list)
 (total (1+ (car working-copy
`((acknowledgers
   (paper-column-interface
. ,(lambda (engraver grob source-engraver)
 (let ((internal-bar (ly:context-property context 'internalBarNumber)))
   (if (and (pair? working-copy)
(= (remainder internal-bar total) 0)
(eq? #t (ly:grob-property grob 'non-musical)))
   (begin
 (set! (ly:grob-property grob 'line-break-permission) 'force)
 (if (null? (cdr working-copy))
 (set! working-copy bar-list)
 (begin
   (set! working-copy (cdr working-copy
   (set! total (+ total (car working-copy

\paper {
  systems-per-page = #5
}
% \repeat unfold 3500 works with 2.19.83 and crashes with 2.20.0
% \repeat unfold 4000 crashed with both 2.19.83 and 2.20.0
music = \absolute { \repeat unfold 4000 { d'8 f' a' g'  d' f' b' d' } }

\score {
  \new Staff { \music }
  \layout {
\context {
  \Score
  \consists #(bars-per-line-engraver '(2))
}
  }
}


signature.asc
Description: OpenPGP digital signature


Lyric Syllable Magnetic Snap snippet

2020-03-23 Thread Peter Crighton
Hello all,

I came upon the Lyric Syllable Magnetic Snap snippet:
https://lists.gnu.org/archive/html/lilypond-user/2019-05/msg00389.html
And I noticed that a small space gets inserted after a multisyllabic word.
Consider this example, including the .ily file from above link:

\version "2.20.0"

\include "lyric-syllable-magnetic-snap.ily"

\new Lyrics \lyricmode {
  This is just a test for the lyric syllable magnetic snap snippet. \break
  This is just a test for the lyr -- ic syl -- la -- ble mag -- net -- ic
snap snip -- pet.
}

\layout {
  \context {
\Lyrics
\override LyricWord.after-line-breaking = #(lyric-word-compressor 0.5)
  }

  \context {
\Score
\remove "Bar_number_engraver"
  }
}

\paper {
  indent = 0
  ragged-right = ##t
  system-system-spacing.basic-distance = 0
  system-system-spacing.minimum-distance = 0
}

This is not a dealbreaker for me, as I rather have those spaces inserted
after a word than after a syllable inside of a word. But it would
nevertheless be nice if someone knew a fix for this.

And as an aside: What does the number after lyric-word-compressor do? I
didn’t notice a change when playing around with it. Does it have to be 0.5?

Thanks,
Peter

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de


Re: key change at end of snippet

2020-01-25 Thread Werner LEMBERG
From: David Kastrup 
Subject: Re: key change at end of snippet
Date: Sat, 25 Jan 2020 09:41:45 +0100

> \relative c' {
>   \key d \major
>   d1
>   \key c \major
>   \grace s256
> }

Thanks for the suggestion!  I'm now trying Thomas's route.


Werner



Re: key change at end of snippet

2020-01-25 Thread Werner LEMBERG
>> I have to typeset a snippet that is an excerpt of a longer piece,
>> and this snippet ends with a key change:
>>
>>   \relative c' {
>> \key d \major
>> d1
>> \key c \major
>>   }
>>
>> However, the staff stops right before the key change, see attached
>> image.  What can I do to avoid that?
>
> Try:
>
>  \relative c' {
>   \override Staff.StaffSymbol.break-align-symbols =
>   #'(time-signature key-cancellation key-signature staff-bar break-alignment)
> \key d \major
> d1
> \tweak X-extent #'(0.25 . 2.4)
> \key c \major
>   }
>
> The StaffSymbol being too short is a consequence of a bug-fix some
> time ago, though in this case the cure isn't nice either.
> Furthermore you need to add some padding to the right manually.

Very nice, thanks!  I didn't think of manipulating the X-extent.  Any
chance that this could be done in an official way as a bug fix to
LilyPond?  I don't think that the current behaviour is ever wanted...


Werner



Re: key change at end of snippet

2020-01-25 Thread David Kastrup
Werner LEMBERG  writes:

> I have to typeset a snippet that is an excerpt of a longer piece, and
> this snippet ends with a key change:
>
>   \relative c' {
> \key d \major
> d1
> \key c \major
>   }
>
> However, the staff stops right before the key change, see attached
> image.  What can I do to avoid that?
>
>
> Werner

\relative c' {
  \key d \major
  d1
  \key c \major
  \grace s256
}


-- 
David Kastrup


Re: key change at end of snippet

2020-01-25 Thread Thomas Morley
Am Sa., 25. Jan. 2020 um 06:31 Uhr schrieb Werner LEMBERG :
>
>
> I have to typeset a snippet that is an excerpt of a longer piece, and
> this snippet ends with a key change:
>
>   \relative c' {
> \key d \major
> d1
> \key c \major
>   }
>
> However, the staff stops right before the key change, see attached
> image.  What can I do to avoid that?
>
>
> Werner

Try:

 \relative c' {
  \override Staff.StaffSymbol.break-align-symbols =
  #'(time-signature key-cancellation key-signature staff-bar break-alignment)
\key d \major
d1
\tweak X-extent #'(0.25 . 2.4)
\key c \major
  }

The StaffSymbol being too short is a consequence of a bug-fix some
time ago, though in this case the cure isn't nice either.
Furthermore you need to add some padding to the right manually.

Cheers,
  Harm



Re: key change at end of snippet

2020-01-24 Thread Urs Liska



Am 25. Januar 2020 08:17:05 MEZ schrieb Werner LEMBERG :
>
>>> I think it is necessary to somehow keep the staff line alive – I
>>> guess I can probably fake a solution by adding another bar with a
>>> suppressed bar line that contains some invisible music.  Not sure
>>> yet whether this is sensible, and if yes, how to make the width of
>>> this extra bar (almost) zero...
>> 
>> Maybe just add a s32?
>
>This I tried first; it creates a quite wide bar.
>
>> Maybe even s4*0.
>
>This doesnt make the staff line longer.
>

Maybe try with some hidden grob with a fixed extent (see 
https://github.com/ism-dme/lm-vs/blob/import-1756/examples/library/toolbox/custos.ily)

Urs
>
>Werner

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.



Re: key change at end of snippet

2020-01-24 Thread Werner LEMBERG

>> I think it is necessary to somehow keep the staff line alive – I
>> guess I can probably fake a solution by adding another bar with a
>> suppressed bar line that contains some invisible music.  Not sure
>> yet whether this is sensible, and if yes, how to make the width of
>> this extra bar (almost) zero...
> 
> Maybe just add a s32?

This I tried first; it creates a quite wide bar.

> Maybe even s4*0.

This doesnt make the staff line longer.


Werner


Re: key change at end of snippet

2020-01-24 Thread Urs Liska



Am 25. Januar 2020 07:30:01 MEZ schrieb Werner LEMBERG :
>
>> \once \override Score.BreakAlignment #'break-align-orders =
>>   #(make-vector 3 '( staff-bar
>>  clef
>>  span-bar
>>  breathing-sign
>>  ...
>>  key
>>  time-signature)),
>> 
>> To insert the key change before the bar.
>
>Thanks for the suggestion, but the key change must happen after the
>bar line.
>
>I think it is necessary to somehow keep the staff line alive – I guess
>I can probably fake a solution by adding another bar with a suppressed
>bar line that contains some invisible music.  Not sure yet whether
>this is sensible, and if yes, how to make the width of this extra bar
>(almost) zero...
>

Maybe just add a s32? Maybe even s4*0.

HTH
Urs

>
>Werner

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.



Re: key change at end of snippet

2020-01-24 Thread Werner LEMBERG

> \once \override Score.BreakAlignment #'break-align-orders =
>   #(make-vector 3 '( staff-bar
>  clef
>  span-bar
>  breathing-sign
>  ...
>  key
>  time-signature)),
> 
> To insert the key change before the bar.

Thanks for the suggestion, but the key change must happen after the
bar line.

I think it is necessary to somehow keep the staff line alive – I guess
I can probably fake a solution by adding another bar with a suppressed
bar line that contains some invisible music.  Not sure yet whether
this is sensible, and if yes, how to make the width of this extra bar
(almost) zero...


Werner


RE: key change at end of snippet

2020-01-24 Thread Mark Stephen Mrotek
Werner,

Perhaps using

\once \override Score.BreakAlignment #'break-align-orders = #(make-vector 3
'( staff-bar clef span-bar  breathing-sign  .  .  key  time-signature)),

To insert the key change before the bar.

Mark



-Original Message-
From: lilypond-user
[mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org] On Behalf Of
Werner LEMBERG
Sent: Friday, January 24, 2020 9:30 PM
To: lilypond-user@gnu.org
Subject: key change at end of snippet


I have to typeset a snippet that is an excerpt of a longer piece, and this
snippet ends with a key change:

  \relative c' {
\key d \major
d1
\key c \major
  }

However, the staff stops right before the key change, see attached image.
What can I do to avoid that?


Werner




key change at end of snippet

2020-01-24 Thread Werner LEMBERG

I have to typeset a snippet that is an excerpt of a longer piece, and
this snippet ends with a key change:

  \relative c' {
\key d \major
d1
\key c \major
  }

However, the staff stops right before the key change, see attached
image.  What can I do to avoid that?


Werner


Re: A snippet for editing Beams using the mouse

2019-12-16 Thread Martin Tarenskeen




On Tue, 17 Dec 2019, Paolo Prete wrote:


Here's the fixed version:
waiting for feedbacks!

(Again and again: I write these snippets really in a hurry, in these days. A more 
"structured" collaboration is getting necessary for me, at this point)


Put it in a little Github project?

--

MT



Re: Indentation, was Re: A snippet for editing Beams using the mouse

2019-12-16 Thread Paolo Prete
Hi David,

I probably have messed something up in the editor coding style. Currently
I'm using at least three different editors ad the same time.
I know it's weird and bad, but don't have time to switch to a proper env.
In Christmas days things are even more difficult...



On Tue, Dec 17, 2019 at 2:17 AM David Wright 
wrote:

> On Mon 16 Dec 2019 at 23:55:52 (+0100), Paolo Prete wrote:
> > P.S) I don't know why the browser's viewer messes up the indentation of
> > these attachments.
> > If so, I ask if are there volunteers to fix that and re-post the snippet
> (I
> > see correct indentation if I paste the code to any online js editor)
>
> I don't know how scheme is meant to be indented so, other than to say
> that my emacs (LilyPond mode) indents by aligning parentheses of the
> same nesting-level (which indents the 8th and 9th lines to >60 chars),
> I'll move on to C.
>
> It appears you're indenting with real TAB characters, possibly
> generated by your pressing the TAB key. My tabs are set at the
> standard size (8) which makes some of the code cross the screen.
> Perhaps you are expecting something else?
>
> Looking, for example, at the lines that you've split, editing your
> TABS to two spaces brings the continuation line into sensible
> alignment with the initial line. So, if you want your indentation to
> be displayed correctly by other people (including your own browser?) I
> would replace your real TABs with spaces before attaching the files.
>
> Editing in emacs, the TAB key can be made to indent by two spaces,
> and conversion of 8 (or any other number of) spaces into a TAB
> prevented.
>
> >   distanceFromCenter = Math.abs(event.pageX * scaleX -
> >
>  (leftX + (rightX -
> leftX)/2))
>
> becomes
>
> >   distanceFromCenter = Math.abs(event.pageX * scaleX -
> > (leftX + (rightX - leftX)/2))
>
> and
>
> >   minDistance = Math.min(distanceFromLeftSide,
> >
>   distanceFromCenter,
> >
>   distanceFromRightSide)
>
> becomes
>
> >   minDistance = Math.min(distanceFromLeftSide,
> >  distanceFromCenter,
> >  distanceFromRightSide)
>
> when TAB is replaced by two spaces.
>
> Cheers,
> David.
>


Re: A snippet for editing Beams using the mouse

2019-12-16 Thread Paolo Prete
Here's the fixed version:

waiting for feedbacks!

(Again and again: I write these snippets really in a hurry, in these days.
A more "structured" collaboration is getting necessary for me, at this
point)

Any Javascript volunteer?


On Tue, Dec 17, 2019 at 1:24 AM Paolo Prete  wrote:

> I'm just noting that there's a bug with more than one Beam. I'm fixing it.
> Have a bit of patience please ;-)
>
> On Mon, Dec 16, 2019 at 11:55 PM Paolo Prete  wrote:
>
>> Hello everybody,
>>
>> here is another snippet that uses the system that I previously
>> implemented. This time for the tuning of the beams.
>> This is too a very tedious operation to do with just the code and for
>> this I believe that this tool is also useful.
>> As you can see, the code is not only shorter than the previous one, but
>> it recycles the whole template of the previous snippet, which I'm making
>> more and more generic.
>> In short, the goal is to have Lilypond itself automatically create a GUI
>> tool for the tuning of the main properties of the grobs.
>>
>> This is somewhat crazy: Lilypond used as a factory for WYSIWYG editors!
>> :-)
>>
>> HTH
>>
>> Paolo
>>
>> P.S) I don't know why the browser's viewer messes up the indentation of
>> these attachments.
>> If so, I ask if are there volunteers to fix that and re-post the snippet
>> (I see correct indentation if I paste the code to any online js editor)
>>
>>
\version "2.19.45"

JSSVGBeamTuner = #(define-void-function (body) (string?)
   (let* ((mod (resolve-module '(scm framework-svg)))
  (svg-end (module-ref mod 'svg-end #f)))
 (if (procedure? svg-end)
   (module-define! mod 'svg-end (lambda () (string-join
 (list "<![CDATA["
   body "]]>" (svg-end)) "\n"))

JSSVGBeamTunerScript = #"
rootNode = document.querySelector('svg')
pixelsX  = rootNode.getAttribute('width').replace('mm', '') * 96 / 25.4
pixelsY  = rootNode.getAttribute('height').replace('mm', '') * 96 / 25.4
scaleX   = rootNode.getAttribute('viewBox').split(' ')[2] / pixelsX
scaleY   = rootNode.getAttribute('viewBox').split(' ')[3] / pixelsY

var beamId = 0
var currGrob = null

function pointsArrToStr(points)
{
		pointsStr = ''
		for (var i = 0; i< 8; i++) {
			pointsStr += points[i] + ' '
		}
		return pointsStr.substring(0, pointsStr.length - 1)
}

function initBeam(n1) {

	n1.setAttribute('id', beamId)

	for (n2 = n1.firstChild; n2 !== null; n2 = n2.nextSibling) {
		if (n2.nodeName == 'polygon') {
			//TODO Ugly parsering, replace with a proper and safer one
			transf = n2.getAttribute('transform')
			// TODO: check backspaces?
			// TODO: check if it doesn't have transform attr?
			translateX = transf.replace('translate(', '').split(',')[0]
			translateY = transf.split(',')[1].trim().replace(')', '')
			points = n2.getAttribute('points').split(' ')
			//alert(translateX)
			
			for (var i = 0; i<7; i = i+2) {
points[i] = Number(points[i]) + Number(translateX)
			}

			for (var i = 1; i<8; i = i+2) {
points[i] = Number(points[i]) + Number(translateY)
			}			

			pointsStr = pointsArrToStr(points)
			
			n2.setAttribute('points', pointsStr)
			n2.setAttribute('origPoints', pointsStr)
			n2.setAttribute('id', 'lilyBeamPoly_'+beamId)
			n2.setAttribute('onmousedown', 'selectGrob(this)')
			n2.removeAttribute('transform')
			n2.setAttribute('anchor', '')
		}
	}
	
	beamId++
}

function selectGrob(grob) {

	if (!grob.hasAttribute('id'))
		return

	if (!detectLeftButton(event)) {
		event.preventDefault()
		showGrobModifyExpr(grob)
		return
	}

	grob.setAttribute('color', 'cyan')
	points = grob.getAttribute('points').split(' ')
	leftX = Number(points[4])
	rightX = Number(points[0])
	distanceFromRightSide  = Math.abs(event.pageX * scaleX - rightX)
	distanceFromLeftSide = Math.abs(event.pageX * scaleX - leftX)
	distanceFromCenter = Math.abs(event.pageX * scaleX - 
(leftX + (rightX - leftX)/2))

	minDistance = Math.min(distanceFromLeftSide, 
 distanceFromCenter, 
 distanceFromRightSide)
	
	switch(minDistance) 
	{
		case distanceFromRightSide:
			grob.setAttribute('anchor','right')
			break;
		case distanceFromLeftSide:
			grob.setAttribute('anchor','left')
			break;
		case distanceFromCenter:
			grob.setAttribute('anchor','center')

Indentation, was Re: A snippet for editing Beams using the mouse

2019-12-16 Thread David Wright
On Mon 16 Dec 2019 at 23:55:52 (+0100), Paolo Prete wrote:
> P.S) I don't know why the browser's viewer messes up the indentation of
> these attachments.
> If so, I ask if are there volunteers to fix that and re-post the snippet (I
> see correct indentation if I paste the code to any online js editor)

I don't know how scheme is meant to be indented so, other than to say
that my emacs (LilyPond mode) indents by aligning parentheses of the
same nesting-level (which indents the 8th and 9th lines to >60 chars),
I'll move on to C.

It appears you're indenting with real TAB characters, possibly
generated by your pressing the TAB key. My tabs are set at the
standard size (8) which makes some of the code cross the screen.
Perhaps you are expecting something else?

Looking, for example, at the lines that you've split, editing your
TABS to two spaces brings the continuation line into sensible
alignment with the initial line. So, if you want your indentation to
be displayed correctly by other people (including your own browser?) I
would replace your real TABs with spaces before attaching the files.

Editing in emacs, the TAB key can be made to indent by two spaces,
and conversion of 8 (or any other number of) spaces into a TAB
prevented.

>   distanceFromCenter = Math.abs(event.pageX * scaleX - 
>   
> (leftX + (rightX - leftX)/2))

becomes

>   distanceFromCenter = Math.abs(event.pageX * scaleX - 
> (leftX + (rightX - leftX)/2))

and

>   minDistance = Math.min(distanceFromLeftSide, 
>   
>  distanceFromCenter, 
>   
>  distanceFromRightSide)

becomes

>   minDistance = Math.min(distanceFromLeftSide, 
>  distanceFromCenter, 
>  distanceFromRightSide)

when TAB is replaced by two spaces.

Cheers,
David.



Re: A snippet for editing Beams using the mouse

2019-12-16 Thread Paolo Prete
I'm just noting that there's a bug with more than one Beam. I'm fixing it.
Have a bit of patience please ;-)

On Mon, Dec 16, 2019 at 11:55 PM Paolo Prete  wrote:

> Hello everybody,
>
> here is another snippet that uses the system that I previously
> implemented. This time for the tuning of the beams.
> This is too a very tedious operation to do with just the code and for this
> I believe that this tool is also useful.
> As you can see, the code is not only shorter than the previous one, but it
> recycles the whole template of the previous snippet, which I'm making more
> and more generic.
> In short, the goal is to have Lilypond itself automatically create a GUI
> tool for the tuning of the main properties of the grobs.
>
> This is somewhat crazy: Lilypond used as a factory for WYSIWYG editors! :-)
>
> HTH
>
> Paolo
>
> P.S) I don't know why the browser's viewer messes up the indentation of
> these attachments.
> If so, I ask if are there volunteers to fix that and re-post the snippet
> (I see correct indentation if I paste the code to any online js editor)
>
>


Re: A snippet for editing Beams using the mouse

2019-12-16 Thread mason
On 12/16, Paolo Prete wrote:
> Hello everybody,
> 
> here is another snippet that uses the system that I previously
> implemented.  This time for the tuning of the beams.  This is too a
> very tedious operation to do with just the code and for this I believe
> that this tool is also useful.  As you can see, the code is not only
> shorter than the previous one, but it recycles the whole template of
> the previous snippet, which I'm making more and more generic.  In
> short, the goal is to have Lilypond itself automatically create a GUI
> tool for the tuning of the main properties of the grobs.
> 
> This is somewhat crazy: Lilypond used as a factory for WYSIWYG
> editors! :-)
> 
> HTH
> 
> Paolo
> 
> P.S) I don't know why the browser's viewer messes up the indentation
> of these attachments.  If so, I ask if are there volunteers to fix
> that and re-post the snippet (I see correct indentation if I paste the
> code to any online js editor)

Hi Paolo,

I haven't yet had time to thoroughly read your recent threads, but at
first glance what you're working on seems very cool, and I look forward
to having a chance to take a closer look.  Keep up the great work!

Mason


signature.asc
Description: PGP signature


A snippet for editing Beams using the mouse

2019-12-16 Thread Paolo Prete
Hello everybody,

here is another snippet that uses the system that I previously implemented.
This time for the tuning of the beams.
This is too a very tedious operation to do with just the code and for this
I believe that this tool is also useful.
As you can see, the code is not only shorter than the previous one, but it
recycles the whole template of the previous snippet, which I'm making more
and more generic.
In short, the goal is to have Lilypond itself automatically create a GUI
tool for the tuning of the main properties of the grobs.

This is somewhat crazy: Lilypond used as a factory for WYSIWYG editors! :-)

HTH

Paolo

P.S) I don't know why the browser's viewer messes up the indentation of
these attachments.
If so, I ask if are there volunteers to fix that and re-post the snippet (I
see correct indentation if I paste the code to any online js editor)
\version "2.19.45"

JSSVGBeamTuner = #(define-void-function (body) (string?)
   (let* ((mod (resolve-module '(scm framework-svg)))
  (svg-end (module-ref mod 'svg-end #f)))
 (if (procedure? svg-end)
   (module-define! mod 'svg-end (lambda () (string-join
 (list "<![CDATA["
   body "]]>" (svg-end)) "\n"))

JSSVGBeamTunerScript = #"
rootNode = document.querySelector('svg')
pixelsX  = rootNode.getAttribute('width').replace('mm', '') * 96 / 25.4
pixelsY  = rootNode.getAttribute('height').replace('mm', '') * 96 / 25.4
scaleX   = rootNode.getAttribute('viewBox').split(' ')[2] / pixelsX
scaleY   = rootNode.getAttribute('viewBox').split(' ')[3] / pixelsY

var beamId = 0
var currGrob = null

function pointsArrToStr(points)
{
		pointsStr = ''
		for (i = 0; i< 8; i++) {
			pointsStr += points[i] + ' '
		}
		return pointsStr.substring(0, pointsStr.length - 1)
}

function initBeam(n1) {

	for (n2 = n1.firstChild; n2 !== null; n2 = n2.nextSibling) {
		if (n2.nodeName == 'polygon') {
			//TODO Ugly parsering, replace with a proper and safer one
			transf = n2.getAttribute('transform')
			// TODO: check backspaces?
			// TODO: check if it doesn't have transform attr?
			translateX = transf.replace('translate(', '').split(',')[0]
			translateY = transf.split(',')[1].trim().replace(')', '')
			points = n2.getAttribute('points').split(' ')
			//alert(translateX)
			
			for (i = 0; i<7; i = i+2) {
points[i] = Number(points[i]) + Number(translateX)
			}

			for (i = 1; i<8; i = i+2) {
points[i] = Number(points[i]) + Number(translateY)
			}			

			pointsStr = pointsArrToStr(points)
			
			n2.setAttribute('points', pointsStr)
			n2.setAttribute('origPoints', pointsStr)
			n2.setAttribute('id', beamId++)
			n2.setAttribute('onmousedown', 'selectGrob(this)')
			n2.removeAttribute('transform')
			n2.setAttribute('anchor', '')

		}
	}
}

function selectGrob(grob) {

	if (!grob.hasAttribute('id'))
		return

	if (!detectLeftButton(event)) {
		event.preventDefault()
		showGrobModifyExpr(grob)
		return
	}

	grob.setAttribute('color', 'cyan')
	points = grob.getAttribute('points').split(' ')
	leftX = Number(points[4])
	rightX = Number(points[0])
	distanceFromRightSide  = Math.abs(event.pageX * scaleX - rightX)
	distanceFromLeftSide = Math.abs(event.pageX * scaleX - leftX)
	distanceFromCenter = Math.abs(event.pageX * scaleX - 
(leftX + (rightX - leftX)/2))

	minDistance = Math.min(distanceFromLeftSide, 
 distanceFromCenter, 
 distanceFromRightSide)
	
	switch(minDistance) 
	{
		case distanceFromRightSide:
			grob.setAttribute('anchor','right')
			break;
		case distanceFromLeftSide:
			grob.setAttribute('anchor','left')
			break;
		case distanceFromCenter:
			grob.setAttribute('anchor','center')
			break;
	}
	
	grob.setAttribute('yScreenPrev', event.pageY * scaleY)
	
	currGrob = grob

}

function detectLeftButton(evt) {

	evt = evt || window.event
	if ('buttons' in evt) {
		return evt.buttons == 1
	}
	var button = evt.which || evt.button
	return button == 1

}

function unselectGrob() {

	if (currGrob)
		currGrob.setAttribute('color', 'black')

	currGrob = null
	
}

function moveGrob() {

	if (!currGrob)
		return
	
	points = currGrob.getAttribute('points').split(' ')
	origPoints = 	currGrob.getAttribute('origPoints').split(' ')
	idx1 = 1
	idx2 = 8
	
	if (currGrob.getAttribute('anchor') == 'left') {
		idx1 = 5
	}
	else if (currGrob.getAttribute('anchor') == 'right'

Re: how to implement the snippet in the attachment

2019-11-01 Thread Simon Albrecht

On 31.10.19 15:32, DJF wrote:

\relative c'' {
\key f \major
<<{bes2 ~ 8  4} \\
{r4  ~ \hideNotes 8 \unHideNotes s8 s4 } >>
}



Code formatting matters. The above may be legible to LilyPond, and maybe 
you’re used to that style, but if you’re sharing code, please stick to 
the standards evident from the source code and documentation. 
Frescobaldi’s auto-format is very good as well. Here’s the same with 
good formatting:


\relative c'' {
  \key f \major
  <<
    { bes2~ 8  4 }
    \\
    { r4 ~ \hideNotes 8 \unHideNotes s8 s4 }
  >>
}

If you have questions about any of the changes I made, I’m happy to 
explain them. All are made with good reason and help understanding how 
the code works.


Best, Simon




Re: how to implement the snippet in the attachment

2019-10-31 Thread Kieren MacMillan
Hi Jinsong,

> Thank you very much for the help. It works well.

I’m glad!

> I don't understand the \new Voice

If you do a web search for

   \new Voice lilypond

the first hit is: 
.

> and \voiceTwo

A web search for

\voiceTwo lilypond

returns the same page as above.

That page of the documentation describes both commands.

Hope that helps!
Kieren.



Re: how to implement the snippet in the attachment

2019-10-31 Thread Jinsong Zhao

On 2019/10/31 22:22, Kieren MacMillan wrote:

Hi,


I don't figure out a way to implement it.


Something like this, maybe?

\version "2.19.83"

{
   \key f \major
   <<
 { bes'2 ~ 8[ ] } \\
 \new Voice  { \voiceTwo r4  ~ \once \hideNotes q8 }
   >>
   4
}

Hope that helps!
Kieren.


Thank you very much for the help. It works well.

However, I don't understand the code well. In fact, I don't understand 
the \new Voice and \voiceTwo here.


Thanks again.

Best,
Jinsong







Re: how to implement the snippet in the attachment

2019-10-31 Thread DJF
On Oct 31, 2019, at 10:02 AM, Jinsong Zhao  wrote:
> 
> hi there,
> I am trying to transcribe a music sheet.  I have encountered the snippet in 
> the attachment.  I don't figure out a way to implement it.  I am now using an 
> alternative way like:

Use hidden notes in the second voice to accomplish this.

\relative c'' {
\key f \major
<<{bes2 ~ 8  4} \\
{r4  ~ \hideNotes 8 \unHideNotes s8 s4 } >>
}

--
Dan


Re: how to implement the snippet in the attachment

2019-10-31 Thread Kieren MacMillan
Hi,

> I don't figure out a way to implement it.

Something like this, maybe?

\version "2.19.83"

{
  \key f \major
  <<
{ bes'2 ~ 8[ ] } \\
\new Voice  { \voiceTwo r4  ~ \once \hideNotes q8 }
  >>
  4
}

Hope that helps!
Kieren.




how to implement the snippet in the attachment

2019-10-31 Thread Jinsong Zhao
hi there,
I am trying to transcribe a music sheet.  I have encountered the snippet 
in the attachment.  I don't figure out a way to implement it.  I am 
now using an alternative way like:


\version "2.19.83"
\relative c'' {
\key f \major
<<{bes2 ~ bes8 g a4} \\
{r4 <>


Re: Snippet for aligning markup inside another markup

2019-10-05 Thread Michael Käppler

Oops, here the missing snippet image...


Am 01.10.2019 um 01:45 schrieb Kieren MacMillan:



Hi Aaron,


Here's my take:

Nice work!
This should be part of the base distro, IMO.

Thanks,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Snippet for aligning markup inside another markup

2019-10-05 Thread Michael Käppler

Hi Aaron and Kieren,
very nice!
(I really should have read how the markup commands make use of 
ly:stencil-aligned-to...)
Here my variant of the code with tweakable alignment. Personally I 
prefer the "scheme only-style" but

I agree that the mixed style Aaron used would be shorter.


\version "2.19.80"

#(define-markup-command (aligned-overlay layout props xdir ydir args)
   (number? number? markup-list?)
   (let* ((stencils (interpret-markup-list layout props args))
  (align (lambda (stencil)
   (ly:stencil-aligned-to
  (ly:stencil-aligned-to stencil X xdir)
  Y ydir)))
  (stencils-aligned-merged (apply ly:stencil-add (map align 
stencils
 (ly:stencil-aligned-to (ly:stencil-aligned-to 
stencils-aligned-merged X LEFT)

   Y DOWN)))

boxone = \markup \with-color #yellow \filled-box #'(0 . 10) #'(0 . 10) #0
boxtwo = \markup \with-color #green \filled-box #'(3 . 9) #'(5 . 11) #0
boxthree = \markup \with-color #red \filled-box #'(2 . 5) #'(3 . 6) #0

\markup \column {
  "Without alignment"
  \overlay { \boxone \boxtwo \boxthree }
  \line {
  \column {
    "Everything centered "
    \aligned-overlay #CENTER #CENTER { \boxone \boxtwo \boxthree }
  }
  \column {
    "Everything aligned to bottom-left "
    \aligned-overlay #LEFT #DOWN { \boxone \boxtwo \boxthree }
  }
  \column {
    "Different alignments "
    \aligned-overlay #CENTER #UP {
  \boxone
  \aligned-overlay #LEFT #CENTER { \boxtwo \boxthree }
    }
  }
  \column {
    "Values in-between"
    \aligned-overlay #-0.8 #-0.5 {
  \boxone
  \aligned-overlay #0.5 #-0.2 { \boxtwo \boxthree }
    }
  }
  }
}


Cheers,
Michael

Am 01.10.2019 um 01:45 schrieb Kieren MacMillan:

Hi Aaron,


Here's my take:

Nice work!
This should be part of the base distro, IMO.

Thanks,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: LSR-snippet 1071 "Percussion example" incomplete

2019-10-03 Thread Thomas Morley
Am Do., 3. Okt. 2019 um 11:43 Uhr schrieb Thomas Morley
:
>
> To the author of LSR-snippet 1071 "Percussion example",
>
> this snippet
> lsr.di.unimi.it/LSR/Item?u=1&id=1071
> is obviously not complete (probably a copy/paste-error), please add
> the missing parts.
>
> Otherwise I'll delete it soon.
>
> Cheers,
>   Harm

I could complete it, following discussion/code from here:
https://sourceforge.net/p/testlilyissues/issues/5408/
https://codereview.appspot.com/353760043

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


LSR-snippet 1071 "Percussion example" incomplete

2019-10-03 Thread Thomas Morley
To the author of LSR-snippet 1071 "Percussion example",

this snippet
lsr.di.unimi.it/LSR/Item?u=1&id=1071
is obviously not complete (probably a copy/paste-error), please add
the missing parts.

Otherwise I'll delete it soon.

Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Kieren MacMillan
Hi Aaron,

> Here's my take:

Nice work!
This should be part of the base distro, IMO.

Thanks,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Aaron Hill

On 2019-09-30 6:18 am, Kieren MacMillan wrote:

Hi Michael,

for a project of mine I wanted to center a markup inside another 
markup.
I searched the built-in markup functions, but to no avail. (Surely it 
is

possible that I missed something...)


This is *almost* it, right?

%%%  SNIPPET ENDS
\version "2.19.83"

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \combine \halign #0 \boxone \halign #0 \boxtwo
%%%  SNIPPET ENDS

I may be wrong, but I’m thinking there’s some relatively simple
incantation which would take it to the goal line.
Hopefully someone out there more knowledgeable than I will help.


Here's my take:


\version "2.19.83"

#(define-markup-command (centered-overlay layout props args)
  (markup-list?)
  (ly:stencil-aligned-to
(interpret-markup layout props #{ \markup \halign #LEFT \overlay {
  #@(map (lambda (m) #{ \markup \vcenter \halign #CENTER $m #}) 
args) } #})

Y DOWN))

boxone = \markup \with-color #yellow \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #green \filled-box #'(3 . 5) #'(5 . 7) #0

\markup {
  "\centered-overlay:"
  \centered-overlay { \boxone "1" }
  \centered-overlay { \boxtwo "2" }
  \centered-overlay { \boxone \boxtwo "1+2" }
}



-- Aaron Hill___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Snippet for aligning markup inside another markup

2019-09-30 Thread Kieren MacMillan
Hi Michael,

> for a project of mine I wanted to center a markup inside another markup.
> I searched the built-in markup functions, but to no avail. (Surely it is
> possible that I missed something...)

This is *almost* it, right?

%%%  SNIPPET ENDS
\version "2.19.83"

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \combine \halign #0 \boxone \halign #0 \boxtwo
%%%  SNIPPET ENDS

I may be wrong, but I’m thinking there’s some relatively simple incantation 
which would take it to the goal line.
Hopefully someone out there more knowledgeable than I will help.

Cheers,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Snippet for aligning markup inside another markup

2019-09-30 Thread Michael Käppler

Hi folks,
for a project of mine I wanted to center a markup inside another markup.
I searched the built-in markup functions, but to no avail. (Surely it is
possible that I missed something...)
So I came up with the following code. Feel free to test and comment it.
Maybe it is possible in an easier way, though.
Would this kind of stuff fit into the LSR?

Best regards,
Michael

% Align src-markup inside dest-markup and merge stencils
% xdir = -1 aligns left edges, 1 right edges
% ydir = -1 aligns bottom edges, 1 top edges
% Values between -1 and 1 are interpolated

#(define-markup-command (align-inside layout props xdir ydir src-markup
dest-markup)
   (number? number? markup? markup?)
   (let* ((src-stil (interpret-markup layout props src-markup))
  (dest-stil (interpret-markup layout props dest-markup))

  (src-x-extent (ly:stencil-extent src-stil X))
  (src-y-extent (ly:stencil-extent src-stil Y))
  (src-x-center (interval-center src-x-extent))
  (src-y-center (interval-center src-y-extent))
  (src-width (interval-length src-x-extent))
  (src-height (interval-length src-y-extent))

  (dest-x-extent (ly:stencil-extent dest-stil X))
  (dest-y-extent (ly:stencil-extent dest-stil Y))
  (dest-x-center (interval-center dest-x-extent))
  (dest-y-center (interval-center dest-y-extent))
  (dest-width (interval-length dest-x-extent))
  (dest-height (interval-length dest-y-extent))

  (offset-x-centered (- dest-x-center src-x-center))
  (offset-y-centered (- dest-y-center src-y-center))
  (offset-dir (cons (+ offset-x-centered (* xdir 0.5 (-
dest-width src-width)))
 (+ offset-y-centered (* ydir 0.5 (-
dest-height src-height))

 (ly:stencil-add dest-stil (ly:stencil-translate src-stil
offset-dir

boxone = \markup \with-color #blue \filled-box #'(0 . 6) #'(0 . 6) #0
boxtwo = \markup \with-color #red \filled-box #'(3 . 5) #'(5 . 7) #0

\markup \align-inside #CENTER #CENTER \boxtwo \boxone
\markup \align-inside #LEFT #0.5 \boxtwo \boxone
\markup \align-inside #RIGHT #DOWN \boxtwo \boxone

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Arrowed quartertones notes snippet compilation problem

2019-07-18 Thread Jacques Menu
Thanks Harm!

Here is the result of convert-ly, which compiles fine:

menu@macbookprojm: ~/Documents/LaTeX/PartitionsLilypond > convert-ly 
ArrowedQuarterNotesExample.ly > ArrowedQuarterNotesExample_CONVERTED.ly
convert-ly (GNU LilyPond) 2.19.83

convert-ly: Processing `ArrowedQuarterNotesExample.ly'... 
Applying conversion: 2.19.2, 2.19.7, 2.19.11, 2.19.16, 2.19.22, 2.19.24, 
2.19.28, 2.19.29, 2.19.32, 2.19.40, 2.19.46, 2.19.49, 2.19.80


menu@macbookprojm: ~/Documents/LaTeX/PartitionsLilypond > diff 
ArrowedQuarterNotesExample.ly ArrowedQuarterNotesExample_CONVERTED.ly
1c1
< \version "2.18.2"
---
> \version "2.19.80"
116c116
< #(ly:parser-set-note-names parser pitchnames)
---
> #(ly:parser-set-note-names pitchnames)

JM

> Le 18 juil. 2019 à 21:19, Thomas Morley  a écrit :
> 
> Am Do., 18. Juli 2019 um 21:15 Uhr schrieb Jacques Menu 
> :
>> 
>> Hello folks,
>> 
>> The snippet at http://lsr.di.unimi.it/LSR/Snippet?id=784 leads to the error 
>> messages below with LP 2.19.83.
>> 
>> Didn’t find eiseh nor feh in Lily's source code.
>> I don’t know which version it was written for. Does anyone know?
> 
> See last line of
> http://lsr.di.unimi.it/LSR/html/contributing.html
> 
> convert-ly should help
> 
> 
> Cheers,
>  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


  1   2   3   4   5   6   >