Re: Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread David Kastrup
Kevin Cole  writes:

> On Mon, Jul 25, 2022 at 5:56 PM Aaron Hill  wrote:
>>
>> On 2022-07-25 1:56 pm, Kevin Cole wrote:
>> >> frets = \chordmode { f4 c4:7 g4:7 c4 bf4 d4:m }
>> ^^
>> Input is in chord mode.  Modifiers like :m and :7 work.
>>
>> >> frets = { g4 c4 a4 d4:7 }
>>^
>> Missing \chordmode.  :7 indicates a tremolo with an invalid duration.
>
> Oops. I stared at it for half an hour and missed the typo completely.
> Embarrassing. I'll blame it on sleepiness.

Frankly, we already had a discussion about how to make the default
\notemode a unified note/chord mode, long long ago.  Tremolo input
notation is what is the main detraction here.

-- 
David Kastrup



Re: A new Scheme tutorial

2022-07-25 Thread David Kastrup
Jean Abou Samra  writes:

> Le 25 juil. 2022 à 14:51, David Kastrup  a écrit :
>> 
>> syntax-rules/syntax-case introduce a completely new and arbitrary syntax
>> intended to be human-readable.  That's sort of a counterthesis to the
>> LISP philosophy of representing programs by the data representation of
>> their parse tree, skipping a human-readable abstraction for the sake of
>> making it easy to programmatically generate and analyze programs.
>> 
>> Macros, in contrast, are just a flag on functions telling the evaluator
>> "evaluate the function result instead of its arguments".  That is an
>> almost trivial tweak.
>
> Modulo the fact that IIRC, Guile 1 would only run the macro the first
> time the form was evaluated, but I see what you mean.

I was not really talking about Guile.  Guile is a comparatively faithful
Scheme implementation.  It was more about the LISP/Scheme difference in
philosophy.

LISP is at its heart, conception and inception an interpreted language.
Compilation is an afterthought, just like demand-paging is an
afterthought for UNIX, with the original concept having just one process
in memory and the difference between swapping and forking essentially
being that swapping pulled in a process image before continuing
execution and forking just continued running, as "child", the process
image it just wrote to disk.

The original simplicity that allowed running stuff in 64k of memory or
less has not been retained either way.

In Guile 1, I've successfully used call/cc for implementing a fairly
trivial local-eval that was able to deal with closures.



That doesn't work with the compilation complexity of Guile 2 since this
trick obviously falls apart really hard with anything operating in
multiple passes.

>> More complex, indeed, is the quasiquote mechanism that operates to a
>> good degree in the LISP reader and makes it comparatively easy to
>> handle the creation of material suitable as macro body.
>> 
>> In contrast to syntax-rules/syntax-case this reflects more a
>> philosophy rather than a religion since it isn't arbitrary.  Using it
>> is more a matter of understanding rather than learning it.
>
>
> There are two mostly unrelated parts in the Scheme macro system that
> differentiate it from the traditional Lisp system: the pattern
> matching language, and hygiene.

Effective hygiene can be achieved with make-symbol.  But of course once
you stop having an interpreter, the conceptual simplicity is not
continued into the implementation, particularly if you want
compiled-language efficiency.  And Scheme also has thrown the conceptual
simplicity overboard along with the simple implementation.

> The first part is definitely not all lilies and roses. It’s weird to
> have a separate namespace for the pattern variables bound by
> syntax-case. It’s weird that the primitive way to analyze syntax
> objects is not a set of simple procedures like syntax-pair?,
> syntax-car, but only syntax-case pattern matching, against the
> traditional Scheme principle that complex tools (like syntax-case) are
> built at will on top of very simple tools. It’s weird that syntax
> pairs aren’t normal pairs, so you can’t use list functions on them
> directly. It’s weird that #'(pat …) doesn’t return a syntax list but
> just a plain list (at least in Guile, didn’t check the standard).
>
> Still, this macro system gives you a form of lexical scoping and
> hygiene, and allows things like renaming syntax keywords when
> importing them, which is really nifty and the main reason why I prefer
> writing syntax-rules/case macros. I like the principle of annotated
> symbols containing scope information. It’s not that I’m fond of the
> tools provided to manipulate them.

I feel similar with regard to C++'s implementation of the template
system: the goals are worthwhile and they are accomplished, but the
syntax appears foreign to the base language and has been dragged in from
elsewhere (in C++'s case, basically from Ada with subsequent cancerous
proliferation), at considerable cost that seems like too much of an
uncalled-for expense.

-- 
David Kastrup



Re: Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread Kevin Cole
On Mon, Jul 25, 2022 at 5:56 PM Aaron Hill  wrote:
>
> On 2022-07-25 1:56 pm, Kevin Cole wrote:
> >> frets = \chordmode { f4 c4:7 g4:7 c4 bf4 d4:m }
> ^^
> Input is in chord mode.  Modifiers like :m and :7 work.
>
> >> frets = { g4 c4 a4 d4:7 }
>^
> Missing \chordmode.  :7 indicates a tremolo with an invalid duration.

Oops. I stared at it for half an hour and missed the typo completely.
Embarrassing. I'll blame it on sleepiness.

But many thanks.



Re: Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread Carl Sorensen
>
> > respectively, work fine. The third has a bit more going on, but adding:
> >
> > > 
> > > frets = { g4 c4 a4 d4:7 }
> > > 
> >
> > now gives me:
> >
> > > error: not a duration
> > >  g4 c4 a4 d4:
> > >  7
> >
> > (Without the frets score, everything is fine.)
>

You are not in \chordmode

frets = \chordmode{g4 c4 a4 d4:7}

Carl


Re: Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread Aaron Hill

On 2022-07-25 1:56 pm, Kevin Cole wrote:

frets = \chordmode { f4 c4:7 g4:7 c4 bf4 d4:m }

   ^^
Input is in chord mode.  Modifiers like :m and :7 work.


frets = { g4 c4 a4 d4:7 }

  ^
Missing \chordmode.  :7 indicates a tremolo with an invalid duration.


-- Aaron Hill



