Re: creating mixtures

2024-07-30 Thread Stefan Thomas
Dear David,
when I do

\multitranspose c << e g c >> {c4 d e f g1 }

I get
test.ly:4:53: warning: this Voice needs a \voiceXx or \shiftXx setting
Maybee, it has to do, that I have version 2.22.2
It works with

\multitranspose c {c' d' e' f' g'1} {  }

but all notes have the same duration.

Am Di., 30. Juli 2024 um 13:40 Uhr schrieb David Kastrup :

> Stefan Thomas  writes:
>
> > With your help, I was able to create a function that can generate
> sequences
> > of a motif in a simple way:
> >
> >> multitranspose =
> >> #(define-music-function (initton seq  motiv   ) (ly:pitch? ly:music?
> >> ly:music?  )
> >>   (music-clone seq 'elements
> >>(map (lambda (p) #{ \transpose $initton #(ly:music-property p 'pitch
> )
> >>   $motiv  #})
> >> (ly:music-property seq 'elements
> >
> > Instead of having several transpositions of a tone sequence follow one
> > another, I would like to have the option of having them sound
> > simultaneously, as a mixture.
> > I would like to have the possibility to do something like:
> > \multitranspose c'' {e' g' c''} {c''4 d'' e'' f'' g''1 }
> > With the result:
> > 41
>
> Have you tried just entering
>
> \multitranspose << e' g' c'' >> {c''4 d'' e'' f'' g''1 }
>
> ?
>
> It would appear like the function is already prepared for dealing with
> that functionality.
>
> --
> David Kastrup
>


creating mixtures

2024-07-30 Thread Stefan Thomas
With your help, I was able to create a function that can generate sequences
of a motif in a simple way:

> multitranspose =
> #(define-music-function (initton seq  motiv   ) (ly:pitch? ly:music?
> ly:music?  )
>   (music-clone seq 'elements
>(map (lambda (p) #{ \transpose $initton #(ly:music-property p 'pitch )
>   $motiv  #})
> (ly:music-property seq 'elements

Instead of having several transpositions of a tone sequence follow one
another, I would like to have the option of having them sound
simultaneously, as a mixture.
I would like to have the possibility to do something like:
\multitranspose c'' {e' g' c''} {c''4 d'' e'' f'' g''1 }
With the result:
41
Thanks for Your help
Stefan


Re: Tempo changes and spanners

2024-07-23 Thread Thomas Morley
Am Di., 23. Juli 2024 um 23:52 Uhr schrieb Tom Brennan :
>
> Hi all
>
> I'm notating a sonata for a cello and piano, and I would like to produce 
> three "artifacts" (products?) from this:
>
> 1. A solo cello part (a typical single staff representation)
> 2. A "study score" where all staves are equivalent sizes
> 3. An accompaniment part for the piano, where the cello is above in a smaller 
> staff
>
> Now, the problem I'm facing is that there are plenty of "accel." and "rit." 
> marks with lines/spanners that I would like to be treated like tempo 
> markings, so that they are presented in the following ways:
>
> 1. Normally for the solo cello part
> 2. Only above the entire system in the "study score" product
> 3. Above both the piano and the solo part in the "accompaniment" product
>
> The way I have designed the music input is like:
>
> ```
> lattice = { s1 \tempo "Andante" 4 = 72 | s1 }
> cello = << \lattice \relative c { a4 b c2 | d1 } >>
> left = << \lattice { ...some music... } >>
> right = << \latttice { ... } >>
> ```
>
> i.e., so that the tempo lives in its own spaced-out voice, which provides the 
> tempo to the rest of the staves but doesn't have its own staff to print. This 
> seems to work, but I'm missing some key knowledge about how to handle the 
> above scenarios. In particular, I don't know how to
>
> 1. treat a tempo marking and/or textmark as a spanner, so that it can have a 
> dotted connecting line between tempo changes
> 2. toggle these tempo changes based on the requirements above -- sometimes 
> only above the whole system, sometimes above the grand staff and the cello 
> part (but not the left hand)
>
> I haven't been able to find the right documentation for this -- it seems like 
> the only way to use a spanner is within a particular staff. Perhaps my 
> approach is completely wrong, and I would love to know the best approach. I 
> imagine this has to be a common (and hence solved) problem.
>
> Thanks
> Tom

Tempo-spanners are not yet implemented.

Though we have an issue for it:
https://gitlab.com/lilypond/lilypond/-/issues/3176
You'll find a workaround there:
https://gitlab.com/lilypond/lilypond/-/issues/3176#note_1277019697

Furthermore I tried a proper implementation, see:
https://gitlab.com/lilypond/lilypond/-/merge_requests/2256
Though, a problem arises as soon as the relevant engravers are moved
around. This is unsolved...

Anyway, you may use the workaround from the issue or grap the code
from the MR, in most cases it will work.
Though, no garantee...

Cheers,
  Harm



Re: 'cloning' Voice properties

2024-07-17 Thread Thomas Morley
Am Mi., 17. Juli 2024 um 11:02 Uhr schrieb Werner LEMBERG :
>
>
> >> ```
> >> \version "2.25.18"
> >>
> >> foo =
> >> #(define-music-function () ()
> >>   #{
> >> <<
> >>   c'4
> >>   \new Voice { g''4 }
> >> >>
> >>   #})
> >>
> >> {
> >>  \override Staff.NoteColumn.ignore-collision = ##t
> >>   c'4 \foo \stemUp \foo \stemDown \foo
> >> }
> >> ```
> >>
> >> As can be seen, the `\new Voice` doesn't react to `\stemUp` and
> >> `\stemDown`.  Is there a way to fix this, maybe by 'cloning' all
> >> properties of the `Stem` grob in the current `Voice` context to the
> >> new one?
> >
> > why not:
> >   [\once] \override Staff.Stem.direction = #UP/DOWN
> > ?
>
> Well, if I could get this info within the music function, I would pass
> it on to `\new Voice` as you describe.  So: How do I get this info
> from the current context?
>
>
> Werner

Well, obviously I don't understand what you want.
Typing \stemUp/Down or [\once] \override Staff.Stem.direction =
#UP/DOWN is no real difference, if you need to enter such a command.

You could do:

foo =
#(define-music-function () ()
  #{
<<
  \applyContext
  #(lambda (ctx)
(let* ((stem-direction
 (assoc-get 'direction (ly:context-grob-definition ctx 'Stem)))
   (ctx-parent (ly:context-parent ctx)))
(when (number? stem-direction)
  (ly:context-pushpop-property
ctx-parent
'Stem
'direction
stem-direction
  c'4
  \new Voice { g''4 \revert Staff.Stem.direction  }
>>
  #})

{
 \override Staff.NoteColumn.ignore-collision = ##t
  c'4 \foo \once \stemUp \foo \foo \stemDown \foo
}

But there is still the Stem.direction-override.
Apart from that I'm not convinced above coding is suffiviently robust.
You may need ti test thoroughly.

Cheers,
  Harm



Re: 'cloning' Voice properties

2024-07-17 Thread Thomas Morley
Am So., 14. Juli 2024 um 18:38 Uhr schrieb Werner LEMBERG :
>
>
> Folks,
>
>
> consider the following snippet.
>
>
> ```
> \version "2.25.18"
>
> foo =
> #(define-music-function () ()
>   #{
> <<
>   c'4
>   \new Voice { g''4 }
> >>
>   #})
>
> {
>  \override Staff.NoteColumn.ignore-collision = ##t
>   c'4 \foo \stemUp \foo \stemDown \foo
> }
> ```
>
> As can be seen, the `\new Voice` doesn't react to `\stemUp` and
> `\stemDown`.  Is there a way to fix this, maybe by 'cloning' all
> properties of the `Stem` grob in the current `Voice` context to the
> new one?
>
>
> Werner

Hi Werner,

why not:
  [\once] \override Staff.Stem.direction = #UP/DOWN
?

Cheers,
  Harm



Re: Workaround for \grace + \tuplet bug

2024-07-09 Thread Thomas Morley
Am Mo., 8. Juli 2024 um 18:09 Uhr schrieb Tom Brennan :
>
> I just realized that guile 3 is available for 2.24.x, so that's the 
> workaround. I'll still file the bug, though, for v2.25 in the proper channel.
>
> Thanks
> Tom
>
> On Mon, Jul 8, 2024 at 11:40 AM Tom Brennan  wrote:
>>
>> Hi all
>>
>> I came across a bug with grace music containing tuplets and I haven't filed 
>> the report yet, because I'm waiting to be added to the bug list to provide 
>> the report there.
>>
>> However, I'm looking for a workaround for this problem. Here is the report:
>>
>> ```
>> % Grace note music containing tuplets cannot contain other music after the
>> % first tuplet. (The result is a segfault.)
>> % Note: this compiles normally on at least "2.24.3"
>> \version "2.25.18"
>>
>> music_that_does_not_work = \relative c'' {
>> a4 b c
>> \grace {
>> \tuplet 3/2 { a16 b c }
>> g32 a
>> }
>> d4
>> }
>>
>> music_that_works = \relative c'' {
>> a4 b c
>> \grace {
>> g32 a
>> \tuplet 3/2 { a16 b c }
>> }
>> d4
>> }
>>
>> \score {
>> {
>> % uncomment the following to get a segfault:
>> % \music_that_does_not_work
>> \bar "||"
>> \music_that_works
>> }
>> }
>> ```
>>
>> This is only a problem in version 2.25.x, but I'm specifically using that 
>> version to gain access to guile 3, so downgrading to 2.24.x doesn't work for 
>> my situation.
>>
>> Does this sound like low hanging fruit? Is there a workaround maybe?
>>
>> Thanks!
>> Tom

This is now https://gitlab.com/lilypond/lilypond/-/issues/6726

Thanks for your report,
  Harm



Re: Graphical markup between objects?

2024-06-23 Thread Thomas Morley
Am So., 23. Juni 2024 um 19:48 Uhr schrieb Fennel :
>
>
> Wondering if it's possible to override the behavior of the glide line such 
> that the glide will draw to the next fingering regardless of what the second 
> number is.
>
> - Fennel

It's not possible. Think of chords with multiple fingerings, how to decide?
But you can fake it:

{
  b1-\glide -1 b'-\tweak text "2" -1
}

Cheers,
  Harm



Re: vim-transpose

2024-06-18 Thread Stefan Thomas
Dear Kenneth,
thanks for Your reply.
I  already have a file lilypond.vim in ~/.vim/ftplugin/. Could I paste the
content of Transpose.vim into that file?

Am Di., 18. Juni 2024 um 10:09 Uhr schrieb Kenneth Flak <
kennethf...@protonmail.com>:

> Hi,
>
> The plugin is missing some vital parts, but you should be able to get it
> working by renaming Transpose.vim to lilypond.vim and moving it into the
> after/ftplugin folder of your (n)vim configuration. Haven't tested it yet,
> though...
>
> Best,
> Kenneth
>
> Stefan Thomas, Jun 18, 2024 at 09:35:
> > Dear community,
> > has anyone of You successfully installed LilyVimTranspose?
> > See [1]https://github.com/gustaphe/LilyVimTranspose
> >
> > References:
> >
> > [1] https://github.com/gustaphe/LilyVimTranspose
>
>
>
>


vim-transpose

2024-06-18 Thread Stefan Thomas
Dear community,
has anyone of You successfully installed LilyVimTranspose?
See https://github.com/gustaphe/LilyVimTranspose


Re: autocompletion with vim

2024-06-06 Thread Stefan Thomas
Hello everyone,
these are really a lot of suggestions, I will try them out and then get
back to you.

Am Do., 6. Juni 2024 um 11:05 Uhr schrieb Kenneth Flak <
kennethf...@protonmail.com>:

> This issue seems related:
>
> https://github.com/uga-rosa/cmp-dictionary/issues/58
>
> Fennel, Jun 06, 2024 at 11:51:
> > It seems like cmp-dictionary​ doesn’t play nice with oil.nvim, and I
> > am not
> > removing that to make this work unfortunately. Here’s a stack trace if
> > you’re
> > interested:
> >
> > Error executing luv callback:
> > ...vim/lazy/cmp-dictionary/lua/cmp_dictionary/dict/trie.lua:43: bad
> > argument #1 to 'decode' (string expect
> > ed, got nil)
> > stack traceback:
> > [C]: in function 'decode'
> > ...vim/lazy/cmp-dictionary/lua/cmp_dictionary/dict/trie.lua:43: in
> > function <...vim/lazy/cmp-dicti
> > onary/lua/cmp_dictionary/dict/trie.lua:42>
> >
> >
> >
> > [C]: in function 'nvim_buf_delete'
> > .../fennel/.local/share/nvim/lazy/oil.nvim/lua/oil/util.lua:159: in
> > function 'rename_buffer'
> > .../fennel/.local/share/nvim/lazy/oil.nvim/lua/oil/init.lua:746: in
> > function 'maybe_hijack_directo
> > ry_buffer'
> > .../fennel/.local/share/nvim/lazy/oil.nvim/lua/oil/init.lua:1265: in
> > function 'setup'
> > /home/fennel/.config/nvim/init.lua:209: in main chunk
> >
> > if you have any suggestions, I’d love to hear them! This has been very
> > frustrating for me.
> >
> > Fennel
> >
> > ​
>
>
>
>


autocompletion with vim

2024-06-05 Thread Stefan Thomas
Dear community,
did any of You manage to get the autoload-function for lilypond  of vim to
work?
Thanks for Your help,
Stefan


Re: gvim point and click

2024-06-04 Thread Stefan Thomas
Dear Timothy,
for all, who are interested in, I finally got it to work (with Your help
and also with chatgpt).
I wrote in okular/settings/configure okular/edior:

> custom editor  gvim --servername GVIM --remote-send ":e %f:call
> SetCursorAdjusted(%l,%c)"

And I wrote in .vimrc

function! SetCursorAdjusted(line, col)
  " Adjust line number down by 1
  let lnum = a:line - 1
  " Use the cursor function to set the cursor position
  call cursor(lnum, a:col)
endfunction

Now I start gvim with
gvim --servername GVIM
and everything works fine!

Am Mo., 3. Juni 2024 um 10:35 Uhr schrieb Timothy Lanfear <
timo...@lanfear.me>:

> Maybe you could try the call cursor command
>
> vim +"call cursor(%l,%c)" %f
>
> As in David' remarks, you may need to adjust the quoting to get the
> desired result.
>
> vim +"call cursor(5,3)" file.ly
>
> works on the shell command line.
> On 03/06/2024 06:24, Stefan Thomas wrote:
>
> Dear David,
> thanks for Your reply.
> Unfortunately, none of your suggestions have brought the desired result!
> Best,
> Stefan
>
> Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright <
> lily...@lionunicorn.co.uk>:
>
>> On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
>> > again, I'm trying to activate point and click in gvim. I made a little
>> > success:
>> > I wrote in the editor options of okular:
>> > gvim --remote-silent +%l %f +normal! %c
>> > When I click on a note, the right document is opened and the cursor is
>> > placed at the correct line, but not at the correct note in the lilypond
>> > file.
>> > What can I do?
>>
>> Perhaps the command you're trying to invoke is, for example:
>>
>>   gvim --remote-silent +:123:norm45l path-to-file
>>
>> using literal constants for line number 123 and column 45.
>>
>> Naively, that would mean okular would have something like:
>>
>>   gvim --remote-silent +:%l:norm%cl %f
>>
>> but, not being familiar with okular, I can't tell how it would
>> handle %cl (where l means move to the right by %c columns) and
>> whether it would need any quoting. For example,
>>
>>   gvim --remote-silent '+:%l:norm%c l' %f
>>
>> might work better.
>>
>> Cheers,
>> David.
>>
> --
> Timothy Lanfear, Bristol, UK.
>
>


Re: gvim point and click

2024-06-02 Thread Stefan Thomas
Dear David,
thanks for Your reply.
Unfortunately, none of your suggestions have brought the desired result!
Best,
Stefan

Am Mo., 3. Juni 2024 um 03:19 Uhr schrieb David Wright <
lily...@lionunicorn.co.uk>:

> On Sun 02 Jun 2024 at 16:10:56 (+0200), Stefan Thomas wrote:
> > again, I'm trying to activate point and click in gvim. I made a little
> > success:
> > I wrote in the editor options of okular:
> > gvim --remote-silent +%l %f +normal! %c
> > When I click on a note, the right document is opened and the cursor is
> > placed at the correct line, but not at the correct note in the lilypond
> > file.
> > What can I do?
>
> Perhaps the command you're trying to invoke is, for example:
>
>   gvim --remote-silent +:123:norm45l path-to-file
>
> using literal constants for line number 123 and column 45.
>
> Naively, that would mean okular would have something like:
>
>   gvim --remote-silent +:%l:norm%cl %f
>
> but, not being familiar with okular, I can't tell how it would
> handle %cl (where l means move to the right by %c columns) and
> whether it would need any quoting. For example,
>
>   gvim --remote-silent '+:%l:norm%c l' %f
>
> might work better.
>
> Cheers,
> David.
>


gvim point and click

2024-06-02 Thread Stefan Thomas
Dear community,
again, I'm trying to activate point and click in gvim. I made a little
success:
I wrote in the editor options of okular:
gvim --remote-silent +%l %f +normal! %c
When I click on a note, the right document is opened and the cursor is
placed at the correct line, but not at the correct note in the lilypond
file.
What can I do?
Thanks for Your help,
Stefan


Re: spontini-editor

2024-06-01 Thread Stefan Thomas
dear Paolo,
rhanks, that helped me a lot. There is one more thing: how çan I set the
default include path for lilypond?

Paolo Prete  schrieb am Fr., 31. Mai 2024, 21:18:

> Check here (tell me if you have issues):
>
>
> https://github.com/paopre/Spontini/blob/master/documentation/miscellaneous.md#midi-input
>
> Hope it helps!
>
>
>
> On Fri, May 31, 2024 at 8:38 PM Stefan Thomas 
> wrote:
>
>> Dear Paolo,
>> thank for Your help. I've installed chrome and I changed the workspace. I
>> can also see, that webmidi works with this browser.
>> But I don't know how I could activate midi input with Spontini. A hint
>> would be great.
>> Thanks,
>> Stefan
>>
>> Am Fr., 31. Mai 2024 um 00:43 Uhr schrieb Paolo Prete <
>> paolopr...@gmail.com>:
>>
>>>
>>>
>>> On Thu, May 30, 2024 at 7:14 PM Stefan Thomas <
>>> kontrapunktste...@gmail.com> wrote:
>>>
>>>> Dear Paolo,
>>>> I could install Spontini. When I open it in chromium browser I get the
>>>> message "InvalidStateError: Platform dependent initialization failed."
>>>>
>>>
>>> Hi Stefan, this is a Chromium bug (you don't have it in Chrome) on MIDI
>>> input. See for example, https://versioduo.com/webmidi-test/ (but it
>>> affects many other programs and websites)
>>> you can avoid the annoying popup by removing line 129 in
>>> lib/webgui/main.js:
>>>
>>> turnOnMidiInputAndListenOnChannel(-1)
>>>
>>> Just remove this line and reload the editor clearing the cache (hold
>>> down the Ctrl key and click the Reload button)
>>> But given that I don't think chromium people will fix it in the near
>>> future, IF you need MIDI input (which is IMHO useful) I suggest you to
>>> switch to Chrome
>>>
>>>
>>>
>>>> What does that mean? I can also open files, but Spontini doesn't find
>>>> the root directory of my scores, which is ~/partituren/
>>>>
>>>>
>>> Just set the workspace to ~/partituren/ in the SpontiniServer window.
>>> See:
>>> https://github.com/paopre/Spontini/blob/master/documentation/spontini-server.md
>>>
>>> Hope this helps!
>>>
>>>
>>>
>>


Re: spontini-editor

2024-05-31 Thread Stefan Thomas
Dear Paolo,
thank for Your help. I've installed chrome and I changed the workspace. I
can also see, that webmidi works with this browser.
But I don't know how I could activate midi input with Spontini. A hint
would be great.
Thanks,
Stefan

Am Fr., 31. Mai 2024 um 00:43 Uhr schrieb Paolo Prete :

>
>
> On Thu, May 30, 2024 at 7:14 PM Stefan Thomas 
> wrote:
>
>> Dear Paolo,
>> I could install Spontini. When I open it in chromium browser I get the
>> message "InvalidStateError: Platform dependent initialization failed."
>>
>
> Hi Stefan, this is a Chromium bug (you don't have it in Chrome) on MIDI
> input. See for example, https://versioduo.com/webmidi-test/ (but it
> affects many other programs and websites)
> you can avoid the annoying popup by removing line 129 in
> lib/webgui/main.js:
>
> turnOnMidiInputAndListenOnChannel(-1)
>
> Just remove this line and reload the editor clearing the cache (hold down
> the Ctrl key and click the Reload button)
> But given that I don't think chromium people will fix it in the near
> future, IF you need MIDI input (which is IMHO useful) I suggest you to
> switch to Chrome
>
>
>
>> What does that mean? I can also open files, but Spontini doesn't find the
>> root directory of my scores, which is ~/partituren/
>>
>>
> Just set the workspace to ~/partituren/ in the SpontiniServer window. See:
> https://github.com/paopre/Spontini/blob/master/documentation/spontini-server.md
>
> Hope this helps!
>
>
>


Re: spontini-editor

2024-05-30 Thread Stefan Thomas
Dear Paolo,
I could install Spontini. When I open it in chromium browser I get the
message "InvalidStateError: Platform dependent initialization failed."
What does that mean? I can also open files, but Spontini doesn't find the
root directory of my scores, which is ~/partituren/

Am Do., 30. Mai 2024 um 13:59 Uhr schrieb Paolo Prete :

>
> Hello Stefan,
>
> Unfortunately not, at the moment. Maybe it would be good to open a mailing 
> list dedicated to easier editing with LilyPond, and direct questions there?
>
> Otherwise, tell me what the best and fastest choice might be.
>
>
> In the meantime you can ask questions in the LilyPond-user mailing list, as 
> is also the case for other editors (like Frescobaldi). I normally read this 
> mailing list.
>
>
> Il gio 30 mag 2024, 10:49 Stefan Thomas  ha
> scritto:
>
>> Dear communiy,
>> is there a user group for the spontini editor?
>>
>


spontini-editor

2024-05-30 Thread Stefan Thomas
Dear communiy,
is there a user group for the spontini editor?


Re: how to remove marks automatically

2024-05-25 Thread Stefan Thomas
Dear Silvain,
thank You, this worked perfectly for me!
Providing you have juste one space as in the example,
in the part \mark \markup {
you can do a search and replace

\\mark.\\markup.{[^{]+{[^}]+}[^}]+}

with nothing

(I tested it in Geany on Ubuntu)

dot means one character
[^{]* means a non-empty sequence of characters without any { character
\ needs escaping
Your could add \s at the end to remove empty spaces or lines


Le 25.05.24 à 18:15, Stefan Thomas a écrit :

Dear community,
I would like to remove automatically all the "\mark \markup { \box { LETTER
} }" in the below quoted text. Can I do this with regex? Does someone know
how?
Thanks,
Stefan

\version "2.22.2"

violine =  {
\clef "treble" | % 1
R1*8 | % 9
\mark \markup { \box { A   } } R1*8 -\markup{ \tiny {Lija+Tambor} }
\mark \markup { \box { B   } }
 R1*8
\mark \markup { \box { C   } }
r4 2. \fermata :32
}



-- 
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org <https://perso.silvain-dupertuis.org>


how to remove marks automatically

2024-05-25 Thread Stefan Thomas
Dear community,
I would like to remove automatically all the "\mark \markup { \box { LETTER
} }" in the below quoted text. Can I do this with regex? Does someone know
how?
Thanks,
Stefan

\version "2.22.2"

violine =  {
\clef "treble" | % 1
R1*8 | % 9
\mark \markup { \box { A   } } R1*8 -\markup{ \tiny {Lija+Tambor} }
\mark \markup { \box { B   } }
 R1*8
\mark \markup { \box { C   } }
r4 2. \fermata :32
}


Re: Conditional code in the midi block

2024-05-20 Thread Thomas Morley
Am So., 19. Mai 2024 um 21:28 Uhr schrieb Carolyn Beeton
:
>
> I would like to include some Staff and Voice context settings in the \midi 
> block only if a flag is set to ##t and I have not been able to figure out how 
> to do this.  When I try to wrap the \context blocks in a code block with 
> #{…#} I get this error:
> trackPerVoiceMWE.ly:31:16: error: syntax error, unexpected '{', expecting 
> SCM_IDENTIFIER or SCM_TOKEN or STRING or SYMBOL
>   \context {
> Is there any way to conditionally change the Staff_performer based on a flag 
> setting?
>
> This is my non-working MWE:
>
> \version "2.24.0"
> \include "english.ly"
>
> global = {
>   \key c \major
>   \time 4/4
> }
> TrackPerVoice = ##t
> \score {
>   \new ChoirStaff <<
> \new Staff <<
>   \new Voice = "soprano" <<
> \global
> \relative c' { c'4 d e f << g1 \\ { g4 f e2 } >> }
>   >>
>   \new Voice = "alto" <<
> \global
> \voiceTwo
> \relative c' { c'4 b a g | f e d2 }
>   >>
> >>
>   >>
>   \layout {}
>   \midi {
> #(display (format #f "TrackPerVoice is ~a\n" TrackPerVoice))
> #(if TrackPerVoice #{
>   #(display "One track per Voice (may make too many voices with 
> polyphony)")
>   #(display "Turn this off to get sop and alto combined in one track.")
>   \context {
> \Staff
> \remove "Staff_performer"
>   }
>   \context {
> \Voice
> \consists "Staff_performer"
>   }
> #} )
>   }
> }
>
> Thanks,
> Carolyn

Here my take on this. Modeled after `enablePolymeter`. Prpbably
overkill, though...

\version "2.24.3"

enableVoicePerformer =
#(define-void-function (do-it) (boolean?)
  (when do-it
(display "One track per Voice (may make too many voices with polyphony)")
(display "Turn this off to get sop and alto combined in one track.")
(let ((module (current-module))
  (cmod-remove (ly:make-context-mod))
  (cmod-consists (ly:make-context-mod)))
 (if (not (output-module? module))
 (ly:parser-error (G_ "Not in an output definition")))
 (ly:add-context-mod cmod-remove (list 'remove 'Staff_performer))
 (ly:add-context-mod cmod-consists (list 'consists 'Staff_performer))
 ;; FIXME: any chance to use ly:output-find-context-def here?  The
 ;; problem is that we don't have access to the context def, just
 ;; its scope (module).
 (module-map
  (lambda (_sym var)
   (if (variable-bound? var)
   (let ((cdef (variable-ref var)))
 (if (ly:context-def? cdef)
 (let* ((context-name
  (ly:context-def-lookup cdef 'context-name))
(aliases (ly:context-def-lookup cdef 'aliases))
(all-names (cons context-name aliases)))
   (cond
((memq 'Staff all-names)
 (variable-set!
   var
   (ly:context-def-modify cdef cmod-remove)))
((memq 'Voice all-names)
 (variable-set!
   var
   (ly:context-def-modify cdef cmod-consists)
  module

global = {
  \key c \major
  \time 4/4
}

TrackPerVoice = ##t

\score {
  \new ChoirStaff <<
\new Staff
\with { midiInstrument = "acoustic grand" }
<<
  \new Voice = "soprano"
  \with { midiInstrument = "marimba" }
   <<
\global
\relative c' { c'4 d e f << g1 \\ { g4 f e2 } >> }
  >>
  \new Voice = "alto"
  \with { midiInstrument = "violin" }
  <<
\global
\voiceTwo
\relative c' { c'4 b a g | f e d2 }
  >>
>>
  >>
  \layout {}
  \midi {
\enableVoicePerformer \TrackPerVoice
  }
}


Cheers,
  Harm



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=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: Empty chord construct and \break.

2024-05-01 Thread Thomas Morley
Am So., 28. Apr. 2024 um 22:34 Uhr schrieb Hwaen Ch'uqi :
>
> I suppose I spoke too soon, for when I compiled the code, the result was 
> actually the same.
>
> HC
>
>
> On Sun, Apr 28, 2024 at 7:47 AM Hwaen Ch'uqi  wrote:
>>
>> Indeed, that helps tremendously. Thank you so much!!!
>>
>> Hwaen Ch'uqi
>>
>>
>> On Sun, Apr 28, 2024 at 7:24 AM Thomas Morley  
>> wrote:
>>>
>>> Am So., 28. Apr. 2024 um 06:25 Uhr schrieb Hwaen Ch'uqi 
>>> :
>>> >
>>> > Greetings,
>>> >
>>> > I am trying to typeset a stack of spoken lines above a multimeasure rest. 
>>> > This works fine when preceded by notes in the same system. However, when 
>>> > it follows a forced break, the output is not so desirable. Can anyone 
>>> > explain what I am missing? MWE below.
>>> >
>>> > \version "2.24.3"
>>> >
>>> > \score {
>>> >   \new Staff = contrabass {
>>> > \relative c' {
>>> >   \key des \major \time 3/4 \clef bass
>>> >   des,2. %!
>>> >   des %2
>>> >   des %3
>>> >   des %4
>>> >   \break
>>> > \textLengthOn
>>> > <>^\markup \override #'(line-width . 66) \override #'(baseline-skip . 
>>> > 2.3) \wordwrap { But enough with introductions. You are no doubt here to 
>>> > learn about a most difficult episode in the life of our Katz. It was 
>>> > during a particular night of fitful sleep that our beloved Katzlein 
>>> > finally slipped into Traumland, and it is there where our story begins. }
>>> > R2.\fermata%29
>>> > \textLengthOff
>>> > }
>>> >   }
>>> > }
>>> >
>>> > Thank you so much.
>>> >
>>> > Hwaen Ch'uqi
>>> >
>>>
>>> Hi,
>>>
>>> what happens here is, the TextScript attached to the empty chord is printed 
>>> at
>>> start of the measure. \textLengthOn stretches the measure to fit with
>>> the TextScript,
>>> and the MultiMeasureRest is centered in this stretched measure.
>>> This is correct in both cases with and without \break.
>>> Though, with the \break the measure has a lonely MultiMeasureRest and
>>> is stretched
>>> even more by ragged-right being #f, the default for all but the first line.
>>> Thus the MultiMeasureRest is centered in a whole single line, the
>>> TextScript not.
>>>
>>> You probably had the idea to attach text to a MultiMeasureRest with:
>>> <>^"markup" R2.
>>> Alas, text of a MultiMeasureRest is of type MultiMeasureRestText.
>>> Nevertheless, you can do so with a little more code. Though, \textLengthOn 
>>> will
>>> then not work, you'll need to stretch the MultiMeasureRest itself:
>>>
>>>
>>> \version "2.24.3"
>>>
>>> mrkp =
>>>   \markup
>>> \override #'(line-width . 66)
>>> \override #'(baseline-skip . 2.3)
>>> \wordwrap {
>>>   But enough with introductions. You are no doubt here to learn about a
>>>   most difficult episode in the life of our Katz. It was during a
>>>   particular night of fitful sleep that our beloved Katzlein finally
>>>   slipped into Traumland, and it is there where our story begins.
>>> }
>>>
>>> mmrText =
>>>   #(make-music
>>> 'MultiMeasureTextEvent
>>> 'direction 1
>>> 'text mrkp)
>>>
>>> \score {
>>>   \new Staff = contrabass {
>>> \relative c' {
>>>   \key des \major \time 3/4 \clef bass
>>>   des,2. %!
>>>   des %2
>>>   des %3
>>>   des %4
>>>   \break
>>>   %% stretch by aprox. half the width of the MultiMeasureRestText:
>>>   \once \override MultiMeasureRest.bound-padding = 32
>>>   <>^\mmrText
>>>   R2.\fermata %29
>>> }
>>>   }
>>> }
>>>
>>>
>>> HTH,
>>>   Harm

The code below uses your initial posted code to show behaviour before
and after \break and the same with my proposal.
Image is attached.
Please tell whats wrong and what you want instead.

Cheers,
  Harm

\version "2.24.3"

mrkp =
  \markup
\override #'(line-width . 66)
\override #'(baseline-skip . 2.3)
\wordwrap {
  But enough with introductions. You

Re: Empty chord construct and \break.

2024-04-28 Thread Thomas Morley
Am So., 28. Apr. 2024 um 06:25 Uhr schrieb Hwaen Ch'uqi :
>
> Greetings,
>
> I am trying to typeset a stack of spoken lines above a multimeasure rest. 
> This works fine when preceded by notes in the same system. However, when it 
> follows a forced break, the output is not so desirable. Can anyone explain 
> what I am missing? MWE below.
>
> \version "2.24.3"
>
> \score {
>   \new Staff = contrabass {
> \relative c' {
>   \key des \major \time 3/4 \clef bass
>   des,2. %!
>   des %2
>   des %3
>   des %4
>   \break
> \textLengthOn
> <>^\markup \override #'(line-width . 66) \override #'(baseline-skip . 2.3) 
> \wordwrap { But enough with introductions. You are no doubt here to learn 
> about a most difficult episode in the life of our Katz. It was during a 
> particular night of fitful sleep that our beloved Katzlein finally slipped 
> into Traumland, and it is there where our story begins. }
> R2.\fermata%29
> \textLengthOff
> }
>   }
> }
>
> Thank you so much.
>
> Hwaen Ch'uqi
>

Hi,

what happens here is, the TextScript attached to the empty chord is printed at
start of the measure. \textLengthOn stretches the measure to fit with
the TextScript,
and the MultiMeasureRest is centered in this stretched measure.
This is correct in both cases with and without \break.
Though, with the \break the measure has a lonely MultiMeasureRest and
is stretched
even more by ragged-right being #f, the default for all but the first line.
Thus the MultiMeasureRest is centered in a whole single line, the
TextScript not.

You probably had the idea to attach text to a MultiMeasureRest with:
<>^"markup" R2.
Alas, text of a MultiMeasureRest is of type MultiMeasureRestText.
Nevertheless, you can do so with a little more code. Though, \textLengthOn will
then not work, you'll need to stretch the MultiMeasureRest itself:


\version "2.24.3"

mrkp =
  \markup
\override #'(line-width . 66)
\override #'(baseline-skip . 2.3)
\wordwrap {
  But enough with introductions. You are no doubt here to learn about a
  most difficult episode in the life of our Katz. It was during a
  particular night of fitful sleep that our beloved Katzlein finally
  slipped into Traumland, and it is there where our story begins.
}

mmrText =
  #(make-music
'MultiMeasureTextEvent
'direction 1
'text mrkp)

\score {
  \new Staff = contrabass {
\relative c' {
  \key des \major \time 3/4 \clef bass
  des,2. %!
  des %2
  des %3
  des %4
  \break
  %% stretch by aprox. half the width of the MultiMeasureRestText:
  \once \override MultiMeasureRest.bound-padding = 32
  <>^\mmrText
  R2.\fermata %29
}
  }
}


HTH,
  Harm



Re: Special notation question

2024-04-21 Thread Thomas Morley
Am So., 21. Apr. 2024 um 17:43 Uhr schrieb Xavier Mayeur :

> Hello,
>
> In a \time 3/2 score, how can I write the following snippet in Lilypond?
>
>
>
> I wonder how to create the 'g' note with that special appearance and with
> the right duration...
>
> --
> Cordialement,
>
> Xavier MAYEUR
> Bruxelles
>
>
{
  \tweak duration-log 1
  g''8
  %% or
  \override NoteHead.duration-log = 1
  g''8
}

Cheers,
  Harm


Re: Bend

2024-04-21 Thread Thomas Richter
I guess what you are looking for is the brassBend glyph defined in SMuFL 
compliant fonts like Bravura or Ekmelos 
<http://www.ekmelic-music.org/en/extra/ekmelos.htm> with codepoint 
U+E5E3.  And it is one of the few musical symbols which is also defined 
in Unicode with codepoint U+1D189.





\version "2.24.0"

#(define-markup-command (brassBend layout props) ()
  #:properties ((font-size 0))
  (interpret-markup layout
    (cons
  `((font-name . "Ekmelos")
    (font-size . ,(+ font-size 5)))
  props)
    (ly:wide-char->utf-8 #xE5E3)))

{ c'' ^ \markup \brassBend }



Thomas


Am 20.04.2024 um 22:39 schrieb gehent...@gmail.com:

Hello friends,

I thought this was recently covered, but I haven't been able to find
what I need.

I'm looking for an articulation to add that will indicate a note is
supposed to bend down, before bending back up again. Usually I see it
looking something like an upside-down fermata, without the dot. I can
do this in Musescore easily, but I've never found a satisfactory bend
like this in Lilypond. I have a script for a scoop, and I know about
\bendBefore, but not this one.

Thanks!

Brian



Re: Bend

2024-04-21 Thread Thomas Richter

I guess what you are looking for is the brassBend glyph (U+E5E3) in



Am 20.04.2024 um 22:39 schrieb gehent...@gmail.com:

Hello friends,

I thought this was recently covered, but I haven't been able to find
what I need.

I'm looking for an articulation to add that will indicate a note is
supposed to bend down, before bending back up again. Usually I see it
looking something like an upside-down fermata, without the dot. I can
do this in Musescore easily, but I've never found a satisfactory bend
like this in Lilypond. I have a script for a scoop, and I know about
\bendBefore, but not this one.

Thanks!

Brian






Re: Multiple parts on the same stems

2024-04-19 Thread Thomas Morley
Am Di., 16. Apr. 2024 um 22:01 Uhr schrieb Gerardo Ballabio
:
>
> Hello all,
> I'm trying to typeset a percussion score with several instruments on
> the same staff. When they play simultaneous notes I want to line them
> up all on the same stem, like this (output attached, percussion1.pdf):
>
> %%
> \version "2.24.1"
>
> \new Staff \relative {
>   \clef "varpercussion"
>   \stemDown
>   R1 |
>   r2 2\f-> |
>   R1 |
>   r2 q2-> |
> }
> %%
>
> But I'd like to write down each part separately, so that I may also
> print the single parts without redoing everything. And I also want to
> use different note heads for each instrument.
> This is the best I could come up with:
>
> %%
> \version "2.24.1"
>
> bassDrum = \relative {
>   \stemDown
>   s1 |
>   s2 b2-> |
>   s1 |
>   s2 b2-> |
> }
>
> cymbals = \relative {
>   \override NoteHead.style = #'xcircle \stemDown
>   s1 |
>   s2 f'2 |
>   s1 |
>   s2 f2 |
> }
>
> tamTam = \relative {
>   \override NoteHead.style = #'cross \stemDown
>   s1 |
>   s2 e2 |
>   s1 |
>   s2 e2 |
> }
>
> pause = \new Voice {
>   \clef "varpercussion"
>   \time 4/4
>   R1 |
>   r2 s2\f |
>   R1 |
>   r2 s2 |
> }
>
> percussions = \new Voice \relative {
>   <<
> \cymbals
>   \\
> \tamTam
>   \\
> \bassDrum
>   >>
> }
>
> \new Staff
> <<
>   \pause
>   \percussions
> >>
> %%
>
> But as you can see (output attached, percussion2.pdf) the three notes
> aren't aligned on the same stem, only two of them are.
>
> I tried \partCombine, it works nicely with two parts, but if there's a
> way to combine three or more I didn't find it.
>
> Any help is much appreciated.
>
> Thanks
> Gerardo

I don't understand why you're writing a percussion score in \notemode,
i.e. with common Voice, Staff etc.
We do have \drummode, DrumVoice, DrumStaff and the possibility to
customize the appearance:

#(define my-style
  '((bassdrum default  accent  -1)
(splashcymbal xcircle #f3)
(tamtam   cross   #f   -5)))

one = \drummode { s1 s2 bd s1 s2 bd }
two = \drummode { s1 s2  cyms2 s1 s2  cyms2 }
three = \drummode { s1 s2 tt2 s1 s2 tt2 }
four = \drummode {
  \clef "varpercussion"
  \time 4/4
  R1 |
  r2 s2\f |
  R1 |
  r2 s2 |
}

\new DrumStaff
  \with {
drumStyleTable = #(alist->hash-table my-style)
  }
  \new DrumVoice << \one \two \three \four >>

HTH,
  Harm



Re: Delayed turns etc

2024-04-17 Thread Thomas Morley
Am Mi., 17. Apr. 2024 um 11:13 Uhr schrieb Jean Abou Samra :
>
> That works for the last line of the whole score. The line I want to be 
> "ragged" is the last line of a page. with more music on the next page.
>
>
> There is no way to make just one system ragged except the last one in the 
> score. I'm afraid you need a second \score block if you want to do this.

I'd vote for a second score as well, though there is
https://lsr.di.unimi.it/LSR/Item?id=1098
(Not tested with 2.25.xx)

Cheers,
  Harm



Re: make-music?

2024-04-13 Thread Thomas Morley
Am Sa., 13. Apr. 2024 um 22:09 Uhr schrieb Pierre-Luc Gauthier
:

> But what about the parenthesised alist -> (alist) ‽
>
> I have not found documentation here :
> https://extending-lilypond.gitlab.io/en/scheme/alists.html
> nor here :
> https://lilypond.org/doc/v2.25/Documentation/extending/association-lists-_0028alists_0029
>

(alist) is a procedure, which evaluates to an alist, when called, p.e.

#(define (foo) '((bar . buzz)))

#(display foo)
=> #

#(display (foo))
=> ((bar . buzz))


Instead of
#(define (anAList) `((aVariable . ,aSymbol)))
you could write:
#(define anAList (lambda () `((aVariable . ,aSymbol

Cheers,
  Harm



Re: make-music?

2024-04-13 Thread Thomas Morley
Am Sa., 13. Apr. 2024 um 20:59 Uhr schrieb Pierre-Luc Gauthier
:
>
> Hello there,
>
> Quite an easy one I'm sure but I tried many combinations to no avail.
>
> I have this symbol that I wish to evaluate later. I thought that was
> what ly:make-music was for.
>
> \version "2.25.15"
>
> #(define anAList ((aVariable . aSymbol)))
>
> aSymbol = {cis'}
>
> {
>   #(cdr (assoc 'aVariable anAList))
> }
>
> How can I make this symbol into music without defining it before the alist ?
>
> Thanks for any pointers :-)
> --
> Pierre-Luc Gauthier
>

Quick'n dirty:

#(define (anAList) `((aVariable . ,aSymbol)))

aSymbol = { cis'4 }

{
  $(assoc-get 'aVariable (anAList))
}

Cheers,
  Harm



Re: Volta spanner missing edge when using "|" as endRepeatType

2024-02-29 Thread Thomas Morley
Am Do., 29. Feb. 2024 um 07:53 Uhr schrieb Andy Bradford
:
>
> Hello,
>
> I want to place an interlude that  happens only the first time through a
> a section that has  a repeat and a second interlude  for the second time
> through. I don't want the repeat measure bar showing up in the middle of
> the piece, so  I set the endRepeatType  to "|", but when I  do that, the
> right edge of the volta spanner  loses the stright edge line. I've tried
> various combinations of bars to see if  I can get it to work but haven't
> succeeded so far.
>
> I also tried  just using a solid  line Text spanner but  couldn't find a
> way to get any text "inside" the spanner (only on the ends).
>
> Any clues on how this could be done?
>
> %%%
> \version "2.22.2"
>
> voltaprima = \markup { \text \italic { First time only } }
> voltaseconda = \markup { \text \italic { On repeat only } }
> \relative {
>   c''1
>   \repeat volta 2 {
>   c
>   \once \set Score.startRepeatType = "|"
>   \set Score.endRepeatType = "|" % or "||"
>   \set Score.repeatCommands = #(list (list 'volta voltaprima) 'start-repeat)
>   c4 b d e
>   \set Score.repeatCommands = #(list (list 'volta #f) (list 'volta 
> voltaseconda)
>  'end-repeat)
>   c b a b
>   \set Score.repeatCommands = #'((volta #f) end-repeat)
>   f'1
>   \set Score.endRepeatType = ":|."
>   e
>   }
>   \alternative {
> { d }
> { a' }
>   }
>   f \bar "|."
> }
> %%%
>
> Thanks,
>
> Andy
>
>
>
>

\allowVoltaHook = "|"
placed toplevel, should do the trick.

Cheers,
  Harm



Re: How to get more accidentials?

2024-02-22 Thread Thomas Richter


Am 21.02.2024 um 17:14 schrieb Johannes Koch:

Hi,

I was trying to extend the example at

<https://lsr.di.unimi.it/LSR/Snippet?id=786>

.. The emmentaler font currently contains single-arrowed 
flat/natural/sharp accidentials. I'd like to use more accidentials, 
like the double/triple arrow flat/natural/sharp accidentials shown in


<https://en.xen.wiki/w/Helmholtz-Ellis_notation#Helmholtz-Ellis_glyphs>

.. Is there a way to "extend" the font? Or put the SVGs for the 
missing glphs in a separate file so I can reference them somehow?




you could use ekmelily 
<http://www.ekmelic-music.org/en/extra/ekmelily.htm> . I extended it now 
with a new file "ly/ekmel-he.ily" for JI in HE notation as described in 
the LSR example <http://lsr.di.unimi.it/LSR/Item?id=786> . It requires a 
SMuFL compliant font like Ekmelos 
<http://www.ekmelic-music.org/en/extra/ekmelos.htm> or Bravura 
<https://github.com/steinbergmedia/bravura> and the main include file 
"ly/ekmel-main.ily"; e.g.



\version "2.24.0"
\include "ekmel-he.ily"

\fixed c'' {
  c cih cihh cihhh cisehhh cisehh ciseh cis %...
}


See "samples/he.ly" for all c... notenames (the other names are equivalent).

This is a first attempt to support JI in ekmelily with solely "he" 
notation and a single set of notenames (Dutch), and alias names like 
"es" are missing yet.


--
Thomas



Re: dynamics in coulour

2024-02-20 Thread Stefan Thomas
Thanks, I'll check it out!
Best,
Stefan

Am Di., 20. Feb. 2024 um 16:33 Uhr schrieb Ritchie Fraser <
euphoge...@gmail.com>:

> Hi Stefan,
>
> I did just that last week I need to do the same thing for a cue part. This
> is how I achieved it.
>
>
> \new CueVoice {
>\override Staff.StaffSymbol.color = #magenta
>\override Accidental.color = #magenta
>\override Beam.color = #magenta
>\override NoteHead.color = #magenta
>\override Stem.color = #magenta
>\override Rest.color = #magenta
>\override TextScript.color = #magenta
>\override DynamicText.color = #magenta
>\override DynamicTextSpanner.color = #magenta
> f,4\f^"Bb Bass" r4 r4 |
> c4 r4 r4 |
> g'4 r4 r4 |
> c,2. |
> f4\f r4 r4 |
> d4 r4 r4 |
> g4 r4 r4 |
> c,2. |
> fis2.\pp\( |
> g4\) r4 r4 |
> e2.\( |
> f4\) r4 r4 |
> }
>
> Regards
>
> Ritchie
>
> On Tue, 20 Feb 2024 at 14:49, Stefan Thomas 
> wrote:
>
>> Dear community,
>> is it possible to display the dynamics, also haipins and other things
>> like crescendo etc., in coulour?
>> Could someone could give me a hint?
>> Thanks,
>> Stefan
>>
>
>
> --
> Kind Regards
>
> Ritchie
> -
> Ritchie Fraser
>
>


dynamics in coulour

2024-02-20 Thread Stefan Thomas
Dear community,
is it possible to display the dynamics, also haipins and other things like
crescendo etc., in coulour?
Could someone could give me a hint?
Thanks,
Stefan


Re: Anyone know this ornament?

2024-02-19 Thread Stefan Thomas
Dear Auke,
I don't know this ornament either but maybe it could be useful to see a few
bars more of this music.
Best,
Stefan

>
> Hallo,

I'm transcribing the organ music of Josef Ferdinand Norbert Seger. The prelude
I'm currently working on, shows an ornamentation I am not familiar with.
See screenshot. I think it is probably meant as arpeggio, but I'm not sure.
Does anyone know for sure what it is?

Regards, Auke


Re: \partial and \compressMMRests don't seem to work together

2024-02-18 Thread Thomas Morley
Am Sa., 17. Feb. 2024 um 01:18 Uhr schrieb Gerardo Ballabio
:
>
> Sorry, forgot the attachment.
>
> Il giorno sab 17 feb 2024 alle ore 01:15 Gerardo Ballabio
>  ha scritto:
> >
> > Hello,
> > I need to change the time in the middle of a bar.
> > I managed to do that using \partial, but it seems that after that,
> > \compressMMRests no longer works -- only for the group of measures
> > immediately following, then it resumes working normally.
> > See example below, attaching the output that I get.
> > Can you please help me fix that?
> >
> > Thank you
> > Gerardo
> >
> > %%
> > \version "2.24.1"
> >
> > \new Staff \compressMMRests {
> >   \time 2/4
> >   R2*4 |
> >   \partial 4 r4 \bar "" \time 6/8 \partial 4. r4 r8 |
> >   R2.*4 | % these bars aren't compressed
> >   R2.*4 | % these are
> > }
> > %%

Hi,

works out of the box with 2.25.13.
Please consider to upgrade.

Cheers,
  Harm



Re: Table of Contents and mixed numbers.

2024-02-18 Thread Thomas Morley
Am Do., 15. Feb. 2024 um 19:16 Uhr schrieb Hwaen Ch'uqi :
>
> Greetings,
>
> Until upgrading to 2.24, I had been using certain Scheme code and
> \paper block layouts in order to output books consisting of prefatory
> material with Roman numeral page numbers and the music itself with
> Arabic page numbers. When I upgraded one such file to 2.24.3 using
> convert-ly, the result was puzzling. The actual page numbering is
> correct - ten pages of either invisible or Roman numerals followed by
> Arabic numerals starting on page 1. However, the Table of Contents
> shows Arabic numerals from the beginning, so that the first page of
> actual music is 11. I am not sure what to present as an MWE; I am
> guessing that the Scheme code and \paper blocks should suffice. The
> original was laid out as follows:
>
> %%% roman numeral page numbers
> #(define begin-arabic 11)
>
> %% The following is an adaptation of a function found in
> `define-markup-commands.scm' which is used to create tables of
> contents. An offset to the Arabic numerals has been incorporated so
> that the first page of the music is 1.
> #(define-markup-command (page-ref layout props label gauge default)
>   (symbol? markup? markup?)
>   #:category other
>   "
> @cindex referencing page numbers in text
>
> Reference to a page number.  @var{label} is the label set on the referenced
> page (using the @code{\\label} command), @var{gauge} a markup used to estimate
> the maximum width of the page number, and @var{default} the value to display
> when @var{label} is not found."
>   (let* ((gauge-stencil (interpret-markup layout props gauge))
>  (x-ext (ly:stencil-extent gauge-stencil X))
>  (y-ext (ly:stencil-extent gauge-stencil Y)))
> (ly:make-stencil
>  `(delay-stencil-evaluation
>,(delay (ly:stencil-expr
> (let* ((table (ly:output-def-lookup layout 'label-page-table))
>(page-number (if (list? table)
> (assoc-get label table)
> #f))
>(page-markup
>  (if page-number
>  (if (< page-number begin-arabic)
>  (format #f "~(~@r~)" page-number) ;
> Roman numerals
>  ; Arabic numerals, but offset to begin on 1
>  (format #f "~a" (- (1+ page-number)
> begin-arabic)))
>  default))
>(page-stencil (interpret-markup layout props
> page-markup))
>(gap (- (interval-length x-ext)
>(interval-length (ly:stencil-extent
> page-stencil X)
>   (interpret-markup layout props
> (markup #:concat (#:hspace gap
> page-markup)))
>  x-ext
>  y-ext)))
>
> #(define-markup-command (roman-numeral-page-number layout props) ()
>   (let ((page-number (chain-assoc-get 'page:page-number props -1)))
> (interpret-markup layout props
>   (if (> page-number 0) ; only positive integers can be `romanized'
>   (format #f "~(~@r~)" page-number)
>   (chain-assoc-get 'page:page-number-string props -1)
>
> #(define-markup-command (offset-page-number layout props offset) (integer?)
>   (let ((page-number (chain-assoc-get 'page:page-number props -1)))
> (interpret-markup layout props
>   (format #f "~a" (- page-number offset)
>
> #(define (part-not-first-page layout props arg)
>   (if (= (chain-assoc-get 'page:page-number props -1)
>  (ly:output-def-lookup layout 'first-page-number))
>   empty-stencil
>   (interpret-markup layout props arg)))
>
> \book {
>
> \bookpart {
>
> \paper {
>   oddHeaderMarkup = \markup \fill-line {
> " "
>   }
>   evenHeaderMarkup = \markup \fill-line {
> " "
>   }
> }
>
> Title, copyright, and dedication pages.
>
>   }
>
> \bookpart {
>
> \paper {
>   oddHeaderMarkup = \markup \fill-line {
> " "
>   }
>   evenHeaderMarkup = \markup \fill-line {
> " "
>   }
>   oddFooterMarkup = \markup \fill-line {
> " "
> \on-the-fly #print-page-number-check-first \roman-numeral-page-number
> " "
>   }
>   evenFooterMarkup = \oddFooterMarkup
>   tocTitleMarkup = \markup \column {
> \vspace #3
> \fill-line \abs-fontsize #16 \bold {
>   "TABLE OF CONTENTS"
> }
> \vspace #2
>   }
>   tocItemMarkup = \markup \column {
> \fill-with-pattern #1 #RIGHT . \fromproperty #'toc:text \fromproperty
> #'toc:page
> \vspace #1
>   }
> }
>
> \markuplist \table-of-contents
>
> Preface and Performance Notes.
>
>   }
>
> \bookpart {
>
> \paper {
>   oddHeaderMarkup = \markup {
> \fill-line {
>   " "
>   \on-the-fly #create-page-number-stencil 

Re: markup for circular bowing

2024-02-14 Thread Thomas Richter

Hi Orm,

maybe the smufl compliant ekmelos 
<http://www.ekmelic-music.org/en/extra/ekmelos.htm> font is useful for 
you. It also defines some Unicode glyphs like circle and arc arrows. The 
following (similar to Pierre's 
<https://lists.gnu.org/archive/html/lilypond-user/2024-02/msg00095.html> 
proposal) uses the path from ekmelos.svg of the Clockwise gapped circle 
arrow (U+27F3) which is maybe more appropriate than the 
stringsScrapeCircularClockwise glyph (U+EE88) in smufl.



\version "2.24.0"

#(define-markup-command (circular-bowing layout props) ()
  #:properties ((font-size 0))
  (let ((s (/ (magstep font-size) 256)))
    (interpret-markup layout props
 (markup
  (#:halign -0.5 #:scale (cons s s) #:stencil
   (make-path-stencil
 '(M 0 260
   c 0 138 112 250 250 250
   c 84 0 159 -41 204 -104
   c 3 -5 7 -10 10 -10
   c 16 0 16 85 38 101
   c 3 2 5 3 8 3
   c 6 0 10 -4 10 -9
   c 0 -7 -18 -82 -18 -131
   c 0 -35 10 -53 10 -62
   c 0 -4 -2 -8 -6 -8
   c -3 0 -6 1 -10 4
   c -37 29 -81 39 -174 54
   c -6 1 -10 5 -10 10
   c 0 11 13 14 26 14
   c 23 0 58 -8 76 -8
   c 8 0 12 1 12 6
   c 0 3 -1 8 -4 12
   c -38 53 -101 88 -172 88
   c -116 0 -210 -94 -210 -210
   c 0 -116 94 -210 210 -210
   c 84 0 158 49 192 120
   c 3 7 8 12 16 12
   c 10 0 20 -9 20 -20
   c 0 -3 -1 -8 -2 -10
   c -40 -80 -123 -142 -226 -142
   c -138 0 -250 112 -250 250
   z)
 0 1 1 #t))

{ c''^\markup \circular-bowing }



You can use esmuflily 
<http://www.ekmelic-music.org/en/extra/esmuflily.htm> to draw smufl 
glyphs in Lilypond as in the following sample. But in case of svg 
backend it embeds the codepoint of a smufl glyph, not the path. So you 
will not obtain a stand-alone svg file.



\version "2.24.0"
\include "esmufl.ily"

{ c''^\markup \halign #-0.5 \ekm-char ##x27F3 }


--
Thomas


Am 14.02.2024 um 10:59 schrieb Orm Finnendahl:

Hi,

  I'd like to make a sign for circular bowing like in the attached
png. The example was done using an epsfile, but unfortunately that
doesn't export to svg, which I need. So it should be done using
lilypond's builtin markup commands (or scheme code). Can someone point
me to examples to do circular arcs with attached arrows (can also be
scheme code)?

I couldn't find anything similar in the docs/internet.

--
Orm

Re: Drum notation and style

2024-01-22 Thread Thomas Richter

On 2024-01-20 06:33, Adrian wrote:

   is it possible to create a "z" stem for buzz rolls?

Maybe esmuflily <http://www.ekmelic-music.org/en/extra/esmuflily.htm> is 
useful for you. The following requires no extra font and achieves 
horizontal beams in two ways: manual beams and an empty tremolo symbol 
on the first two notes:


% ---

\version "2.24.0"
\include "esmufl.ily"

buzz = \markup \sans \bold "z"

\drums {
  \ekmSmuflOn #'tremolo

  sn16^"R" 16^"l"
  \ekmTremolo \buzz { 16:32^"r"[ 16:32^"l"] }

  \ekmTremolo \markup "" { sn16:32^"R" 16:32^"l" }
  \ekmTremolo \buzz { 16:32^"r" 16:32^"l" }
}

% ---

or with a SMuFL compliant font like Bravura or Ekmelos:

% ---

\version "2.24.0"

ekmelicFont = "Bravura"
\include "esmufl.ily"

\drums {
  \ekmSmuflOn #'tremolo

  \ekmTremolo \markup "" { sn16:32^"R" 16:32^"l" }
  \ekmTremolo buzzroll { 16:32^"r" 16:32^"l" }
}

% ---

--
Thomas Richter


Re: Help with some lyrics gymnastics

2024-01-15 Thread Thomas Richter

Hello again,

a few more ideas:

My solution uses the TextSpanner which works for two or more notes. But 
for a single note (syllable), a function like your lyricsWithOption is 
more suitable. The following draws the separating line in the proper length.


%%-

#(define-markup-command (stacked-lyric-single layout props one two)
  (string? string?)
  (let* ((lyric (interpret-markup layout props 
(make-stacked-lyric-markup one two)))

 (width (interval-length (ly:stencil-extent lyric X
    (ly:stencil-add
  lyric
  (make-line-stencil 0.1 0 0.8 width 0.8

%%-

It can be used in the Lyrics context, e.g.

\markup \stacked-lyric-single "you" "God the Father"


For another line thickness, change the first argument of 
make-line-stencil (0.1) and include the following for the TextSpanner in 
the startStackedLyric function with a 10 times larger value:


\once \override TextSpanner.thickness = #1.0


For a proper layout in case of a TextSpanner line break, it could be 
necessary to set the properties of left-broken and right-broken in 
bound-details.



All the best,

Thomas

--

Thomas Richter
Vienna / Austria
thomas-rich...@aon.at

Re: Help with some lyrics gymnastics

2024-01-14 Thread Thomas Richter



On Fri, Jan 12, 2024 at 6:09 PM Matthew Fong  wrote:

I'm trying to replicate lyrics as shown in the red box (the Roman
Missal in English), where
1/ Lyric options are *stacked* and separated by a horizontal line
2/ Lyrics without options are*vertically centered* relative to the
option stack



The following uses TextSpanner for the separating line and the Lyrics 
context is aligned to a NullVoice.


%%-

\version "2.24.0"

#(define-markup-command (stacked-lyric layout props one two)
  (string? string?)
  #:properties ((baseline-skip))
  (interpret-markup layout props
    (markup
  #:translate `(0 . ,(* 0.5 baseline-skip))
  #:center-column (one two

startStackedLyric =
#(define-music-function (one two)
  (string? string?)
  (let ((lyric (make-stacked-lyric-markup one two)))
    #{
  \once \override TextSpanner.style = #'line
  \once \override TextSpanner.outside-staff-priority = ##f
  \once \override TextSpanner.padding = #0.8
  \once \override TextSpanner.bound-details =
    #(lambda (grob)
  `((left (padding .
    ,(* -0.5 (interval-length
  (ly:stencil-extent
    (grob-interpret-markup grob lyric) X
  (attach-dir . -1))
    (right (padding . -0.5
  \lyricmode { #lyric }
  \startTextSpan
    #}))

stackedLyric =
#(define-music-function (one two)
  (string? string?)
  #{ \lyricmode { \markup \stacked-lyric #one #two } #})

stopStackedLyric =
#(define-music-function () ()
  #{ \lyricmode { "" } \stopTextSpan #})


\new Staff
<<
  \new Voice \relative c'' {
    g4 a\breve*1/4 g4
    g4 a\breve*1/4 a4
  }
  \new NullVoice = "aligner" {
    g4 a8*4/5 a a a a g4
    g4 a8 a4 a8 a4
  }
  \new Lyrics \lyricsto "aligner" {
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = 
#2.5

    Through our Lord Jesus Christ, your Son,
    \startStackedLyric "who" "who"
    \stackedLyric "lives" "live"
    \stackedLyric "and reigns" "and reign"
    \stopStackedLyric
    with
  }
>>
\layout {
  \context {
    \Lyrics
    \consists "Text_spanner_engraver"
  }
}

%%-

Note that \stopStackedLyric requires a separate note in the NullVoice. 
Its note value affects the length to the right of the horizontal line.


I used a somehow similar solution for function theory symbols, based on 
the snipped lsr.di.unimi.it/LSR/Item?id=967 
<https://lsr.di.unimi.it/LSR/Item?id=967> by Klaus Blum.



All the best,

Thomas

--
Thomas Richter
Vienna / Austria
thomas-rich...@aon.at

Re: Is there a property that would set all of the "above staff" text to "above chordnames"

2024-01-01 Thread Thomas Morley
Am Mo., 1. Jan. 2024 um 21:59 Uhr schrieb :
>
> On Mon, 1 Jan 2024, Kevin Cole wrote:
>
> > What I mean is, I often have a situation where there's only a wee bit
> > o' text occasionally, above the staff. But I frequently have
> > ChordNames. It seems to me that the ChordNames would be better placed
> > below the occasional text, and I was hoping that, rather than manually
>
> You can't really put the text in a Staff and have ChordNames appear
> between the text and the staff, because ChordNames is a context kind of
> like a staff in itself.  Trying to position it in the middle of a Staff
> context is a recipe for annoyance.  But if you're willing to define the
> text separately, you could create a Dynamics context and put your text
> there to get a similar visual effect.  The nonstaff-nonstaff padding
> override can be varied to taste; without it, the text collides with the
> top of the ChordNames in an unsightly way.
>
> global = {
>   \time 4/4
>   \key c \major
> }
>
> textMarkups = {
>   s1^\markup \bold "CHORUS" |
>   s1 |
>   s1 |
>   s1 |
> }
>
> chordNames = \chordmode {
>   \global
>   f2 d2:m | c4 s4 c8 g8:7 c4 | g4 c4 f4 c4 | g4 s4 g2:7|
> }
>
> melody = \relative c'' {
>   \global
>   \clef treble
>   a2 f2 |
>   g4 g4 g8[ f8] e4 |
>   d4. e8 f4 e4 |
>   d4 b4 g2 |
> }
>
> \score {
>   <<
> \new Dynamics \with {
>   \override VerticalAxisGroup.nonstaff-nonstaff-spacing.padding = #1
> } { \textMarkups }
> \new ChordNames \chordNames
> \new Voice = "mel" { \melody }
>   >>
> }
>
> --
> Matthew Skala
> msk...@ansuz.sooke.bc.ca People before tribes.
> https://ansuz.sooke.bc.ca/
>

A Dynamics may be a solution.
For things like "CHORUS" I'd always use \textMark. It will
automatically be placed on top.
In a ChordNames context TextScript is not supported by default,
additionally the usual direction-modifiers "-" and "^" are already
taken for different purpose. But you could do:

\new ChordNames
  \with { \consists Text_engraver }
  \chordmode {
d2:m _\tweak direction #UP _\markup "put me above the chordname"
  }

Cheers,
  Harm



Problems while defining an aligning mark-spanner

2023-12-30 Thread Thomas Morley
Hi,

please have a look at the code below.
It is an attempt to implement an aligning spanner between certain
marks at score-level.
Here I use TextMark and a newly defined TextMarkSpanner-grob.

Currently the TextNarks are moved, which is nice. Though, it relies on
the highest element in the Staff, regardles if it's under the spanner
or not.
It should only rely on the elements covered by said spanner.

Furthermore, skylines are not working for the moved TextMarks.
Consequently -dcrop does not work as wished.

What am I missing or doing wrongly?

Disclaimer:
This is stripped down code only meant for demonstration. Although, the
given example compiles, don't use it for serious work.

Thanks,
  Harm

\version "2.25.11"

#(define (add-grob-definition grob-entry)
   (set! all-grob-descriptions
 (cons
  ((@@ (lily) completize-grob-entry) grob-entry)
  all-grob-descriptions)))

#(define-event-class 'text-mark-line-spanner-interface 'span-event)

#(define text-mark-spanner-types
   '((TextMarkSpanEvent
  . ((description . "DOCME")
 (types . (text-mark-span-event span-event event))

#(set!
  text-mark-spanner-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)))
   text-mark-spanner-types))

#(set! music-descriptions
   (sort (append text-mark-spanner-types music-descriptions) alist
  \once \override Score.TextMark.color = #red
  \textMark "bar"
  b'
}


Re: right enharmonic spelling

2023-12-09 Thread Stefan Thomas
Dear David,
thanks for your reply. But would also a solution with regex be possible?

David Kastrup  schrieb am Sa., 9. Dez. 2023, 13:49:

> Stefan Thomas  writes:
>
> > Dear community,
> > I'm using a lot frescobaldi with MIDI input. I would like to know is how
> > could I achieve automatically the right enharmonic spelling. e.g. when I
> > want to get bis instead of c'?
>
> If I remember correctly, the MIDI entry box allowed you to set the key
> it was working with.  Just bump the number of sharps until you like the
> enharmonic spelling.
>
> --
> David Kastrup
>


right enharmonic spelling

2023-12-09 Thread Stefan Thomas
Dear community,
I'm using a lot frescobaldi with MIDI input. I would like to know is how
could I achieve automatically the right enharmonic spelling. e.g. when I
want to get bis instead of c'?
Maybee one could usw a python Script with python.ly?


Re: programming error: Improbable offset for stencil: -inf staff space,Setting to zero.

2023-11-19 Thread Thomas Morley
Am So., 19. Nov. 2023 um 15:30 Uhr schrieb Michael Gerdau :
>
> Hi lilyponders!
>
> the attached fairly short script creates 4x the aforementioned error. It
> seems to be created by the combined
>\tweak Parentheses.font-size #2 \parenthesize
>
> The resulting score looks basically fine (AFAICT) but I guess this error
> should not occur anyway.
>
> This happens both with 2.25.9 and 2.25.10
>
> Kind regards,
> Michael
> --
>   Michael Gerdau   email: m...@qata.de
>   GPG-keys available on request or at public keyserver

Well, the output is not ok. Look at the begin of measure 13, those
small parentheses...
A minimal:

\version "2.25.10" %% happens with 2.24. already
{
  \override DynamicTextSpanner.style = #'none
  b1-\parenthesize \cresc \break b\f
}

Imho a bug.

You're brobably better of doing:

{
  \set crescendoSpanner = #'text
  \set crescendoText = "(cresc.)"
  \override DynamicTextSpanner.style = #'none
  b1\< \break b\f
}

Cheers,
  Harm



Re: LilyPond 2.25.10

2023-11-18 Thread Thomas Morley
Am Fr., 17. Nov. 2023 um 21:33 Uhr schrieb Michael Gerdau :
>
> >>> I will try to create a MWE if that is required to track down the
> >>> problem.
> >>
> >>
> >> A *minimal* example is not strictly required (though helpful), but
> >> *some* example is — otherwise, there is nothing we can do, sorry.
> >
> > Attached is a fairly short example that shows the described behaviour
> > with 2.25.10
> >
> > The problem seems to be created by the code copied from LSR snippet 888.
> > When the \layout{} section is commented out, everything compiles fine.
> > So maybe it's not a lilypond problem but one of LSR snippet 888.
>
> The attached example from the previous email did have a function
> \paradyn not removed. The attached version does have it removed. Sorry
> for sending the wrong file.
>
> As an additional finding:
> Not only removing the \layout{} does make the error go away, removing
> the  '\new ChoirStaff <<' with the corresponding '>>' makes the error go
> away as well.
>
> Not sure what the problem could be.
>
> Kind regards,
> Michael
> --
>   Michael Gerdau   email: m...@qata.de
>   GPG-keys available on request or at public keyserver

The problem is said LSR-snippet. The LSR runs 2.24., though with 2.25.10
(ly:grob-property-data lyric-text-grob 'self-alignment-X)
may return a procedure. The snippet needs to learn how to deal with it.
Fixed in LSR.
https://lsr.di.unimi.it/LSR/Item?id=888

Cheers,
  Harm



Re: FYI: recent MacPorts ghostscript upgrade causes Lilypond 2.24.2 warning from Guile

2023-11-16 Thread Thomas Scharkowski



> Am 15.11.2023 um 21:26 schrieb Kenneth Wolcott :
> 
> Thanks, Jean, I wasn't sure that this was a different thing with
> ghostscript or not, just thought I'd mention it.  Yes, I am using the
> Lilypond tarball now in place of the MacPorts Lilypond.  I am looking
> forward to the new Lilypond release...
> 
> Thanks,
> Ken
> 
> On Wed, Nov 15, 2023 at 11:41 AM Jean Abou Samra  wrote:
>> 
>> Thanks, but we already know about this. See 
>> https://gitlab.com/lilypond/lilypond/-/issues/6675 and the various recent 
>> threads about Homebrew on this list.
>> 
>> We are unfortunately unlikely to convince package maintainers to downgrade 
>> Ghostscript to 10.02.0 since the change that broke LilyPond was a security 
>> fix.
>> 
>> LilyPond 2.24.3 is going to be released quite soon with a workaround on our 
>> side that should fix this issue. Meanwhile, it's best to use binaries from 
>> lilypond.org.
> 
I get this error with MacPorts lilypond 2.25.8 and ghostscript @10.02.1_0+x11
/opt/local/share/lilypond/2.25.8/ly/init.ly:66:2: Fehler: Guile signaled an 
error for the expression beginning here
#
 (let ((book-handler (if (defined? 'default-toplevel-book-handler)
Throw to key `ly-file-failed' with args `()'.

I downgraded to ghostscript @10.02.0_0+x11 so it works again.

Thomas
 


Re: programming error: note-column has no direction

2023-10-12 Thread Thomas Morley
Am Sa., 7. Okt. 2023 um 19:23 Uhr schrieb Valentin Petzel :
>
> Hello Harm,
>
> The error you are seeing is caused by handling NoteCollisions. This has
> different behavior depending on the direction of the note column. The 
> direction
> is set by the stem engraver, which is removed in this context.
>
> To get rid of this message we can either remove collision handling alltogether
> by doing
>
> \layout {
>   \context {
> \GregorianTranscriptionStaff
> \remove Collision_engraver
>   }
> }
>
> or we can let Lilypond properly handle collision by having a Stem grob
> created, but not actually printed:
>
> \layout {
>   \context {
> \GregorianTranscriptionVoice
> \consists Stem_engraver
> \omit Stem
>   }
> }
>
> The second one is most likely the more stable one, as other places might also
> assume that a note column does always have a stem.
>
> Regarding whether this is a valid bug: Basically we are running into UB here.
> This context is explicitely intended for transcribing gregorian chant, so we
> would not expect polyphony in the first place. But I think no syntactically
> correct Lilypond code should trigger an internal error, so I’d say there are
> these two paths to resove this:
>
>  → Remove the very concept of collision from these contexts or
>  → Allow the context to create silent Stem grobs
>
> I do not know if there is any reason for not engraving the stems, but if there
> isn’t I’d say the latter one is the more stable path.
>
> Cheers,
> Valentin
>
> Am Samstag, 7. Oktober 2023, 10:35:20 CEST schrieb Thomas Morley:
> > Hi,
> >
> > this came up in the german forum:
> > https://lilypondforum.de/index.php/topic,1280.msg6613.html
> >
> > A more minimel example:
> >
> > \version "2.24.2"
> >
> > %% \include "gregorian.ly"
> > %%
> > %% \layout {
> > %%   \context {
> > %% \GregorianTranscriptionVoice
> > %% \consists Stem_engraver
> > %% \omit Stem
> > %%   }
> > %% }
> >
> > \new GregorianTranscriptionStaff
> >   <<
> > \new GregorianTranscriptionVoice
> > { \voiceOne b' }
> > \new GregorianTranscriptionVoice
> > { \voiceTwo g' }
> >
> >
> > Returns:
> > programming error: note-column has no direction
> > { \voiceOne
> > b' }
> >
> > Looks like its triggered by the removed Stem_engraver in 2.24., thus a
> > first fix is to reconsist said engraver and omit Stems.
> >
> > Is this a valid bug?
> >
> >
> > Thanks,
> >   Harm
>

Hi Valentin,

thanks for your hints.
Though, please have a look at https://lsr.di.unimi.it/LSR/Item?id=104
Current 2.24.-output is simply wrong.
I see two possibilities to fix it:
a) tweak Voice-context
b) use GregorianTranscriptionVoice instead
The former will add a bunch of overrides and other settings to an
otherwise simple snippet.
With GregorianTranscriptionVoice one could even delete some of the
present overrides, making for:

\version "2.14.0"

\score {
  <<
\context GregorianTranscriptionVoice \transpose c c' {
  g4( a) g^\markup { "divisio minima" }
  \divisioMinima
  g4( a) g^\markup { "divisio maior" }
  \divisioMaior
  g4( a) g^\markup { "divisio maxima" }
  \divisioMaxima
  g4( a) g^\markup { "  finalis" }
  \finalis
  \break
  g4( a) g
  ^\markup { "virgula" }
  \virgula
  g4( a) g
  ^\markup { "caesura" }
  \caesura
  g4( a) g
}
\new  Lyrics \lyricsto "" {
  Blah blub, blah blam.
  Blah blub, blah blam.
  Blah blub, blah blam.
  Blah blub.
}
  >>
}

Alas, a plethora of "programming error: no stem for note column" for
this non-polyphonic snippet is returned. Furthermore removing
Collision_engraver takes no effect.One needs to add the already
mentioned:

\layout {
  \context {
\GregorianTranscriptionVoice
\consists Stem_engraver
\omit Stem
  }
}

Thus, I lean toward calling it a bug.
Opinions?

Thanks,
  Harm



programming error: note-column has no direction

2023-10-07 Thread Thomas Morley
Hi,

this came up in the german forum:
https://lilypondforum.de/index.php/topic,1280.msg6613.html

A more minimel example:

\version "2.24.2"

%% \include "gregorian.ly"
%%
%% \layout {
%%   \context {
%% \GregorianTranscriptionVoice
%% \consists Stem_engraver
%% \omit Stem
%%   }
%% }

\new GregorianTranscriptionStaff
  <<
\new GregorianTranscriptionVoice
{ \voiceOne b' }
\new GregorianTranscriptionVoice
{ \voiceTwo g' }
  >>

Returns:
programming error: note-column has no direction
{ \voiceOne
b' }

Looks like its triggered by the removed Stem_engraver in 2.24., thus a
first fix is to reconsist said engraver and omit Stems.

Is this a valid bug?


Thanks,
  Harm



Four bar percent repeat mark?

2023-09-22 Thread Dr. Thomas Tensi

Dear all,


about 15 years ago there has been a question on (or "request
for") a four bar percent repeat mark.

As far as I see this has not yet been implemented in Lilypond
possibly due to lack of user interest.  Nevertheless note that
this seems to be a common notation especially in a jazz or pop
arranger context, since it shortens and simplifies arrangements
considerably.

E.g. Steinberg Dorico can do that as can be seen on their
web page:
https://steinberg.help/dorico/v2/en/dorico/topics/notation_reference/notation_reference_bar_repeats_c.html

Any ideas whether this shall be put on the official lilypond
"change request" list?


Best regards,

    Thomas



Re: Question about condensed score

2023-08-19 Thread Thomas Morley
Am Fr., 18. Aug. 2023 um 21:51 Uhr schrieb David Kastrup :
>
> Rip _Mus  writes:
>
> > Hello,
> > does anyone happen to have an answer?
> > I just can't understand this behavior...
> >
> > Thank you
> >
> > Il mer 16 ago 2023, 08:18 Rip _Mus  ha
> > scritto:
> >
> >> Good morning everyone,
> >> going back to the solution written by David, I found that simply adding
> >> the Duration_line_engraver causes the example to fail to compile.
> >> Can anyone tell me why this happens?
>
> This is just the Duration_line_engraver unable to deal with frenched
> scores (basically, it needs to check that a grob is still live before
> doing certain operations on it).  This is easy to get wrong since
> frenched scores are not typically specifically tested for.
>
> Putting its original author in Cc.
>
> --
> David Kastrup

Embarrassingly already

\version "2.25.7"

\layout {
  \context {
\Voice
\consists "Duration_line_engraver"
  }
}

\partCombine
  \relative c' { e1 r e }
  \relative c' { c1 r e }

fails.
Patch is up, though:
https://gitlab.com/lilypond/lilypond/-/merge_requests/2088

Cheers,
  Harm



Re: markup accidentals for a microtonal system

2023-08-13 Thread Thomas Richter

Hello Nike,

following your submission I extended Ekmelily to support now arbitrary 
markup (not only glyphs from an external font); see 
www.ekmelic-music.org/en/extra/ekmelily.htm 
<http://www.ekmelic-music.org/en/extra/ekmelily.htm> (version 3.11).


Maybe this is a solution for you. It defines accidentals for eighth 
tones with glyphs from LilyPond's Emmentaler font and additional markup, 
and it also works for midi output.  It uses notenames defined in 
"ekmel-48.ily", but I could also define a new set of notenames with 
suffix "et" for eighth tones upward, however, I'm not sure how to name 
downward alterations.



\version "2.24.0"
\include "ekmel-48.ily"

arrow = \markup {
    \override #'(thickness . 1.45)
    \overlay {
    \draw-line #'(0.01 . -2)
    \draw-line #'(-0.3 . -0.7)
    \draw-line #'(0.3 . -0.7)
    }}

\ekmelicUserStyle myeighthnotation #`(
    (1/8 ,(markup #:translate '(0 . 0.4) arrow))
    (-1/8 ,(markup #:translate '(0 . 1.5) #:rotate 180 arrow))
    (1/4 ,(markup #:musicglyph "accidentals.sharp.slashslash.stem"))
    (-1/4 ,(markup #:musicglyph "accidentals.mirroredflat"))
    (3/8 ,(markup #:combine
    #:musicglyph "accidentals.sharp.slashslash.stem"
    #:translate '(0.35 . 2.5) arrow))
    (-3/8 ,(markup #:combine
    #:musicglyph "accidentals.mirroredflat"
    #:translate '(0.7 . 0) #:rotate 180 arrow))
    (1/2 ,(markup #:sharp))
    (-1/2 ,(markup #:flat))
    (5/8 ,(markup #:musicglyph "accidentals.sharp.arrowup"))
    (-5/8 ,(markup #:musicglyph "accidentals.flat.arrowdown"))
    (3/4 ,(markup #:musicglyph 
"accidentals.sharp.slashslash.stemstemstem"))

    (-3/4 ,(markup #:musicglyph "accidentals.mirroredflat.flat"))
    (7/8 ,(markup #:combine
    #:musicglyph "accidentals.sharp.slashslash.stemstemstem"
    #:translate '(1.24 . 2.5) arrow))
    (-7/8 ,(markup #:combine
    #:musicglyph "accidentals.mirroredflat.flat"
    #:translate '(0.8 . 0) #:rotate 180 arrow))
    (1 ,(markup #:doublesharp))
    (-1 ,(markup #:doubleflat))
)

\fixed c' {
    cil cih cisel cis cisil cisih cisisel cisis
    del deh desil des desel deseh desesil deses
}

Regards,
Thomas Richter


multiple transpositions

2023-08-12 Thread Stefan Thomas
Dear community,
is it possible to transpose a sequence of notes with only one motif several
times at once?
I'have in mind something like this:
motiv = { c'4 d' e' c' }
\multitranspose d e fis gis \motiv
% result:  d'4 e' fis' d'   e' fis' gis' e'e' fis' gis' e' gis'
ais' bis' gis'
Or maybee something like recursive transposition could be done?
For example, as in the snippet above, a motif is to be transposed several
times by a certain interval.
Thanks for Your help
Stefan


Re: A query about tablature

2023-08-08 Thread Thomas Morley
Am Di., 8. Aug. 2023 um 11:14 Uhr schrieb Lukas-Fabian Moser :
>
> Hi Alasdair,
>
> > Thank you very much - that is quite amazing!
> You're very welcome.
> > But it does show what I have long suspected: that without some extra
> > programming, Lilypond does not have a current facility to extract the
> > rhythm from a music definition.  All of the tablatures I've seen in
> > Lilypond require the music to be entered twice: once fully, and the
> > other as durations only.   As well, the tablature section in the
> > documentation nowhere shows how to do this: to create a tablature
> > score with just the rhythm above it.   Maybe this will be amended in
> > future versions?
> > [...]
> > I should add that those remarks of mine were not meant as complaints
> > about Lilypond; merely as observations.  I'm very aware that as an
> > open-source project, Lilypond's strength derives from the hard,
> > unpaid, tireless and often thankless work by its developers.  It is
> > often said about open source projects that if you want some
> > particular functionality, you should write it yourself and submit it
> > for review.  However, my programming skills (at least in scheme) are
> > too poor for this myself.
> Well, I think the point with LilyPond is that - unlike other open-source
> projects - you actually don't have to modify the program itself in order
> to add new functionality, but instead, you can implement the function
> you want _inside_ your own .ly file which you can re-use, share and put
> on a snippet repository. I have lots of custom-tailored functions like
> this in an include file (.ily) on my computer which I simply \include in
> any project where I need them.
>
> So that's what I recommend for you: Just copy the relevant parts of my
> code into a .ily file and \include it whenever you need to use tablature.
>
> Of course I concede that I needed to know a bit about LilyPond's inner
> workings and about Scheme to write a function like this. But nowadays
> there's even lots of well-written documentation that can get you
> started; do you know Jean's manual on https://extending-lilypond.gitlab.io ?
>
> > But maybe your code could be submitted to be part of Lilypond in future?
> That's always a possibility, but the way I see it, there are two
> requirements for this:
>
> 1) The desired functionality should be sufficiently "general" or
> "standard" that there's a chance that it'll actually be being used. I
> don't know much about tabulature, so I can't really judge if the
> notation you want to use is standard in some area.
>
> 2) The submitted code should be of high quality. That's definitely not
> the case with the function I wrote yesterday; it would need quite a bit
> of polishing in order to gracefully deal with special cases and so on.
> (E.g. how should we deal with polyphony inside the given music?)
>
> At the moment I feel that my function would probably best be put in a
> LSR snippet, so maybe I should do this.
>
> As a side remark: In order to put music into a RhythmicStaff, one
> doesn't even have to remove the pitches, they will just be ignored. But
> I noticed yesterday that LilyPond does not behave very well with chords
> in that situation:
>
> \version "2.24.0"
>
> mus = { c' d' 4. f'8 }
>
> <<
>\new RhythmicStaff \mus
>\new Staff \mus
>  >>
>
> I'm not sure whether that should be called a bug: one would have to
> think a bit about the most natural way to deal with chords here.
>
> Lukas
>
>
>

There's also an old thread on -devel
https://lists.gnu.org/archive/html/lilypond-devel/2016-09/msg00023.html
This is the last public code. After that the discussion went offlist.
Anway, this code is unfinished, maybe one gets some ideas, though.

Cheers,
  Harm



Re: Retrieve context properties

2023-07-23 Thread Thomas Morley
Am So., 23. Juli 2023 um 10:03 Uhr schrieb Rip _Mus
:
>
> Thank you Valentin,
> this is very helpful!
> The situation is that I always create a custom context, named "Tactus", that 
> creates bars for proportional notation (it's a Dynamics alias, that accepts 
> Voice and some overrides, transparent noteheads, offset, etc.).
> During the insertion of notes, if I want a passage with Tactus bars onto the 
> current staff, I always write something like
>
> \new Staff = "main_staff_context" {
> %...
> <<
> { %music }
> \new Tactus \with { alignAboveContext = "main_staff_context"}
> { c4 c c c %...
>  }
> >>
> %...
> }
>
>
> Now, I find this very redundant, because it's glaring that the Tactus is to 
> be aligned above the current Staff context.
>
> I just have to figure out how to avoid having to write it, so I imagined I 
> could track down the name of the current context.
> The fact of having to access it during the translation process I think is the 
> greatest difficulty.
>
> What do you think?
>
> Rip_mus
>
> Il giorno dom 23 lug 2023 alle ore 09:34 Valentin Petzel  
> ha scritto:
>>
>> Hello Rip_Mus,
>>
>> you can obtain the name of a context using ly::context-id, and the type of a
>> context using ly:context-name.
>>
>> The problem is that you can only really use these only during the translation
>> step. So I thing the easiest way would be to create an engraver that adds 
>> this
>> information:
>>
>> #(define ((annotate-ctx-engraver which) context)
>>(define (extract-context-hierarchy ctx)
>>  (if ctx
>>  (cons (cons (ly:context-name ctx) (ly:context-id ctx)) (extract-
>> context-hierarchy (ly:context-parent ctx)))
>>  '()))
>>(let* ((hierarchy (extract-context-hierarchy context))
>>   (hierarchy (filter (lambda (x) (member (car x) which)) hierarchy))
>>   (hierarchy-markups (map (lambda (x) (format #f "~a: ~a" (car x) 
>> (cdr
>> x))) hierarchy))
>>   (hierarchy-markup (primitive-eval (list 'markup #:column hierarchy-
>> markups
>>  (make-engraver
>>  (acknowledgers
>>((grob-interface engraver grob source-engraver)
>> (let* ((det (ly:grob-property grob 'details))
>>(annotate (assoc-get 'annotate-context det)))
>>   (if annotate
>>   (let ((text-grob (ly:engraver-make-grob engraver 'TextScript
>> '(
>> (ly:grob-set-property! text-grob 'text hierarchy-
>> markup)
>>
>> \layout {
>>   \context {
>> \Voice
>> \consists #(annotate-ctx-engraver '(Staff Voice))
>>   }
>> }
>>
>> \new Staff = "the-staff" \new Voice = "the-one-and-only-voice" {
>>   c' d' \override NoteHead.details.annotate-context = ##t e
>> }
>>
>> Cheers,
>> Valentin
>>
>> Am Sonntag, 23. Juli 2023, 08:37:52 CEST schrieb Rip _Mus:
>> > Good morning,
>> > is it possible to retrieve the name of the Voice and Staff contexts during
>> > the insertion of the music (as if I wanted to use it to automatically print
>> > the name of these contexts on a markup of a note)?
>> >
>> > Thank you
>> >
>> > Rip_mus
>>

Hi,

I still don't understand what you want to achieve with the "Tactus"-context.
Nevertheless here another possibility to get context-name/id in a markup.

\version "2.24.0"

printCtx = {
  \applyOutput
Bottom.TextScript
#(lambda (grob current-ctx target-context)
;; `current-ctx' is the context where this command is applied
;; `target-conetxt' is the context which is specified above, here: Bottom
;; (uncomment below and change Bottom to Staff above to see the difference)
;; (pretty-print target-context)
  (ly:grob-set-property! grob 'text
(format #f "In ~a named ~a"
  (ly:context-name current-ctx)
  (ly:context-id current-ctx
   <>-""
}

\new Staff = "my-staff"
  \new Voice = "my-voice"
{ \printCtx b }

Cheers,
  Harm



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


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: In-staff fermata with 2.25.

2023-06-07 Thread Thomas Morley
Hi Jean,

Am Mi., 7. Juni 2023 um 23:31 Uhr schrieb Jean Abou Samra :
>
> Le mercredi 07 juin 2023 à 23:07 +0200, Thomas Morley a écrit :
>
> Hi,
>
> this came up in the german forum:
> https://lilypondforum.de/index.php/topic,1247.msg6512.html
>
> How to print fermata _in_ staff with 2.25.?
>
>
>
> Amusingly, the same question was asked on the French-speaking list today.
>
> You have to use
> \tweak outside-staff-priority ##f \fermata

thanks!
Though, below commit-message does not explain why a tweak works, but
an override not.
Personally I think this is very strange and apart from that, totally
undocumented.
Do we have other, but similar, situations where a tweak works an override not?

> due to
>
> commit 3185bdd345acf338f748f1d604e101578285e1fe
> Author: Martín Rincón Botero 
> Date: Sat Jan 7 22:45:51 2023 +0100
>
> Outside-staff-priority for fermatas
> According to Gould there is no difference in the vertical stacking
> of trills and trill spanners, which should be below a fermata.
> This is confirmed with all published editions of Debussy's "L'isle
> Joyeuse" on IMSLP, amongst other various snippets of
> unidentifiable sources. An outside-staff-priority for fermatas
> was accordingly given.
>
>
> Jean
>

Thanks agian,
  Harm



In-staff fermata with 2.25.

2023-06-07 Thread Thomas Morley
Hi,

this came up in the german forum:
https://lilypondforum.de/index.php/topic,1247.msg6512.html

How to print fermata _in_ staff with 2.25.?

Below works with 2.24.
\version "2.24.1"

%#(ly:set-option 'debug-skylines #t)

\layout {
  \override Score.VerticalAxisGroup.default-staff-staff-spacing.basic-distance
= 0
  \override Score.VerticalAxisGroup.default-staff-staff-spacing.minimum-distance
= 0
}

<<
  \new Staff { \clef bass R1*6 }
  \new Staff {
\clef bass
\override Script.staff-padding = ##f
c1\fermata
d\fermata
e\fermata
\override Script.direction = #DOWN
e\fermata
f\fermata
g\fermata
  }
>>

But not with 2.25.

Any hints?

Thanks,
  Harm



Missing documentation archives for 2.24 and 2.25

2023-05-02 Thread Thomas Weißschuh
Hi,

it seems the documenation archives for 2.24 (and 2.25) are missing from
https://lilypond.org/downloads/binaries/documentation/ .

Thomas



Re: Circular staves

2023-04-23 Thread Thomas Morley
Am So., 23. Apr. 2023 um 04:38 Uhr schrieb Andrew Bernard
:
>
> Just checking - you can't make circular staves with notes in lilypond,
> can you? I know you can do nice circle of fifths diagrams as per an LSR
> example, but circular staves are way out of scope, aren't they?
>
> This came up in the Dorico forum and several users assert with no
> evidence or examples that lilypond can, so I wanted to check my view.
>
> Andrew
>
>
>
Hi Andrew,

we have https://lsr.di.unimi.it/LSR/Item?id=1005
Not exactly what you asked for though.

Cheers,
  Harm



Re: Bounding box for rotated markup

2023-04-10 Thread Thomas Morley
Am So., 9. Apr. 2023 um 12:16 Uhr schrieb Jean Abou Samra :
>
>
>
> > Le 9 avr. 2023 à 10:50, Thomas Morley  a écrit :
> >
> > Hi,
> >
> > please consider following code:
> >
> > pol = \markup \polygon #'((0 . 2) (10 . 0) (10 . 20) (0 . 22))
> > \markup \override #'(box-padding . 0) \box { \pol \rotate #45 \pol }
> >
> > See attached image.
> > How to get \box tight to the rotated polygon?
>
>
> (Untested) Try \with-true-dimensions.
>
>

Hi Jean,

thanks for the hint, works now.
Especially the there used `stencil-true-extent' is great.

Best,
  Harm



Bounding box for rotated markup

2023-04-09 Thread Thomas Morley
Hi,

please consider following code:

pol = \markup \polygon #'((0 . 2) (10 . 0) (10 . 20) (0 . 22))
\markup \override #'(box-padding . 0) \box { \pol \rotate #45 \pol }

See attached image.
How to get \box tight to the rotated polygon?

Thanks,
  Harm


Re: \rightHandFinger in banjo tablature

2023-03-22 Thread Thomas Widmann
Thanks, that's perfect! :-)

Cheers,
Thomas

Den ons. 22. mar. 2023 kl. 21.10 skrev Jean Abou Samra :
>
> Le mercredi 22 mars 2023 à 20:57 +0100, Thomas Widmann a écrit :
>
> Hello,
>
> it's me again with a follow-up question: I've now added \stemDown and
> adjusted the concaveness to make the banjo tablature look more like I
> want it. However, ideally I'd want all the right hand fingerings
> aligned on one line, but they keep jumping up and down (because of
> where the beams end). I've played around with
> Stem.details.beamed-lengths and
> Stem.details.beamed-minimum-free-lengths, but it's still not looking
> right.
>
> Any ideas? Here's my code:
>
> Try a Y-offset override:
>
> \version "2.24.1"
>
> fT = \rightHandFinger #1
> fI = \rightHandFinger #2
> fM= \rightHandFinger #3
>
> music = {
> gis16\fT
>   (\glissando a)
>   b8 \fI
>   g'\5\fT
>   d' \fM
>   g \fT
>   b \fI
>   g'\5 \fT
>   d' \fM
>   |
>   c'4 \fI
>   g'8\5 \fT
>   c' \fI
>   e' \fM
>   g'\5 \fT
>   c' \fI
>   e' \fM
> }
>
> \new TabStaff \with {
>   \tabFullNotation
>   tablatureFormat = #fret-number-tablature-format-banjo
>   stringTunings = #banjo-open-g-tuning
>   \consists New_fingering_engraver
>   \override StrokeFinger.digit-names = ##("T" "I" "M" "R" "P")
>   strokeFingerOrientations = #'(down)
>   \override StrokeFinger.Y-offset = -10
> } {
>   \stemDown
>   %\override Beam.concaveness = #1
>   \music
> }
>
> https://lilypond.org/doc/v2.24/Documentation/notation/aligning-objects.html#setting-x_002doffset-and-y_002doffset-directly



-- 
Thomas Widmann
Rugårdsvej 821
Stillebæk
DK-5474 Veflinge
Email: t...@bibulus.org



Re: \rightHandFinger in banjo tablature

2023-03-22 Thread Thomas Widmann
Hello,

it's me again with a follow-up question: I've now added \stemDown and
adjusted the concaveness to make the banjo tablature look more like I
want it. However, ideally I'd want all the right hand fingerings
aligned on one line, but they keep jumping up and down (because of
where the beams end). I've played around with
Stem.details.beamed-lengths and
Stem.details.beamed-minimum-free-lengths, but it's still not looking
right.

Any ideas? Here's my code:

fT = \rightHandFinger #1
fI = \rightHandFinger #2
fM= \rightHandFinger #3

music = {
gis16\fT
  (\glissando a)
  b8 \fI
  g'\5\fT
  d' \fM
  g \fT
  b \fI
  g'\5 \fT
  d' \fM
  |
  c'4 \fI
  g'8\5 \fT
  c' \fI
  e' \fM
  g'\5 \fT
  c' \fI
  e' \fM
}

 \new TabStaff \with { \tabFullNotation
tablatureFormat = #fret-number-tablature-format-banjo
stringTunings = #banjo-open-g-tuning
  \consists New_fingering_engraver
  \override StrokeFinger.digit-names = ##("T" "I" "M" "R" "P")
strokeFingerOrientations = #'(down)
}{
  \stemDown
  \override Beam.concaveness = #1
  \music
}

Den tirs. 21. mar. 2023 kl. 21.12 skrev Michael Werner :
>
> Hi Thomas -
>
> On Tue, Mar 21, 2023 at 3:28 PM Thomas Widmann  wrote:
>>
>> Hello,
>>
>> I'm trying to produce banjo tablatures similar to the ones seen here: 
>> <https://eligilbertbanjo.com/wp-content/uploads/2021/01/30-Days-of-Banjo.pdf>
>>
>> In general it's working well, but I seem unable to get the right hand 
>> fingerings to show in the tablature. A simple example:
>>
>> fT = \rightHandFinger #1
>> fI = \rightHandFinger #2
>> fM= \rightHandFinger #3
>>
>> music = {
>>  \set strokeFingerOrientations = #'(down)
>>   g8\fT
>>   b \fI
>>   g'\5\fT
>>   d' \fM
>>   g \fT
>>   b \fI
>>   g'\5 \fT
>>   d' \fM
>> }
>>
>>  \new TabStaff \with { \tabFullNotation
>> tablatureFormat = #fret-number-tablature-format-banjo
>> stringTunings = #banjo-open-g-tuning
>>  }{ \music }
>>
>> If I add a normal Staff, the right hand fingerings will show up there, but I 
>> only want the tablature.
>
>
> Turns out that the right hand fingerings are produced by an engraver that 
> isn't normally a part of the TabStaff context. But it's easily enough added 
> in, like this:
>
> \new TabStaff \with {
>   \tabFullNotation
>   \consists New_fingering_engraver
>   tablatureFormat = #fret-number-tablature-format-banjo
>   stringTunings = #banjo-open-g-tuning
> }
>
> The \consists command is what's used to add an engraver to a context. 
> Conversly, the \remove command will remove an engraver and all of what that 
> engraver produces.
>
>>
>> Furthermore, I'd prefer the fingers to be called T, I and M rather than p, i 
>> and m. How would I do that?
>
>
> One more line added into the \with block takes care of that, resulting in:
>
> \new TabStaff \with {
>   \tabFullNotation
>   \consists New_fingering_engraver
>   tablatureFormat = #fret-number-tablature-format-banjo
>   stringTunings = #banjo-open-g-tuning
>   \override StrokeFinger.digit-names = ##("T" "I" "M" "a" "x")
>   strokeFingerOrientations = #'(down)
> }
>
> The first three right-hand fingerings are changed to what you listed, while 
> the other two are the defaults. Also the strokeFingerOrientations seemed to 
> need moved into the \with block to take effect.
>
> michael



-- 
Thomas Widmann
Rugårdsvej 821
Stillebæk
DK-5474 Veflinge
Email: t...@bibulus.org



Re: \rightHandFinger in banjo tablature

2023-03-21 Thread Thomas Widmann
Hi Michael,

that works beautifully – thanks a million!

Cheers,
Thomas
-- 
Thomas Widmann
Email: t...@bibulus.org



\rightHandFinger in banjo tablature

2023-03-21 Thread Thomas Widmann
Hello,

I'm trying to produce banjo tablatures similar to the ones seen here: <
https://eligilbertbanjo.com/wp-content/uploads/2021/01/30-Days-of-Banjo.pdf>

In general it's working well, but I seem unable to get the right hand
fingerings to show in the tablature. A simple example:

fT = \rightHandFinger #1
fI = \rightHandFinger #2
fM= \rightHandFinger #3

music = {
 \set strokeFingerOrientations = #'(down)
  g8\fT
  b \fI
  g'\5\fT
  d' \fM
  g \fT
  b \fI
  g'\5 \fT
  d' \fM
}

 \new TabStaff \with { \tabFullNotation
tablatureFormat = #fret-number-tablature-format-banjo
stringTunings = #banjo-open-g-tuning
 }{ \music }

If I add a normal Staff, the right hand fingerings will show up there, but
I only want the tablature.

Furthermore, I'd prefer the fingers to be called T, I and M rather than p,
i and m. How would I do that?

Thanks a lot!

Thomas
-- 
Thomas Widmann
Email: t...@bibulus.org


Re: Programming error with change staff

2023-02-17 Thread Thomas Morley
Am Do., 16. Feb. 2023 um 19:09 Uhr schrieb Knute Snortum :
>
> I have run into a situation where LilyPond produces a programming error.  It 
> involves changing staff, voice one, accent fingering and avoid-slur.  It's 
> best to just look at the MWE:
>
> \version "2.25.1"
>
> staffUp = \change Staff = "upper"
> staffDown = \change Staff = "lower"
>
> rightHand = {
>   \new Voice {
> \voiceOne \staffDown g16->-1( \staffUp c' c' \staffDown g)
>   }
> }
>
> leftHand = { \new Voice { \clef bass s4 } }
>
> \score {
>   \new PianoStaff \with { \override Fingering.avoid-slur = #'inside } <<
> \new Staff = "upper" \rightHand
> \new Staff = "lower" \leftHand
>   >>
> }
>
> There may be a way to get this smaller, but I couldn't find it.  Is there a 
> way around this bug as it is affecting my current project?
>
> --
> Knute Snortum

Add
\override Script.avoid-slur = #'inside

Cheers,
  Harm



Re: Error in Extending Lilypond example

2023-02-01 Thread Thomas Morley
Am Mi., 1. Feb. 2023 um 04:16 Uhr schrieb Saul Tobin
:
>
> The fourth example engraver here:
> https://extending-lilypond.readthedocs.io/en/latest/extending/translation.html#fourth-engraver-example
>
> Running this code in 2.24 crashes on initializing the engraver with In
> procedure ly:spanner-set-bound!: Wrong type argument in position 3
> (expecting Item): ().

Fwiw, looks like (ly:context-property ctx 'currentCommandColumn) is
not longer available in the initialize-step of an engraver.
Not the time to bisect when and why this happened,
Here a stripped down code-example:

\version "2.24.0"

\new Voice
  \with {
\consists
#(lambda (ctx)
  (make-engraver
((initialize this-engraver)
  (newline)(display (ly:context-property ctx 'currentCommandColumn)
  }
  { b1 }

Cheers,
  Harm



Re: German notation

2023-01-29 Thread Thomas Scharkowski
Hi Wim,

I looked at the score of the Menuet - I do not find anything extraordinary 
there. The Bass clarinet in B flat (Si b) is transposed as usual. I still do 
not understand what you mean by „German“ and „French notation“.

Thomas

BTW: The French Horn parts (4 Corni) are also transposed, these are in F 
(french: Fa).


> Am 29.01.2023 um 10:29 schrieb Wim van Dommelen :
> 
> Hi Thomas,
> 
> "Short" is a dificult concept
> 
> I think the best is to point you to a live example, check entry PMLP255074 on 
> the (magnificant) IMSLP collection (do not hit print, this is bad for your 
> carbon footprint as the full score is 170 pages <;0). I myself looked at part 
> III "Menuette" (still 29 pages :-). Within the score look for the Bass 
> clarinet line and compare this score with the other instruments, both 
> concerning the pitch to play it as checking the key in which it is done. A 
> befriended professional player confirmed me this is "German notation". I'm 
> looking for help in converting this to the regular way of working.
> 
> Regards,
> Wim.
> 
> 
>> On 29 Jan 2023, at 10:00 , Thomas Scharkowski  
>> wrote:
>> 
>> Hi Wim,
>> 
>> could you provide short example?
>> 
>> Thomas
>> 
>> PS: I do not unterstand this sentence: << I want to play it properly 
>> notation (which is „French“ >>
>>> 
>>> Am 29.01.2023 um 09:43 schrieb Wim van Dommelen :
>>> 
>>> I encountered a piece written in so-called "German notation"  and I want to 
>>> play it properly notation (which is "French"
>>> 
>>> I can do the basic transposes but the key is always interfering and 
>>> produces strange results.
>>> 
>>> Is there a quick Lilypond recipe to convert this (from "German" to "French" 
>>> written) ?
>>> 
>>> Thanks,
>>> Wim van Dommelen
>>> 
>>> 
>> 
> 




Re: German notation

2023-01-29 Thread Thomas Scharkowski
Hi Wim,

could you provide short example?

Thomas

PS: I do not unterstand this sentence: << I want to play it properly notation 
(which is „French“ >>
> 
> Am 29.01.2023 um 09:43 schrieb Wim van Dommelen :
> 
> I encountered a piece written in so-called "German notation"  and I want to 
> play it properly notation (which is "French"
> 
> I can do the basic transposes but the key is always interfering and produces 
> strange results.
> 
> Is there a quick Lilypond recipe to convert this (from "German" to "French" 
> written) ?
> 
> Thanks,
> Wim van Dommelen
> 
> 




Re: Completion_heads_engraver for line-ends only?

2023-01-18 Thread Thomas Morley
Am Di., 17. Jan. 2023 um 18:32 Uhr schrieb Graham King
:
>
> I'm preparing an edition of de Wert's motet "Ascendente Jesu in naviculam" 
> which has an extended stretto section with dotted rhythms across barlines.  
> For this, Harm's Mensurstriche example in the Learning Manual produces a 
> mostly beautiful result.

As a sidenote.
I'm not the author of said snippet. It comes from LSR
https://lsr.di.unimi.it/LSR/Item?id=582
Though, as LSR editor I noticed the a programming error with 2.23,
thus I edited the comment on top of the code.
Meanwhile LSR runs 2.24.0 and the programming error is gone for this
snippet. Thus I removed the comment inside LSR.
The modified snippet will be available with next lsr-import.

Though, in general the mentioned issue is still present:
https://gitlab.com/lilypond/lilypond/-/issues/4084

Cheers,
  Harm



Re: Resize \rhythm in mixed markup

2023-01-10 Thread Thomas Morley
Am Di., 10. Jan. 2023 um 02:44 Uhr schrieb David Kastrup :
>
> Thomas Morley  writes:
>
> > Am So., 8. Jan. 2023 um 10:21 Uhr schrieb Thomas Morley
> > :
> >>
> >> Hi,
> >>
> >> consider below
> >>
> >> \version "2.24.0"
> >>
> >> \score {
> >>   { g'1^\markup { My Rhythm \rhythm { 8[ 8] } } }
> >>   \layout {
> >> \context {
> >>   \StandaloneRhythmStaff
> >>   fontSize = #6
> >> }
> >>   }
> >> }
> >>
> >> I'll have numerous such markups combining straight text and \rhythm.
> >> Thus I'd like to have a method to adjust the \rhythm-part in a
> >> score-layout without affecting other parts of TextScripts.
> >> Alas the setting fontSize takes no effect.
> >>
> >> How to?
> >>
> >> Cheers,
> >>   Harm
> >
> > Actually it works, if the \layout is placed toplevel.
> > A bug?
>
> Try <https://gitlab.com/lilypond/lilypond/-/merge_requests/1810>
>
> --
> David Kastrup

Hi David,

I used below test-code and commented/uncommented the color settings.

\layout {
  \context {
\StandaloneRhythmScore
\override NoteHead.color = #red
  }
  \context {
\StandaloneRhythmStaff
\override NoteHead.color = #green
  }
  \context {
\StandaloneRhythmVoice
\override NoteHead.color = #blue
  }
}

\markup \rhythm { { 2 } }

\score {
  { g^\markup \rhythm { { 1 } } }
  \layout {
\context {
  \StandaloneRhythmScore
  \override NoteHead.color = #cyan
}
\context {
  \StandaloneRhythmStaff
  \override NoteHead.color = #yellow
}
\context {
  \StandaloneRhythmVoice
  \override NoteHead.color = #grey
}
  }
}

Afaict, it works fine, the score-layout is taken into account and
takes precedence over the toplevel one.
Very nice!

No idea why the pipeline fails for !1810 ...

Many thanks for your work!

Best,
  H>arm



Re: Resize \rhythm in mixed markup

2023-01-08 Thread Thomas Morley
Am So., 8. Jan. 2023 um 11:13 Uhr schrieb Thomas Morley
:
>
> Am So., 8. Jan. 2023 um 10:21 Uhr schrieb Thomas Morley
> :
> >
> > Hi,
> >
> > consider below
> >
> > \version "2.24.0"
> >
> > \score {
> >   { g'1^\markup { My Rhythm \rhythm { 8[ 8] } } }
> >   \layout {
> > \context {
> >   \StandaloneRhythmStaff
> >   fontSize = #6
> > }
> >   }
> > }
> >
> > I'll have numerous such markups combining straight text and \rhythm.
> > Thus I'd like to have a method to adjust the \rhythm-part in a
> > score-layout without affecting other parts of TextScripts.
> > Alas the setting fontSize takes no effect.
> >
> > How to?
> >
> > Cheers,
> >   Harm
>
> Actually it works, if the \layout is placed toplevel.
> A bug?

Hi Jean,

I came across this and other complications while rewriting the lsr
snippet about rhythm marks.
Please take a look at
https://lsr.di.unimi.it/LSR/Item?u=1=204
with the new code (the old one is commented for now).
Several comments at toplevel and inline.

I aimed at a smaller size and all Beams and (flagged) Stems should end
at the same height.
Can this be achieved more easily?

Thanks,
  Harm



Re: Resize \rhythm in mixed markup

2023-01-08 Thread Thomas Morley
Am So., 8. Jan. 2023 um 10:21 Uhr schrieb Thomas Morley
:
>
> Hi,
>
> consider below
>
> \version "2.24.0"
>
> \score {
>   { g'1^\markup { My Rhythm \rhythm { 8[ 8] } } }
>   \layout {
> \context {
>   \StandaloneRhythmStaff
>   fontSize = #6
> }
>   }
> }
>
> I'll have numerous such markups combining straight text and \rhythm.
> Thus I'd like to have a method to adjust the \rhythm-part in a
> score-layout without affecting other parts of TextScripts.
> Alas the setting fontSize takes no effect.
>
> How to?
>
> Cheers,
>   Harm

Actually it works, if the \layout is placed toplevel.
A bug?



Resize \rhythm in mixed markup

2023-01-08 Thread Thomas Morley
Hi,

consider below

\version "2.24.0"

\score {
  { g'1^\markup { My Rhythm \rhythm { 8[ 8] } } }
  \layout {
\context {
  \StandaloneRhythmStaff
  fontSize = #6
}
  }
}

I'll have numerous such markups combining straight text and \rhythm.
Thus I'd like to have a method to adjust the \rhythm-part in a
score-layout without affecting other parts of TextScripts.
Alas the setting fontSize takes no effect.

How to?

Cheers,
  Harm



Re: How to get log only

2022-12-23 Thread Thomas Morley
Am Fr., 23. Dez. 2022 um 15:53 Uhr schrieb Jean Abou Samra :
>
> Le 23/12/2022 à 10:35, Thomas Morley a écrit :
> > Hi,
> >
> > while debugging some files I'm interested in the log only, thus I'd
> > like to avoid creating any other output.
> >$ lilypond -dlog-file=AAALOG --formats=#f
> > -ddelete-intermediate-files file-1.ly file-2.ly
> > still returns .ps-files.
> >
> > What's the correct command?
>
>
> $ lilypond -dlog-file=AAALOG -dno-print-pages file.ly
>
> Best,
> Jean
>

Thanks, I must have missed that somehow...

Cheers,
  Harm



How to get log only

2022-12-23 Thread Thomas Morley
Hi,

while debugging some files I'm interested in the log only, thus I'd
like to avoid creating any other output.
  $ lilypond -dlog-file=AAALOG --formats=#f
-ddelete-intermediate-files file-1.ly file-2.ly
still returns .ps-files.

What's the correct command?

Thanks,
  Harm



Re: Lily 2.24 vshape

2022-12-19 Thread Thomas Scharkowski
O.k, solved - just remove the "v" :-)

> Am 19.12.2022 um 09:00 schrieb Thomas Scharkowski :
> 
> How can I hide \vshape control points and polygons? There are always present 
> on screen and print.
> 
> Thank you,
> 
> Thomas





Lily 2.24 vshape

2022-12-19 Thread Thomas Scharkowski
How can I hide \vshape control points and polygons? There are always present on 
screen and print.

Thank you,

Thomas


Re: "loco" after ottava

2022-12-03 Thread Thomas Morley
Am Sa., 3. Dez. 2022 um 16:56 Uhr schrieb Jean Abou Samra :
>
> Le 03/12/2022 à 15:41, Thomas Morley a écrit :
> > Granted, if I use -dcheck-internal-types I mostly wear my developer
> > hat. But sometimes I use it even for huge custom codings as part of
> > debugging processes.
>
>
>
> Why? What does it catch?

It catches what you describe below.
Call me a perfectionist, applying it to my custom codings.

>
> In my view, warnings about a property being set on a grob
> that has no interface for it are nothing you need to care
> about as a user. This check merely helps ensuring that the
> IR remains complete when developers add features. I see no
> reason why it would be bad to set a property on a grob even
> if it doesn't have an interface declaring this property,
> if you set another property in this grob to something that
> will read it. For example, it's a common pattern to set
> stencil to #ly:text-interface::print and text to some markup,
> even on grobs that don't have text-interface. That's fine.
> On the other hand, if you change the stencil default for
> a given grob to #ly:text-interface::print in the source,
> you shouldn't forget to add text-interface to that grob.
>
> The other thing check-internal-types catches is callbacks
> returning a value of the wrong type, but I have never
> encountered this case AFAIR.

>
> > Also, hiding internal things from mere users would arguable lead to a
> > very small IR.
> > We could just delete all internal grob and context properties.
> > Which would be a very bad thing, if I think back how often I used them...
>
>
>
> I view internal properties and internal options differently.
> LilyPond has a blurry line between users and developers.

Yep.

> "Internal" for properties draws a line between advanced users
> and other users. Internal properties are thing that you can
> use if you know how to use them from Scheme and (like many
> Scheme things) accept the lesser degree of stability that
> you can expect from them.

Agreed.

> In contrast, for me, the options
> currently listed as "internal" really only make sense if
> you are a contributor working on the source, e.g.,
> debug-gc-assert-parsed-dead catches low-level garbage
> collection problems, debug-parser is only useful if you
> know your way around the Bison / C++ parser, etc.

I will not object to the examples you mentioned.
Alas, if -dcheck-internal-types detects something in my custom code, I
feel the need to fix.
Feels not clean otherwise.
But that's probably only me...

Best,
  Harm



Re: Different default arpeggio positions

2022-12-03 Thread Thomas Morley
Am Sa., 3. Dez. 2022 um 16:35 Uhr schrieb Jean Abou Samra :
>
> Le 03/12/2022 à 15:58, Thomas Morley a écrit :
> > Ofcourse. Though, it's another  thing a (probably new) user has to
> > learn, maybe scaring him/her away.
>
>
> For someone coming from a language like Haskell, Rust,
> OCaml or now even Python, pattern matching will feel
> already familiar.
>
> Someone new to Scheme programming might be glad to discover a
> construct that is easier to remember than functions with cryptic
> names like "car", "cdr" and "cadadr".
>
>  It's a matter of point of view ...

Yep, my point of view is highly influenced by my own history:
Before I started with LilyPond I had no programming knowledge.
No Haskell, Perl, Python or whatever.
I started to learn scheme because LilyPond not always did what I
wanted her to do...

There may be more users out there with zero programming experience.
My whole point is to not increase the hurdles for them.

Other users are experienced programmers.

As always we need to strike a balance between all of them.

Best,
  Harm



Re: Different default arpeggio positions

2022-12-03 Thread Thomas Morley
Am Sa., 3. Dez. 2022 um 13:41 Uhr schrieb Jean Abou Samra :
>
> Le 02/12/2022 à 23:47, Thomas Morley a écrit :
> > I know you like pattern matching, though imho it makes things not
> > always easier for users.
>
>
>
> Yes, I like pattern matching. No, I'm not going to stop using it :-)

I don't intend to advertise you shouldn't use it, but I wanted to
mention my concerns, see below

> Sure, you have to learn it, like every construct,

Ofcourse. Though, it's another  thing a (probably new) user has to
learn, maybe scaring him/her away.
Therefore I usually code using only simple features from default
guile, using more "fancy" modules only if really neccessary.
Looks this opinion is not very wide spread. I had a similar discussion
with a guile-dev some time ago, LOL

> but it improves code clarity IMHO (especially in complex code).
>
>
> > Even for me - I don't understand that (x x)-line:
> >
> > \override Arpeggio.positions =
> >   #(grob-transformer
> > 'positions
> > (lambda (grob original)
> >   (match original
> > ((a . b) (cons (- a 5.0) (+ b 5.0)))
> > (x x  ;; <==
>
>
>
>
> This was me being too lazy to look up whether
> original might be something other than a pair,
> like #f, '() or *unspecified*, especially if
> the grob suicided itself inside the positions
> callback. In such a case, this code would have
> returned original unchanged, as
>
> (if (pair? original)
>  (cons (- (car original) 5.0) (+ (cdr original) 5.0))
>  original)
>
> This case appears not to occur, though, so that precaution
> was unnecessary.
>
> Best,
> Jean
>
Thanks for the explanation.
Iiuc, than
(x x)
is a second pattern (and return value), triggered if the first one, a
pair like (a . b), doesn't match.

Thanks,
  Harm



Re: "loco" after ottava

2022-12-03 Thread Thomas Morley
Am Sa., 3. Dez. 2022 um 15:06 Uhr schrieb Jean Abou Samra :

> -S only shows commits that changed the number of occurrences
> of the pattern, which is useful to find out when something
> was added or deleted. To find all the times a line containing
> the pattern was changed, use -G instead.

Thanks again
>
>
> > Anyway, "Add internal/external distinction to -d flags" is
> > https://gitlab.com/lilypond/lilypond/-/merge_requests/1231
> >
> >
> > That said, I researched a bit more about "check-internal-types".
> > and found we have:
> >
> > lilypond --help
> > lilypond -dhelp
> > and actually
> > lilypond -dhelp-internal
> >
> > The latter is undocumented as intended by one of the mentioned
> > patches, but shows "check-internal-types"
> >
> > I agree with separating internal/external options and not explicitley
> > documenting internal ones.
> > But not to document at all how to reach the internal ones is too much, imho.
>
>
> You can see it in "lilypond -dhelp".

Yep, that's how I found "help-internal", though I'd call that "well hidden" ;)

>
>
> > I'd vote for documenting help-internal in "Application Usage".  With a
> > short hint, something at the lines of:
> >
> > help-internal bool
> >If bool is #t, display options for internal usage. Default: #f.
> >
> > Opinions?
>
>
>
> If the purpose of internal options is to be hidden
> from the user, why add them back in the manual?
>
> What do you find -dcheck-internal-types useful for
> as a user? *If* it has functionality useful for
> non-developers, that functionality possibly shouldn't
> be internal in the first place.

Granted, if I use -dcheck-internal-types I mostly wear my developer
hat. But sometimes I use it even for huge custom codings as part of
debugging processes.

That said, we not only want to attract new users but new developers, too.
Some of them may not be experienced programmers but musicians with
some interest in coding (like me).
Playing hide and seek with them may not be appreciated...
We could place the info about -dhelp-internal in CG, but that would
spread "help-infos" over two manuals.
Thus I prefer my suggestion above.

Also, hiding internal things from mere users would arguable lead to a
very small IR.
We could just delete all internal grob and context properties.
Which would be a very bad thing, if I think back how often I used them...

Cheers,
  Harm



Re: "loco" after ottava

2022-12-03 Thread Thomas Morley
Am Sa., 3. Dez. 2022 um 13:53 Uhr schrieb Jean Abou Samra :

> Le 03/12/2022 à 13:26, Thomas Morley a écrit :

> > \version "2.23.0"
>
>
> 2.23.80, I suppose? horizontal-line-spanner is new in 2.23.6.

Ofcourse, that 8 slipped away somehow...

> > Btw, I can't find -dcheck-internal-types in the 2.23.-docs any more
> > and was not able to find out why.
> >
> > Anyone with more insight?
>
>
>
> In such cases, use
>
> $ git log -S "check-internal-types"

I didn't know about -S
Thanks.

Alas, this command extended as
$ git log -S "check-internal-types" --oneline --author="Han-Wen"
prints for me:
$ git log -S "check-internal-types" --oneline --author="Han-Wen"
264570e68e Documentation: remove documentation for internal options
e435a88122 Remove en/contributor/build-notes.texi
8ad3efa86f output-distance: make self test pass again:
51117d43f1 Don't Graham's compile logs.
cf7f4f614b (tag: release/2.11.33-1) Make test generation generic.
9291834601 replace SCM_ASSERT_TYPE with LY_ASSERT_TYPE and friends
acc8482ad0 set LILYPOND_BOOK_LILYPOND_FLAGS explicitly for test.
Removes PDF for tests.
b7da29a7aa * scm/framework-ps.scm (output-preview-framework): use new name.
29ebcd1876 * scm/framework-ps.scm (output-preview-framework): use new name.

I.e. this one is not found:

> commit a1dead391ed016a8aefd1be7fb62946e094b4535
> Author: Han-Wen Nienhuys 
> Date:   Sat Feb 26 12:19:32 2022 +0100
>
>  Add internal/external distinction to -d flags

whereas

> commit 264570e68ea13b06c1b9dd88c491948979926aa1
> Author: Han-Wen Nienhuys 
> Date:   Sun Apr 3 12:45:51 2022 +0200
>
>  Documentation: remove documentation for internal options

is indeed found.
Anyway, "Add internal/external distinction to -d flags" is
https://gitlab.com/lilypond/lilypond/-/merge_requests/1231


That said, I researched a bit more about "check-internal-types".
and found we have:

lilypond --help
lilypond -dhelp
and actually
lilypond -dhelp-internal

The latter is undocumented as intended by one of the mentioned
patches, but shows "check-internal-types"

I agree with separating internal/external options and not explicitley
documenting internal ones.
But not to document at all how to reach the internal ones is too much, imho.
I'd vote for documenting help-internal in "Application Usage".  With a
short hint, something at the lines of:

help-internal bool
  If bool is #t, display options for internal usage. Default: #f.

Opinions?

Thanks,
  Harm



Re: "loco" after ottava

2022-12-03 Thread Thomas Morley
Am Fr., 2. Dez. 2022 um 02:28 Uhr schrieb Joel C. Salomon
:
>
> Piece of music I have in front of me puts the text "loco." above the
> first note after an ottava.  See also the attached example, from
> .
>
> The code below does not work, which makes me suspect I do not in fact
> understand the spanner interface. (I tried to adapt the example from
> crescendo spanners.)  The less-elegant solution of "just use
> `\textMark` on the next note" works fine, but it feels like I'm
> missing something obvious.
>
> --Joel
>
> \version "2.23.80"
>
> {
>   r4
>   \override Staff.OttavaBracket.bound-details.right.text = "loco."
>   \ottava 1
>   c''' d''' e''' |
>   \ottava 0
>   r \textMark \markup\italic "kluge" e' d' c'
> }

Hi Joel,

as Jean and Valentin already said, use simple TextScript to indicate
"loco", although it is indeed superfluous.
To be complete, it is possible to make your override work.
Switch OttavaBracket.stencil to ly:line-spanner::print. NR has a
snippet for the method.
Adapted to the case at hand:

\version "2.23.0"

ottavaBracketLineSpanner = {
  \override Staff.OttavaBracket.stencil = #ly:line-spanner::print
  \override Staff.OttavaBracket.bound-details =
#`((left . ((Y . 0)
(attach-dir . ,LEFT)
(padding . 0)
(stencil-align-dir-y . ,CENTER)))
   (right . ((Y . 0)
 (padding . 0)
 (attach-dir . ,RIGHT)
 (stencil-align-dir-y . ,CENTER
  \override Staff.OttavaBracket.left-bound-info =
 #ly:horizontal-line-spanner::calc-left-bound-info-and-text
  \override Staff.OttavaBracket.right-bound-info =
 #ly:horizontal-line-spanner::calc-right-bound-info
}

{
  r4
  \ottavaBracketLineSpanner
%% Format "loco" with usual markup-commands to taste
  \override Staff.OttavaBracket.bound-details.right.text = "loco"
  \ottava 1
  c''' d''' e''' |
  \ottava 0
  r e' d' c'
}

Though, I don't see a good way to place the end of the OttavaBracket
in a pleasing way. The downpointing hook at line-end is gone as well.
Even if you extend the "loco"-markup to print it, it's not convincing,
imho.

Furthermore, the snippet from NR as well as the one above emit several
programming errors if compiled with -dcheck-internal-types

Btw, I can't find -dcheck-internal-types in the 2.23.-docs any more
and was not able to find out why.

Anyone with more insight?

Cheers,
  Harm



Re: Different default arpeggio positions

2022-12-02 Thread Thomas Morley
Am Fr., 2. Dez. 2022 um 11:46 Uhr schrieb Jean Abou Samra :
>
> Le 02/12/2022 à 05:16, Abraham Lee a écrit :
> > Code works perfectly, Jean, though what it's doing is a bit of a
> > mystery. You've been very kind to provide a solution and I don't want
> > to take more of your time on the subject, but is there some
> > documentation somewhere that explains that commands you've used so I
> > can figure out what's going on for myself? Or if the explanation is
> > simple, I'd greatly appreciate it so I can stop using
> > before/after-line-breaking since I used to use it a lot (as Thomas has
> > hinted at).
>
>
> Try reading this, and feel free to ask again if this doesn't clarify it
> for you:
>
> https://extending-lilypond.readthedocs.io/en/latest/backend.html#properties-and-callbacks
>
> Best,
> Jean
>
Hi Jean,

we have a very short section about grob-transformer in the Extending
Manual. Probably too concise.
Your text is more clear.
Many thanks again for the entire text!

I know you like pattern matching, though imho it makes things not
always easier for users.

Even for me - I don't understand that (x x)-line:

   \override Arpeggio.positions =
 #(grob-transformer
   'positions
   (lambda (grob original)
 (match original
   ((a . b) (cons (- a 5.0) (+ b 5.0)))
   (x x  ;; <==

I'd likely code it like:
   \override Arpeggio.positions =
 #(grob-transformer
   'positions
   (lambda (grob original)
 (cons (- (car original) 5.0) (+ (cdr original) 5.0

Best,
  Harm



Re: Different default arpeggio positions

2022-12-01 Thread Thomas Morley
Hi Jean,

Am Do., 1. Dez. 2022 um 09:48 Uhr schrieb Jean Abou Samra :

> This is a widespread but bad coding pattern that I regularly advise
> against on this list :-)

you'll find a plethora of snippets in the archives using
after-line-breaking authored by me.
Likely starting in 2.12.3.

> It seems that when people notice they can set grob properties
> in after-line-breaking, they start using after-line-breaking
> for anything and everything, while that is not its purpose.

Well, the purpose of after-line-breaking was not well documented back
those days.
And in 2.23. IR still reads:
"Dummy property, used to trigger callback for after-line-breaking."
This is a collection of words making little sense, at least without
further explanations.

> The problem here is that after-line-breaking is run *just* after
> line breaking. It happens before LilyPond has done page spacing,
> i.e., layout out systems and staves vertically.

This is not documented afaik.

> For a cross-staff
> arpeggio, the positions depend on the distance between the
> two staves, so you are requesting 'positions earlier than LilyPond
> can provide it to you.
>
> In general, cross-staff objects are treated specially. For
> a normal arpeggio, LilyPond will request the arpeggio's
> stencil, to build the staff's skylines, and stencil will
> read positions. For a cross-staff arpeggio, which LilyPond
> recognizes by its cross-staff property set to #t, LilyPond
> refrains from reading the stencil before page layout is done,
> knowing that it needs to depend on page layout.
>
> The proper solution is to stop assuming that positions is
> available at a specific point, and instead write a callback
> that computes it as soon as it is asked for:
>
> \version "2.23.82"
>
> \score {
><<
>  \new PianoStaff <<
>\new Staff = "pianoRH" \pianoRH
>\new Staff = "pianoLH" \pianoLH
>  >>
>>>
>\layout {
>  #(use-modules (ice-9 match))
>  \context {
>\Score
>\override Arpeggio.positions =

Furthermore, grob-transformer is not very old
In older versions one had to code far more complex
or
use after-line-breaking - with its limitations.

>  #(grob-transformer
>'positions
>(lambda (grob original)
>  (match original
>((a . b) (cons (- a 0.5) (+ b 1.0)))
>(x x
>  }
>}
> }
>
>
>
> Best,
> Jean
>
>

Ofcourse you're right advertising  not to use after-line-breaking for
all and everything.
Though, I do understand why it's still in use.

Just my 2 cents,
  Harm



Re: table-of-contents for multiple books per ly-file

2022-11-19 Thread Thomas Morley
Am Sa., 19. Nov. 2022 um 14:48 Uhr schrieb Jean Abou Samra :
>
> Le 19/11/2022 à 14:43, Thomas Morley a écrit :
> > Though, I can't use a modified version of the new code setting
> > `toc-items' because dong so in an own ly-file causes:
> > fatal error: call-after-session used after session start
>
>
> This comes from
>
> (call-after-session (lambda ()
>   (hash-clear! toc-hashtab)
>   (set! toc-alist '())
>   (hash-clear! toc-name-id-hashtab)))
>
> This clears the TOC data structures after processing each
> .ly file, to ensure there are no leaks from a .ly file to
> the next if processing several files with the same lilypond
> invocation.
>
> call-after-session can only be used in LilyPond's internal
> .ly files, not in user files.
>
> If you don't care about that, just delete it.
>
> Best,
> Jean
>
>
Hi Jean,

thanks for the hint.
Attached my current (ugly) workaround.

Thanks,
  Harm
\version "2.23.80"

%% TODO: this should be per-book, issue #4227

#(let (;; Maps TOC item IDs (symbols) to alists
   (toc-hashtab (make-hash-table))
   ;; Same, in alist form.  This is what we eventually want to return, but a
   ;; hash table avoids quadratic algorithms while constructing the TOC tree.
   (toc-alist '())
   ;; Map names, i.e. terminal symbols of the paths
   ;; (\tocItem foo.bar.baz ... has the name 'baz) to
   ;; TOC IDs.
   (toc-name-id-hashtab (make-hash-table)))
;; NB Commenting next lines may cause bleed-over into next session, while
;; doing: lilypond file-1.ly file-2.ly
;; Though otherwise we cannpt use this coding
;;
;;   (call-after-session (lambda ()
;; (hash-clear! toc-hashtab)
;; (set! toc-alist '())
;; (hash-clear! toc-name-id-hashtab)))
   (set! add-toc-item!
 (lambda* (markup-symbol text #:optional raw-path)
   (let* ((id (gensym "toc"))
  (path (cond
 ((symbol? raw-path) (list raw-path))
 ;; Without a raw-path, we add an entry at the toplevel, which
 ;; is the same as a one-element raw-path.
 ((or (not raw-path) (null? raw-path)) (list id))
 ((list? raw-path) raw-path)
 (else (begin
(ly:warning (_i "Invalid toc label: ~a")
raw-path))
   (list id
  (level
   ;; Find which existing TOC entry, if any, to attach this entry to.
   ;; The principle is that the first element of path is interpreted specially:
   ;; it can refer to a previously defined nested node, as with
   ;; \tocItem foo.bar "x"
   ;; \tocItem bar.baz "y"
   ;; This attaches bar as a subtree of foo, which can be handy in
   ;; large nested TOCs. If there are several possibilities (foo.bar
   ;; and baz.bar), we choose the one that added last.  This is
   ;; achieved by simply overwriting any existing entry in
   ;; toc-name-id-hashtab when doing the hashq-set!.
   (match path
 ((single)
  (hashq-set! toc-name-id-hashtab single id)
  0)
 ((head . tail)
  (let* ((node-id (hashq-ref toc-name-id-hashtab head))
 (entry (and node-id (hashq-ref toc-hashtab node-id
(let loop ((path path)
   ;; entry corresponds to the entry for the first element
   ;; in the path.  path still contains its name so a warning
   ;; can be emitted if entry is #f.
   (entry entry)
   (level (and entry (1+ (assq-ref entry 'level)
  (if entry
  (let ((children (assq-ref entry 'children)))
(match path
  ((head name)
   ;; The last component is a newly created node.
   (hashq-set! children name id)
   (hashq-set! toc-name-id-hashtab name id)
   level)
  ((head . (and remaining (child . rest)))
   (loop remaining
 (let ((child-id (hashq-ref children child)))
 

table-of-contents for multiple books per ly-file

2022-11-19 Thread Thomas Morley
Hi,

this is about #4227 "Tables of contents are not independent between \books"
https://gitlab.com/lilypond/lilypond/-/issues/4227

My previous workaround was to abuse the 'name entry in each toc-item,
i.e. I used a custom `tabel-of-contents'-markup-command filtering
`toc-items' for a certain name and only print the remaining ones per
book (ofcourse this made hierarchical indents impossible, which was
acceptable).

Alas, that 'name-entry is gone with:

commit 33ca296b8c71d0e30352653d2108445e3395b74e
Author: Jean Abou Samra 
Date:   Mon Jul 11 13:34:34 2022 +0200

Fix possible naming conflicts in structured TOCs

While the head of the path can refer to a nested node, the rest
of the path is now interpreted by always looking up a direct
child of the previous node. This fixes odd conflicts when
several nested nodes have the same path, although it is still
not possible (by design) to have a nested node called something,
and then a root node called the same.

Nonexistent nodes (trying to do \tocItem foo.bar before \tocItem foo)
are no longer silent, but now emit a warning.

This uses modification of hash tables instead of mutation of alists,
so it also happens to fix #6302, caused by alist pairs being shared.

Fixes #6302, #6384

Though, I can't use a modified version of the new code setting
`toc-items' because dong so in an own ly-file causes:
fatal error: call-after-session used after session start

So, #4227 persist and my workaround is gone...
Any idea how to make it work?

Here some basic code to play with:

\version "2.23.80"

\book {
  \markuplist \table-of-contents
  \tocItem \markup "bookI"
  { r1 }
}

\book {
  \markuplist \table-of-contents
  \tocItem \markup \italic "bookII"
  { r1 }
}

Thanks,
  Harm



Re: MetronomeMark and break-visibility

2022-11-01 Thread Thomas Morley
Am Di., 1. Nov. 2022 um 16:30 Uhr schrieb Jean Abou Samra :
>
> Le 01/11/2022 à 12:55, Thomas Morley a écrit :
> > Hi,
> >
> > the following code for _Rehearsal_Mark works as expected, i.e. the
> > RehearsalMark is printed at end of line:
> >
> > {
> >b1
> >\override Score.RehearsalMark.break-visibility = ##(#t #f #f)
> >\mark \default
> >\break
> >b
> > }
> >
> > Alas, the same for _Metronome_Mark fails, the MetronomeMark is not
> > printed at all:
> >
> > {
> >b1
> >\override Score.MetronomeMark.break-visibility = ##(#t #f #f)
> >\tempo "Andante" 4 = 60
> >\break
> >b
> > }
> >
> > although MetronomeMark has settings for break-visibility.
> >
> > Is this on purpose or a bug?
> > How to make it work?
>
>
> This looks weird. In this case at least, Metronome_engraver sets
> non-musical = #t on the MetronomeMark, yet it also sets its X
> parent to the current *musical* column, not the non-musical one.
> That's contradictory. As a result, MetronomeMark is not a breakable
> item, since its parent is PaperColumn and not NonMusicalPaperColumn.
> But it has a break-visibility. This makes for a mess.
>
> It works if you do
>
> \version "2.23.80"
>
> \new Score \with {
>\consists
>  #(lambda (context)
> (let ((tempo #f))
>   (make-engraver
>(acknowledgers
> ((metronome-mark-interface engraver grob source-engraver)
>  (set! tempo grob)))
>((stop-translation-timestep engraver)
> (when tempo
>   (ly:grob-set-parent! tempo X (ly:context-property context
> 'currentCommandColumn)))
> (set! tempo #f)
> }
> {
>b1
>\override Score.MetronomeMark.break-visibility = ##(#t #f #f)
>\override Score.MetronomeMark.self-alignment-X = #RIGHT
>\tempo "Andante" 4 = 60
>\break
>b
> }
>
>
>
> I suggest to open an issue.
>
> It is probably related to
> https://gitlab.com/lilypond/lilypond/-/issues/1276
>
> Best,
> Jean
>

Done.
https://gitlab.com/lilypond/lilypond/-/issues/6452

Thanks,
  Harm



MetronomeMark and break-visibility

2022-11-01 Thread Thomas Morley
Hi,

the following code for _Rehearsal_Mark works as expected, i.e. the
RehearsalMark is printed at end of line:

{
  b1
  \override Score.RehearsalMark.break-visibility = ##(#t #f #f)
  \mark \default
  \break
  b
}

Alas, the same for _Metronome_Mark fails, the MetronomeMark is not
printed at all:

{
  b1
  \override Score.MetronomeMark.break-visibility = ##(#t #f #f)
  \tempo "Andante" 4 = 60
  \break
  b
}

although MetronomeMark has settings for break-visibility.

Is this on purpose or a bug?
How to make it work?

Thanks,
  Harm



Re: Passing a parameter to Scheme

2022-10-29 Thread Thomas Morley
Am Sa., 29. Okt. 2022 um 12:32 Uhr schrieb Paul Hodges :
>
> On further thought, I suspect that I can't aim at "\speak #-3.8 c" because 
> #-3.8 isn't a music expression so LilyPond won't let me.  I guess I'll need 
> to use a \tweak or \set on the parameter variable instead.  But that leaves 
> me even further from knowing how to write it, largely because my brain's 
> model of computing (honed over 55 years) is entirely based on procedural 
> languages with nested scopes (Algol, C) or Assembly language with everything 
> global.  I simply don't know how scopes and namespaces work in Scheme, and 
> thus how to define that parameter in a way that I can access it to tweak.
>
> Paul
>
>
> From: Paul Hodges 
> To: lilypond-user 
> Sent: 29/10/2022 10:50
> Subject: Passing a parameter to Scheme
>
> I am trying to make my first steps in actually modifying some Scheme.  I am 
> using a procedure taken from the snippets repository to add a cross to a stem 
> (e.g. to indicate sprechgesang):
>
> %%
> speak = {
>   \once \override Stem.stencil =
> #(lambda (grob)
>(let* ((x-parent (ly:grob-parent grob X))
>   (is-rest? (ly:grob? (ly:grob-object x-parent 'rest
>  (if is-rest?
>  empty-stencil
>  (ly:stencil-combine-at-edge
>   (ly:stem::print grob)
>   Y
>   (- (ly:grob-property grob 'direction))
>   (grob-interpret-markup grob
>  (markup #:center-align #:fontsize -2
>  #:musicglyph 
> "noteheads.s2cross"))
>   -2.3
> }
> %%
>
> This works fine, writing "\speak c4" for instance.
>
> However, I'd like to be able to parameterise the position of the cross which 
> is hard-coded as -2.3, so that I can write "\speak #-3.8 c" for instance.  
> I've tried a couple of ways to write it, but I can't find one that works.  I 
> suppose that I will need something like "lambda (grob posn)" to define the 
> parameter for use at the end, but I can't see how to get the value of posn 
> from the LilyPond source into the Scheme procedure.
>
> Help?
>
> Thanks,
> Paul

Hi Paul,

please always give the link to the LSR snippet:
https://lsr.di.unimi.it/LSR/Item?id=374
and some example code of your use case.

That said...

I'd always use `grob-transformer', if the original value of a grob is
taken and modified (here Stem.stencil with (ly:stem::print grob)).
This procedure was not available back when the snippet was coded, though.
Making for:

\version "2.23.14"

speakOff = \revert Stem.stencil

speakOnI =
  \override Stem.stencil =
#(grob-transformer 'stencil
  (lambda (grob orig)
 (let* ((x-parent (ly:grob-parent grob X))
(is-rest? (ly:grob-object x-parent 'rest #f)))
   (if is-rest?
   orig
   (ly:stencil-combine-at-edge
orig
Y
(- (ly:grob-property grob 'direction))
(grob-interpret-markup
  grob
  (markup #:center-align #:fontsize -2
  #:musicglyph "noteheads.s2cross"))
-2.3)

\score {
  \new Staff {
\relative c'' {
  a8 b a c
  \speakOnI
  g f r g
  b r d e
  \speakOff
  c a g f
}
  }
}

This does not solve your question, but we can start from it.

(1) Most common would be to code a music-function.
I think it's explained in the Extending Manual.
Making for:

speakOff = \revert Stem.stencil

speakOnII =
#(define-music-function (y-pad)(number?)
#{
  \override Stem.stencil =
#(grob-transformer 'stencil
  (lambda (grob orig)
 (let* ((x-parent (ly:grob-parent grob X))
(is-rest? (ly:grob-object x-parent 'rest #f))) ;; no
need to chaeck for  ly:grob?
   (if is-rest?
   orig
   (ly:stencil-combine-at-edge
orig
Y
(- (ly:grob-property grob 'direction))
(grob-interpret-markup
  grob
  (markup #:center-align #:fontsize -2
  #:musicglyph "noteheads.s2cross"))
y-pad)
#})

\score {
  \new Staff {
\relative c'' {
  a8 b a c
  \speakOnII #-2.3
  g f r g
  b r d e
  \speakOff
  c a g f
}
  }
}

(2) Read a custom details,sub-property:

speakOff = \revert Stem.stencil

speakOnIII =
  \override Stem.stencil =
#(grob-transformer 'stencil
  (lambda (grob orig)
 (let* ((x-parent (ly:grob-parent grob X))
(is-rest? (ly:grob-object x-parent 'rest #f)))
   (if is-rest?
   orig
   (let* ((details (ly:grob-property grob 'details))
  (my-y-move (assoc-get 'my-y-move details -2.3)))
 (ly:stencil-combine-at-edge
 

Re: Appoggiatura in bass clef at start of piece

2022-10-26 Thread Thomas Morley
Am Mi., 26. Okt. 2022 um 19:27 Uhr schrieb Peter Mitton :
>
> Hi,
>
> I’m wondering if there is a better way of writing this code:
>
> \version "2.22.2"
>
> \new Staff {
>   <<
> % \time 6/8
> % \clef bass
> \new Voice = "a" {
>   \voiceFour
>   \time 6/8 \clef bass \appoggiatura c,8 c1 \appoggiatura c,8 c1
> }
> \new Voice = "b" {
>   \voiceThree
>   \grace s8  e1 \grace s8 e1
> }
>   >>
> }
>
> This is the only place I’ve found where I can place the bass clef without an 
> additional treble clef appearing before the first appoggiatura (with multiple 
> ledger lines).
>
> Similarly this is the only place I’ve found where I can place the time 
> signature where it doesn’t appear after the first appoggiatura.
>
> The second appogggiatura works without problem wherever I declare the rhythm 
> or clef (e.g. in the above commented section or in a global)
>
> I’m sure I’m missing something simple, but any suggested improvements would 
> be most appreciated.
>
> Many thanks,
>
> Pete

Well, you could do:

\new Staff {
  \time 6/8
  \clef bass
  <<
\new Voice = "a" {
  \voiceFour
  \appoggiatura c,8 c1 \appoggiatura c,8 c1
}
\new Voice = "b" {
  \voiceThree
  \grace s8  e1 \grace s8 e1
}
  >>
}

Why two Voices, though? Below works as well:

\new Voice = "a" {
  \voiceFour
  \time 6/8 \clef bass
  \appoggiatura c,8 1 \appoggiatura c,8 1
}

Btw, you're aware c1 exceeds 6/8-time?

Cheers,
  Harm



line-width in lilypond book

2022-10-25 Thread Stefan Thomas
Community,
I just noticed that it doesn't seem to make any difference whether I write
 \begin[line-width=394\pt]{lilypond}
or
 \begin[line-width=394\pt]{lilypond}
in a latex file, that I process with lilypond-book.
The lines don't fit the page margins.
Does anyone know what to do here?
Thanks,
Stefan


Re: another 'wrong type argument' error

2022-10-12 Thread Thomas Morley
Am Mi., 12. Okt. 2022 um 11:37 Uhr schrieb Thomas Morley
:
>
> Am Mo., 10. Okt. 2022 um 21:04 Uhr schrieb Kieren MacMillan
> :
> >
> > Hi Jean,
> >
> > > This looks like you have done something like
> > > { c'\custdyn "p" }
> > > instead of
> > > { c'\custdyn "{p}" }
> >
> > Hmmm… the only three calls I have look like the second (correct) version, 
> > not the first. But switching those three custom dynamics to simple/native 
> > dynamics eliminates the error, so it's definitely something in that code 
> > that's breaking.
> >
> > Because I need to keep ploughing forward on this score, I'm going to bail 
> > here and just leave them as simple dynamics… When I can take a breath (next 
> > week?), I'll return and see if I/we can figure out the real root of the 
> > problem.
> >
> > Thank you so much for all your help!
> > Kieren.
>
> Hi Kieren,
>
> sorry for the delay...
> I wrote the original code for 2.19.65 and overlooked the bug you
> encountered - it happens if the string-argument is plain text, i.e. no
> dynamics are present, _and_ no spaces occur like "laut", "sehr laut"
> would have worked.
> Furhermore there were a guile1/guile2 problem: `split-at' behaves
> differently now.
> The definition for `note-column::main-extent' is now superflous, can
> be retrieved by calling NoteColumn.main-extent.
>
> Attached you'll find the newest code.
>

Aargh, still an oversight...
New file attached.

>
> You need to rename the function `dynamicH' to `custdyn'
>
> Though, there's currently a patch waiting for 2.25. deleting the
> \simple-markup-command.
> https://gitlab.com/lilypond/lilypond/-/merge_requests/1650
> If merged it will break the coding again.
> While it is possible to work around I'll object to this change.
>
> Cheers,
>   Harm
\version "2.23.13"


 DynamicText, created on the fly

 Reads
  DynamicText.details.separator-pair
  DynamicText.details.dyn-rest-font-sizes
  DynamicText.details.markup-commands
  DynamicText.details.inner-x-space
  DynamicText.details.outer-x-space

#(use-modules (ice-9 regex))
  
#(define remove-empty
  ;; Remove empty strings and empty lists from the given list 'lst'
  (lambda (lst)
(remove 
  (lambda (e) 
(or
  (and (string? e) (string-null? e))
  (and (list? e) (null? e
  lst)))

#(define char-set:dynamics
  (char-set #\f #\m #\p #\r #\s #\z)) 
  
#(define (make-reg-exp separator-pair)
  (format #f "\\~a[^~a~a]*\\~a"
(car separator-pair)
(car separator-pair)
(cdr separator-pair)
(cdr separator-pair)))

#(define (dynamics-list separator-pair strg)
  (let ((reg-exp (make-reg-exp separator-pair))
(separators (char-set (car separator-pair) (cdr separator-pair
(map
  (lambda (s)
(let* ((match (string-match reg-exp s)))
   (if match 
   (let* ((poss-dyn (match:substring match))
  (cand (string-trim-both poss-dyn separators)))
 (if (string-every char-set:dynamics cand)
   (list
 (match:prefix match)
 cand
 (match:suffix match))
 s))  
   s)))
  (string-split strg #\space
  
#(define (dynamic-text::format-text 
   fontsizes inner-kern outer-kern text-markup-command lst)
  (let* ((mrkp-cmnd
   (lambda (arg) (make-normal-text-markup (text-markup-command arg
 (txt-font-size (if (pair? fontsizes) (cdr fontsizes) #f))
 (txt-mrkp-cmnd
   (lambda (txt)
 (if (number? txt-font-size)
 (make-fontsize-markup txt-font-size (mrkp-cmnd txt))
 (mrkp-cmnd txt
 (left-out (if (pair? outer-kern) (car outer-kern) #f))
 (left-inner (if (pair? inner-kern) (car inner-kern) #f))
 (right-inner (if (pair? inner-kern) (cdr inner-kern) #f))
 (right-out (if (pair? outer-kern) (cdr outer-kern) #f))
 (space-mrkp-cmd
   (lambda (space)
 (if (number? space)
 (txt-mrkp-cmnd (make-hspace-markup space))
 ""
(map
  (lambda (e)
(if (list? e)
(remove-empty
  (list
(cond ((and (string-null? (car e)) (equal? e (car lst))) '())
  ((string-null? (car e))
(space-mrkp-cmd left-out))
  ((and (not (string-null? (car e))) (equal? e (car lst)))
(make-concat-markup
(remove-empty
  (list

Re: another 'wrong type argument' error

2022-10-12 Thread Thomas Morley
Am Mo., 10. Okt. 2022 um 21:04 Uhr schrieb Kieren MacMillan
:
>
> Hi Jean,
>
> > This looks like you have done something like
> > { c'\custdyn "p" }
> > instead of
> > { c'\custdyn "{p}" }
>
> Hmmm… the only three calls I have look like the second (correct) version, not 
> the first. But switching those three custom dynamics to simple/native 
> dynamics eliminates the error, so it's definitely something in that code 
> that's breaking.
>
> Because I need to keep ploughing forward on this score, I'm going to bail 
> here and just leave them as simple dynamics… When I can take a breath (next 
> week?), I'll return and see if I/we can figure out the real root of the 
> problem.
>
> Thank you so much for all your help!
> Kieren.

Hi Kieren,

sorry for the delay...
I wrote the original code for 2.19.65 and overlooked the bug you
encountered - it happens if the string-argument is plain text, i.e. no
dynamics are present, _and_ no spaces occur like "laut", "sehr laut"
would have worked.
Furhermore there were a guile1/guile2 problem: `split-at' behaves
differently now.
The definition for `note-column::main-extent' is now superflous, can
be retrieved by calling NoteColumn.main-extent.

Attached you'll find the newest code.
You need to rename the function `dynamicH' to `custdyn'

Though, there's currently a patch waiting for 2.25. deleting the
\simple-markup-command.
https://gitlab.com/lilypond/lilypond/-/merge_requests/1650
If merged it will break the coding again.
While it is possible to work around I'll object to this change.

Cheers,
  Harm
\version "2.23.13"


 DynamicText, created on the fly

 Reads
  DynamicText.details.separator-pair
  DynamicText.details.dyn-rest-font-sizes
  DynamicText.details.markup-commands
  DynamicText.details.inner-x-space
  DynamicText.details.outer-x-space

#(use-modules (ice-9 regex))
  
#(define remove-empty
  ;; Remove empty strings and empty lists from the given list 'lst'
  (lambda (lst)
(remove 
  (lambda (e) 
(or
  (and (string? e) (string-null? e))
  (and (list? e) (null? e
  lst)))

#(define char-set:dynamics
  (char-set #\f #\m #\p #\r #\s #\z)) 
  
#(define (make-reg-exp separator-pair)
  (format #f "\\~a[^~a~a]*\\~a"
(car separator-pair)
(car separator-pair)
(cdr separator-pair)
(cdr separator-pair)))

#(define (dynamics-list separator-pair strg)
  (let ((reg-exp (make-reg-exp separator-pair))
(separators (char-set (car separator-pair) (cdr separator-pair
(map
  (lambda (s)
(let* ((match (string-match reg-exp s)))
   (if match 
   (let* ((poss-dyn (match:substring match))
  (cand (string-trim-both poss-dyn separators)))
 (if (string-every char-set:dynamics cand)
   (list
 (match:prefix match)
 cand
 (match:suffix match))
 s))  
   s)))
  (string-split strg #\space
  
#(define (dynamic-text::format-text 
   fontsizes inner-kern outer-kern text-markup-command lst)
  (let* ((mrkp-cmnd
   (lambda (arg) (make-normal-text-markup (text-markup-command arg
 (txt-font-size (if (pair? fontsizes) (cdr fontsizes) #f))
 (txt-mrkp-cmnd
   (lambda (txt)
 (if (number? txt-font-size)
 (make-fontsize-markup txt-font-size (mrkp-cmnd txt))
 (mrkp-cmnd txt
 (left-out (if (pair? outer-kern) (car outer-kern) #f))
 (left-inner (if (pair? inner-kern) (car inner-kern) #f))
 (right-inner (if (pair? inner-kern) (cdr inner-kern) #f))
 (right-out (if (pair? outer-kern) (cdr outer-kern) #f))
 (space-mrkp-cmd
   (lambda (space)
 (if (number? space)
 (txt-mrkp-cmnd (make-hspace-markup space))
 ""
(map
  (lambda (e)
(if (list? e)
(remove-empty
  (list
(cond ((and (string-null? (car e)) (equal? e (car lst))) '())
  ((string-null? (car e))
(space-mrkp-cmd left-out))
  ((and (not (string-null? (car e))) (equal? e (car lst)))
(make-concat-markup
(remove-empty
  (list
(txt-mrkp-cmnd (car e))
(space-mrkp-cmd left-inner)
  (else
(make-concat-markup
(remove-empty
  (list
(space-mrkp-cmd left-out)
(txt-mrkp-cmnd (car e))
(space-mrkp-cmd left-inner))
(second e)
(cond ((and (string-null? (last e)) 

  1   2   3   4   5   6   7   8   9   10   >