Automatically set Hairpin.to-barline

2024-11-19 Thread Mark Knoop
I'm looking for a way to set a hairpin's to-barline property depending on whether the terminating grob it is attached to is a note or a rest. I'd like hairpins which end on a rest to stop at the barline (to-barline = ##t), and hairpins which end on a note to continue to the notehead column (to-b

Re: Message: "Note: compilation failed and \version outdated"

2024-11-19 Thread David Wright
On Tue 19 Nov 2024 at 09:05:00 (-0800), Stu McKenzie wrote: > > Reply to David Wright (et al): > > On 2024-11-18 10:40, Stu McKenzie wrote: [ recapitulation of OP snipped ] > > In reply to your post: > > > It's typical that an error occurs before the "outdated" message > > is issued. But your O

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread David Kastrup
Thomas Morley writes: > Hi Mark, > > probably: > > \override Hairpin.to-barline = > #(grob-transformer 'to-barline > (lambda (grob orig) > (let* ((right-bound (ly:spanner-bound grob RIGHT)) >(nhds (ly:grob-object right-bound 'note-heads))) > (if (ly:g

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Thomas Morley
Am Di., 19. Nov. 2024 um 11:58 Uhr schrieb Mark Knoop : > > I'm looking for a way to set a hairpin's to-barline property depending on > whether the terminating grob it is attached to is a note or a rest. I'd like > hairpins which end on a rest to stop at the barline (to-barline = ##t), and > hai

Re: Message: "Note: compilation failed and \version outdated"

2024-11-19 Thread Stu McKenzie via LilyPond User List
On 2024-11-19 14:57, David Wright wrote: On Tue 19 Nov 2024 at 09:05:00 (-0800), Stu McKenzie wrote: Reply to David Wright (et al): On 2024-11-18 10:40, Stu McKenzie wrote: [ recapitulation of OP snipped ] In reply to your post: It's typical that an error occurs before the "outdated" mes

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Mark Knoop
Many thanks Valentin. At 15:48 on 19 Nov 2024, Valentin Petzel wrote: > Am Dienstag, 19. November 2024, 15:22:16 MEZ schrieb Mark Knoop: >> This works, but crashes with broken hairpins: > Hello Mark, > the issue here is not the break, but the spanner ending on > a multimeasure rest, which causes

Re: Message: "Note: compilation failed and \version outdated"

2024-11-19 Thread Valentin Petzel
Hello Stu, here you see two messages: One is that your file did fail to compile. The other one is a note that the version string is older than your Lilypond version, and a suggestion that this might be the cause. From your messages you are clearly compiling a 2.25.18 file with 2.25.21, so this

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Thomas Morley
Am Di., 19. Nov. 2024 um 13:54 Uhr schrieb David Kastrup : > > Thomas Morley writes: > > > Hi Mark, > > > > probably: > > > > \override Hairpin.to-barline = > > #(grob-transformer 'to-barline > > (lambda (grob orig) > > (let* ((right-bound (ly:spanner-bound grob RIGHT)) > >

Re: How to break a loop when using Scheme in LilyPond?

2024-11-19 Thread David Kastrup
tran li writes: > My current code is as follows: > > ```ly > > #(define* ((_hash-table-deep-ref getter) h keys #:optional (fallback #f)) >   (let* ((target h)) >     (for-each >   (lambda (key) >     (set! target (getter target key))) >   keys) >     target)) > > #(define hash-deep-re

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Valentin Petzel
Am Dienstag, 19. November 2024, 15:22:16 MEZ schrieb Mark Knoop: > This works, but crashes with broken hairpins: Hello Mark, the issue here is not the break, but the spanner ending on a multimeasure rest, which causes in the hairpin not having a right bound. The reason for this is that the engr

How to break a loop when using Scheme in LilyPond?

2024-11-19 Thread tran li
I encountered a situation that need to break a loop while invoking Scheme code in LilyPond. Typically LilyPond offers the `for-each` function which simulates the for-loop in most programming languages. However, the `break` functionality isn't explicitly offered. There seems to be a function nam

Re: Message: "Note: compilation failed and \version outdated"

2024-11-19 Thread Stu McKenzie via LilyPond User List
Reply to David Wright (et al): On 2024-11-18 10:40, Stu McKenzie via LilyPond User List wrote: I'm using LilyPond version 2.25.21. This message occurred: " Note: compilation failed and \version outdated, did you update input syntax with convert-ly? https://lilypond.org/doc/v2.25/Documentat

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Valentin Petzel
Am Dienstag, 19. November 2024, 14:41:03 MEZ schrieb Thomas Morley: > > Though possibly this would need > > > > \override Hairpin.to-barline = > > > > #(ly:make-unpure-pure-container > > > >(lambda (grob) > > > > (let* ((right-bound (ly:spanner-bound grob RI

Re: Automatically set Hairpin.to-barline

2024-11-19 Thread Mark Knoop
Many thanks David and Harm At 14:41 on 19 Nov 2024, Thomas Morley wrote: > Or even: > \override Hairpin.to-barline = > #(lambda (grob) >(let* ((right-bound (ly:spanner-bound grob RIGHT)) > (nhds (ly:grob-object right-bound 'note-heads #f))) > (not nhds))) Thi

Re: How to break a loop when using Scheme in LilyPond?

2024-11-19 Thread Valentin Petzel
Hello, > However, in Scheme, returning a value inside a loop is troublesome. I > must first break the loop and then return the value. So what is the > correct way of doing this? Scheme does not really have loops. At least not in the sense you know it from procedural languages. `for-each` is naug