Re: Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread Kevin Cole
On Mon, Jul 25, 2022 at 4:56 PM Kevin Cole  wrote:
>
> Hi,
>
> I decided to move all of the fretboards from various scores to a
> "summary" score at the top -- sort of a "legend" so that the scores
> would not take up so much space.
>
> I'm defining a variable named frets and then, later:
>
> 
> \score {
>   <<
> \new ChordNames \frets
> \new FretBoards \frets
>   >>
>   \layout { }
> }
>
> \score {
>   <<
> \new ChordNames \chordNames
> \new Voice = "mel" { \melody }
> \new Lyrics \lyricsto mel \words
>   >>
>   \layout { \autoBeamOff }
> }
> 
>
> Two files:
>
> > 
> > frets = \chordmode {  f4 c4:7 g4:7 c4 bf4 d4:m }
> > 
>
> and
>
> > 
> > frets = { f4 bf4 c4 }
> > 
>
> respectively, work fine. The third has a bit more going on, but adding:
>
> > 
> > frets = { g4 c4 a4 d4:7 }
> > 
>
> now gives me:
>
> > error: not a duration
> >  g4 c4 a4 d4:
> >  7
>
> (Without the frets score, everything is fine.)

P.S. BTW, since people often ask, I am using LilyPond 2.22.1



Re: A new Scheme tutorial

2022-07-25 Thread Jean Abou Samra



> Le 25 juil. 2022 à 14:51, David Kastrup  a écrit :
> 
> Jean Abou Samra  writes:
> 
 Le 25 juil. 2022 à 09:01, Andrew Bernard  a 
 écrit :
>>> 
>>> 
>>> Hello Jean,
>>> 
>>> This is a great effort.
>>> 
>>> A couple of suggestions. I suppose there are a few web pages with
>>> lists of recommended texts for Scheme, but I think it would be great
>>> if you added this one to the 'where to go from here' section:
>>> 
>>> Teach Yourself Scheme in Fixnum Days (ds26gte.github.io)
>>> 
>> 
>> 
>> Gosh, it seems to teach Lisp-style non-hygienic macros instead of
>> syntax-rules/syntax-case. That’s heresy against my religion! OK, I
>> stop now :-)
> 
> syntax-rules/syntax-case introduce a completely new and arbitrary syntax
> intended to be human-readable.  That's sort of a counterthesis to the
> LISP philosophy of representing programs by the data representation of
> their parse tree, skipping a human-readable abstraction for the sake of
> making it easy to programmatically generate and analyze programs.
> 
> Macros, in contrast, are just a flag on functions telling the evaluator
> "evaluate the function result instead of its arguments".  That is an
> almost trivial tweak.

Modulo the fact that IIRC, Guile 1 would only run the macro the first time the 
form was evaluated, but I see what you mean.


> More complex, indeed, is the quasiquote mechanism
> that operates to a good degree in the LISP reader and makes it
> comparatively easy to handle the creation of material suitable as macro
> body.
> 
> In contrast to syntax-rules/syntax-case this reflects more a philosophy
> rather than a religion since it isn't arbitrary.  Using it is more a
> matter of understanding rather than learning it.


There are two mostly unrelated parts in the Scheme macro system that 
differentiate it from the traditional Lisp system: the pattern matching 
language, and hygiene.

The first part is definitely not all lilies and roses. It’s weird to have a 
separate namespace for the pattern variables bound by syntax-case. It’s weird 
that the primitive way to analyze syntax objects is not a set of simple 
procedures like syntax-pair?, syntax-car, but only syntax-case pattern 
matching, against the traditional Scheme principle that complex tools (like 
syntax-case) are built at will on top of very simple tools. It’s weird that 
syntax pairs aren’t normal pairs, so you can’t use list functions on them 
directly. It’s weird that #'(pat …) doesn’t return a syntax list but just a 
plain list (at least in Guile, didn’t check the standard).

Still, this macro system gives you a form of lexical scoping and hygiene, and 
allows things like renaming syntax keywords when importing them, which is 
really nifty and the main reason why I prefer writing syntax-rules/case macros. 
I like the principle of annotated symbols containing scope information. It’s 
not that I’m fond of the tools provided to manipulate them.

I tend to think of Scheme as a language with elegant syntax on top of clumsy 
data structures (alist lookup is linear, etc). In this case, it’s sort of the 
opposite…






Fretboard diagrams: Why does LilyPond sometimes try to interpret ":7" as a duration?

2022-07-25 Thread Kevin Cole
Hi,

I decided to move all of the fretboards from various scores to a
"summary" score at the top -- sort of a "legend" so that the scores
would not take up so much space.

I'm defining a variable named frets and then, later:


\score {
  <<
\new ChordNames \frets
\new FretBoards \frets
  >>
  \layout { }
}

\score {
  <<
\new ChordNames \chordNames
\new Voice = "mel" { \melody }
\new Lyrics \lyricsto mel \words
  >>
  \layout { \autoBeamOff }
}


Two files:

> 
> frets = \chordmode {  f4 c4:7 g4:7 c4 bf4 d4:m }
> 

and

> 
> frets = { f4 bf4 c4 }
> 

respectively, work fine. The third has a bit more going on, but adding:

> 
> frets = { g4 c4 a4 d4:7 }
> 

now gives me:

> error: not a duration
>  g4 c4 a4 d4:
>  7

(Without the frets score, everything is fine.)



Re: Custom scheme engraver (Barline) problem

2022-07-25 Thread Kyle Baldwin
Jean -

Merci! This is exactly what I needed.

