Re: My finances.

2018-11-08 Thread Karlin High

On 11/8/2018 5:40 PM, Thomas Morley wrote:

  @ all:
I'd like to invite you to consider joining (if not already done).


And if anyone is wondering how:



"In Europe's EURO zone [...] SEPA transfers are usually easiest
(account number on request) as the fees must not exceed in-country EUR
transfers. U.S. and U.K. and a number of other countries get fewer
fees via Paypal (this mail address works fine)."

> Well, I'm not a native speaker so I doubt I've expressed myself
> accurately, so you may reread the mail I reply to.

I find little to correct. Dein Englisch ist besser als mein Deutsch.
--
Karlin High
Missouri, USA

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


Re: My finances.

2018-11-08 Thread Thomas Morley
Am Mi., 27. Juni 2018 um 22:31 Uhr schrieb David Kastrup :
>
>
> Hi folks,
>
> I've been afraid of looking at my bank account for the past months but
> finally had to do so.  For the last three months, the payments from
> LilyPond users were stable: one paying €100 monthly, one paying €75
> monthly, one paying €10 monthly.  Thanks, you know who you are (I hope).
>
> When adding in the payments arriving via Paypal, I am at about €200 per
> month.  Which doesn't pay for a whole lot of bills in Germany.
>
> Now obviously I am not currently providing a whole lot of value in
> return but at least enough that we will hopefully be seeing a reasonably
> tolerable stable version 2.20 soonish and it's not like I have nothing
> to do with it, either.  And it's not like when I wasn't yet hampered as
> absolutely by the blood pressure medication until skipping it gave me a
> stroke and not burned out as much that I earned as much as a software
> developer of my productivity then.  Or even as much as a janitor.
>
> I'll go looking for a menial minimum wage job soonish where I don't need
> to be creative on command.  In the meantime, try thinking about whether
> my contributions to what LilyPond is have been of value to you.  And if
> they were, consider giving some back.  And if you can't think of
> anything better than money, that's ok with me too.
>
> All the best
>
> David

Hi David,

I've sent something to your bank account. Should be available soon, if
not already.
Not as much I'd wish and with huge delay (sorry for that) ...

Thanks for all you've done and do.

 @ all:
I'd like to invite you to consider joining (if not already done).
Well, I'm not a native speaker so I doubt I've expressed myself
accurately, so you may reread the mail I reply to.

Thanks,
  Harm

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


Re: markup->string and user markup commands

2018-11-08 Thread Thomas Morley
Am Do., 8. Nov. 2018 um 21:00 Uhr schrieb Jérôme Plût :
>
>
> #(begin
> ; after http://lsr.di.unimi.it/LSR/Snippet?id=969
> (define-markup-command (with-background layout props color arg) (color? 
> markup?)
>(let* ((stencil (interpret-markup layout props arg))
>   (X-ext (ly:stencil-extent stencil X))
>   (Y-ext (ly:stencil-extent stencil Y)))
>  (ly:stencil-add (ly:make-stencil
>   (list 'color color
> (ly:stencil-expr (ly:round-filled-box X-ext Y-ext 0))
> X-ext Y-ext)) stencil)))
> (display "\"")
> (display (markup->string (markup #:with-background `(1. 0. 0.) "something")))
> (display "\"")
> )
>
> This should display "something". However it displays an empty string.
> How could I fix this?
>
> (I tried to manually debug markup->string (in scm/markup.scm): as I
> understand it, the problem is likely that with-background does not
> belong to the 'lily module. However, I am completely unfamiliar with
> guile's module system, so I don't have the slightest idea about how to
> fix this).
>
> Thanks,
>
> --
> Jérôme

You could do

(define all-relevant-markup-commands
  ;; Returns a list containing the names of all markup-commands and
  ;; markup-list-commands with predicate @code{cheap-markup?} or
  ;; @code{markup-list?} in their @code{markup-command-signature}.
  ;; @code{table-of-contents} is not caught, same for user-defined commands.
  ;; markup-commands from @code{markup-commands-to-ignore} are removed.
  (lset-difference eq?
(map car
  (filter
(lambda (x)
  (let* ((predicates (markup-command-signature (cdr x
(and predicates
 (not
   (null?
 (lset-intersection eq?
   '(cheap-markup? markup-list?)
   (map procedure-name predicates)))
 !!
 (append
   (ly:module->alist (current-module))
   (ly:module->alist (resolve-module '(lily))
markup-commands-to-ignore))

in markup->string from markup.scm

Not sure about unwished side-effects, though.

Cheers,
  Harm

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


Adding text (with horizontal padding) to slur

2018-11-08 Thread Pablo Cordal
Hi,

Finally I figured it out myself. This is function modified to incorporate a
horizontal padding:

annotatedSlur =
#(define-music-function (parser location paddingVertical paddingHorizontal
texto) (number? number? markup?)
   #{
 \once \override Slur.after-line-breaking =
 #(lambda (grob)
(let*
 ((stencil (ly:slur::print grob))
  (dir (ly:grob-property grob 'direction))
  (markup-stencil (grob-interpret-markup grob texto))
  (shift (- (interval-center (ly:stencil-extent stencil X))  (-
(interval-center (ly:stencil-extent markup-stencil X)) paddingHorizontal)))
  (new-stencil
   (ly:stencil-combine-at-edge
stencil
Y dir
(ly:stencil-translate-axis markup-stencil shift X)
paddingVertical)))
  (ly:grob-set-property! grob 'stencil new-stencil)))
   #})

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


markup->string and user markup commands

2018-11-08 Thread Jérôme Plût


#(begin
; after http://lsr.di.unimi.it/LSR/Snippet?id=969
(define-markup-command (with-background layout props color arg) (color? markup?)
   (let* ((stencil (interpret-markup layout props arg))
  (X-ext (ly:stencil-extent stencil X))
  (Y-ext (ly:stencil-extent stencil Y)))
 (ly:stencil-add (ly:make-stencil
  (list 'color color
(ly:stencil-expr (ly:round-filled-box X-ext Y-ext 0))
X-ext Y-ext)) stencil)))
(display "\"")
(display (markup->string (markup #:with-background `(1. 0. 0.) "something")))
(display "\"")
)

This should display "something". However it displays an empty string.
How could I fix this?

(I tried to manually debug markup->string (in scm/markup.scm): as I
understand it, the problem is likely that with-background does not
belong to the 'lily module. However, I am completely unfamiliar with
guile's module system, so I don't have the slightest idea about how to
fix this).

Thanks,

-- 
Jérôme

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


Re: Adding text to slurs

2018-11-08 Thread Urs Liska


Am 08.11.18 um 16:00 schrieb pablocordal:

Hi everyone!

I really have a special need with this function we have been talking about:


annotatedSlur =
#(define-music-function (parser location padding text) (number? markup?)
#{
  \once \override Slur.after-line-breaking =
  #(lambda (grob)
 (let*
  ((stencil (ly:slur::print grob))
   (dir (ly:grob-property grob 'direction))
   (markup-stencil (grob-interpret-markup grob text))
   (shift (- (interval-center (ly:stencil-extent stencil X))
(interval-center (ly:stencil-extent markup-stencil X
   (new-stencil
(ly:stencil-combine-at-edge
 stencil
 Y dir
 (ly:stencil-translate-axis markup-stencil shift X)
 padding)))
  (ly:grob-set-property! grob 'stencil new-stencil)))
#})


The funcion works fine, but I think it would be even better if it could
receive another number. This number should move the text horizontally in the
slur- sometimes, the text collides with another element, and it would be
great to move it forward or backward a little.

Any master coder out there can help me with this please?



annotatedSlur =
#(define-music-function (parser location padding hor-offset text) 
(number? number? markup?)

   #{
 \once \override Slur.after-line-breaking =
 #(lambda (grob)
    (let*
 ((stencil (ly:slur::print grob))
  (dir (ly:grob-property grob 'direction))
  (markup-stencil (grob-interpret-markup grob text))
  (shift (+ hor-offset
   (- (interval-center (ly:stencil-extent stencil X))
   (interval-center (ly:stencil-extent markup-stencil 
X)

  (new-stencil
   (ly:stencil-combine-at-edge
    stencil
    Y dir
    (ly:stencil-translate-axis markup-stencil shift X)
    padding)))
 (ly:grob-set-property! grob 'stencil new-stencil)))
   #})

{
  \annotatedSlur 2 1 "Here"
  c'1 ( d' )
}

But of course this means you have to use "0" everytime you do *not* need 
the horizontal offset.


Best
Urs



Thank you. Best regards



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


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


Re: Modified slur stencil with added markup

2018-11-08 Thread Pablo Cordal
Hi again!
Can I propose a small modification in the "annotated slur" funcion?

annotatedSlur =
#(define-music-function (parser location padding text) (number? markup?)
   #{
 \once \override Slur.after-line-breaking =
 #(lambda (grob)
(let*
 ((stencil (ly:slur::print grob))
  (dir (ly:grob-property grob 'direction))
  (markup-stencil (grob-interpret-markup grob text))
  (shift (- (interval-center (ly:stencil-extent stencil X))
   (interval-center (ly:stencil-extent markup-stencil X
  (new-stencil
   (ly:stencil-combine-at-edge
stencil
Y dir
(ly:stencil-translate-axis markup-stencil shift X)
padding)))
 (ly:grob-set-property! grob 'stencil new-stencil)))
   #})

Sometimes the text collides with another element, so it would be even
better if the function would have another parameter for horizontal
alignment.
Any master coder can help me with this please?

Thank you. Best regards

El jue., 8 nov. 2018 a las 16:33, Pablo Cordal ()
escribió:

> Hi again!
> Can I propose a small modification in this funcion?
>
> annotatedSlur =
> #(define-music-function (parser location padding text) (number? markup?)
>#{
>  \once \override Slur.after-line-breaking =
>  #(lambda (grob)
> (let*
>  ((stencil (ly:slur::print grob))
>   (dir (ly:grob-property grob 'direction))
>   (markup-stencil (grob-interpret-markup grob text))
>   (shift (- (interval-center (ly:stencil-extent stencil X))
>(interval-center (ly:stencil-extent markup-stencil X
>   (new-stencil
>(ly:stencil-combine-at-edge
> stencil
> Y dir
> (ly:stencil-translate-axis markup-stencil shift X)
> padding)))
>  (ly:grob-set-property! grob 'stencil new-stencil)))
>#})
>
> Sometimes the text collides with another element, so it would be even
> better if the function would have another parameter for horizontal
> alignment.
> Any master coder can help me with this please?
>
> Thank you. Best regards
>
> El dom., 4 nov. 2018 a las 17:26, Pablo Cordal ()
> escribió:
>
>> Thank you very very very much Harm. Now it works perfectly, it is just
>> what I needed!.
>>
>> Best regards
>>
>> El dom., 4 nov. 2018 a las 17:20, Thomas Morley (<
>> thomasmorle...@gmail.com>) escribió:
>>
>>> Am So., 4. Nov. 2018 um 16:38 Uhr schrieb pablocordal <
>>> pablocor...@gmail.com>:
>>> >
>>> > Hi Urs and Torsten,
>>> >
>>> > This snippet is exactly what I need. I'm trying to test it, but when I
>>> copy
>>> > your code in Frescobaldi (which uses Lilypond underneath) and try to
>>> compile
>>> > it I receive this error:
>>> >
>>> >  error: syntax error, unexpected LYRIC_ELEMENT
>>> >   \markup  "hin."
>>> >
>>> > I don't know much about Lilypond code, so please can you please help
>>> me just
>>> > to make it work?
>>> >
>>> > Thank you. Best regards
>>>
>>> You likely use 2.18.2
>>> With this version the possibility to use optional arguments is limited
>>> and does not work for the current coding.
>>>
>>> Please consider to upgrade to 2.19.82.
>>>
>>> If you want to stay with 2.18 some adjustments in the function are
>>> needed, also, the function must be called with _two_ arguments: the
>>> padding-value and the markup-text.
>>>
>>> \version "2.18.2"
>>>
>>> annotatedSlur =
>>> #(define-music-function (parser location padding text) (number? markup?)
>>>#{
>>>  \once \override Slur.after-line-breaking =
>>>  #(lambda (grob)
>>> (let*
>>>  ((stencil (ly:slur::print grob))
>>>   (dir (ly:grob-property grob 'direction))
>>>   (markup-stencil (grob-interpret-markup grob text))
>>>   (shift (- (interval-center (ly:stencil-extent stencil X))
>>>(interval-center (ly:stencil-extent markup-stencil
>>> X
>>>   (new-stencil
>>>(ly:stencil-combine-at-edge
>>> stencil
>>> Y dir
>>> (ly:stencil-translate-axis markup-stencil shift X)
>>> padding)))
>>>  (ly:grob-set-property! grob 'stencil new-stencil)))
>>>#})
>>>
>>> {
>>>   \annotatedSlur
>>>   %\markup \score { c''' }
>>>   #1
>>>   \markup  "hin."
>>>   c''4( g' g' c'' )
>>> }
>>>
>>> HTH,
>>>   Harm
>>>
>>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Modified slur stencil with added markup

2018-11-08 Thread Pablo Cordal
Hi again!
Can I propose a small modification in this funcion?

annotatedSlur =
#(define-music-function (parser location padding text) (number? markup?)
   #{
 \once \override Slur.after-line-breaking =
 #(lambda (grob)
(let*
 ((stencil (ly:slur::print grob))
  (dir (ly:grob-property grob 'direction))
  (markup-stencil (grob-interpret-markup grob text))
  (shift (- (interval-center (ly:stencil-extent stencil X))
   (interval-center (ly:stencil-extent markup-stencil X
  (new-stencil
   (ly:stencil-combine-at-edge
stencil
Y dir
(ly:stencil-translate-axis markup-stencil shift X)
padding)))
 (ly:grob-set-property! grob 'stencil new-stencil)))
   #})

Sometimes the text collides with another element, so it would be even
better if the function would have another parameter for horizontal
alignment.
Any master coder can help me with this please?

Thank you. Best regards

El dom., 4 nov. 2018 a las 17:26, Pablo Cordal ()
escribió:

> Thank you very very very much Harm. Now it works perfectly, it is just
> what I needed!.
>
> Best regards
>
> El dom., 4 nov. 2018 a las 17:20, Thomas Morley ()
> escribió:
>
>> Am So., 4. Nov. 2018 um 16:38 Uhr schrieb pablocordal <
>> pablocor...@gmail.com>:
>> >
>> > Hi Urs and Torsten,
>> >
>> > This snippet is exactly what I need. I'm trying to test it, but when I
>> copy
>> > your code in Frescobaldi (which uses Lilypond underneath) and try to
>> compile
>> > it I receive this error:
>> >
>> >  error: syntax error, unexpected LYRIC_ELEMENT
>> >   \markup  "hin."
>> >
>> > I don't know much about Lilypond code, so please can you please help me
>> just
>> > to make it work?
>> >
>> > Thank you. Best regards
>>
>> You likely use 2.18.2
>> With this version the possibility to use optional arguments is limited
>> and does not work for the current coding.
>>
>> Please consider to upgrade to 2.19.82.
>>
>> If you want to stay with 2.18 some adjustments in the function are
>> needed, also, the function must be called with _two_ arguments: the
>> padding-value and the markup-text.
>>
>> \version "2.18.2"
>>
>> annotatedSlur =
>> #(define-music-function (parser location padding text) (number? markup?)
>>#{
>>  \once \override Slur.after-line-breaking =
>>  #(lambda (grob)
>> (let*
>>  ((stencil (ly:slur::print grob))
>>   (dir (ly:grob-property grob 'direction))
>>   (markup-stencil (grob-interpret-markup grob text))
>>   (shift (- (interval-center (ly:stencil-extent stencil X))
>>(interval-center (ly:stencil-extent markup-stencil
>> X
>>   (new-stencil
>>(ly:stencil-combine-at-edge
>> stencil
>> Y dir
>> (ly:stencil-translate-axis markup-stencil shift X)
>> padding)))
>>  (ly:grob-set-property! grob 'stencil new-stencil)))
>>#})
>>
>> {
>>   \annotatedSlur
>>   %\markup \score { c''' }
>>   #1
>>   \markup  "hin."
>>   c''4( g' g' c'' )
>> }
>>
>> HTH,
>>   Harm
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Adding text to slurs

2018-11-08 Thread pablocordal
Hi everyone!

I really have a special need with this function we have been talking about:


annotatedSlur =
#(define-music-function (parser location padding text) (number? markup?)
   #{
 \once \override Slur.after-line-breaking =
 #(lambda (grob)
(let*
 ((stencil (ly:slur::print grob))
  (dir (ly:grob-property grob 'direction))
  (markup-stencil (grob-interpret-markup grob text))
  (shift (- (interval-center (ly:stencil-extent stencil X))
   (interval-center (ly:stencil-extent markup-stencil X
  (new-stencil
   (ly:stencil-combine-at-edge
stencil
Y dir
(ly:stencil-translate-axis markup-stencil shift X)
padding)))
 (ly:grob-set-property! grob 'stencil new-stencil)))
   #})


The funcion works fine, but I think it would be even better if it could
receive another number. This number should move the text horizontally in the
slur- sometimes, the text collides with another element, and it would be
great to move it forward or backward a little.

Any master coder out there can help me with this please?

Thank you. Best regards



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

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


Re: \goto for Lilypond

2018-11-08 Thread Kieren MacMillan
Hi Jérôme,

> Oh! I guess you meant, "Why don't I cue directly from the
> oboe/bassoon/etc. voice"?

Yes.  =)

> In that case, the reason is that I generally
> only need to redo the trombone/horn parts (instead of the full 20-25
> voices in the orchestra...), so I don't have full oboe/etc. voices to
> quote from. Hence the fact that I put all cues in the same voice.

Ah! That makes a lot of sense. Sorry for the noisy question.

Kieren.



Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: \goto for Lilypond

2018-11-08 Thread Jérôme Plût
Sexto Idus Octobres MMXVIII scripsit Jérôme Plût :
> Sexto Idus Octobres MMXVIII scripsit Kieren MacMillan :
> > Hi Jérôme,
> > 
> > > and cues in another variable:
> > 
> > May I ask why you don’t use the built-in cue system? I’ve found it very 
> > useful and flexible.
> 
> I do use it! I have another set of macros (not shown here) that
> basically wrap \cueDuringWithClef. (I actually wrote a generator for
> such trivial wrappers, which I use like this:

Oh! I guess you meant, "Why don't I cue directly from the
oboe/bassoon/etc. voice"? In that case, the reason is that I generally
only need to redo the trombone/horn parts (instead of the full 20-25
voices in the orchestra...), so I don't have full oboe/etc. voices to
quote from. Hence the fact that I put all cues in the same voice.

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


Re: \goto for Lilypond

2018-11-08 Thread Jérôme Plût
Sexto Idus Octobres MMXVIII scripsit Kieren MacMillan :
> Hi Jérôme,
> 
> > and cues in another variable:
> 
> May I ask why you don’t use the built-in cue system? I’ve found it very 
> useful and flexible.

I do use it! I have another set of macros (not shown here) that
basically wrap \cueDuringWithClef. (I actually wrote a generator for
such trivial wrappers, which I use like this:

cc = #(cue-gen "cues" "")
ccF = #(cue-gen "cues" "" "F")
ctA = #(cue-gen "tromboneA" "Tbn. I" "F")
ctB = #(cue-gen "tromboneB" "Tbn. II" "F")

{ ... \cc R1*2 ... }

I could send it here in case anyone were interested (but it would need
a bit of code cleansing before)).

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


Re: \goto for Lilypond

2018-11-08 Thread Kieren MacMillan
Hi Jérôme,

> and cues in another variable:

May I ask why you don’t use the built-in cue system? I’ve found it very useful 
and flexible.

> Now I can write the previous score in this way:
> 
> global = {
>  \at-bar 1 { \time 4/4 \tempo "..." }
>  \at-bar 48 { \mark "A" }
>  \at-bar 86 { \mark "B" }
> }

David K wrote a similar function for me a couple of years ago.
Clearly, something like this should be in the regular distro…

Cheers,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: \goto for Lilypond

2018-11-08 Thread Jérôme Plût
> cues = {
>   % I don't know about you, but I like having *a lot* of cues to
>   % follow. I suspect that being a former pianist, I find it easier
>   % than most brass colleagues to read several lines at once?
>   R1*15 % bar 16
>   \relative { fis'1^"Fl." } % bar 17
>   R1*24
>   \relative { c''1^"Ob." } % bar 41
> }

By the way, a secondary question:

the \cues voice has some cues from a large number of instruments and
therefore a large range. So the clef used for the cues will depend on
the instrument I am currently cueing from.

Currently I use several different macros for cueing in F, G or current
clef. Does there exist a way to put the clef info in the cue voice
itself? (e.g. a oboe cue will always be in G clef, whereas a viola cue
will not provoke a clef change). Or else, to have access to the cued
music (and possibly the current clef) to compute an appropriate
cue-clef?

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


\goto for Lilypond

2018-11-08 Thread Jérôme Plût
I quite often find myself transcribing a part of a big orchestral
score from IMSLP (e.g., putting the horns in F
transposition and the trombones in bass clef -- our brass section is
not too good at exotic sightreading).

For this I put the global structure of a movement in a \global
variable, such as:


global = {
  \time 4/4 \tempo "Al dente ma non troppo"
  s1*47 \mark "A" % bar 48
  s1*38 \mark "B" % bar 86
  ...
}

and cues in another variable:

cues = {
  % I don't know about you, but I like having *a lot* of cues to
  % follow. I suspect that being a former pianist, I find it easier
  % than most brass colleagues to read several lines at once?
  R1*15 % bar 16
  \relative { fis'1^"Fl." } % bar 17
  R1*24
  \relative { c''1^"Ob." } % bar 41
}

Keeping tracks of the bar numbers is a bit tedious, and I find myself
doing a *lot* of additions/subtractions (« sooo this oboe cue is 7
bars before A, and my last cue ended at bar 17, which makes it, let's
see.. 17 measures of rest »). And then spend twice as long fixing the
bugs (and introducing new ones, etc.)



So I wrote a few macros to automate this (and I expect them to pay
for themselves in only 1-2 more symphonies).

Now I can write the previous score in this way:

global = {
  \at-bar 1 { \time 4/4 \tempo "..." }
  \at-bar 48 { \mark "A" }
  \at-bar 86 { \mark "B" }
}

cues = <<
  \relative { \goto 16 fis'1^"Fl." }
  \relative { \goto "A-7" c''1^"Ob." } % we can even make them relative
>>

(In particular, this makes *inserting* a new cue much, much easier).

The functions should work even in the presence of varying time
signatures. A proof of concept (in 608 parentheses) is in the attached file.

Drawbacks (those identified for now):
 - \partial is not recognized yet
   (but this is quite easy to compensate for, by putting the
   appropriate skip at the beginning of \global);
 - this assumes that alternateBarNumbering is 'numbers-with-letters,
   (the other way around is quite easier; I could put some code to
   identify \set Score.alternateBarNumbering commands);
 - it *does not work* (for syntax reasons) in the presence of true
   repeats (they must be simulated using Score.repeatCommands);
 - when a voice uses \at-bar, it must *only* use \at-bar (this is the
   only way to keep track of time; see my previous question).


Oh, and by the way, I have a half-serious bug-report:
negative-length skips don't work.

-- 
Jérôme

#(begin

(use-modules (ice-9 regex))

(define (print . l) (map display l) (newline) #f)
(define (music-length m)
  "Duration of m, as a rational"
(ly:moment-main (ly:music-length m)))


(define (rcons e l) (append! l (list e)))

;  alternatives: 
;   VoltaRepeatedMusic 'element [rpt] 'repeat-count 2 'elements [alternatives]
;   - if 'numbers, then sets bar number to the *sum* of all lengths
;   - if 'numbers-with-letters, sets bar number to the *last* length only
; HOWEVER, inserting \atBar syntaxically prevents us from inserting ture
; \repeat volta  { ... } construct; we are stuck with
; score.repeatCommands, which produces
; 'ContextSpeccedMusic 'context-type 'Score 'element
;('PropertySet 'symbol 'repeatCommands 'value ... )

; the (bar number ↦ time) function* is piecewise affine.
; - slope is current time signature
; - jumps are introduced by \partial, repeats, or currentBarNumber changes.
; The status of timing is given by a list:
; (current-time, last-bar, last-time, last-sig, last-volta) where:
;  - current-time [rational] = duration since beginning of music
;  - last-bar  = bar number of beginning of current affine function part
;  - last-time = position of same (rational)
;  - last-sig  = signature of same (rational)
;  - last-volta= bar number of current volta (or #f)
; The *bars-affine* global holds only the last 4 values.
(define *bars-affine* '()) ; list of (bar pos sig volta)
(define *bars-marks* '())
(define *bars-current-time* 0)
(define *bar-number-defining* #t)

(define (reset-bar-structures!)
  (set! *bars-marks* '())
  (set! *bars-affine* '((1 0 1 #f)))
  #t)
(reset-bar-structures!)
(define (bar-find-affine-part bar data)
  (if (< bar (caar data)) (bar-find-affine-part bar (cdr data))
(car data)))

(define (update-bars-affine! bar pos sig volta)
  (set! *bars-affine* (cons (list bar pos sig volta) *bars-affine*)))
(define (update-bars-marks! bar mark)
  (set! *bars-marks* (cons (cons mark bar) *bars-marks*)))

; this appends (if needed) a new state in structures
; and returns the current state
(define (update-bar-structures! music . state);<<<
  (let* (
(prop (lambda (x . y) (apply ly:music-property music (cons x y
(n (prop 'name))
(state (if (null? state) (list 0 1 0 1 #f) (car state)))
(pos (list-ref state 0))
(last-bar (list-ref state 1))
(last-time (list-ref state 2))
(last-sig (list-ref state 3))
(last-volta (list-ref state 4))
(this-bar (+ last-bar (/ (- pos last-time) last-sig)))
  ) (cond
  ((eq? n 'SequentialMusic)
(fold 

Re: Adjusting angle of glissando

2018-11-08 Thread Andrew Bernard
Hi Mark,

Thanks!

I also just discovered this approach:

\once \override Glissando.bound-details.left.Y = #-3.8
\once \override Glissando.bound-details.right.Y = #-4.2


On Thu, 8 Nov 2018 at 20:40, Mark Knoop  wrote:

> You want something like
>
> -\tweak extra-dy #-1 \glissando
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Reading global variables from Scheme [documentation request?]

2018-11-08 Thread Thomas Morley
Am Do., 8. Nov. 2018 um 10:10 Uhr schrieb David Kastrup :
>
> Jérôme Plût  writes:
>
> > I would like to *read*, from within a Scheme function
> > (define-music-function), the values of variables such as
> > Score.currentBarNumber or Score.alternativeNumberingStyle.
> >
> > I can have a guess that this is possible with such functions as
> > ly:context-property or ly:output-def-lookup, but the documentation of
> > these functions is quite terse.
> >
> > How is it possible to access these values?
>
> Not at all since they don't exist at the time a music function is
> interpreted.  Depending on what you actually want to do, you might
> install callbacks that kick in at a time where those values exist.
>
> How this is done depends on just what you want to see done when.
>
> --
> David Kastrup

Hi Jérôme,

could you post some example- or pseudo-code what you want to achieve?
Would be helpful...

Have to run for my regular job now, though.


Cheers,
  Harm

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


Re: Adjusting angle of glissando

2018-11-08 Thread Mark Knoop
At 20:31 on 08 Nov 2018, Andrew Bernard wrote:
>My colleague wants a glissando on an angle down from the first note to
>the last in the typical example of his work attached.
>
>How can one adjust the endpoints of a glissando? I looked everywhere
>to no avail.

You want something like

-\tweak extra-dy #-1 \glissando

>While we are here, I am told that this is stock standard and common
>notation. Is it actually (esp, having to make the hack with a grace
>note at the end)?
>
>Sorry the MWE cant be shorter, but it needs to be this ling to show to
>the full context. The musical problem the engraver faces of course, as
>opposed to a man with a pencil, is that C# and C are at the same
>level, and he wants the angle to show the slope down in pitch (I
>remain unconvinced.)
>
>Andrew
>
>%%
>
>\version "2.19.82"
>
>glissandoSkipOn = {
>  \override NoteColumn.glissando-skip = ##t
>  \hide NoteHead
>  \override NoteHead.no-ledgers = ##t
>}
>
>glissandoSkipOff = {
>  \revert NoteColumn.glissando-skip
>  \undo \hide NoteHead
>  \revert NoteHead.no-ledgers
>}
>
>{
>  \time 1/4
>  \clef bass
>  \stemUp
>  \tuplet 3/2 {
>deh,4\glissando
>\glissandoSkipOn cis,16
>\glissandoSkipOff
>cis,16\glissando
>\glissandoSkipOn
>  }
>  \tuplet 3/2 {
>c,4
>\glissandoSkipOff
>\grace { \once \override Stem.transparent = ##t c,!8 }
>\breathe
>d8\rest
>  }
>}
>
>%%


-- 
Mark Knoop

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


Adjusting angle of glissando

2018-11-08 Thread Andrew Bernard
My colleague wants a glissando on an angle down from the first note to the
last in the typical example of his work attached.

How can one adjust the endpoints of a glissando? I looked everywhere to no
avail.

While we are here, I am told that this is stock standard and common
notation. Is it actually (esp, having to make the hack with a grace note at
the end)?

Sorry the MWE cant be shorter, but it needs to be this ling to show to the
full context. The musical problem the engraver faces of course, as opposed
to a man with a pencil, is that C# and C are at the same level, and he
wants the angle to show the slope down in pitch (I remain unconvinced.)

Andrew

%%

\version "2.19.82"

glissandoSkipOn = {
  \override NoteColumn.glissando-skip = ##t
  \hide NoteHead
  \override NoteHead.no-ledgers = ##t
}

glissandoSkipOff = {
  \revert NoteColumn.glissando-skip
  \undo \hide NoteHead
  \revert NoteHead.no-ledgers
}

{
  \time 1/4
  \clef bass
  \stemUp
  \tuplet 3/2 {
deh,4\glissando
\glissandoSkipOn cis,16
\glissandoSkipOff
cis,16\glissando
\glissandoSkipOn
  }
  \tuplet 3/2 {
c,4
\glissandoSkipOff
\grace { \once \override Stem.transparent = ##t c,!8 }
\breathe
d8\rest
  }
}

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


Re: Reading global variables from Scheme [documentation request?]

2018-11-08 Thread David Kastrup
Jérôme Plût  writes:

> I would like to *read*, from within a Scheme function
> (define-music-function), the values of variables such as
> Score.currentBarNumber or Score.alternativeNumberingStyle.
>
> I can have a guess that this is possible with such functions as
> ly:context-property or ly:output-def-lookup, but the documentation of
> these functions is quite terse.
>
> How is it possible to access these values?

Not at all since they don't exist at the time a music function is
interpreted.  Depending on what you actually want to do, you might
install callbacks that kick in at a time where those values exist.

How this is done depends on just what you want to see done when.

-- 
David Kastrup

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


Reading global variables from Scheme [documentation request?]

2018-11-08 Thread Jérôme Plût
I would like to *read*, from within a Scheme function
(define-music-function), the values of variables such as
Score.currentBarNumber or Score.alternativeNumberingStyle.

I can have a guess that this is possible with such functions as
ly:context-property or ly:output-def-lookup, but the documentation of
these functions is quite terse.

How is it possible to access these values?

Thanks,

-- 
Jérôme

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