-kwb
On Jul 24, 2022, 11:50 PM -0700, Jean Abou Samra , wrote:
>
>
> > Le 25 juil. 2022 à 08:23, Kyle Baldwin  a écrit :
> >
> > I'm trying to create a custom bar number engraver that will respond to 
> > couple of different events, but wanted to initially try and clone the Bar 
> > number engraver in c to scheme. Everything seems to work the way I want it 
> > to, except for the positioning seems to be wrong. The numbers appear in 
> > line with the top staff as opposed to above the top staff.
> >
> > If someone can help me get these numbers into the "correct" place, it would 
> > be greatly appreciated. I think that it may have something to do with the 
> > side-support not working correctly, but not sure why.
> >
> > Thanks
> >
> > %
> > #(define (Bar_number_ten_engraver context)
> >   ; main let
> >   (let*
> >     ; main let defs
> >     (
> >       ; we need two variables to hold information about current bar number 
> > grobs.
> >       ; The bar-text is for regular bar numbers and the bar-span is for 
> > spanning
> >       ; bar number - i.e., "centered" bar numbers. Default values we can 
> > just
> >       ; mark as empty lists to make error checking easier. (with null?)
> >       (bar-text '())
> >       (bar-span '())
> >       ; The next set of variables are just used for internal state.
> >       (considered-numbering #f) ; flag to mark if we have already processed 
> > this barline
> >       (saw-bar-line #t)         ; flag to set when we see a barline. This 
> > makes it
> >                                 ; so the same barline isn't processed 
> > multiple times.
> >                                 ; although the first barline will never 
> > have a number,
> >                                 ; this should run the check to get things 
> > started
> >       (break-allowed-now #f)    ; store the value read in process-music. 
> > This is
> >                                 ; explained in the default bar number 
> > engraved to
> >                                 ; to avoid engraver order dependance.
> >       ; there are the "class" helper functions
> >       ; this will get the alternate bar number to send to the bar number 
> > formatter
> >       (get-alt-number (lambda (ctx)
> >         (let
> >           (
> >             (alt-number (ly:context-property ctx 'alternativeNumber 0))
> >             (numbering-style (ly:context-property ctx 
> > 'alternativeNumberingStyle)))
> >           ; if alt-number > 0 and numbering-style != 'numbers-with-letters
> >           (if
> >             (and
> >               (> alt-number 0)
> >               (not (eqv? numbering-style 'numbers-with-letters)))
> >             0
> >             alt-number
> >       ; this function either creates the actual bar number if a simple grob 
> > (smob)
> >       ; or starts the spanner if using centered bar numbers.
> >       (create-bar-number (lambda (engr ctx txt)
> >         (let
> >           (
> >             (are-centered-bars (ly:context-property ctx 'centerBarNumbers 
> > #f)))
> >           (if (eqv? are-centered-bars #t)
> >             ; if we're using centered bar numbers
> >             (begin
> >                 (set! bar-span (ly:engraver-make-grob engr 
> > 'CenteredBarNumber '()))
> >                 (ly:spanner-set-bound! bar-span LEFT (ly:context-property 
> > ctx 'currentCommandColumn))
> >                 (ly:grob-set-property! bar-span 'text txt)
> >             )
> >             ; regular bar numbers
> >             (begin
> >                 (set! bar-text (ly:engraver-make-grob engr 'BarNumber '()))
> >                 (ly:grob-set-property! bar-text 'text txt)
> >             )
> >       (consider-creating-bar-number (lambda (engr ctx)
> >         (format #t "Considering creating bar number...~%")
> >         ; note that we considered a bar number here
> >         (set! considered-numbering #t)
> >
> >         ; if there is a center bar number pending, close it out now as we 
> > are now
> >         ; at the next bar line
> >         (when (ly:grob? bar-span) (
> >             ; set right (end) column
> >             (ly:spanner-set-bound! bar-span RIGHT (ly:context-property ctx 
> > 'currentCommandColumn))
> >             ; announce
> >             (ly:engraver-announce-end-grob engr bar-span '())
> >             ; reset bar-span
> >             (set! bar-span '()))
> >         ) ; end close bar span block
> >
> >         ; actual bar number consider logic
> >         (let (
> >           (cur-bar (ly:context-property ctx 'currentBarNumber))
> >           (measure-pos (ly:context-property ctx 'measurePosition 
> > (ly:make-moment 0)))
> >           ; bar number formatter
> >           (formatter (ly:context-property ctx 'barNumberFormatter))
> >         )
> >           ; if bar num mod 10 = 0, then we can put a bar number here
> >           (when
> >             (eqv? (modulo cur-bar 10) 0)
> >           

Re: Issue with download link

2022-07-25 Thread Knute Snortum
On Mon, Jul 25, 2022 at 6:56 AM Simon Albrecht  wrote:
>
> Hello everyone,
>
> On 24/07/2022 19:44, Jonas Hahnfeld via LilyPond user discussion wrote:
> > Please refer to the Installing section in the
> > Learning Manual for instructions how to set up the provided binaries:
> > https://lilypond.org/doc/v2.23/Documentation/learning/installing
>
> This link leads to a 2.23 documentation page which contains links for
> 2.22.1 binaries.
>
> Would it make more sense linking to
>  and
>  instead?

Ah, this ties in to what I posted early.  The webpage...

https://lilypond.org/doc/v2.23/Documentation/learning/command-line-setup

...has a link labeled Download that leads to this page:

https://lilypond.org/doc/v2.23/Documentation/web/download

It has "v2.23" in the URL, but the page still says "Downloads for
LilyPond 2.22.2"  Following this link you get to:

https://lilypond.org/doc/v2.23/Documentation/web/unix

Which is the best page I found earlier.  It has 2.22 downloads.

--
Knute Snortum



Re: Markup command trouble

2022-07-25 Thread Simon Albrecht

Hi David,

On 25/07/2022 16:35, David Kastrup wrote:

You probably meant

\markup spanish = \markup \italic \etc

which defines a markup command.  The way you wrote it, \spanish is just
a scheme function that happens to return the internals of a markup
command definition.


I did mean that. Strange that I didn’t remember that from when you 
introduced the \etc syntax—it is properly documented.


Thanks for helping out and all the best!
Simon




Re: Going back in MIDI time

2022-07-25 Thread Knute Snortum
On Mon, Jul 25, 2022 at 2:38 AM Jean Abou Samra  wrote:
>
>
>
> Le 25 juil. 2022 à 11:05, Mario Moles  a écrit :
>
> Hi lilponders!
>
> Do you know how to eliminate this warning? I have not found anything either 
> on the list or on google:
> "programming error: Going back in MIDI time.
> go on, cross your fingers "

I'm not sure that the documentation mentions this outright, but if you
have grace notes that take up too much MIDI time, but you still want
them appear in the score as written, you can do this:

%%%
\version "2.22.2"

\score {
  \new Staff \relative { c'8. c16 \grace { c8*1/4 d c b c } g'4 }
  \layout {}
  \midi {}
}
%%%

--
Knute Snortum



Re: LilyPond 2.23.11

2022-07-25 Thread Knute Snortum
On Sun, Jul 24, 2022 at 3:37 PM Jean Abou Samra  wrote:
>
>
>
> Le 25/07/2022 à 00:36, Jean Abou Samra a écrit :
> > Le 25/07/2022 à 00:32, Knute Snortum a écrit :
> >> Okay, it's even stranger than I thought. It's this URL:
> >>
> >> https://lilypond.org/doc/v2.23/Documentation/web/unix
> >>
> >> ...but the only way I can get to it is:
> >>
> >> https://lilypond.org/doc/v2.23/Documentation -> web -> download -> unix.
> >>
> >> It must be a Google thing -- even though I just tried to get to that
> >> page through a Google search and couldn't.  Weird.  Well, it's
> >> probably not something people are going to run into frequently.
> >
> >
> > You mean this?
> >
> > https://lilypond.org/doc/v2.23/Documentation/web/unix
>
>
> Sorry. I'm tired.

No worries. Get some sleep!

--
Knute Snortum



Re: Markup command trouble

2022-07-25 Thread David Kastrup
Simon Albrecht  writes:

> Dear list,
>
> I wanted to define a markup command for easy switchable styling of
> text and ran into an issue which seems hard to understand:
>
> 
> \version "2.23.9"
>
> spanish = \markup\italic \etc
>
> \markup \column {
>   \spanish \justify { test }
> }
> 
>
> => “error: not a markup”
>
> My understanding would have been that \justify returns a list of
> markups and the \spanish command, as if I had just used \italic
> directly, should act on all elements of that list. What did I get
> wrong? Is it just me or should that be made more predictable, if
> possible?

You probably meant

\markup spanish = \markup \italic \etc

which defines a markup command.  The way you wrote it, \spanish is just
a scheme function that happens to return the internals of a markup
command definition.

-- 
David Kastrup



Issue with download link

2022-07-25 Thread Simon Albrecht

Hello everyone,

On 24/07/2022 19:44, Jonas Hahnfeld via LilyPond user discussion wrote:

Please refer to the Installing section in the
Learning Manual for instructions how to set up the provided binaries:
https://lilypond.org/doc/v2.23/Documentation/learning/installing


This link leads to a 2.23 documentation page which contains links for 
2.22.1 binaries.


Would it make more sense linking to 
 and 
 instead?


Best, Simon




Markup command trouble

2022-07-25 Thread Simon Albrecht

Dear list,

I wanted to define a markup command for easy switchable styling of text 
and ran into an issue which seems hard to understand:



\version "2.23.9"

spanish = \markup\italic \etc

\markup \column {
  \spanish \justify { test }
}


=> “error: not a markup”

My understanding would have been that \justify returns a list of markups 
and the \spanish command, as if I had just used \italic directly, should 
act on all elements of that list. What did I get wrong? Is it just me or 
should that be made more predictable, if possible?


Best, Simon




Re: A new Scheme tutorial

2022-07-25 Thread David Kastrup
Jean Abou Samra  writes:

>> Le 25 juil. 2022 à 09:01, Andrew Bernard  a 
>> écrit :
>> 
>> 
>> Hello Jean,
>> 
>> This is a great effort.
>> 
>> A couple of suggestions. I suppose there are a few web pages with
>> lists of recommended texts for Scheme, but I think it would be great
>> if you added this one to the 'where to go from here' section:
>> 
>> Teach Yourself Scheme in Fixnum Days (ds26gte.github.io)
>> 
>
>
> Gosh, it seems to teach Lisp-style non-hygienic macros instead of
> syntax-rules/syntax-case. That’s heresy against my religion! OK, I
> stop now :-)

syntax-rules/syntax-case introduce a completely new and arbitrary syntax
intended to be human-readable.  That's sort of a counterthesis to the
LISP philosophy of representing programs by the data representation of
their parse tree, skipping a human-readable abstraction for the sake of
making it easy to programmatically generate and analyze programs.

Macros, in contrast, are just a flag on functions telling the evaluator
"evaluate the function result instead of its arguments".  That is an
almost trivial tweak.  More complex, indeed, is the quasiquote mechanism
that operates to a good degree in the LISP reader and makes it
comparatively easy to handle the creation of material suitable as macro
body.

In contrast to syntax-rules/syntax-case this reflects more a philosophy
rather than a religion since it isn't arbitrary.  Using it is more a
matter of understanding rather than learning it.

-- 
David Kastrup



Re: A new Scheme tutorial

2022-07-25 Thread Andrew Bernard
Yes, that is a downside - and I suppose if one is just learning Scheme 
one would not be aware of the issue.


Andrew


On 25/07/2022 10:11 pm, Jean Abou Samra wrote:
Gosh, it seems to teach Lisp-style non-hygienic macros instead of 
syntax-rules/syntax-case. That’s heresy against my religion! OK, I 
stop now :-)




Re: A new Scheme tutorial

2022-07-25 Thread Jean Abou Samra


> Le 25 juil. 2022 à 09:01, Andrew Bernard  a écrit 
> :
> 
> 
> Hello Jean,
> 
> This is a great effort.
> 
> A couple of suggestions. I suppose there are a few web pages with lists of 
> recommended texts for Scheme, but I think it would be great if you added this 
> one to the 'where to go from here' section:
> 
> Teach Yourself Scheme in Fixnum Days (ds26gte.github.io)
> 


Gosh, it seems to teach Lisp-style non-hygienic macros instead of 
syntax-rules/syntax-case. That’s heresy against my religion! OK, I stop now :-)

Thanks for that link, I saw it before but didn’t remember it. When I’m back 
from vacation, I’ll probably replace the reference to the books with a link to 
schemers.org.

Cheers,
Jean

> Also, the link to the SICP text is only for the companion site for the book, 
> not the text. I strongly urge anybody who is involved with Scheme to obtain 
> this book, and keep it on the desk and read it a dozen times. A superb 
> classic computer science text, quite unparalleled. Scheme was the standard 
> language taught at MIT for many years. A large number of people are 
> disappointed and dismayed that I believe they now teach Python instead. While 
> Python is a nice language. Scheme teaches a much higher level of abstract 
> thought, and even if you never use it, it makes you a better programmer.
> 
> And amazingly, here are Abelson and Sussman lecturing MIT 6.001 in 1986, the 
> complete series, for employees at HP.
> 
> https://youtube.com/playlist?list=PLE18841CABEA24090
> 
> 
> 
> Andrew
> 
> 
> 
> On 12/07/2022 9:28 am, Jean Abou Samra wrote:
>> Hi, 
>> 
>> Last year, after I delivered a presentation on Scheme at a 
>> French-speaking virtual meeting of LilyPond users, I was asked 
>> if I could write that down in tutorial form, which I did as 
>> https://tutoriel-scheme.readthedocs.io. Over the past few days, 
>> I've set some time apart to translate that into English. 
>> The English version can be found here: 
>> 
>> https://scheme-tutorial.readthedocs.io 
>> 


Re: Help needed with arranger.ly

2022-07-25 Thread David Kastrup
Eef Weenink  writes:

> :-) works fine. So if I understandn this correctly, inside a scheme
> part it is possible to insert lilypondinstructions like this:
>
> (scheme instructions #{ lilypondinstructions #}) 
>
> (that was not in the manual ;-)



-- 
David Kastrup



Re: Help needed with arranger.ly

2022-07-25 Thread Eef Weenink

Ok, I start studying . 
(I meant the manual if arranger.Ly) 

Met vriendelijke groet, Eef

H.E. Weenink MBA

> Op 25 jul. 2022 om 12:17 heeft David Kastrup  het volgende 
> geschreven:
> 
> Eef Weenink  writes:
> 
>> :-) works fine. So if I understandn this correctly, inside a scheme
>> part it is possible to insert lilypondinstructions like this:
>> 
>> (scheme instructions #{ lilypondinstructions #}) 
>> 
>> (that was not in the manual ;-)
> 
> 
> 
> -- 
> David Kastrup


Re: Help needed with arranger.ly

2022-07-25 Thread Eef Weenink
:-) works fine. So if I understandn this correctly, inside a scheme part it is 
possible to insert lilypondinstructions like this: 

(scheme instructions #{ lilypondinstructions #}) 

(that was not in the manual ;-)

regards, Eef 

> Op 25 jul. 2022, om 11:53 heeft Eef Weenink  het 
> volgende geschreven:
> 
> Merci beaucoup, I will check. regards, Eef 
> 
>> Op 25 jul. 2022, om 10:07 heeft Gilles Thibault  het 
>> volgende geschreven:
>> 
>> Le 2022-07-24 13:38, Eef Weenink a écrit :
>>> I need some help to get this nice program really running.
>>> I read the manual several times,studied NOTES.ly
>>> etcetera and now able to get the first parts of music on the correct
>>> place. :-)
>>> (I am using a score with 6 instruments and I am trying to arrange this
>>> or other combination of instruments. If needed I can give an example,
>>> but that is a lot of work, so hopefully my description is enough. )
>>> Question1:
>>> - How to insert a clef change at a specific point?
>>> I have two voices in lefthand of piano, created like:
>>> (rm 'leftOne  1 'leftOOne '(8 16)  )
>>> (rm 'leftTwo  1 'leftOTwo '(8 16)  )
>>> Now I need a clef change in bar 7, to change clef from treble to bass.
>> 
>> well i don't know exactly how your 2 voices are mixed in your lefthand.
>> I imagine that is something like that
>>   << \leftOne \\ \leftTwo >>
>> So i think that including a clef change in either on one voice would do the 
>> trick
>> 
>> (rm 'leftOne 7 #{ \clef "bass" #})
>> or
>> (rm 'leftTwo 7 #{ \clef "bass" #})
>> 
>> (Sorry, i am not at home for 2 days, i cannot test)
>> 
>>> Question 2:
>>> Having two voices in left hand, I want to insert the command to get
>>> stems of both voices in same direction. So in both voices I need to
>>> insert:
>>> \stemDown
>> 
>> If the insertion is in bar 5 for example :
>> (rm '(leftOne leftTwo) 5 #{ \stemDown #})
>> Or also
>> (rm '(leftOne leftTwo) 5 stemDown) ; should work
>> 
>>> Probably same questions for inserting articulations, slurs, etcera,
>>> Normally I would do that in the source of music, but when arranging
>>> that is not the way to go, because I want to reuse the same material
>>> perhaps with other slurs/etcetera.
>> 
>> You can have articulations pattern (copyArticulation.ly)
>> 
>> arti = { 16( 16) 8-. 8-. }
>> ...
>> (rm 'instru 15 (ca arti #{ c d e f g a b c #}))
>> 
>> 
>> -- 
>> Gilles
> 



Re: Help needed with arranger.ly

2022-07-25 Thread Eef Weenink
Merci beaucoup, I will check. regards, Eef 

> Op 25 jul. 2022, om 10:07 heeft Gilles Thibault  het 
> volgende geschreven:
> 
> Le 2022-07-24 13:38, Eef Weenink a écrit :
>> I need some help to get this nice program really running.
>> I read the manual several times,studied NOTES.ly
>> etcetera and now able to get the first parts of music on the correct
>> place. :-)
>> (I am using a score with 6 instruments and I am trying to arrange this
>> or other combination of instruments. If needed I can give an example,
>> but that is a lot of work, so hopefully my description is enough. )
>> Question1:
>> - How to insert a clef change at a specific point?
>> I have two voices in lefthand of piano, created like:
>>  (rm 'leftOne  1 'leftOOne '(8 16)  )
>>  (rm 'leftTwo  1 'leftOTwo '(8 16)  )
>> Now I need a clef change in bar 7, to change clef from treble to bass.
> 
> well i don't know exactly how your 2 voices are mixed in your lefthand.
> I imagine that is something like that
><< \leftOne \\ \leftTwo >>
> So i think that including a clef change in either on one voice would do the 
> trick
> 
>  (rm 'leftOne 7 #{ \clef "bass" #})
> or
>  (rm 'leftTwo 7 #{ \clef "bass" #})
> 
> (Sorry, i am not at home for 2 days, i cannot test)
> 
>> Question 2:
>> Having two voices in left hand, I want to insert the command to get
>> stems of both voices in same direction. So in both voices I need to
>> insert:
>> \stemDown
> 
> If the insertion is in bar 5 for example :
>  (rm '(leftOne leftTwo) 5 #{ \stemDown #})
> Or also
>  (rm '(leftOne leftTwo) 5 stemDown) ; should work
> 
>> Probably same questions for inserting articulations, slurs, etcera,
>> Normally I would do that in the source of music, but when arranging
>> that is not the way to go, because I want to reuse the same material
>> perhaps with other slurs/etcetera.
> 
> You can have articulations pattern (copyArticulation.ly)
> 
>  arti = { 16( 16) 8-. 8-. }
>  ...
>  (rm 'instru 15 (ca arti #{ c d e f g a b c #}))
> 
> 
> -- 
> Gilles



Re: Going back in MIDI time

2022-07-25 Thread Jean Abou Samra


> Le 25 juil. 2022 à 11:05, Mario Moles  a écrit :
> 
> Hi lilponders!
> 
> Do you know how to eliminate this warning? I have not found anything either 
> on the list or on google:
> "programming error: Going back in MIDI time.
> go on, cross your fingers "
> 
> Thanks

It’s mentioned on this page:

https://lilypond.org/doc/v2.22/Documentation/notation/special-rhythmic-concerns

If this is not the cause of your problem, please show a code example.

Best,
Jean

Re: Going back in MIDI time

2022-07-25 Thread Thomas Morley
Am Mo., 25. Juli 2022 um 11:05 Uhr schrieb Mario Moles
:
>
> Hi lilponders!
>
> Do you know how to eliminate this warning? I have not found anything
> either on the list or on google:
> "programming error: Going back in MIDI time.
> go on, cross your fingers "
>
> Thanks
>
>

Haven't seen this for long time.
In the past it was almost always caused by not synchronized graces.

Cheers,
  Harm



Going back in MIDI time

2022-07-25 Thread Mario Moles

Hi lilponders!

Do you know how to eliminate this warning? I have not found anything 
either on the list or on google:

"programming error: Going back in MIDI time.
go on, cross your fingers "

Thanks




Re: Spacing between Lyrics and Chordnames

2022-07-25 Thread Xavier Scheuer
On Mon, 25 Jul 2022 at 09:25, Randy Josleyn  wrote:
>
> Hi everyone!
>
> I'm trying to increase the spacing between the bottom line of lyrics and
the ChordNames in the next system.
>
> My score looks like the MWE below. I played with example below and even
without the ChordNames, the override doesn't behave as I expected it would.
I checked the IR and it says nonstaff-unrelatedstaff-spacing.padding is
set, so I assumed changing it would change the distance.
>
> I also tried setting the same setting on ChordNames, but it similarly had
no effect on the spacing.
>
> (snip)
>
> Can anyone make any suggestions to help me increase the space from the
bottom of the lyrics of one system and the top of the next system?

Hello,

Well, if it is spacing between two systems, then you should not look into
Flexible vertical spacing *within systems*.
Use system-system-spacing as described in NR 4.1.4 Flexible vertical
spacing \paper variables.

\paper {
  system-system-spacing.padding = #5
}

Cheers,
Xavier

-- 
Xavier Scheuer 


Re: Help needed with arranger.ly

2022-07-25 Thread Gilles Thibault

Le 2022-07-24 13:38, Eef Weenink a écrit :

I need some help to get this nice program really running.
I read the manual several times,studied NOTES.ly
etcetera and now able to get the first parts of music on the correct
place. :-)
(I am using a score with 6 instruments and I am trying to arrange this
or other combination of instruments. If needed I can give an example,
but that is a lot of work, so hopefully my description is enough. )

Question1:
- How to insert a clef change at a specific point?
I have two voices in lefthand of piano, created like:
  (rm 'leftOne  1 'leftOOne '(8 16)  )
  (rm 'leftTwo  1 'leftOTwo '(8 16)  )
Now I need a clef change in bar 7, to change clef from treble to bass.


well i don't know exactly how your 2 voices are mixed in your lefthand.
I imagine that is something like that
<< \leftOne \\ \leftTwo >>
So i think that including a clef change in either on one voice would do 
the trick


  (rm 'leftOne 7 #{ \clef "bass" #})
or
  (rm 'leftTwo 7 #{ \clef "bass" #})

(Sorry, i am not at home for 2 days, i cannot test)


Question 2:

Having two voices in left hand, I want to insert the command to get
stems of both voices in same direction. So in both voices I need to
insert:
 \stemDown


If the insertion is in bar 5 for example :
  (rm '(leftOne leftTwo) 5 #{ \stemDown #})
Or also
  (rm '(leftOne leftTwo) 5 stemDown) ; should work


Probably same questions for inserting articulations, slurs, etcera,
Normally I would do that in the source of music, but when arranging
that is not the way to go, because I want to reuse the same material
perhaps with other slurs/etcetera.


You can have articulations pattern (copyArticulation.ly)

  arti = { 16( 16) 8-. 8-. }
  ...
  (rm 'instru 15 (ca arti #{ c d e f g a b c #}))


--
Gilles



Spacing between Lyrics and Chordnames

2022-07-25 Thread Randy Josleyn
Hi everyone!

I'm trying to increase the spacing between the bottom line of lyrics and
the ChordNames in the next system.

My score looks like the MWE below. I played with example below and even
without the ChordNames, the override doesn't behave as I expected it would.
I checked the IR and it says nonstaff-unrelatedstaff-spacing.padding is
set, so I assumed changing it would change the distance.

I also tried setting the same setting on ChordNames, but it similarly had
no effect on the spacing.

%%% MWE 
\version "2.23.8"

\score {
<<
%\new ChordNames { \repeat unfold 4 { c1 c f g } }
\new Staff { \new Voice = "vox" \repeat unfold 16 { c'2 e'4 g' } }
\new Lyrics = A \lyricsto "vox" { \lyricmode { Line __ _ _ _  one,
_ _ _  line one! } }
%\new Lyrics = B \lyricsto "vox" { \lyricmode { Line __ _ _ _  two,
_ _ _  line two! } }
%\new Lyrics = C \lyricsto "vox" { \lyricmode { Line __ _ _ _
 three, _ _ _  line three! } }
%\new Lyrics = D \lyricsto "vox" { \lyricmode { Line __ _ _ _
 four, _ _ _  line four! } }
>>
\layout {
\context {
\Lyrics
\override VerticalAxisGroup.
  nonstaff-relatedstaff-spacing.padding = #5
\override VerticalAxisGroup.
  nonstaff-unrelatedstaff-spacing.padding = #5
}
}
}
%% END MWE %%
[image: image.png]

Can anyone make any suggestions to help me increase the space from the
bottom of the lyrics of one system and the top of the next system?

Thanks!

Regards,


Randy


Re: A new Scheme tutorial

2022-07-25 Thread Andrew Bernard

Hello Jean,

This is a great effort.

A couple of suggestions. I suppose there are a few web pages with lists 
of recommended texts for Scheme, but I think it would be great if you 
added this one to the 'where to go from here' section:


Teach Yourself Scheme in Fixnum Days (ds26gte.github.io) 



Also, the link to the SICP text is only for the companion site for the 
book, not the text. I strongly urge anybody who is involved with Scheme 
to obtain this book, and keep it on the desk and read it a dozen times. 
A superb classic computer science text, quite unparalleled. Scheme was 
the standard language taught at MIT for many years. A large number of 
people are disappointed and dismayed that I believe they now teach 
Python instead. While Python is a nice language. Scheme teaches a much 
higher level of abstract thought, and even if you never use it, it makes 
you a better programmer.


And amazingly, here are Abelson and Sussman lecturing MIT 6.001 in 1986, 
the complete series, for employees at HP.


https://youtube.com/playlist?list=PLE18841CABEA24090


Andrew


On 12/07/2022 9:28 am, Jean Abou Samra wrote:

Hi,

Last year, after I delivered a presentation on Scheme at a
French-speaking virtual meeting of LilyPond users, I was asked
if I could write that down in tutorial form, which I did as
https://tutoriel-scheme.readthedocs.io. Over the past few days,
I've set some time apart to translate that into English.
The English version can be found here:

https://scheme-tutorial.readthedocs.io


Re: Custom scheme engraver (Barline) problem

2022-07-25 Thread Jean Abou Samra


> Le 25 juil. 2022 à 08:23, Kyle Baldwin  a écrit :
> 
> 
> I'm trying to create a custom bar number engraver that will respond to couple 
> of different events, but wanted to initially try and clone the Bar number 
> engraver in c to scheme. Everything seems to work the way I want it to, 
> except for the positioning seems to be wrong. The numbers appear in line with 
> the top staff as opposed to above the top staff. 
> 
> If someone can help me get these numbers into the "correct" place, it would 
> be greatly appreciated. I think that it may have something to do with the 
> side-support not working correctly, but not sure why. 
> 
> Thanks 
> 
> %
> #(define (Bar_number_ten_engraver context)
>   ; main let 
>   (let*
> ; main let defs  
> (
>   ; we need two variables to hold information about current bar number 
> grobs.  
>   ; The bar-text is for regular bar numbers and the bar-span is for 
> spanning 
>   ; bar number - i.e., "centered" bar numbers. Default values we can just 
>   ; mark as empty lists to make error checking easier. (with null?)
>   (bar-text '())
>   (bar-span '())
>   ; The next set of variables are just used for internal state. 
>   (considered-numbering #f) ; flag to mark if we have already processed 
> this barline 
>   (saw-bar-line #t) ; flag to set when we see a barline. This 
> makes it 
> ; so the same barline isn't processed 
> multiple times. 
> ; although the first barline will never have 
> a number, 
> ; this should run the check to get things 
> started 
>   (break-allowed-now #f); store the value read in process-music. This 
> is 
> ; explained in the default bar number 
> engraved to 
> ; to avoid engraver order dependance. 
>   ; there are the "class" helper functions
>   ; this will get the alternate bar number to send to the bar number 
> formatter 
>   (get-alt-number (lambda (ctx) 
> (let 
>   (
> (alt-number (ly:context-property ctx 'alternativeNumber 0))
> (numbering-style (ly:context-property ctx 
> 'alternativeNumberingStyle)))
>   ; if alt-number > 0 and numbering-style != 'numbers-with-letters
>   (if 
> (and 
>   (> alt-number 0) 
>   (not (eqv? numbering-style 'numbers-with-letters)))
> 0
> alt-number
>   ; this function either creates the actual bar number if a simple grob 
> (smob)
>   ; or starts the spanner if using centered bar numbers. 
>   (create-bar-number (lambda (engr ctx txt)
> (let
>   (
> (are-centered-bars (ly:context-property ctx 'centerBarNumbers 
> #f)))
>   (if (eqv? are-centered-bars #t)
> ; if we're using centered bar numbers 
> (begin  
> (set! bar-span (ly:engraver-make-grob engr 'CenteredBarNumber 
> '()))
> (ly:spanner-set-bound! bar-span LEFT (ly:context-property ctx 
> 'currentCommandColumn))
> (ly:grob-set-property! bar-span 'text txt)
> )
> ; regular bar numbers 
> (begin 
> (set! bar-text (ly:engraver-make-grob engr 'BarNumber '()))
> (ly:grob-set-property! bar-text 'text txt)
> )
>   (consider-creating-bar-number (lambda (engr ctx) 
> (format #t "Considering creating bar number...~%") 
> ; note that we considered a bar number here 
> (set! considered-numbering #t)
> 
> ; if there is a center bar number pending, close it out now as we are 
> now 
> ; at the next bar line
> (when (ly:grob? bar-span) ( 
> ; set right (end) column 
> (ly:spanner-set-bound! bar-span RIGHT (ly:context-property ctx 
> 'currentCommandColumn))
> ; announce 
> (ly:engraver-announce-end-grob engr bar-span '())
> ; reset bar-span 
> (set! bar-span '())) 
> ) ; end close bar span block 
> 
> ; actual bar number consider logic 
> (let (
>   (cur-bar (ly:context-property ctx 'currentBarNumber))
>   (measure-pos (ly:context-property ctx 'measurePosition 
> (ly:make-moment 0)))
>   ; bar number formatter 
>   (formatter (ly:context-property ctx 'barNumberFormatter))
> )
>   ; if bar num mod 10 = 0, then we can put a bar number here 
>   (when 
> (eqv? (modulo cur-bar 10) 0) 
> (create-bar-number 
>   engr 
>   ctx 
>   (formatter 
> cur-bar 
> measure-pos 
> (- (get-alt-number ctx) 1)
> ctx)))
> ; main let body 
> (make-engraver

Custom scheme engraver (Barline) problem

2022-07-25 Thread Kyle Baldwin
I'm trying to create a custom bar number engraver that will respond to couple 
of different events, but wanted to initially try and clone the Bar number 
engraver in c to scheme. Everything seems to work the way I want it to, except 
for the positioning seems to be wrong. The numbers appear in line with the top 
staff as opposed to above the top staff.

If someone can help me get these numbers into the "correct" place, it would be 
greatly appreciated. I think that it may have something to do with the 
side-support not working correctly, but not sure why.

Thanks

%
#(define (Bar_number_ten_engraver context)
  ; main let
  (let*
    ; main let defs
    (
      ; we need two variables to hold information about current bar number 
grobs.
      ; The bar-text is for regular bar numbers and the bar-span is for spanning
      ; bar number - i.e., "centered" bar numbers. Default values we can just
      ; mark as empty lists to make error checking easier. (with null?)
      (bar-text '())
      (bar-span '())
      ; The next set of variables are just used for internal state.
      (considered-numbering #f) ; flag to mark if we have already processed 
this barline
      (saw-bar-line #t)         ; flag to set when we see a barline. This makes 
it
                                ; so the same barline isn't processed multiple 
times.
                                ; although the first barline will never have a 
number,
                                ; this should run the check to get things 
started
      (break-allowed-now #f)    ; store the value read in process-music. This is
                                ; explained in the default bar number engraved 
to
                                ; to avoid engraver order dependance.
      ; there are the "class" helper functions
      ; this will get the alternate bar number to send to the bar number 
formatter
      (get-alt-number (lambda (ctx)
        (let
          (
            (alt-number (ly:context-property ctx 'alternativeNumber 0))
            (numbering-style (ly:context-property ctx 
'alternativeNumberingStyle)))
          ; if alt-number > 0 and numbering-style != 'numbers-with-letters
          (if
            (and
              (> alt-number 0)
              (not (eqv? numbering-style 'numbers-with-letters)))
            0
            alt-number
      ; this function either creates the actual bar number if a simple grob 
(smob)
      ; or starts the spanner if using centered bar numbers.
      (create-bar-number (lambda (engr ctx txt)
        (let
          (
            (are-centered-bars (ly:context-property ctx 'centerBarNumbers #f)))
          (if (eqv? are-centered-bars #t)
            ; if we're using centered bar numbers
            (begin
                (set! bar-span (ly:engraver-make-grob engr 'CenteredBarNumber 
'()))
                (ly:spanner-set-bound! bar-span LEFT (ly:context-property ctx 
'currentCommandColumn))
                (ly:grob-set-property! bar-span 'text txt)
            )
            ; regular bar numbers
            (begin
                (set! bar-text (ly:engraver-make-grob engr 'BarNumber '()))
                (ly:grob-set-property! bar-text 'text txt)
            )
      (consider-creating-bar-number (lambda (engr ctx)
        (format #t "Considering creating bar number...~%")
        ; note that we considered a bar number here
        (set! considered-numbering #t)

        ; if there is a center bar number pending, close it out now as we are 
now
        ; at the next bar line
        (when (ly:grob? bar-span) (
            ; set right (end) column
            (ly:spanner-set-bound! bar-span RIGHT (ly:context-property ctx 
'currentCommandColumn))
            ; announce
            (ly:engraver-announce-end-grob engr bar-span '())
            ; reset bar-span
            (set! bar-span '()))
        ) ; end close bar span block

        ; actual bar number consider logic
        (let (
          (cur-bar (ly:context-property ctx 'currentBarNumber))
          (measure-pos (ly:context-property ctx 'measurePosition 
(ly:make-moment 0)))
          ; bar number formatter
          (formatter (ly:context-property ctx 'barNumberFormatter))
        )
          ; if bar num mod 10 = 0, then we can put a bar number here
          (when
            (eqv? (modulo cur-bar 10) 0)
            (create-bar-number
              engr
              ctx
              (formatter
                cur-bar
                measure-pos
                (- (get-alt-number ctx) 1)
                ctx)))
    ; main let body
    (make-engraver
      (acknowledgers
        (
          (bar-line-interface engraver grob source-engraver)
          (begin
            (format #t "Acknowledged barline.~%")
            (set! saw-bar-line #t)
          )
        )
      )
      ((process-acknowledged engraver)
        (begin
          ; if we saw a barline and we haven't considered numbering here yet...