Re: Transparent box around notes

2024-05-04 Thread Paolo Prete
Thanks, I'll check it out!

Il ven 3 mag 2024, 14:23 K. Blum  ha scritto:

> Hi Paolo, hi David,
>
> I've replaced the current stencil function with the one from the
> openLilyLib "frames" module (which has even more capabilities).
> Here is the result:
> https://github.com/KlausBlum/Ly-Boxer-Snippet
> If you like, please feel free to experiment or add further things...
>
> I'll try to send you an invitation to give you full access to that repo.
> (Never done that before, but I'll find my way...)
>
> If anyone else is interested, please send a short message. :-)
>
> Cheers,
> Klaus
>


Re: Transparent box around notes

2024-05-01 Thread Paolo Prete
Hello David and Klaus,

A further improvement is to add colors with alpha channel.

I therefore replaced (see the attached file):

   (if filled
  (ly:make-stencil (list 'color fill-color
 (list 'round-filled-box
   (- (- (car xext) thick)) (+ (cdr xext) thick)
   (- (car yext)) (cdr yext)
   0.0)
 xext yext))
  empty-stencil)

with:

  (if filled
  (stencil-with-color
(ly:round-filled-box xext yext 0)
fill-color)
  empty-stencil)


But the alpha channel is ignored...
Is there a way to fix this?

Thanks!






>
% \version "2.19.15"
\version "2.24.1"


\header {
  tagline = ##f
}

#(define-event-class 'music-boxer-event 'span-event)

#(define-event-class 'box-event 'music-event)

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

#(define (define-grob-property symbol type? description)
   ;(if (not (equal? (object-property symbol 'backend-doc) #f))
   ;(ly:error (_ "symbol ~S redefined") symbol))

   (set-object-property! symbol 'backend-type? type?)
   (set-object-property! symbol 'backend-doc description)
   symbol)

#(map
  (lambda (x)
(apply define-grob-property x))

  `(
 (filled ,boolean? "Should we fill in this box?")
 (fill-color ,color? "Background color for filling the rectangle")
 (acknowledge-finger-interface ,boolean? "Include fingerings in box?")
 (acknowledge-script-interface ,boolean? "Include scripts in box?")
 ; add more properties here
 ))

#(define (make-box thick padding filled fill-color open-on-left open-on-right xext yext)
   (let* ((xext (interval-widen xext padding))
  (yext (interval-widen yext padding)))
 (ly:stencil-add
  (if filled
  (stencil-with-color
(ly:round-filled-box xext yext 0)
fill-color)
  empty-stencil)
  (if (> thick 0)
  (make-filled-box-stencil
   (cons (- (car xext) thick) (+ (cdr xext) thick))
   (cons (- (car yext) thick) (car yext)))
  empty-stencil)
  (if (> thick 0)
  (make-filled-box-stencil
   (cons (- (car xext) thick) (+ (cdr xext) thick))
   (cons (cdr yext) (+ (cdr yext) thick)))
  empty-stencil)
  (if (and (not open-on-right) (> thick 0))
  (make-filled-box-stencil
   (cons (cdr xext) (+ (cdr xext) thick))
   yext)
  empty-stencil)
  (if (and (not open-on-left) (> thick 0))
  (make-filled-box-stencil
   (cons (- (car xext) thick) (car xext))
   yext)
  empty-stencil)
  )))

#(define (music-boxer-stencil grob)
   (let* ((elts (ly:grob-object grob 'elements))
  (refp-X (ly:grob-common-refpoint-of-array grob elts X))
  (X-ext (ly:relative-group-extent elts refp-X X))
  (refp-Y (ly:grob-common-refpoint-of-array grob elts Y))
  (Y-ext (ly:relative-group-extent elts refp-Y Y))
  (padding (ly:grob-property grob 'padding 0.3))
  (thick (ly:grob-property grob 'thickness 0.1))
  (filled (ly:grob-property grob 'filled #f))
  (fill-color (ly:grob-property grob 'fill-color grey))
  (offset (ly:grob-relative-coordinate grob refp-X X))
  ; (left-bound  (ly:spanner-bound grob LEFT))
  ; (right-bound (ly:spanner-bound grob RIGHT))
  ; (break-dir-L (ly:item-break-dir left-bound))
  ; (break-dir-R (ly:item-break-dir right-bound))
  ; (open-on-left  (if (=  1 break-dir-L) #t #f))
  ; (open-on-right (if (= -1 break-dir-R) #t #f))
  (open-on-left
   (and (ly:spanner? grob)
(= 1 (ly:item-break-dir (ly:spanner-bound grob LEFT)
  ; (open-on-left 
  ; (if (ly:spanner? grob)
  ; (if (=  1 (ly:item-break-dir (ly:spanner-bound grob LEFT)))
  ;#t #f)
  ;  #f))
  (open-on-right
   (and (ly:spanner? grob)
(= -1 (ly:item-break-dir (ly:spanner-bound grob RIGHT)
  ;(open-on-right
  ;(if (ly:spanner? grob)
  ;   (if (= -1 (ly:item-break-dir (ly:spanner-bound grob RIGHT)))
  ;  #t #f)
  ; #f))
  (stil (make-box thick padding filled fill-color
  open-on-left open-on-right X-ext Y-ext))
  )
 (ly:stencil-translate-axis stil (- offset) X)
 )
   )

#(define box-stil music-boxer-stencil)

#(add-grob-definition
  'Box
  `(
 (stencil . ,box-stil)
 (meta . ((class . Item)
  (interfaces . ())

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


#(define box-types
   

Re: Transparent box around notes

2024-04-30 Thread Paolo Prete
Ta

On Tue, Apr 30, 2024 at 8:04 PM K. Blum  wrote:

> Hi Paolo, hi everyone,
>
> > Yeah, it works if I just replace add-grob-definition with:
> >
> > #(define (add-grob-definition grob-name grob-entry)
> >(set! all-grob-descriptions
> >  (cons ((@@ (lily) completize-grob-entry)
> > (cons grob-name grob-entry))
> >all-grob-descriptions)))
> >
> > That said, the snippet is _very_ useful, and certainly much easier to
> > use than the lsr snippet. I strongly encourage the community to add it
> > to the repository, because the trial and error method is inaccurate
> > and time consuming.
> > That said, is there an easy way to adapt it so that it draws a colored
> > box (with transparency) instead of a rectangle with segments?
>
> if you read the further replies to the thread
> https://lists.gnu.org/archive/html/lilypond-user/2015-01/msg00416.html
> you will find that there was an attempt to combine David Nalesnik's
> engraver with the colored boxes from snippet 1000:
> https://lists.gnu.org/archive/html/lilypond-user/2015-01/msg00416.html
>
> I've applied your version of add-grob-definition from above to the
> latest working state of our attempts and came up with boxer3b.ly, see
> attached.
>

This is really great, thanks, I'm going to use it intensively!
fortunately you read and responded to my message, otherwise this feature
would have been swallowed up and obscured in the confusion of the mailing
list archive (and I would have wasted days reinventing the wheel).
After I've done more testing I'll post a new message proposing to remove
the current snippet from the LSR and replace it with yours and David's
implementation.

Cheers,
Paoo



>
> Hope to help,
> Klaus
>
>


Re: Fw: Frescobaldi ... panic alternatives?

2024-04-30 Thread Paolo Prete
You'll find all you need at the main page:

https://github.com/paopre/Spontini

Cheers

On Tue, Apr 30, 2024 at 10:04 PM Mark Stephen Mrotek 
wrote:

> Paolo,
>
>
>
> Installation instructions?
> Learning/notation manual?
>
> I want to try it.
>
>
>
> Mark
>
>
>
> *From:* lilypond-user-bounces+carsonmark=ca.rr@gnu.org
>  *On Behalf Of *Paolo
> Prete
> *Sent:* Tuesday, April 30, 2024 12:58 PM
> *To:* Dirck Nagy ; lilypond-user 
> *Subject:* Re: Fw: Frescobaldi ... panic alternatives?
>
>
>
> FYI I just made a new release of Spontini editor, with the most recent
> changes (most notably: support for recent Lilypond versions)
>
> As mentioned before, I don't own a  MacOS, but the HUGE implemented CI/CD
> should avoid bad surprises. When I say "huge", I mean it.
>
> I always hope that someone decides to host the application, so that it
> provides the same service that LilyBin previously offered.
>
> Please note that you don't have to install anything. Nor the editor, nor
> LilyPond, and you can switch between multiple LilyPond versions.
>
> Anyway, I'm currently the only developer and maintainer of the software,
> and I need collaboration (most notably for testing). Without it, I'm forced
> to mark my releases as "alfa"  (but it should work...)
>
>
>
> https://github.com/paopre/Spontini/releases/tag/1.23_alfa
>
>
>
>
>
> On Tue, Apr 30, 2024 at 12:56 PM Paolo Prete  wrote:
>
>
>
>
>
> On Tue, Apr 30, 2024 at 6:45 AM Dirck Nagy  wrote:
>
> Hi all
>
>
>
> Reading that last thread about Frescobaldi and its possible disappearance
> from Mac is causing me to panic. Jean, I did not realize that you were the
> last person to seriously work on Frescobaldi / Mac.
>
>
>
> I use Mac exclusively, and Frescobaldi / Lilypond is very important to me.
>
>
>
> FYI, what I like the most about Frescobaldi are:
>
>
>
>- Templates and wizards
>- Snippets
>- Point and Click selection
>- Syntax highlighting
>
>
>
> If Frescobaldi for Mac does indeed vanish, what are my alternatives for a
> Lilypond editor?
>
>
>
>
>
> Hi,
>
>
>
> Although https://github.com/paopre/Spontini is focused on _very
> different_ tasks than Frescobaldi, it has the features you just mentioned
> (they are exposed in a somewhat different way, but they should work),
> including code completion
>
> I could not extensively test it in the past months, nor I own a Mac, but
> thanks to CI/CD it should work on newer versions.
>
> I'm planning to make a new release in the next few weeks.
>
> Also, at the moment there are no active contributors for it. Therefore,
> any help is really appreciated...
>
>
>
>
>
>


Re: Fw: Frescobaldi ... panic alternatives?

2024-04-30 Thread Paolo Prete
FYI I just made a new release of Spontini editor, with the most recent
changes (most notably: support for recent Lilypond versions)
As mentioned before, I don't own a  MacOS, but the HUGE implemented CI/CD
should avoid bad surprises. When I say "huge", I mean it.
I always hope that someone decides to host the application, so that it
provides the same service that LilyBin previously offered.
Please note that you don't have to install anything. Nor the editor, nor
LilyPond, and you can switch between multiple LilyPond versions.
Anyway, I'm currently the only developer and maintainer of the software,
and I need collaboration (most notably for testing). Without it, I'm forced
to mark my releases as "alfa"  (but it should work...)

https://github.com/paopre/Spontini/releases/tag/1.23_alfa


On Tue, Apr 30, 2024 at 12:56 PM Paolo Prete  wrote:

>
>
> On Tue, Apr 30, 2024 at 6:45 AM Dirck Nagy  wrote:
>
>> Hi all
>>
>> Reading that last thread about Frescobaldi and its possible disappearance
>> from Mac is causing me to panic. Jean, I did not realize that you were the
>> last person to seriously work on Frescobaldi / Mac.
>>
>>
>> I use Mac exclusively, and Frescobaldi / Lilypond is very important to
>> me.
>>
>>
>> FYI, what I like the most about Frescobaldi are:
>>
>>
>>
>>-
>>
>>Templates and wizards
>>-
>>
>>Snippets
>>-
>>
>>Point and Click selection
>>-
>>
>>Syntax highlighting
>>
>>
>> If Frescobaldi for Mac does indeed vanish, what are my alternatives for a
>> Lilypond editor?
>>
>>
>>
> Hi,
>
> Although https://github.com/paopre/Spontini is focused on _very
> different_ tasks than Frescobaldi, it has the features you just mentioned
> (they are exposed in a somewhat different way, but they should work),
> including code completion
> I could not extensively test it in the past months, nor I own a Mac, but
> thanks to CI/CD it should work on newer versions.
> I'm planning to make a new release in the next few weeks.
> Also, at the moment there are no active contributors for it. Therefore,
> any help is really appreciated...
>
>
>


Re: Fw: Frescobaldi ... panic alternatives?

2024-04-30 Thread Paolo Prete
On Tue, Apr 30, 2024 at 6:45 AM Dirck Nagy  wrote:

> Hi all
>
> Reading that last thread about Frescobaldi and its possible disappearance
> from Mac is causing me to panic. Jean, I did not realize that you were the
> last person to seriously work on Frescobaldi / Mac.
>
>
> I use Mac exclusively, and Frescobaldi / Lilypond is very important to me.
>
>
> FYI, what I like the most about Frescobaldi are:
>
>
>
>-
>
>Templates and wizards
>-
>
>Snippets
>-
>
>Point and Click selection
>-
>
>Syntax highlighting
>
>
> If Frescobaldi for Mac does indeed vanish, what are my alternatives for a
> Lilypond editor?
>
>
>
Hi,

Although https://github.com/paopre/Spontini is focused on _very different_
tasks than Frescobaldi, it has the features you just mentioned (they are
exposed in a somewhat different way, but they should work), including code
completion
I could not extensively test it in the past months, nor I own a Mac, but
thanks to CI/CD it should work on newer versions.
I'm planning to make a new release in the next few weeks.
Also, at the moment there are no active contributors for it. Therefore, any
help is really appreciated...


Re: Transparent box around notes

2024-04-30 Thread Paolo Prete
On Tue, Apr 30, 2024 at 6:38 AM Werner LEMBERG  wrote:

>
> > [...] the snippet is _very_ useful, and certainly much easier to use
> > than the lsr snippet.
>
> Please submit the example as a new LSR snippet.
>
>
I submitted it (see: https://lsr.di.unimi.it/LSR/Item?u=1=1188 ) but the
second box is not correctly displayed (I tested it with LP 2.24.1 and it's
ok).
Should it be deleted?
Note also that it partially overlaps with
https://lsr.di.unimi.it/LSR/Item?id=1000 : it solves the non-automatic size
issue, but it doesn't provide colors and background.


> Note that we already have a (slightly different) issue for that:
>
>   https://gitlab.com/lilypond/lilypond/-/issues/833
>
>
I added a link to the previous message


> Are you willing to work on that?  It would need extensive tests (for
> example, to add other grobs like trill spanners to the box),
> documentation, and one or more regression tests.
>
>
Unfortunately I'm not that familiar with Scheme/Guile so to modify it with
the color/background feature in a reasonably short time.
And I don't even know if this modification is trivial or not...



>
> Werner
>


Re: Transparent box around notes

2024-04-29 Thread Paolo Prete
Yeah, it works if I just replace add-grob-definition with:

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

That said, the snippet is _very_ useful, and certainly much easier to use
than the lsr snippet. I strongly encourage the community to add it to the
repository, because the trial and error method is inaccurate and time
consuming.
That said, is there an easy way to adapt it so that it draws a colored box
(with transparency) instead of a rectangle with segments?

Thanks again,
P

(I attach here the updated version of the snippet)



On Sun, Apr 28, 2024 at 11:38 AM Robin Bannister  wrote:

> Paolo Prete wrote:
> > Note that there's also this (no trial-and-error):
> >
> > https://lists.gnu.org/archive/html/lilypond-user/2015-01/msg00142.html
> >
> > But it doesn't compile with 2.24...
> >
>
> That's due to merge request !818 [1], applied between 2.23.3 and 2.23.4.
>
> Simon Albrecht ran into the same problem in another case, and Jean
> helped him out [2] by adapting just the add-grob-definition part.
>
> Doing the same to David N's add-grob-definition gets his code running
> again.  Maybe that's all you need to do.
>
>
> [1] https://gitlab.com/lilypond/lilypond/-/merge_requests/818
> [2] https://lists.gnu.org/archive/html/lilypond-user/2021-12/msg00045.html
>
>
> Cheers,
> Robin
>
\version "2.19.15"

\header {
  tagline = ##f
}

#(define-event-class 'music-boxer-event 'span-event)

#(define-event-class 'box-event 'music-event)

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

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

\score {
  \new Staff \melody
}

\layout {
  \context {
\Global
\grobdescriptions #all-grob-descriptions
  }
  \context {
\Score
\consists \musicBoxerEngraver % for spans
\consists \boxEngraver
  }
}


Re: Transparent box around notes

2024-04-27 Thread Paolo Prete
Note that there's also this (no trial-and-error):

https://lists.gnu.org/archive/html/lilypond-user/2015-01/msg00142.html

But it doesn't compile with 2.24...

On Sat, Apr 27, 2024 at 2:20 PM Paolo Prete  wrote:

> Thanks for the tip, but unfortunately it doesn't seem to fit what I'm
> looking for.
> Looking for example at
> https://lsr.di.unimi.it/LSR/Search?q=background+%7C+colorspan , the box
> coordinates must be calculated with a trial and error procedure, which is
> pretty tedious.
>
> Cheers,
> P
>
> On Sat, Apr 27, 2024 at 12:17 PM Robin Bannister  wrote:
>
>> Paolo Prete wrote:
>> > Something like:
>> >
>> > \coloredBox color offsLeft offsTop offsRight offsBottom "labelstring"
>> > labeldirection { c' e' f' }
>> >
>> > Many thanks for your help!
>> > Paolo
>>
>>
>> This may get you started:
>>
>> https://lsr.di.unimi.it/LSR/Search?q=background+%7C+colorspan
>>
>>
>> Cheers,
>> Robin
>>
>


Re: Transparent box around notes

2024-04-27 Thread Paolo Prete
Thanks for the tip, but unfortunately it doesn't seem to fit what I'm
looking for.
Looking for example at
https://lsr.di.unimi.it/LSR/Search?q=background+%7C+colorspan , the box
coordinates must be calculated with a trial and error procedure, which is
pretty tedious.

Cheers,
P

On Sat, Apr 27, 2024 at 12:17 PM Robin Bannister  wrote:

> Paolo Prete wrote:
> > Something like:
> >
> > \coloredBox color offsLeft offsTop offsRight offsBottom "labelstring"
> > labeldirection { c' e' f' }
> >
> > Many thanks for your help!
> > Paolo
>
>
> This may get you started:
>
> https://lsr.di.unimi.it/LSR/Search?q=background+%7C+colorspan
>
>
> Cheers,
> Robin
>


Transparent box around notes

2024-04-26 Thread Paolo Prete
Hello LilyPonders,

How can I draw a box around a group of notes so that (see the attached
image)

1) it is filled with a transparent color
2) it occupies the minimum area that includes the notes + four (optional)
offsets (left, top, right, bottom) that can be set by the user?
3) ... it would be great if I can add a label to the top or bottom of the
box

Something like:

\coloredBox color offsLeft offsTop offsRight offsBottom "labelstring"
labeldirection { c' e' f' }

Many thanks for your help!
Paolo


Re: Default value of top-margin setting

2023-02-20 Thread Paolo Prete
Thanks to you and Aaron!

On Mon, Feb 20, 2023 at 10:37 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> the default value for top-margin is set in
>
> ly/paper-defaults-init.ly
>
> Currently this is 10mm scaled to the selected paper size (so for the
> default
> paper size (A4) this is 10mm, for other sizes this is scaled accodingly).
>
> Cheers,
> Valentin
>
> Am Montag, 20. Februar 2023, 22:30:51 CET schrieb Paolo Prete:
> > Hello,
> >
> > Regarding the top-margin setting of the \paper block, where can I find
> its
> > default value(s) for the various versions (2.20.x, 2.21.x, 2.22.x etc.) ?
> >
> > Thanks!
>
>


Default value of top-margin setting

2023-02-20 Thread Paolo Prete
Hello,

Regarding the top-margin setting of the \paper block, where can I find its
default value(s) for the various versions (2.20.x, 2.21.x, 2.22.x etc.) ?

Thanks!


Re: Workaround for issue on tuplet of skips

2023-02-19 Thread Paolo Prete
Great, thanks Jean!

It made the editor compatible with 2.25.x series too

On Sun, Feb 19, 2023 at 2:18 AM Jean Abou Samra  wrote:

> Le dimanche 19 février 2023 à 02:09 +0100, Paolo Prete a écrit :
>
> Hello LilyPonders,
>
> Currently, I checked that Spontini-Editor has an incompatibility with LP
> 2.25.x (it works well with 2.24.x branch) due to this bug:
>
> https://gitlab.com/lilypond/lilypond/-/issues/6482
>
> More specifically, the incompatibility happens when hidden tuplets of
> skips, which don't compile in the 2.25.x series, are dynamically created by
> the cross-staff libraries of the editor, e.g:  \tuplet 3/2 {s8 s s}
> Of course I'll wait that the LP issue gets fixed, but given that it can
> take some time, I'm considering to work around it, meanwhile, with a Scheme
> filter that does the following transformation:
>
> { c' d' \tuplet 3/2 { s8 s s } f'  \tuplet 5/4 { s4 s s s s } }
>
> becomes
>
> {  c ' d' s8 s f'  s4 s s s } }
>
> (NOTE: skips inside the tuplets have no articulations, nor dynamics etc.)
>
> Therefore I gently ask: is it trivial to write such a Scheme function? If
> simple, how can I implement it?
>
> NOTE 2: if the resulting Scheme code is long, I'd probably (?) wait until
> the issue gets fixed.
>
> Thanks very much!
>
> So IIUC, you want to remove tuplets that contain only skips?
>
> Try something like this:
>
> \version "2.25.2"
>
> noSkipTuplets =
> \musicMap
> #(lambda (m)
>(if (and (music-is-of-type? m 'time-scaled-music)
> (every (lambda (e)
>  (music-is-of-type? e 'skip-event))
>(extract-typed-music m 'rhythmic-event)))
>(ly:music-property m 'element)
>m))
> \etc
> toplevel-music-functions = #(cons noSkipTuplets toplevel-music-functions)
>
> {
>   \tuplet 3/2 { c'8 d' e' }
>   c' d'
>   \tuplet 3/2 { s8 s s }
>   f'4
>   \tuplet 5/4 { s4 s s s s }
> }
>
> When it encounters a tuplet with no notes inside, it removes the tuplet
> music wrapper, leaving only the inner (time-scaled) music.
>
> Best,
>
> Jean
>


Workaround for issue on tuplet of skips

2023-02-18 Thread Paolo Prete
Hello LilyPonders,

Currently, I checked that Spontini-Editor has an incompatibility with LP
2.25.x (it works well with 2.24.x branch) due to this bug:

https://gitlab.com/lilypond/lilypond/-/issues/6482

More specifically, the incompatibility happens when hidden tuplets of
skips, which don't compile in the 2.25.x series, are dynamically created by
the cross-staff libraries of the editor, e.g:  \tuplet 3/2 {s8 s s}
Of course I'll wait that the LP issue gets fixed, but given that it can
take some time, I'm considering to work around it, meanwhile, with a Scheme
filter that does the following transformation:

{ c' d' \tuplet 3/2 { s8 s s } f'  \tuplet 5/4 { s4 s s s s } }

becomes

{  c ' d' s8 s f'  s4 s s s } }

(NOTE: skips inside the tuplets have no articulations, nor dynamics etc.)

Therefore I gently ask: is it trivial to write such a Scheme function? If
simple, how can I implement it?

NOTE 2: if the resulting Scheme code is long, I'd probably (?) wait until
the issue gets fixed.

Thanks very much!


Re: Spontini-Editor 1.20 released

2023-01-17 Thread Paolo Prete
There is an executable for Linux too.
Download it here:

Spontini-Editor-1.20_alfa-linux_x86_64.tar.gz
<https://github.com/paopre/Spontini/releases/download/1.20_alfa/Spontini-Editor-1.20_alfa-linux_x86_64.tar.gz>

then click on SpontiniServer (_not_ SpontiniServer.py) and the program runs
without any installation.



On Wed, Jan 18, 2023 at 2:37 AM Knute Snortum  wrote:

> On Mon, Jan 16, 2023 at 10:07 AM Paolo Prete  wrote:
>
> > You just have to run the executable, not the .py file.
>
> But I'm on Linux.
>
> --
> Knute Snortum
>


Re: Spontini-Editor 1.20 released

2023-01-16 Thread Paolo Prete
Il lun 16 gen 2023, 19:04 Knute Snortum  ha scritto:

> On Mon, Jan 16, 2023 at 4:59 AM Paolo Prete  wrote:
> >
> > Hi,
> >
> > A new release (1.20-alpha) of Spontini-Editor is available at:
> >
> > https://github.com/paopre/Spontini/releases/tag/1.20_alfa
> >
> > It includes two important features:
> >
> > 1) The application is now _totally_ no-install.
>
> Not quite for me.  I'm on Ubuntu 22.04.1 and I needed to add three
> dependencies before the server would start:
>
> $ python SpontiniServer.py
> Traceback (most recent call last):
>   File "/home/knute/git-repos/Spontini/SpontiniServer.py", line 22, in
> 
>

You just have to run the executable, not the .py file.


Re: Spontini-Editor 1.20 released

2023-01-16 Thread Paolo Prete
Thanks for your feedback!

BTW: the editor is ready to be used as an alternative to LilyBin, which is
currently down and not updated, I always hope that in some way we can
obtain free hosting and storage for it...

On Mon, Jan 16, 2023 at 2:59 PM Karlin High  wrote:

> On Mon, Jan 16, 2023 at 6:59 AM Paolo Prete  wrote:
> > A new release (1.20-alpha) of Spontini-Editor is available
>
> Looks very nice so far! I have it running on Windows 10, will explore
> further.
> --
> Karlin High
> Missouri, USA
>


Spontini-Editor 1.20 released

2023-01-16 Thread Paolo Prete
Hi,

A new release (1.20-alpha) of Spontini-Editor is available at:

https://github.com/paopre/Spontini/releases/tag/1.20_alfa

It includes two important features:

1) The application is now _totally_ no-install. This means that you just
need to unzip the downloaded release for the desired operating system
(Linux, Windows or MacOS) and click on the executable to launch the editor,
which now starts very quickly (I applied the same method used by LilyPond).
Furthermore, there is no need to download and install LilyPond either:
Spontini-Editor will automatically download and bundle, inside its tree,
one or more versions of LilyPond, at the user's choice. By default, it will
use LilyPond 2.24.0

2) (For readers with knowledge of software development) A big set of CI/CD
tests has been added. These tests ensure strong stability to the program.
One of the tests, for example, compiles all the included examples for
numerous versions of LilyPond, on all three supported operating systems:
this also catches LilyPond regressions (and in fact with this tool I
identified the one reported in the following issue:
https://gitlab.com/lilypond/lilypond/-/issues/6482 ). The tests really
involve all the parts of the program, from the GUI (via Cypress) to the
backend and _all_ the included libraries are automatically tested. There
are also tests made with ImageMagick to verify that scores' output is
perceptually correct (and this is useful also for catching LilyPond's
regressions). The creation of releases with executables has also been
automated.

Thanks to these features, I will do very easy and fast updates in the
future months for all the supported platforms and included tools.
The current release is labeled as alfa, but it should work.
I'll put it as non-alfa in the next few days, depending on feedback and
further tests done.

Therefore, any feedback is _greatly_ appreciated (please report any issue
on the GitHub page)!

Visit the homepage of the project for more infos:

https://github.com/paopre/Spontini

HTH
Paolo


Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
I need to change them.
More specifically, each:

xlink:href="textedit:///some/personal/path/file.ly:x:y:z"

should be changed into

xlink:href="textedit:///dummy/path/file.ly:x:y:z"

For all the grobs with such metadata (SVG)

Anyway, with 4 lines of python postprocess code I did the operation, so,
never mind: all solved.

Neverthless, IMHO this feature should be exposed in the API, because the
lack of control of personal data should not be a trade-off for using an
appealing feature such as the point-and-click one

Best,
Paolo



On Monday, October 31, 2022, Jean Abou Samra  wrote:

>
>
> Wait — by "clean up", do you mean changing them or removing them?
> If the latter, *that* can be done cleanly; which grobs should
> be affected?
>
> Best,
> Jean
>
>


Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
BTW,

for unknown reasons your mails always go to the spam folder. I don't
experience the same issue with other members of the ml, and I don't
understand if the issue is on my account or on yours...

On Monday, October 31, 2022, Paolo Prete  wrote:

>
> Thank you as always!
>
> In Spontini-Editor there are examples with generated SVG files that rely
> on point-and-click in order to be edited. Although included paths are dummy
> paths, I would like to clean them without post-processing the files. But I
> think I don't have alternatives, given that the functions you use are not
> part of the API (and I need to make this operation any supported LilyPond
> version). I preview I have to do some Python postprocess script with regex
>
>
> Cheers,
> Paolo
>
>
> On Monday, October 31, 2022, Jean Abou Samra  wrote:
>
>> Le 31/10/2022 à 17:56, Jean Abou Samra a écrit :
>>
>>> In general, no.
>>>
>>
>>
>> Well, I spoke too fast. You can do
>>
>> \version "2.23.80"
>>
>> #(set!
>>   (@@ (lily output-ps) stencil-dispatch-alist)
>>   (assq-set!
>>(@@ (lily output-ps) stencil-dispatch-alist)
>>'grob-cause
>>(lambda (offset grob)
>>  (if (ly:get-option 'point-and-click)
>>  (let* ((cause (ly:grob-property grob 'cause))
>> (music-origin (if (ly:stream-event? cause)
>>   (ly:event-property cause 'origin)))
>> (point-and-click (ly:get-option 'point-and-click)))
>>(if (and
>> (ly:input-location? music-origin)
>> (cond ((boolean? point-and-click) point-and-click)
>>   ((symbol? point-and-click)
>>(ly:in-event-class? cause point-and-click))
>>   (else (any (lambda (t)
>>(ly:in-event-class? cause t))
>>  point-and-click
>>(let* ((location (ly:input-file-line-char-column
>> music-origin))
>>   (raw-file (car location))
>>   (file (if (is-absolute? raw-file)
>> raw-file
>> (string-append (ly-getcwd) "/"
>> raw-file)))
>>   (x-ext (ly:grob-extent grob grob X))
>>   (y-ext (ly:grob-extent grob grob Y)))
>>
>>  (if (and (< 0 (interval-length x-ext))
>>   (< 0 (interval-length y-ext)))
>>  (ly:format " ~4f ~4f ~4f ~4f
>> (textedit://~a:~a:~a:~a) mark_URI\n"
>> (+ (car offset) (car x-ext))
>> (+ (cdr offset) (car y-ext))
>> (+ (car offset) (cdr x-ext))
>> (+ (cdr offset) (cdr y-ext))
>>
>> ;; Backslashes are not valid
>> ;; file URI path separators.
>> (ly:string-percent-encode
>>  (ly:string-substitute
>> "\\" "/" file))
>> "foo.ly"
>>
>> (cadr location)
>> (caddr location)
>> (1+ (cadddr location)))
>>  ""))
>>""))
>>  ""
>>
>> { c' }
>>
>>
>>
>>
>> Basically, tamper with the LilyPond function that outputs
>> these textedit:// links. In this example, I'm replacing
>> the file name with "foo.ly".
>>
>> However, this is using undocumented variables that are explicitly
>> not public, so you're at your own risk -- it can and almost
>> certainly will break with some future version of LilyPond,
>> and a replacement will not be guaranteed to exist. Also, it
>> would need different code to work in SVG output.
>>
>> If you can use a different method, that would be really preferable.
>>
>> Best,
>> Jean
>>
>>
>>
>>


Re: Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
Thank you as always!

In Spontini-Editor there are examples with generated SVG files that rely on
point-and-click in order to be edited. Although included paths are dummy
paths, I would like to clean them without post-processing the files. But I
think I don't have alternatives, given that the functions you use are not
part of the API (and I need to make this operation any supported LilyPond
version). I preview I have to do some Python postprocess script with regex


Cheers,
Paolo


On Monday, October 31, 2022, Jean Abou Samra  wrote:

> Le 31/10/2022 à 17:56, Jean Abou Samra a écrit :
>
>> In general, no.
>>
>
>
> Well, I spoke too fast. You can do
>
> \version "2.23.80"
>
> #(set!
>   (@@ (lily output-ps) stencil-dispatch-alist)
>   (assq-set!
>(@@ (lily output-ps) stencil-dispatch-alist)
>'grob-cause
>(lambda (offset grob)
>  (if (ly:get-option 'point-and-click)
>  (let* ((cause (ly:grob-property grob 'cause))
> (music-origin (if (ly:stream-event? cause)
>   (ly:event-property cause 'origin)))
> (point-and-click (ly:get-option 'point-and-click)))
>(if (and
> (ly:input-location? music-origin)
> (cond ((boolean? point-and-click) point-and-click)
>   ((symbol? point-and-click)
>(ly:in-event-class? cause point-and-click))
>   (else (any (lambda (t)
>(ly:in-event-class? cause t))
>  point-and-click
>(let* ((location (ly:input-file-line-char-column
> music-origin))
>   (raw-file (car location))
>   (file (if (is-absolute? raw-file)
> raw-file
> (string-append (ly-getcwd) "/" raw-file)))
>   (x-ext (ly:grob-extent grob grob X))
>   (y-ext (ly:grob-extent grob grob Y)))
>
>  (if (and (< 0 (interval-length x-ext))
>   (< 0 (interval-length y-ext)))
>  (ly:format " ~4f ~4f ~4f ~4f (textedit://~a:~a:~a:~a)
> mark_URI\n"
> (+ (car offset) (car x-ext))
> (+ (cdr offset) (car y-ext))
> (+ (car offset) (cdr x-ext))
> (+ (cdr offset) (cdr y-ext))
>
> ;; Backslashes are not valid
> ;; file URI path separators.
> (ly:string-percent-encode
>  (ly:string-substitute
> "\\" "/" file))
> "foo.ly"
>
> (cadr location)
> (caddr location)
> (1+ (cadddr location)))
>  ""))
>""))
>  ""
>
> { c' }
>
>
>
>
> Basically, tamper with the LilyPond function that outputs
> these textedit:// links. In this example, I'm replacing
> the file name with "foo.ly".
>
> However, this is using undocumented variables that are explicitly
> not public, so you're at your own risk -- it can and almost
> certainly will break with some future version of LilyPond,
> and a replacement will not be guaranteed to exist. Also, it
> would need different code to work in SVG output.
>
> If you can use a different method, that would be really preferable.
>
> Best,
> Jean
>
>
>
>


Question about paths in point-and-click

2022-10-31 Thread Paolo Prete
Hello,

Is it possible to set/customize the path information in the point-and-click
metadata of LilyPond's output?

Thanks!


Re: Error with -dbackend=null (Lilypond 2.23.10)

2022-07-10 Thread Paolo Prete
?

On Sunday, July 10, 2022, David Kastrup  wrote:

> Jean Abou Samra  writes:
>
> > Le 10/07/2022 à 17:38, Paolo Prete a écrit :
> >> I just used -dno-print-pages as an alternative, and it works.
> >> Will it be removed too in the future?
> >
> >
> > I can't speak for future developers of LilyPond. On
> > the other hand, unlike -dbackend=null, -dno-print-pages
> > is documented with an explanation of its use case (not
> > outputting the "main" PDF when using -dcrop or -dpreview),
> > so it certainly won't be removed as a mere cleanup.
>
> Cough cough.
>
> git show release/2.21.0-1:Documentation/usage/running.itely
>
> [...]
>
> @item null
> Do not output a printed score.  This has the same effect as
> @code{-dno-print-pages}.
>
>
> --
> David Kastrup
>


Re: Error with -dbackend=null (Lilypond 2.23.10)

2022-07-10 Thread Paolo Prete
I just used -dno-print-pages as an alternative, and it works.
Will it be removed too in the future?

thanks

On Sun, Jul 10, 2022 at 5:30 PM Jean Abou Samra  wrote:

> Hello,
>
> Please keep the list posted.
>
> Le 10/07/2022 à 14:19, Paolo Prete a écrit :
> > It Is very useful when I have to quickly correct syntax errors on a
> > code that doesn't compile: given that It doesn't produce output, It
> > shortens the time required for compiling. Is there an alternative that
> > I can use?
>
>
> Have you tried -dwarning-as-error? That makes LilyPond stop on the first
> error or warning encountered.
>
> Jean
>


Re: Error with -dbackend=null (Lilypond 2.23.10)

2022-07-10 Thread Paolo Prete
It Is very useful when I have to quickly correct syntax errors on a code
that doesn't compile: given that It doesn't produce output, It shortens the
time required for compiling. Is there an alternative that I can use?

Thanks,

Best
P

On Sunday, July 10, 2022, Jean Abou Samra  wrote:

>
>
> Le 10 juil. 2022 à 12:43, Paolo Prete  a écrit :
>
> 
> Hello,
>
> lilypond -dbackend=null foo.ly produces the following error:
>
> GNU LilyPond 2.23.10 (running Guile 2.2)
> Processing `foo.ly'
> Parsing...
> foo.ly:1: warning: no \version statement found, please add
> \version "2.23.10"
> for future compatibility
> Interpreting music...
> Preprocessing graphical objects...
> Finding the ideal number of pages...
> Fitting music on 1 page...
> Drawing systems...ERROR: In procedure ly:book-process:
> In procedure module-lookup: Unbound variable: output-stencils
>
>
> ...any feedback for this? Thanks
>
>
>
>
> The ‘null’ backend was originally a quick hack for benchmarking. It was no
> longer useful and has been removed. What was your use case for it?
>
> Best,
> Jean
>
>


Error with -dbackend=null (Lilypond 2.23.10)

2022-07-10 Thread Paolo Prete
Hello,

lilypond -dbackend=null foo.ly produces the following error:

GNU LilyPond 2.23.10 (running Guile 2.2)
Processing `foo.ly'
Parsing...
foo.ly:1: warning: no \version statement found, please add
\version "2.23.10"
for future compatibility
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...ERROR: In procedure ly:book-process:
In procedure module-lookup: Unbound variable: output-stencils


...any feedback for this? Thanks

P


Download of 2.23.7-9

2022-07-10 Thread Paolo Prete
Hello,

When looking inside:

http://lilypond.org/download/binaries/linux-64/

...I see that 2.23.7,8,9 are not available for download. Why?

Thanks!

P


Re: Lilybin?

2022-06-02 Thread Paolo Prete
On Friday, June 3, 2022, Knute Snortum  wrote:

> On Wed, Jun 1, 2022 at 4:55 AM Paolo Prete  wrote:
> >
> > Hello,
> >
> > FYI this editor completely works over the web:
> >
> >
> > https://github.com/paopre/Spontini
> >
> >
> > I hope someone will decide to host it...
>
> Too buggy for Prime Time.  Can't save a file,


>
Of course you can. Just do:

1) File -> save / save as

 Or

2) ctrl + s


> can't pick which folder
> to save in,


>
Of course you can. Just do: options -> set workspace



>
>
> can't engrave a file (says I must save),


>
>
If you don't want to save before engraving just fork the file


>
> etc.


?


Re: Lilybin?

2022-06-01 Thread Paolo Prete
Hello,

FYI this editor completely works over the web:


https://github.com/paopre/Spontini


I hope someone will decide to host it...

Best,
P


On Wednesday, June 1, 2022, Kevin Cole  wrote:

> I hadn't heard of either LilyBin or HacLily.
>
> So... Basically Frescobaldi over the web, yes?
>
> Other than the collaborative, distributed nature -- which I can see as
> advantageous in some situations -- do they have features that Frescobaldi
> doesn't have?
>
>


Re: About cross-staff beaming in voiceTwo

2022-02-28 Thread Paolo Prete
Hello,

for complex cross-staff music I would suggest you to try this:

https://github.com/paopre/Spontini/blob/master/documentation/tabular.md

You can save much time while improving the readability of the code.

Cheeers


On Monday, February 28, 2022, Rip _Mus  wrote:

> Hello everyone,
> here's a problem I am encountering:
> [image: image.png]
>
> So, with the "\change" construct put in voiceTwo,  there's no automatic
> kneed-beam.
> Also tried to override the Beam.auto-knee-gap value, but no way to obtain
> the knee.
> Hope there is a way to get what I'm looking for.
>
> Thank you
>
> Rip_mus
>


Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-19 Thread Paolo Prete
Hello Jan-Peter,

thanks for your contribution!
There's already a docker setup for the editor, similar to yours, together
with other very useful setups (ly2video, fonts etc.), made by Alexis:

https://github.com/jeandeaual/docker-lilypond/pulls

However, it's not pushed yet because we have to find a practical way to
solve an issue which appears in your setup too: the need to use the 0.0.0.0
address with HTTP, which could be unsafe.
It is possibile, with Spontini, to use certs, so to switch to HTTPS and
avoid this issue:

https://github.com/paopre/Spontini/blob/master/documentation/webserver.md

However, this could be a bit cumbersome with docker, because the user would
have to create certs and then push them to the container through some
command. If we find a shorter way to obtain a HTTPS setup it would be much
better.
I don't know if a sort of duckdns plugin can be a solution...
Please let me know if you have any idea about this.

Cheers
Paolo





On Saturday, February 19, 2022, Jan-Peter Voigt  wrote:

> Hello Paolo,
>
> I really like Spontini and created a docker setup to test it. I just
> started it again. It takes some time to build, but then one can use it
> from http://localhost:8000/spontini-editor/.
>
> Best
> Jan-Peter
>
> Am 11.02.22 um 00:33 schrieb Paolo Prete:
> > Hello,
> >
> > I have published a new version of Spontini-Editor (1.12-alpha): it is
> > still in the testing phase and therefore not available in the list of
> > releases, but it is already working and it can be downloaded from the
> > main project page.
> >
> > https://github.com/paopre/Spontini
> >
> > The important features of this version are:
> >
> > 1) support for PDF output, in order to speed up the compilation of
> > scores. Thanks to the PDF mode, instead of SVG, the compilation time
> > drastically decreases: once the score has been sketched it is possible
> > to switch to SVG mode, in order to complete it through tweaks with the
> > mouse.
> >
> > 2) MIDI input: it is now possible to enter notes / chords via a MIDI
> > device, using the Web MIDI API on both Chrome and Firefox. It is also
> > possible to insert these notes automatically in the tables for the
> > creation of piano / cross-staff music.
> > In this case the notes are automatically inserted in the upper staff,
> > but they can then be quickly moved to the lower staff (or vice versa)
> > with the arrow keys of the keyboard (see the image below)
> >
> > https://github.com/paopre/Spontini/blob/master/documentation/images/
> midiInput.gif
> >
> > https://github.com/paopre/Spontini/blob/master/
> documentation/miscellaneous.md
> >
> > HTH,
> > P.
>
>


Question about cairo backend

2022-02-12 Thread Paolo Prete
Hello,

I'm testing the cairo backend on SVG output.
However, it doesn't seem to support metadata through output-attributes, nor
point-and-click links.

After reading this thread

https://www.mail-archive.com/lilypond-devel@gnu.org/msg77712.html

... it appears to me that the lack of hyperlinks is in the TODO list. But
what about metadata (output-attributes)? Are they in the TODO list as well?

Best,
P


Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-11 Thread Paolo Prete
Thanks, I was not aware of it and I'll surely test it ASAP

Cheers,
P

On Fri, Feb 11, 2022 at 1:10 PM Jean Abou Samra  wrote:

> > Le 11/02/2022 11:07, Paolo Prete  a écrit :
> >
> >
> > Thanks for these infos.
> >
> >
> > 1) once I download a development snapshot, how can I test it?
>
>
> If you mean an unstable release, you cannot, since these
> aren't built with Cairo yet -- the switch to Guile 2
> and the new infrastructure for binaries was already enough
> for a single release. So if you want to test it (which
> will be very much appreciated if you can report any
> problems you find), you have to compile LilyPond yourself
> by following the procedure described in
>
> http://lilypond.org/doc/v2.23/Documentation/contributor/compiling
>
> To enable Cairo, you have to configure with
>
> ../configure --enable-cairo-backend
>
> and then you run with Cairo using
>
> lilypond --svg -dbackend=cairo file.ly
>
> (if you use --svg, -dbackend=cairo must be last).
>
>
> > 2) Is there a plan of when it will be included into a released version?
>
> I haven't followed this story very closely, but I guess
> it will be included at some point in this development
> series. When it will become the default is another question.
>
>
> > 3) Is it already well working, or is it in unstable/buggy state?
>
> Working quite well overall.
>
> Best,
> Jean
>


Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-11 Thread Paolo Prete
Hello,

I tested the editor on macOS Catalina, with LilyPond 2.22.0 from unofficial
64-bit app bundles and had no problems.

1) Which browser are you using?
2) Please can you paste the complete log of the SpontiniServer window on
the issues page of GitHub https://github.com/paopre/Spontini/issues (or pm
to my email)?

thanks

On Fri, Feb 11, 2022 at 11:18 AM Thomas Scharkowski <
t.scharkow...@t-online.de> wrote:

>
>
> > Am 11.02.2022 um 00:33 schrieb Paolo Prete :
> >
> > Hello,
> >
> > I have published a new version of Spontini-Editor (1.12-alpha): it is
> still in the testing phase and therefore not available in the list of
> releases, but it is already working and it can be downloaded from the main
> project page.
> >
> > https://github.com/paopre/Spontini
> >
> > The important features of this version are:
> >
> Hello,
>
> after installation I get an application window at
> localhost:8000/spontini-editor/, but cannot use it:
>
> "Error while connecting to SpontiniServer.“
>
> Did I miss something?
>
> Thomas
>
> macOS Monterey 12.1
> LilyPond 2.23.6
>
>


Re: ANN: Spontini-Editor version 1.12-alfa

2022-02-11 Thread Paolo Prete
Thanks for these infos.

1) once I download a development snapshot, how can I test it?
2) Is there a plan of when it will be included into a released version?
3) Is it already well working, or is it in unstable/buggy state?

Cheers,
P

On Friday, February 11, 2022, Jean Abou Samra  wrote:

> Le 11/02/2022 à 00:33, Paolo Prete a écrit :
>
>> 1) support for PDF output, in order to speed up the compilation of
>> scores. Thanks to the PDF mode, instead of SVG, the compilation time
>> drastically decreases: once the score has been sketched it is possible to
>> switch to SVG mode, in order to complete it through tweaks with the mouse.
>>
>
>
> For your information, a new backend for LilyPond has been developed
> over the last year, based on the Cairo library, which solves this
> problem (it makes PDF output a bit faster and brings SVG on par
> with PDF in speed). This is just a heads-up, since it not enabled
> in released versions yet.
>
> Best,
> Jean
>
>
>


ANN: Spontini-Editor version 1.12-alfa

2022-02-10 Thread Paolo Prete
Hello,

I have published a new version of Spontini-Editor (1.12-alpha): it is still
in the testing phase and therefore not available in the list of releases,
but it is already working and it can be downloaded from the main project
page.

https://github.com/paopre/Spontini

The important features of this version are:

1) support for PDF output, in order to speed up the compilation of scores.
Thanks to the PDF mode, instead of SVG, the compilation time drastically
decreases: once the score has been sketched it is possible to switch to SVG
mode, in order to complete it through tweaks with the mouse.

2) MIDI input: it is now possible to enter notes / chords via a MIDI
device, using the Web MIDI API on both Chrome and Firefox. It is also
possible to insert these notes automatically in the tables for the creation
of piano / cross-staff music.
In this case the notes are automatically inserted in the upper staff, but
they can then be quickly moved to the lower staff (or vice versa) with the
arrow keys of the keyboard (see the image below)

https://github.com/paopre/Spontini/blob/master/documentation/images/midiInput.gif

https://github.com/paopre/Spontini/blob/master/documentation/miscellaneous.md

HTH,
P.


Re: String at the bottom of a cover page without using \markup

2021-12-19 Thread Paolo Prete
On Sat, Dec 18, 2021 at 11:09 PM Paolo Prete  wrote:

> The vertical-fill method does exactly what I asked in the very first post.
> But soon after, thanks to this thread, I saw some limitations in a
> pure-LilyPond approach, which I did not know: therefore I stated, *before*
> you made this example:
>
> "I well know, and stated several times, that LilyPond has the power of a
> nuclear reactor.
> And I'm sure too that with customizations you can do whatever you want in
> the cover/introductory pages.
> What I meant is different. For these pages I don't want to add or expose
> logic. "
>
> As you can see, your example adds a hard customization for a task that
> should be easy in creating cover pages. If I sum all the effort for doing
> such easy things on cover pages I realize that it is better to have an
> easier and faster tool for creating such pages, instead of growing the code
> with work-arounds, custom functions etc. In addition, you would not have to
> bother in case you are stuck in similar future situations, nor it's
> required that you learn low-level LP.
> Please note that you wrote the example *after* I decided to use this
> alternative, and after I stated that in my case the problem was already
> solved.
>
> "From what I see, your approach is a low-level approach, therefore it
> should be wrapped (so to shorten the code and improve the readibility). But
> wrapping has some other disadvantages, as I explained later. Then I
> concluded that, in my general case, the best thing is to use multiple tools
> (which has disadvantages too, of course, but I consider it a better
> compromise) "
>
> That said, the thread continued because it highlighted interesting points
> that deserved to be discussed. What I want to say is that you already gave
> me the solution of the problem, indirectly, by making me learn how the
> stuff works.
>
>
One last thing:

I would like to encourage Valentin to push his fill-vertical-line function
to the main repo.
it's not important that it doesn't cover my general case: what is important
is that it fills a hole in standard LP, because a fill-vertical-line is
IMHO required for several cases in basic cover or introductory pages. A
fill-line is already in standard LP: so, why not a fill-vertical-line too?

Best,
P




> Best,
> Paolo
>
>
>
> On Sat, Dec 18, 2021 at 10:15 PM Valentin Petzel 
> wrote:
>
>> Hello Paolo,
>>
>> Yes, that makes sense. This was never meant as some full working
>> implementation but just as an example.
>>
>> Still, what problems did you have with the vertical-fill method? This
>> should
>> work quite well for cover pages and such.
>>
>> Cheers,
>> Valentin
>>
>> Am Samstag, 18. Dezember 2021, 21:13:57 CET schrieb Paolo Prete:
>> > Hello Valentin
>> >
>> > On Sat, Dec 18, 2021 at 7:35 PM Valentin Petzel 
>> wrote:
>> > > Hello Paolo,
>> > >
>> > > That is not exactly true. The first time you used the word template
>> was
>> > > quite
>> > > some way in when you assumed that you’d need to set the markups
>> > > differently
>> > > for any possible configuration (which is where I answered you’d be
>> > > underestimating Lilypond as you do NOT need to do that. My example
>> showed
>> > > a
>> > > way you can have ONE header/footer markup producing different results
>> on
>> > > global flags (these could also be put inside the header block or a
>> paper
>> > > block), basically showing you how to create a simple interface like
>> you
>> > > wanted
>> > > (although by that point it was not clear to me that you wanted that)).
>> >
>> > ... but, if you pick up again that message, you will find that the
>> > interface you created did not meet my specs. Here are my words:
>> > "I should have the flexibility to switch on the fly from one choice to
>> > another, which is expected in a header + body + footer template,
>> therefore
>> > this template should not be polluted by mixing body with footer.". In
>> fact
>> > you redefined the template without wrapping it. Then, it should not be
>> > considered a template with the flexibilty to switch from one choice to
>> > another, but rather a customization of a template that doesn't offer
>> that
>> > easy switch. Even if you do the easy switch as a result, this can't be
>> used
>> > as template because you did not wrap it. And this has disadvantages, as
>> I
>> > tried to explain, adding that I could wrap

Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
The vertical-fill method does exactly what I asked in the very first post.
But soon after, thanks to this thread, I saw some limitations in a
pure-LilyPond approach, which I did not know: therefore I stated, *before*
you made this example:

"I well know, and stated several times, that LilyPond has the power of a
nuclear reactor.
And I'm sure too that with customizations you can do whatever you want in
the cover/introductory pages.
What I meant is different. For these pages I don't want to add or expose
logic. "

As you can see, your example adds a hard customization for a task that
should be easy in creating cover pages. If I sum all the effort for doing
such easy things on cover pages I realize that it is better to have an
easier and faster tool for creating such pages, instead of growing the code
with work-arounds, custom functions etc. In addition, you would not have to
bother in case you are stuck in similar future situations, nor it's
required that you learn low-level LP.
Please note that you wrote the example *after* I decided to use this
alternative, and after I stated that in my case the problem was already
solved.

"From what I see, your approach is a low-level approach, therefore it
should be wrapped (so to shorten the code and improve the readibility). But
wrapping has some other disadvantages, as I explained later. Then I
concluded that, in my general case, the best thing is to use multiple tools
(which has disadvantages too, of course, but I consider it a better
compromise) "

That said, the thread continued because it highlighted interesting points
that deserved to be discussed. What I want to say is that you already gave
me the solution of the problem, indirectly, by making me learn how the
stuff works.

Best,
Paolo



On Sat, Dec 18, 2021 at 10:15 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> Yes, that makes sense. This was never meant as some full working
> implementation but just as an example.
>
> Still, what problems did you have with the vertical-fill method? This
> should
> work quite well for cover pages and such.
>
> Cheers,
> Valentin
>
> Am Samstag, 18. Dezember 2021, 21:13:57 CET schrieb Paolo Prete:
> > Hello Valentin
> >
> > On Sat, Dec 18, 2021 at 7:35 PM Valentin Petzel 
> wrote:
> > > Hello Paolo,
> > >
> > > That is not exactly true. The first time you used the word template was
> > > quite
> > > some way in when you assumed that you’d need to set the markups
> > > differently
> > > for any possible configuration (which is where I answered you’d be
> > > underestimating Lilypond as you do NOT need to do that. My example
> showed
> > > a
> > > way you can have ONE header/footer markup producing different results
> on
> > > global flags (these could also be put inside the header block or a
> paper
> > > block), basically showing you how to create a simple interface like you
> > > wanted
> > > (although by that point it was not clear to me that you wanted that)).
> >
> > ... but, if you pick up again that message, you will find that the
> > interface you created did not meet my specs. Here are my words:
> > "I should have the flexibility to switch on the fly from one choice to
> > another, which is expected in a header + body + footer template,
> therefore
> > this template should not be polluted by mixing body with footer.". In
> fact
> > you redefined the template without wrapping it. Then, it should not be
> > considered a template with the flexibilty to switch from one choice to
> > another, but rather a customization of a template that doesn't offer that
> > easy switch. Even if you do the easy switch as a result, this can't be
> used
> > as template because you did not wrap it. And this has disadvantages, as I
> > tried to explain, adding that I could wrap it in my own project, so to
> meet
> > my specs, but this procedure would have disadvantages too.
> >
> > > The technical problem here is that there is no clear border between
> body,
> > > header and footer (unless we are taking full control of the page, for
> > > which I
> > > gave you a way to do this without footer (as I said before, I did not
> > > realize
> > > we were talking about cover pages before that, even though it says so
> in
> > > the
> > > subject. I was expecting a first page with music on it)).
> >
> > This is not true, and this is what I added in my explanation later. There
> > is such clear border: it is given by the template defaults. These are the
> > rules for body, header and footer. When you decide to modify these rules,
> > then you are creating a grey area, then it 

Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
Hello Valentin

On Sat, Dec 18, 2021 at 7:35 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> That is not exactly true. The first time you used the word template was
> quite
> some way in when you assumed that you’d need to set the markups
> differently
> for any possible configuration (which is where I answered you’d be
> underestimating Lilypond as you do NOT need to do that. My example showed
> a
> way you can have ONE header/footer markup producing different results on
> global flags (these could also be put inside the header block or a paper
> block), basically showing you how to create a simple interface like you
> wanted
> (although by that point it was not clear to me that you wanted that)).
>
>
... but, if you pick up again that message, you will find that the
interface you created did not meet my specs. Here are my words:
"I should have the flexibility to switch on the fly from one choice to
another, which is expected in a header + body + footer template, therefore
this template should not be polluted by mixing body with footer.". In fact
you redefined the template without wrapping it. Then, it should not be
considered a template with the flexibilty to switch from one choice to
another, but rather a customization of a template that doesn't offer that
easy switch. Even if you do the easy switch as a result, this can't be used
as template because you did not wrap it. And this has disadvantages, as I
tried to explain, adding that I could wrap it in my own project, so to meet
my specs, but this procedure would have disadvantages too.



> The technical problem here is that there is no clear border between body,
> header and footer (unless we are taking full control of the page, for
> which I
> gave you a way to do this without footer (as I said before, I did not
> realize
> we were talking about cover pages before that, even though it says so in
> the
> subject. I was expecting a first page with music on it)).


This is not true, and this is what I added in my explanation later. There
is such clear border: it is given by the template defaults. These are the
rules for body, header and footer. When you decide to modify these rules,
then you are creating a grey area, then it is needed to wrap your
customization, so to create new defaults (and, consequently, a new
template). When you violate this rule by modifying two instances of two
implementations (footer and header) of an interface, instead of  creating
new instances, then you are doing a hack which makes the code even dirtier,
then a wrap is doubly needed. In the example we are discussing, the motto
is logically part of the body. Then, given that the LP template doesn't
meet this specs, a new template should be created by wrapping a
customization of the original one. Then you have clean code and you can
have new clear borders. As you can see, this is a tedious procedure, and
this is why I prefer to use alternative tools.



> But let’s be specific about the problem: So your aim here is to create
> templates? Or do just want to create a cover page with something at the
> bottom?


my aim (which is not what I asked at the beginning of the thread, though)
is not to create templates (I don't have time for now), but to have a way
to have them for the next future. And I got this result with the
alternative tool. And, of course, with the help of your (and Aaron's)
examples, which made me understand how the things works in LP. Therefore
you are wrong when you feel unmotivated for the things you read. You should
consider the opposite...
Please note that there's nothing strange in using an alternative tool for
this. And I would leave the LP code totally untouched for these tasks.
IMHO  LP doesn't need to have such sophisticated tools for cover pages, as
Jean wished. It would be totally beyond its scope. Therefore I find
ridiculous (and pathetic at the same time) when my words appear as a blame.

Best,
Paolo


Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
On Sat, Dec 18, 2021 at 6:57 PM David Kastrup  wrote:

> Paolo Prete  writes:
>
> > If you read again my posts, you will find the core specification, with
> > a specific word, since the very first posts of this thread, not at a
> > random place. And I repeated it several times. The magic word is:
> > *template*.
>
> That's a buzzphrase that doesn't concern _what_ you want to do but _how_
> you want to get it done.
>
>
Not really. I expressed as a spec that I wanted to obtain my result without
touching the template since the first post (---> avoid touching footer).
Then, this phrase simply repeats that initial statement, where "what I want
to do" has already the constraint "get it done in that way"


> In essence you are complaining that you do not see a proper "On" switch
> on an axe and you consider it a hack to move the axe towards wood rather
> than move the wood to the cutting device.
>


Not really. I'm not complaining anything/anyone. The hack I highlighted has
nothing to do with this example. There's already a proper "On switch" on
the LP template and I see it and its rule. I just don't want to violate it,
because when you have a _rule_ and you violate it for obtaining your
result, I call it a "hack".



>
> You need to accept that your wish to do things in a certain manner is
> not something others will automatically figure out just by repeatedly
> hearing in essence "no, that's wrong".  You will need to more actively
> participate in defining what will and what will not be a manner of
> arriving at a page layout that you deem acceptable.
>

That is what exactly I tried to do, in a *very active way*: I defined my
specs since the first post, and I went into detail for them multiple times
(readability, maintenance of the code etc.) . TBH I donì't understand what
you are talking about.


>
> --
> David Kastrup
>


Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
On Sat, Dec 18, 2021 at 4:44 PM Valentin Petzel  wrote:


> And please don't feel offended by my last mail, I'm not in the best shape,
> as a friend of mine killed himself recently.
>
>
Hello Valentin,

This is really sad news, especially if it happens at a time of pandemic,
which in itself is hard. As a personal advice I tell you: dedicate your
time as much as possible to programming in these months, this will help you
to distract yourself. Don't worry about me, I didn't feel offended at all.
I was just sorry to see a so helpful and active helper/contributor like you
being unmotivated to participate in discussions.


>
> I did not mean a random specification, but a very important core
> specification at a random point.
>

If you read again my posts, you will find the core specification, with a
specific word, since the very first posts of this thread, not at a random
place. And I repeated it several times. The magic word is: *template*.
At a certain point, Jean highlighted the fact that LP currently lacks the
ability of stylesheeting in an easy way; then you focused the problem. But
the big picture is that LP currently lacks the ability of easy-templating
(and the stylesheet is only a part of this context). Currently, LP supports
only one generic template out of the box (header, body, footer), which
therefore needs to be customized (and its customization is somewhat
uncomfortable) for any variation. Customizing a template, as a general
procedure, is not a good idea, for several reasons, including readability
of the code and maintenance. Therefore, typography programs offer a *set*
of templates: then you pick the one that is closest to your specs, and do
customizations only if you really need to. Then your code is *clean*. To be
even more clear: the kind of customization you wanted to do is a hackish
and messy one. In fact, you violate the template rule by putting what
should be part of the body in the footer, by swapping it from the header
(!) ad using a non pertinent field (copyright) (with low-level functions).
This is not how I would proceed. I would avoid hacks at all on templates.
And I would customize templates only for dummy things (for example:
swapping header with footer) and only if I really need to.
I really don't know how to explain it better. But in any case, please read
again the previous posts with these observations.

Hold on for the bad period. I'm sure it will go away, after some time. And
consider this thread a way to get distracted from it...

Best,
Paolo


Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
On Sat, Dec 18, 2021 at 1:38 PM Valentin Petzel  wrote:

> Nothing really heated here, but probably some communication issue. I try
> to
> listen to what you try to explain, but I hardly get anything about your
> actual
> problem and mostly critique how the solutions are not clean enough for you
> without really reasoning why this would be that way.
>
> I’ve sent you an example of how we basically can get what Jean described
> (which involves adding some functionality to the header and footer markups
> which can be put into an include and then on line overrides (which can
> also be
> put into includes). You’ve then dismissed this as too much logic (when
> this
> actually just requires a very miniscule amount of additional
> functionality.
> Then when you talked about cover pages I gave you an example of a markup
> function that spreads markups vertically over the page (which can then be
> used
> to push stuff to the bottom).
>
> I’m spending lots of my time trying my best to help you, and it’s really
> frustrating then to get told to focus on „what you tried to explain”,
> especially when you give core specifications like "I just want to set
> simple
> fields” randomly in the end. And this really takes away a lot of
> motivation
> for trying to help people on the mailing list.
>
>
Please don't misunderstand my words: I stated many and many times that your
(and Aaron's ones) examples HELPED me A LOT. Including these last ones,
with which I could understand how the footer and header do work, and how
they can be customized. Then you can easily understand the value of your
contribution. And, of course, without these examples, I would not have
focused the problem we are discussing. What I meant is different. It
appears to me that when I say something, it is seen as a criticism against
LP. This is absolutely not true. I just try to focus a problem which, IMHO,
deserves to be discussed.
That said, forgive me if I speak frankly: it appears strange to me that you
and Aaron (both have huge experience with LP coding) really say that *any*
of my objections is wrong. Or that you systematically start from this
assumption. Probably I'm wrong with this perception, but maybe I'm not
totally wrong and, in any case, this is my perception. Why do I have this
perception? Let me explain.
I well know and I'm sure that you have huge experience and knowledge of LP
and coding. At the same time, my objections regarding the customization of
headers and footers were very simple. No logic or coupling or low-level
stuff at all is required. This is how stylesheets and templates do work.
Therefore, no matter if you add tiny or huge logic to add. I just talked
about additional logic, in the previous posts. So: why all these objections?
If you add tiny logic to this method, then you corrupt it. But I'm sure
that you already know this, because you surely know how stylesheets do
work. This is not a "random" specification given at the end. This is the
reason for which I stated from the beginning that I did not want to work on
the footer, nor to couple different elements of the template. Instead of
saying: "you're wrong, you're wrong, you're wrong etc." (and then I have
systematically to answer: "no, it's you who are wrong", "no, it's you who
are wrong" etc.) please, read with another perspective my observations.
That said, I see with real regret that you loose motivation in this. I well
know what it means. Of course feel free to ignore my questions (and I still
thank you for your help so far) but, I would not use this behavior in
general with other people. As a personal thought, I can say that my
contribution to LP are totally independent of the general feedback
received, as you can see when I publish an ANN of a new release of my
editor (which costs to me lot of work, obviously): I simply do what I think
is good to do.  And I hope you'll do the same (which completely takes away
possible frustration).

Best,
P




> Valentin
>
> Am Samstag, 18. Dezember 2021, 12:47:34 CET schrieb Paolo Prete:
> > On Sat, Dec 18, 2021 at 10:25 AM Jean Abou Samra 
> wrote:
> > > Hi,
> > >
> > > Okay, I'll let myself sucked in this (in my opinion
> > > unnecessarily) heated thread
> >
> > I really thank you for this post. It not only explains what I had in mind
> > regarding the technical side of the thread; it also highlights a bigger
> > problem: unnecessary heated mood. And I add that it is not only
> > unnecessary: when there are flames without fire, it is nonsense and
> > ridiculous too. I'm sorry if I use this harsh words, but this is what I
> see
> > in all this discussion. I would like to invite the participants to note
> > that I absolutely did NOT say any word against LP. Nor directly, nor
> > indire

Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
On Sat, Dec 18, 2021 at 10:25 AM Jean Abou Samra  wrote:

> Hi,
>
> Okay, I'll let myself sucked in this (in my opinion
> unnecessarily) heated thread


I really thank you for this post. It not only explains what I had in mind
regarding the technical side of the thread; it also highlights a bigger
problem: unnecessary heated mood. And I add that it is not only
unnecessary: when there are flames without fire, it is nonsense and
ridiculous too. I'm sorry if I use this harsh words, but this is what I see
in all this discussion. I would like to invite the participants to note
that I absolutely did NOT say any word against LP. Nor directly, nor
indirectly, nor explicitly, nor in a hidden or subtle way. At the same
time, I invite them (Including the helpful Aaron and Valentin) to focus on
what I really tried to explain (as you did) instead of  negating any
assertion that seems (but it is really not) intended to reduce the LP
value.

Best,
Paolo


>


Re: String at the bottom of a cover page without using \markup

2021-12-18 Thread Paolo Prete
On Sat, Dec 18, 2021 at 11:57 AM Valentin Petzel  wrote:

> Hello Paolo,
>
> Please note that default values are intended to be changed if required.



Hello Valentin,

as said before I don't want this kind of customization: I think it reduces
readability of the code (unless it is wrapped, but this would be not
practical) and it is not easy to maintain.
I just want to set simple fields, without any logic, without any coupling,
cross-link and/or low level functions. This is what I do with LibreOffice
(GUI) or with predefined templates (LaTex, WordPress etc.). I really don't
know how to explain this better: please, refer to Jean's last post. It will
help to understand how to focus the problem.

Best,
P


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Saturday, December 18, 2021, Paolo Prete  wrote:

>
>
> On Saturday, December 18, 2021, Aaron Hill 
> wrote:
>
>> On 2021-12-17 4:28 pm, Paolo Prete wrote:
>>
>>> The example Aaron showed already added *logic* to the template
>>
>>
>
>
>
> . This is how I proceed, when programming. From what I see, your approach
> is a low-level approach,
>

(for Valentin too)
Please note too that this is the reason for which it s not true what
Valentin said that I "underestimate LilyPond. Instead, the opposite is
true: low level tools such the one you showed, reveal how LP is powerful.
But I don't want to use lower level tool for cover or introductory pages,
nor I would like to spend time in wrapping them.


>
>
>
>
>> -- Aaron Hill
>>
>


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Saturday, December 18, 2021, Aaron Hill  wrote:

> On 2021-12-17 4:28 pm, Paolo Prete wrote:
>
>> The example Aaron showed already added *logic* to the template [...]
>>
>
> To be fair, all I showed was the default setting for oddFooterMarkup from
> titling-init.ly.  Nothing added; that is simply how LilyPond works out of
> the box.
>
>
Hello Aaron, this is not what I meant with "added logic to the template". I
just noted that you used some logic for defining a spefic behavior of the
basic template. And this is what I would like to avoid, unless I wrap it.
Therefore, when you write:



>  Your original query was about placing something at the bottom of a page,
> and the response you have received is to leverage oddFooterMarkup as the
> most direct and minimally disruptive method.
>
>
>

... This is not right. My original query was not simply "how to place
something at the bottom of the page". I explicitily added a constraint:
"without using the footer markup". For the reasons I explained later. I
prefer to set properties of a class/structure which hides details for this
kind of stuff, instead of adding/exposing customizations/logic. This is how
I proceed, when programming. From what I see, your approach is a low-level
approach, therefore it should be wrapped (so to shorten the code and
improve the readibility). But wrapping has some other disadvantages, as I
explained later. Then I concluded that, in my general case, the best thing
is to use multiple tools (which has disadvantages too, of course, but I
consider it a better compromise)


Best,
P




> -- Aaron Hill
>


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
>
>
>
> Also you are wrong, recurring footers are not the rule. Many footers or
> headers for example include page numbering, which tends to be different on
> each page.
>
>
(in addition to my previous message)

This is not what I meant. The fact that page numbering is different on each
page doesn't mean that the header is not recurring.
What has to be recurring is the rule, not the content of the string.  And
the recurrence is the rule for footers and headers.

Best,

Paolo


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Sat, Dec 18, 2021 at 1:00 AM Valentin Petzel  wrote:

> Hello Paolo,
>
> I think you underestimate Lilypond.


Hi Valentin,

this is not true. I well know, and stated several times, that LilyPond has
the power of a nuclear reactor.
And I'm sure too that with customizations you can do whatever you want in
the cover/introductory pages.
What I meant is different. For these pages I don't want to add or expose
logic. This is not how I intend typography for such pages.
The example Aaron showed already added *logic* to the template, and so your
example does:

\on-the-fly #part-first-page \fromproperty #'header:copyright

(etc.)

(of course thanks again Aaron and you for your examples, which are
precious: they clarify to me how LP works)
But, IMHO, such pages should not have logic, unless you don't have
alternatives.
Normally, I would prefer another approach, which I consider *standard* for
these things: have a set of templates, pick one of them and do NO
customization at all, unless you don't have alternatives. Your example
would fit my requirements if it was wrapped by a template, but it is
currently not.
This is how you can have a *readable* code (don't misunderstand me: your
code is excellent, what I mean is different). Of course I could wrap it,
but for future different cases I would have to do the same procedure, which
is tedious.

Hope that what I mean is clear, now. In any case, this discussion is
interesting and I think it deserves further insights.  Thanks for your
contribution!

Best,
Paolo


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
Hello Valentin,

Of course I can put a global flag for swapping header content to footer
content and vice-versa. But what if I put the non-recurring "motto" of my
previous example in a recurring footer and preserve easy swapping? I would
have to do something like this (pseudo-code), in order to swap:

header-content = page-numbers
footer-content = motto-on-first-page

to

header-content = nothing
footer-content = motto-on-first-page + page-numbers

As you can see this is not a simple swap: additional logic is required,
because motto and page-numbers have two different recurrence settings (no
recurrence for motto and recurrence for page-numbers). This happens because
I'm coupling what should be in the body with what should be in the footer.
Instead, a clean or basic template IMHO doesn't need additional logic: just
set the recurrence values for the header and for the footer and you have
done.
And this is how, AFAIK, a basic typography template does work. When I write
such a page with LibreOffice, I don't need any additional logic or plugin
for swapping the elements. In addition: It is true that a footer doesn't
necessarily have to be recurring; however, as you can note, it is recurring
as *default*. This default has a precise meaning: recurring is the rule,
non-recurring is the exception. When you have to use an exception, you
should firstly evaluate if you have a proper field for managing it. And the
proper field for this case is the Body part, which is non-recurring as
default. This is why I would use an alternative tool for cover/introductory
pages of a score, in case they don't fit with the LP template. And this is
absolutely not intended for "blaming" LP: instead, it is the contrary.
IMHO, having an all-in-one program, especially for open-source programs, is
not possible and it would not be reasonable either. LP is excellently
focused on score engraving and that is enough. All-in-one programs are
better for closed source stuff, not for open-source systems. And putting
together different open source programs so to have an exhaustive system
should be a normal routine. Hope my message is clear.

Best,
Paolo




On Fri, Dec 17, 2021 at 11:00 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> as already pointed out you can customize the footer markup to contain
> anything you want, including custom header fields (also you can implement
> stuff like swapping of page number position depending on global flags or
> something).
>
> Then a footer does not need to be recurring. A footer is just something
> printed below the actual content.
>
> So I'd consider using footer markup as a quite clean way of doing such
> things.
>
> Valentin
>
> 17.12.2021 19:20:27 Paolo Prete :
>
>
>
> On Fri, Dec 17, 2021 at 7:14 PM Kevin Barry  wrote:
>
>> > I'm still convinced it is a hack. Commonly, the "hack" term is used for
>> indicating a work-around with some emphasis.
>> > In the case we are talking about, David's suggestion would be a simple
>> work-around (---> improper use of a label to bypass the problem).
>>
>> I think you're overthinking things here: think of copyright as a name
>> for any text you might want to put at the bottom of the first page.
>>
>
> It's not important what I think, it is important what can be read on the
> code at a glance.
> If I write copyright = "Composed in 2021", then I have to add a comment
> note above that line as memo for explaining that the copyright field was
> used for another purpose. Not a clean code, IMHO.
>
>
>
>
>
>
>


Send program changes to non general-midi soundfont

2021-12-17 Thread Paolo Prete
Hello,

which is the best way to send program changes to non general-MIDI
soundfonts?

Should I wrap \set Staff.midiInstrument = "general-midi-instr-name" with a
custom command or is there a (lower-level) way to send program changes by
number?

Thanks!


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 8:32 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > No. I'm applying it in its *natural* context (the programming code of
> LP, that couples two functions
>
> Since \header (where the data resides) is not a *function*, I'll be
> interested to hear how you defend that claim.
>
>
I'm sorry,

as said before, I'm not interested in explaining to you in detail what is
obvious and you don't understand, and I'm not interested in talking with
you at all. I'm just going to ignore you.

Cheers!

[To the participants of this thread] That said, if among the readers of
this thread there is someone interested in further clarification of the
discussed problem, including the "coupling" concept, just ask me and I'll
try to go into details (but I don't think it should be necessary)


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
Check the attached pdf.
Nor "author", nor "title", nor "motto" should be part of the header/footer.
They are part of the body and author and motto have a fixed and equal
offset respectively from the top and the bottom.

THANKS for your help !


On Fri, Dec 17, 2021 at 8:08 PM Carl Sorensen  wrote:

>
>
>
>
> *From: *lilypond-user  gmail@gnu.org> on behalf of Paolo Prete 
> *Date: *Friday, December 17, 2021 at 12:06 PM
> *To: *Kieren MacMillan 
> *Cc: *Valentin Petzel , Lilypond-User Mailing List <
> lilypond-user@gnu.org>
> *Subject: *Re: String at the bottom of a cover page without using markup
>
>
>
> Hello again Kieren ;-)
>
>
>
> On Fri, Dec 17, 2021 at 7:57 PM Kieren MacMillan <
> kie...@kierenmacmillan.info> wrote:
>
> Hi Paolo,
>
> > As explained before, I don't want to proceed in this way. The string
> that I have to write at the bottom of the page is part of the *body*, not
> of the footer.
> > I don't want to mess up the template.
>
> Then just place it as an additional markup, between the last system of
> music and the footer, on whichever page(s) you want.
> I guess I don't understand the problem…
>
>
>
> As said in the first post of the thread, I don't know how to make it
> appear at the bottom of the page of the first page (no score)...
>
>
>
> A minimal example that shows your problem would help people answer your
> question appropriately.
>
>
>
> Carl
>


page.pdf
Description: Adobe PDF document


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 8:21 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> >
> https://en.wikipedia.org/wiki/Coupling_(computer_programming)#:~:text=In%20software%20engineering%2C%20coupling%20is,of%20the%20relationships%20between%20modules
>
> "In software engineering, coupling is the degree of interdependence
> between software modules; a measure of how closely connected two routines
> or modules are;[1] the strength of the relationships between modules."
>
> So you're trying to apply the definition of "routines and modules" to
> describe data and how it's referenced in a layout application? ;)
>
>
No. I'm applying it in its *natural* context (the programming code of LP,
that couples two functions, and this appears to me as an issue. I could be
wrong, but it deserves to be discussed, IMHO, and this is not offending
anyone)



> I can't spend any more time on this thread — I hope you figure out your
> solution soon, and stop blaming Lilypond for something it's not actually
> doing.
>
>
I'm not blaming *anything*/*anyone*. Please, go on in saying nonsense
things: I'll just ignore you!

Cheers
P


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
Hello again Kieren ;-)

On Fri, Dec 17, 2021 at 7:57 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > As explained before, I don't want to proceed in this way. The string
> that I have to write at the bottom of the page is part of the *body*, not
> of the footer.
> > I don't want to mess up the template.
>
> Then just place it as an additional markup, between the last system of
> music and the footer, on whichever page(s) you want.
> I guess I don't understand the problem…
>
>
As said in the first post of the thread, I don't know how to make it appear
at the bottom of the page of the first page (no score)...

Cheers,
P



> Cheers,
> Kieren.


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 7:49 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi again,
>
> >> The fields *are* totally decoupled…
> > No, they are not. They are coupled on the first page. Then they are
> partially decoupled, not totally decoupled.
>
> There is absolutely no coupling:
> 1. I can have any value I want in the "copyright" field and have it appear
> nowhere in my score; and
> 2. I can have the information in the "copyright" field/property appear
> wherever I want in the score.
>
>
This is what you wrote in the past post:
"The copyright property isn't a footer, nor is it coupled with the footer
in any way *except* that the default titling includes it on the first page"

---> then yourself wrote that they are not totally decoupled



> There is zero "coupling" involved.
>
> > I don't understand what you mean, sorry. Copyright IMHO should not be
> coupled with the footer
>
> It's not. It's a property that may be given a value in the \header block
> (see my other email for possible discussion about renaming that!). I'm not
> sure how much clearer I can make it for you — it may be a language issue.
>

Yes, I'm seeing it is a language issue. I think you misunderstood the
meaning of "coupling" in computer programming. See (absolutely not intended
to be polemic, just a clarification)

https://en.wikipedia.org/wiki/Coupling_(computer_programming)#:~:text=In%20software%20engineering%2C%20coupling%20is,of%20the%20relationships%20between%20modules
.

Best,
P



>
> Cheers,
> Kieren.


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 7:46 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > This can be solved by having a footer with separate user settable
> fields. For example: footer.text1, footer.text2 etc. Then you don't have to
> use a "copyright" field at all.
>
> You can do that right now — that's literally what I've been suggesting you
> do.
>
>
As explained before, I don't want to proceed in this way. The string that I
have to write at the bottom of the page is part of the *body*, not of the
footer.
I don't want to mess up the template.

Best,
P


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 7:23 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > I still prefer to have these fields totally decoupled.
>
> The fields *are* totally decoupled…
>
>
No, they are not. They are coupled on the first page. Then they are
partially decoupled, not totally decoupled.



> > I think it's reasonable that the copyright appears at the bottom, as
> default, but I don't understand the choice to couple it to the footer of
> the first page.
>
> 1. I don't understand how you would include the copyright field
> information in the footer [of any page] without referencing the
> field/property in the footer definition.
>

I don't understand what you mean, sorry. Copyright IMHO should not be
coupled with the footer, as a field, even if it appears at the bottom of
the page. It can appear on the top of the page as well. But it is
reasonable that its default is to appear at the bottom.


>
> 2. I don't believe I've ever used a text/page layout application which
> allowed multiple footers on a single page.
>
> Please explain how you would like to see the "issue" resolved,
> specifically in light of those two points.
>
>
(just a first idea) This can be solved by having a footer with separate
user settable fields. For example: footer.text1, footer.text2 etc. Then you
don't have to use a "copyright" field at all.

Best, P


On Fri, Dec 17, 2021 at 7:23 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > I still prefer to have these fields totally decoupled.
>
> The fields *are* totally decoupled…
>
> > I think it's reasonable that the copyright appears at the bottom, as
> default, but I don't understand the choice to couple it to the footer of
> the first page.
>
> 1. I don't understand how you would include the copyright field
> information in the footer [of any page] without referencing the
> field/property in the footer definition.
>
> 2. I don't believe I've ever used a text/page layout application which
> allowed multiple footers on a single page.
>
> Please explain how you would like to see the "issue" resolved,
> specifically in light of those two points.
>
> Thanks,
> Kieren.


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 7:14 PM Kevin Barry  wrote:

> > I'm still convinced it is a hack. Commonly, the "hack" term is used for
> indicating a work-around with some emphasis.
> > In the case we are talking about, David's suggestion would be a simple
> work-around (---> improper use of a label to bypass the problem).
>
> I think you're overthinking things here: think of copyright as a name
> for any text you might want to put at the bottom of the first page.
>

It's not important what I think, it is important what can be read on the
code at a glance.
If I write copyright = "Composed in 2021", then I have to add a comment
note above that line as memo for explaining that the copyright field was
used for another purpose. Not a clean code, IMHO.


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 6:57 PM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> > In fact, a footer is not simply an element that is placed on the bottom
> of a page. It also has to be recurrent in order to be a footer.
>
> To be precise, it has to *have the potential* to recur: a footer on a
> one-page document doesn't recur, but it's still a footer.
>
>
Yes, that's more or less what I wrote later.


> As I see it, the problem here is that the documentation isn't clear that
> "copyright" is simply a property that happens to be "pre-defined", in the
> sense that it's referenced somewhere [specifically titling-init.ly >
> oddFooterMarkup] in the standard distro. It could just as easily been
> called 'kieren' or anything else.
>
> Put another way: The copyright property isn't a footer, nor is it coupled
> with the footer in any way *except* that the default titling includes it on
> the first page [only].
>
>
This behavior is a bit ambiguous, IMHO. I still prefer to have these fields
totally decoupled. I think it's reasonable that the copyright appears at
the bottom, as default, but I don't understand the choice to couple it to
the footer of the first page.

Best,
P


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 6:48 PM Paolo Prete  wrote:

>
>
>  It also has to be recurrent in order to be a footer. And a copyright
> field is not required to be recurrent.
>

More precisely: the recurrence of the copyright (if it is recurrent) and
that of the footer should not be coupled.


Re: String at the bottom of a cover page without using \markup

2021-12-17 Thread Paolo Prete
On Fri, Dec 17, 2021 at 8:32 AM Valentin Petzel  wrote:

> Hello Paolo,
> as far as I'm concerned there is nothing hacky about using footer markup
> for its intended purpose, that is placing stuff at the bottom of the page.
> Rather any other method would probably involve lots of volatile hacks. In
> my book a hack would be abusing some functionality in some unintended way
> to get unsupported functionality. Using footer markup does not seem like
> such a thing. Of course you could change Lilypond's whole page layout
> system to effectively have two footer markups, but pretty much the same can
> be achieved with setting the footer markup to something that matches what
> you want.
>
> Indeed, Lilypond's text processing capabilities are rather limited.
>
>

Hello Valentin,

I'm still convinced it is a hack. Commonly, the "hack" term is used for
indicating a work-around with some emphasis.
In the case we are talking about, David's suggestion would be a simple
work-around (---> improper use of a label to bypass the problem). But the
copyright field has an issue (which should be reported to Gitlab, I think:
feedback are welcome, so I can report it): it is coupled to the footer but
it is not necessarily a footer. In fact, a footer is not simply an element
that is placed on the bottom of a page. It also has to be recurrent in
order to be a footer. And a copyright field is not required to be recurrent.
Therefore, using a footer (and not the copyright field) as a non-recurrent
string, so to align an element at a desired position is more than a
work-around. I normally use two labels in my code (which is a common choice
too): FIXME (for issues and hacks) and WORKAROUND for work-arounds. If I
used the hack, I would write a FIXME label in the code: but it is likely it
won't be fixed in the future, because the LP tools for cover pages have
some expected limits that I think should be overcome with tools focused on
text typography. Note too that the "footer" solution has unwanted side
effects: for example, I normally print page numbers on the header of the
page; but another good choice would be to print them centered on the footer
as page X/totPages. I should have the flexibility to switch on the fly from
one choice to another, which is expected in a header + body + footer
template, therefore this template should not be polluted by mixing body
with footer. As said before, an improper use of the copyright field would
be an acceptable compromise, but it has the issue I wrote above.
Therefore, I conclude that using a tool for text typography (for cover
pages) in addition to LilyPond is an exahustive choice for managing a
complete score.

Cheers,
Paolo


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Hello Valentin

On Friday, December 17, 2021, Valentin Petzel  wrote:

> Hello Paolo,
> That is to be expected, as the copyright field is simply used in the
> default
> footer markup (as I’ve hinted before). Still, is there any reason not to
> use
> the footer markup for that one?


>
Because this would be a hack. I don't like to put hacks in my code, and I
use them only if I really don't have alternatives. Hacks break readibility
of the code and cause problems when the code has to be reused in the
future. That said, I'm noting that there are limitations in LP regarding
the format of the introductory pages of the score. This is normal, because
LP is a program for writing scores, not books. Therefore, I think that the
best way to obtain what I need is to edit these pages with another program
and then append them to the generated PDF of the score through a script.

Best,
P



>
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Thank you very much! I thought there was a non-hackish way to do that, but
I don't see alternative...

On Friday, December 17, 2021, Aaron Hill  wrote:

> On 2021-12-16 3:37 pm, Paolo Prete wrote:
>
>> Thanks to all the participants to this thread. I'm a bit stuck into this.
>> Unfortunately, if I use the copyright field of \header and I remove the
>> footer from the paper, then the copyright field disappears:
>>
>
> That's because the copyright (and tagline) is implemented with the footer
> markup.  See titling-init.ly:
>
> 
> oddFooterMarkup = \markup {
>   \column {
> \fill-line {
>   %% Copyright header field only on first page in each bookpart.
>   \on-the-fly #part-first-page \fromproperty #'header:copyright
> }
> \fill-line {
>   %% Tagline header field only on last page in the book.
>   \on-the-fly #last-page \fromproperty #'header:tagline
> }
>   }
> }
> 
>
>
> -- Aaron Hill
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Thanks to all the participants to this thread. I'm a bit stuck into this.
Unfortunately, if I use the copyright field of \header and I remove the
footer from the paper, then the copyright field disappears:

%
\paper {
  bottom-margin = 8
  top-margin = 8
  % oddFooterMarkup = \markup \fill-line { " " }
}

\header {
  copyright = \markup \fill-line
  { \raise #10 \box "String two" }
}

\markup {
  \fill-line
  { \lower #10 \box "String one" }
}
%


On Thu, Dec 16, 2021 at 11:25 PM Timothy Lanfear  wrote:

> On 16/12/2021 21:34, Paolo Prete wrote:
> > Hello Valentin and David,
> >
> > I could place the text at the bottom of the page, with \header {
> > copyright = "some text" } but I wonder if is there a way to offset it
> > (from bottom) of a given value (without setting \paper { bottom-margin
> > = offset }, which would affect the entire document.
> >
> >
> Could you use the \raise and \lower markup commands?
>
> \header { copyright = \markup { \raise #10 "Copyright" } }
>
> --
> Timothy Lanfear, Bristol, UK.
>
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Hello Valentin and David,

I could place the text at the bottom of the page, with \header { copyright
= "some text" } but I wonder if is there a way to offset it (from bottom)
of a given value (without setting \paper { bottom-margin = offset }, which
would affect the entire document.

thanks!

P

On Thu, Dec 16, 2021 at 7:55 AM Valentin Petzel  wrote:

> Hello Paolo,
>
> the only way I think this would be possible would be either using footer
> markup (like using the copyright field) or hacking footnotes to get your
> way.
>
> That being said, is there any reason not to use footer markup? After all
> this is basically what that is for.
>
> Cheers,
> Valentin
>
> 15.12.2021 13:16:24 Paolo Prete :
>
> Hello,
>
> on the very first page of a score, is there a way to place a string at the
> bottom (minus the bottom margin), possibly without using the footer
> markup?
>
> Thanks!
> P
>
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Thanks, got it!

On Thursday, December 16, 2021, Valentin Petzel  wrote:

> Hello Paolo,
>
> the only way I think this would be possible would be either using footer
> markup (like using the copyright field) or hacking footnotes to get your
> way.
>
> That being said, is there any reason not to use footer markup? After all
> this is basically what that is for.
>
> Cheers,
> Valentin
>
> 15.12.2021 13:16:24 Paolo Prete :
>
> Hello,
>
> on the very first page of a score, is there a way to place a string at the
> bottom (minus the bottom margin), possibly without using the footer
> markup?
>
> Thanks!
> P
>
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
All right, thanks!

On Thursday, December 16, 2021, Valentin Petzel  wrote:

> Hello Paolo,
>
> the only way I think this would be possible would be either using footer
> markup (like using the copyright field) or hacking footnotes to get your
> way.
>
> That being said, is there any reason not to use footer markup? After all
> this is basically what that is for.
>
> Cheers,
> Valentin
>
> 15.12.2021 13:16:24 Paolo Prete :
>
> Hello,
>
> on the very first page of a score, is there a way to place a string at the
> bottom (minus the bottom margin), possibly without using the footer
> markup?
>
> Thanks!
> P
>
>


Re: String at the bottom of a cover page without using \markup

2021-12-16 Thread Paolo Prete
Thanks, got it!

On Wednesday, December 15, 2021, David Kastrup  wrote:

> Paolo Prete  writes:
>
> > Hello,
> >
> > on the very first page of a score, is there a way to place a string at
> the
> > bottom (minus the bottom margin), possibly without using the footer
> markup?
>
> Isn't that more or less what the copyright header field is for?
>
> --
> David Kastrup
>


String at the bottom of a cover page without using \markup

2021-12-15 Thread Paolo Prete
Hello,

on the very first page of a score, is there a way to place a string at the
bottom (minus the bottom margin), possibly without using the footer markup?

Thanks!
P


Re: Shift vertically a text centered on a hairpin

2021-12-12 Thread Paolo Prete
Sorry, my bad. I set \lower #2 (and the result was the same) because I
assumed that \lower made an offset from the bottom of the hairpin, but this
is not the case. Using a bigger value did the trick. Thanks for the
additional tip too!

On Sun, Dec 12, 2021 at 3:52 PM Jean Abou Samra  wrote:

>
>
> Le 12/12/2021 à 15:05, Paolo Prete a écrit :
> >
> >
> > On Sun, Dec 12, 2021 at 2:56 PM Jean Abou Samra 
> > wrote:
> >
> >
> >
> > Le 12/12/2021 à 14:28, Paolo Prete a écrit :
> > > Hello,
> > >
> > > it would be good to have more control on the text centered on a
> > hairpin.
> > >
> > > For example: I can't shift the text vertically, and I think this is
> > > useful because sometime the text is too near the hairpin.
> > >
> > > I tried \lower #offset inside the markup but it doesn't work,
> > how can
> > > I fix this?
> > >
> > > Thank you very much!
> > >
> > > %
> > > hairpinWithCenteredText =
> > > #(define-music-function (text) (markup?)
> > >   #{
> > > \once \override Voice.Hairpin.after-line-breaking =
> > >   #(lambda (grob)
> > > (let* ((stencil (ly:hairpin::print grob))
> > >(par-y (ly:grob-parent grob Y))
> > >(dir (ly:grob-property par-y 'direction))
> > >(new-stencil (ly:stencil-aligned-to
> > >  (ly:stencil-combine-at-edge
> >
> >
> > Try replacing this one with ly:stencil-stack.
> >
> >
> > Do you mean ly:stencil-combine-at-edge replaced with ly:stencil-stack
> > ? I tried it, but the result is the same (with \lower #offset inside
> > the markup)
> >
> > thanks,
> >
> > Paolo
>
>
>
> What version do you have? This works over here;
>
> \version "2.22.1"
>
> %
> hairpinWithCenteredText =
> #(define-music-function (text) (markup?)
>#{
>  \once \override Voice.Hairpin.after-line-breaking =
>#(lambda (grob)
>  (let* ((stencil (ly:hairpin::print grob))
> (par-y (ly:grob-parent grob Y))
> (dir (ly:grob-property par-y 'direction))
> (new-stencil (ly:stencil-aligned-to
>   (ly:stencil-stack
> (ly:stencil-aligned-to stencil X CENTER)
> Y dir
> (ly:stencil-aligned-to
>   (grob-interpret-markup grob text) X CENTER))
>   X LEFT))
> (staff-space (ly:output-def-lookup
>   (ly:grob-layout grob) 'staff-space))
> (staff-line-thickness
>   (ly:output-def-lookup (ly:grob-layout grob)
> 'line-thickness))
> (par-x (ly:grob-parent grob X))
> (dyn-text (grob::has-interface par-x
> 'dynamic-text-interface))
> (dyn-text-stencil-x-length
>   (if dyn-text
> (interval-length
>   (ly:stencil-extent (ly:grob-property par-x
> 'stencil) X))
> 0))
> (x-shift
>   (if dyn-text
> (-
>   (+ staff-space dyn-text-stencil-x-length)
>   (* 0.5 staff-line-thickness)) 0)))
>
>  (ly:grob-set-property! grob 'Y-offset 0)
>  (ly:grob-set-property! grob 'stencil
> (ly:stencil-translate-axis
>  new-stencil
>  x-shift X
>#})
>
> hairpinMolto =
> \hairpinWithCenteredText \markup { \italic molto }
>
> hairpinMore =
> \hairpinWithCenteredText \markup { \larger \lower #10 moltissimo }
>
> \layout { ragged-right = ##f }
>
> \relative c' {
>\hairpinMolto
>c2\< c\f
>\hairpinMore
>c2\p\< c\f
>\break
>\hairpinMolto
>c2^\< c\f
>\hairpinMore
>c2\p\< c\f
> }
> %
>
>
> Note that ly:stencil-stack will still prevent the stencils
> from getting too close, while allowing them to get farther
> from each other. I inferred this was not an issue from
> you problem statement that "sometimes the text is too
> near to the hairpin". If it is, you can use ly:stencil-add,
> removing the line with "Y dir", and put \lower in each markup
> as appropriate. You can also keep the original code and use
> \with-dimensions, or \with-dimension from
> https://lists.gnu.org/archive/html/lilypond-user/2020-1

Re: Shift vertically a text centered on a hairpin

2021-12-12 Thread Paolo Prete
On Sun, Dec 12, 2021 at 2:56 PM Jean Abou Samra  wrote:

>
>
> Le 12/12/2021 à 14:28, Paolo Prete a écrit :
> > Hello,
> >
> > it would be good to have more control on the text centered on a hairpin.
> >
> > For example: I can't shift the text vertically, and I think this is
> > useful because sometime the text is too near the hairpin.
> >
> > I tried \lower #offset inside the markup but it doesn't work, how can
> > I fix this?
> >
> > Thank you very much!
> >
> > %
> > hairpinWithCenteredText =
> > #(define-music-function (text) (markup?)
> >   #{
> > \once \override Voice.Hairpin.after-line-breaking =
> >   #(lambda (grob)
> > (let* ((stencil (ly:hairpin::print grob))
> >(par-y (ly:grob-parent grob Y))
> >(dir (ly:grob-property par-y 'direction))
> >(new-stencil (ly:stencil-aligned-to
> >  (ly:stencil-combine-at-edge
>
>
> Try replacing this one with ly:stencil-stack.
>
>
Do you mean ly:stencil-combine-at-edge replaced with ly:stencil-stack ? I
tried it, but the result is the same (with \lower #offset inside the markup)

thanks,

Paolo


Shift vertically a text centered on a hairpin

2021-12-12 Thread Paolo Prete
Hello,

it would be good to have more control on the text centered on a hairpin.

For example: I can't shift the text vertically, and I think this is useful
because sometime the text is too near the hairpin.

I tried \lower #offset inside the markup but it doesn't work, how can I fix
this?

Thank you very much!

%
hairpinWithCenteredText =
#(define-music-function (text) (markup?)
  #{
\once \override Voice.Hairpin.after-line-breaking =
  #(lambda (grob)
(let* ((stencil (ly:hairpin::print grob))
   (par-y (ly:grob-parent grob Y))
   (dir (ly:grob-property par-y 'direction))
   (new-stencil (ly:stencil-aligned-to
 (ly:stencil-combine-at-edge
   (ly:stencil-aligned-to stencil X CENTER)
   Y dir
   (ly:stencil-aligned-to
 (grob-interpret-markup grob text) X CENTER))
 X LEFT))
   (staff-space (ly:output-def-lookup
 (ly:grob-layout grob) 'staff-space))
   (staff-line-thickness
 (ly:output-def-lookup (ly:grob-layout grob)
'line-thickness))
   (par-x (ly:grob-parent grob X))
   (dyn-text (grob::has-interface par-x
'dynamic-text-interface))
   (dyn-text-stencil-x-length
 (if dyn-text
   (interval-length
 (ly:stencil-extent (ly:grob-property par-x 'stencil)
X))
   0))
   (x-shift
 (if dyn-text
   (-
 (+ staff-space dyn-text-stencil-x-length)
 (* 0.5 staff-line-thickness)) 0)))

(ly:grob-set-property! grob 'Y-offset 0)
(ly:grob-set-property! grob 'stencil
   (ly:stencil-translate-axis
new-stencil
x-shift X
  #})

hairpinMolto =
\hairpinWithCenteredText \markup { \italic molto }

hairpinMore =
\hairpinWithCenteredText \markup { \larger \lover #2 moltissimo }

\layout { ragged-right = ##f }

\relative c' {
  \hairpinMolto
  c2\< c\f
  \hairpinMore
  c2\p\< c\f
  \break
  \hairpinMolto
  c2^\< c\f
  \hairpinMore
  c2\p\< c\f
}
%


Re: Issue when setting the font-name for a hairpin with centered text

2021-12-12 Thread Paolo Prete
Thank you, all clear!

On Sun, Dec 12, 2021 at 1:07 PM Jean Abou Samra  wrote:

> Le 12/12/2021 à 12:53, Paolo Prete a écrit :
> > Hello,
> >
> > I'm trying to set the font-name for a hairpin with centered text later
> > in the score, and not in the definition of the function.
> > However, my attempt, in the snippet below, doesn't work. How can I fix
> > this?
> >
> > Thanks,
> > P
> >
> > %
> > hairpinWithCenteredText =
> > #(define-music-function (text) (markup?)
> >   #{
> > \once \override Score.Hairpin.after-line-breaking =
> >   #(lambda (grob)
> > (let* ((stencil (ly:hairpin::print grob))
> >(par-y (ly:grob-parent grob Y))
> >(dir (ly:grob-property par-y 'direction))
> >(new-stencil (ly:stencil-aligned-to
> >  (ly:stencil-combine-at-edge
> >(ly:stencil-aligned-to stencil X CENTER)
> >Y dir
> >(ly:stencil-aligned-to
> >  (grob-interpret-markup grob text) X CENTER))
> >  X LEFT))
> >(staff-space (ly:output-def-lookup
> >  (ly:grob-layout grob) 'staff-space))
> >(staff-line-thickness
> >  (ly:output-def-lookup (ly:grob-layout grob)
> > 'line-thickness))
> >(par-x (ly:grob-parent grob X))
> >(dyn-text (grob::has-interface par-x
> > 'dynamic-text-interface))
> >(dyn-text-stencil-x-length
> >  (if dyn-text
> >(interval-length
> >  (ly:stencil-extent (ly:grob-property par-x
> > 'stencil) X))
> >0))
> >(x-shift
> >  (if dyn-text
> >(-
> >  (+ staff-space dyn-text-stencil-x-length)
> >  (* 0.5 staff-line-thickness)) 0)))
> >
> > (ly:grob-set-property! grob 'Y-offset 0)
> > (ly:grob-set-property! grob 'stencil
> >(ly:stencil-translate-axis
> > new-stencil
> > x-shift X
> >   #})
> >
> > #(define textFontName "Liberation Sans, Italic")
> >
> > hairpinPoco = {
> >   \once \override Score.DynamicLineSpanner.staff-padding = 2
> >   \hairpinWithCenteredText \markup { \override #(cons 'font-name
> > textFontName) \abs-fontsize #6 poco }
> > }
> >
> > {
> >
> > % The following command doesn't change the font name...
> > #(set! textFontName "Liberation Sans")
> > \hairpinPoco c'4\< c' c' c'\!
> >
> > }
>
>
>
> This is exactly the same as, in almost every language,
>
> a = "Liberation Sans, Italic"
> b = some_operation(a)
> a = "Liberation Sans"
>
> b is fixed at the time you define it. You're
> not using textFontName in a function, you
> just put its value in hairpinPoco. Once
> evaluated, hairpinPoco no longer depends
> on textFontName. Also, LilyPond does not
> process the score linearly in one pass. At
> the time at which the font name is retrieved,
> the music of the whole score has long been
> parsed, so it comes after your #(set! ...),
> but also after any other #(set! ...)s coming
> after the hairpin you want to customize.
> How about:
>
> \version "2.22.1"
>
> hairpinWithCenteredText =
> #(define-music-function (text) (markup?)
>#{
>  \once \override Score.Hairpin.after-line-breaking =
>#(lambda (grob)
>  (let* ((stencil (ly:hairpin::print grob))
> (par-y (ly:grob-parent grob Y))
> (dir (ly:grob-property par-y 'direction))
> (new-stencil (ly:stencil-aligned-to
>   (ly:stencil-combine-at-edge
> (ly:stencil-aligned-to stencil X CENTER)
> Y dir
> (ly:stencil-aligned-to
>   (grob-interpret-markup grob text) X CENTER))
>   X LEFT))
> (staff-space (ly:output-def-lookup
>   (ly:grob-layout grob) 'staff-space))
> (staff-line-thickness
>   (ly:output-def-lookup (ly:grob-layout grob)
> 'line-thickness))
> (par-x (ly:grob-parent grob X))
> (dyn-text (grob::has-interface par-x
> 'dynamic-text-interface))
> (dyn-text-stencil-x-length
>   (if dyn-text
> (interval-lengt

Issue when setting the font-name for a hairpin with centered text

2021-12-12 Thread Paolo Prete
Hello,

I'm trying to set the font-name for a hairpin with centered text later in
the score, and not in the definition of the function.
However, my attempt, in the snippet below, doesn't work. How can I fix this?

Thanks,
P

%
hairpinWithCenteredText =
#(define-music-function (text) (markup?)
  #{
\once \override Score.Hairpin.after-line-breaking =
  #(lambda (grob)
(let* ((stencil (ly:hairpin::print grob))
   (par-y (ly:grob-parent grob Y))
   (dir (ly:grob-property par-y 'direction))
   (new-stencil (ly:stencil-aligned-to
 (ly:stencil-combine-at-edge
   (ly:stencil-aligned-to stencil X CENTER)
   Y dir
   (ly:stencil-aligned-to
 (grob-interpret-markup grob text) X CENTER))
 X LEFT))
   (staff-space (ly:output-def-lookup
 (ly:grob-layout grob) 'staff-space))
   (staff-line-thickness
 (ly:output-def-lookup (ly:grob-layout grob)
'line-thickness))
   (par-x (ly:grob-parent grob X))
   (dyn-text (grob::has-interface par-x
'dynamic-text-interface))
   (dyn-text-stencil-x-length
 (if dyn-text
   (interval-length
 (ly:stencil-extent (ly:grob-property par-x 'stencil)
X))
   0))
   (x-shift
 (if dyn-text
   (-
 (+ staff-space dyn-text-stencil-x-length)
 (* 0.5 staff-line-thickness)) 0)))

(ly:grob-set-property! grob 'Y-offset 0)
(ly:grob-set-property! grob 'stencil
   (ly:stencil-translate-axis
new-stencil
x-shift X
  #})

#(define textFontName "Liberation Sans, Italic")

hairpinPoco = {
  \once \override Score.DynamicLineSpanner.staff-padding = 2
  \hairpinWithCenteredText \markup { \override #(cons 'font-name
textFontName) \abs-fontsize #6 poco }
}

{

% The following command doesn't change the font name...
#(set! textFontName "Liberation Sans")
\hairpinPoco c'4\< c' c' c'\!

}
%


Re: Issue on vertical spacing of a TupletBracket

2021-12-10 Thread Paolo Prete
Thank you too for the tip,

Unfortunately, it seems to produce weird results in some cases, For
example: I can't set the 'padding' property in a consistent way. See the
snippet below (and please, give me a feedback, so the gitlab page can be
updated, if needed).
It appears to me that there is a conceptual contradiction in the
TupletBracket itself: it is defined as a non-outside-staff object as
default, but it requires the avoid-collision props of the outside-staff
objects as well. I can understand that there are scores in which brackets
are inside staves (I don't like this choice TBH, I think it visually messes
up the score), but in case the notation doesn't require this constraint,
like my case, putting the bracket outside the score, with a proper barrier
around it, seem to solve all the issues.
Note that a TupletBracket should have an unbalanced barrier (no space or
few space above it, some space below it), which is not possible with
outside-staff-padding but it is possible with the function that Aaron wrote
some time ago (just create a white box):

https://lists.gnu.org/archive/html/lilypond-user/2020-02/msg00202.html

Best,
P

%
(define (Tuplet_accidental_support_engraver context)
(let ((brackets (make-hash-table))
  (ending-brackets '())
  (accidentals '()))
  (make-engraver
(acknowledgers
  ((tuplet-bracket-interface engraver grob source-engraver)
 (hashq-set! brackets grob #t))
  ((accidental-interface engraver grob source-engraver)
 (set! accidentals (cons grob accidentals
(end-acknowledgers
  ((tuplet-bracket-interface engraver grob source-engraver)
 (set! ending-brackets (cons grob ending-brackets
((stop-translation-timestep engraver)
   (hash-for-each
 (lambda (bracket dummy)
   (for-each
 (lambda (accidental)
   (ly:pointer-group-interface::add-grob
 bracket
 'scripts
 accidental))
 accidentals))
 brackets)
   (for-each
 (lambda (bracket)
   (hashq-remove! brackets bracket))
 ending-brackets)
   (set! accidentals '())

\layout {
   \context {
 \Voice
 \consists #Tuplet_accidental_support_engraver
   }
}


%
{
\time 5/4
\override TupletBracket.direction = #UP
\override TupletBracket.padding = 0
\tuplet 3/2 { a'' a'' a''}
\revert TupletBracket.padding
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}

\override TupletBracket.padding = 0
\tuplet 3/2 { a'' a'' a''}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' a''}
}
%


On Fri, Dec 10, 2021 at 10:09 AM Jean Abou Samra  wrote:

> Le 10/12/2021 à 01:13, Paolo Prete a écrit :
> > Hello,
> >
> > please look at this snippet (tested with 2.22.0):
> >
> > %
> > {
> > \time 5/4
> > \override TupletBracket.direction = #UP
> > \tuplet 3/2 { a'' a'' ais''-.}
> > s
> > \tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
> > }
> > %
> >
> > As you can see, the vertical gap between the staccato dot and the
> > tuplet bracket is shorter than the gap between the same bracket and
> > the accidental; however, this is not taken into account and the result
> > is visually faulty.
> > Is there a way to fix this?
>
>
> Try the workaround given here:
>
> https://gitlab.com/lilypond/lilypond/-/issues/3766#note_623977182
>
>
> \version "2.22.1"
>
> #(define (Tuplet_accidental_support_engraver context)
> (let ((brackets (make-hash-table))
>   (ending-brackets '())
>   (accidentals '()))
>   (make-engraver
> (acknowledgers
>   ((tuplet-bracket-interface engraver grob source-engraver)
>  (hashq-set! brackets grob #t))
>   ((accidental-interface engraver grob source-engraver)
>  (set! accidentals (cons grob accidentals
> (end-acknowledgers
>   ((tuplet-bracket-interface engraver grob source-engraver)
>  (set! ending-brackets (cons grob ending-brackets
> ((stop-translation-timestep engraver)
>(hash-for-each
>  (lambda (bracket dummy)
>(for-each
>  (lambda (accidental)
>(ly:pointer-group-interface::add-grob
>  bracket
>  'scripts
>  accidental))
>  accidentals))
>  brackets)
>(for-each
>  (lambda (bracket)
>(hashq-remove! brackets bracket))
>  ending-brackets)
>(set! accidentals '())
>
> \layout {
>\context {
>  \Voice
>  \consists #Tuplet_accidental_support_engraver
>}
> }
>
>
> %
> {
> \time 5/4
> \override TupletBracket.direction = #UP
> \tuplet 3/2 { a'' a'' ais''-.}
> s
> \tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
> }
> %
>
>
> Best,
> Jean
>


Re: Issue on vertical spacing of a TupletBracket

2021-12-10 Thread Paolo Prete
On Fri, Dec 10, 2021 at 3:47 AM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Paolo,
>
> Maybe this gives you a starting point?
>
> %%%
> \version "2.23.4"
>
> ignoreH =
>\propertyTweak horizontal-skylines ##f
>\propertyTweak extra-spacing-width #empty-interval
>\etc
>
> ignoreV =
>\propertyTweak vertical-skylines ##f
>\propertyTweak extra-spacing-height #empty-interval
>\etc
>
> ignore = \ignoreH \ignoreV \etc
>
> {
> \time 6/4
> \override TupletBracket.direction = #UP
> \override TupletBracket.outside-staff-priority = #1000
> \tuplet 3/2 { a''-\ignore ( a'' ais''-.) }
> s
> \tuplet 3/2 { a'' a'' ais'' }
> s
> }
> %%%
>
> Hope that helps!
> Kieren.
>


That's GREAT! Thanks!
It not only solves the alignment issue; it also keeps the
outside-staff-priority for objects that must be put inside the slur.
At this point, I wonder why the method that forces outside-staff-priority
set to ##f is suggested in multiple pages of the documentation:

(Positioning text markups inside slurs)
https://lilypond.org/doc/v2.23Documentation/notation/expressive-marks-as-curves

(Creating a delayed turn)
https://lilypond.org/doc/v2.23/Documentation/snippets/editorial-annotations

(Outside-staff objects)
https://lilypond.org/doc/v2.23/Documentation/learning/outside_002dstaff-objects


The last pages even says that: "The avoid-slur property of the articulation
can be set to 'inside to bring the articulation inside the slur, but the
avoid-slur property is effective only if the outside-staff-priority is also
set to #f", but this is not true, as the snippet shows, if adapted to your
method:

%%%
ignoreH =
   \propertyTweak horizontal-skylines ##f
   \propertyTweak extra-spacing-width #empty-interval
   \etc

ignoreV =
   \propertyTweak vertical-skylines ##f
   \propertyTweak extra-spacing-height #empty-interval
   \etc

ignore = \ignoreH \ignoreV \etc

\relative c'' {
  c4( c^\markup { \tiny \sharp } d4.) c8 |
  c4-\ignore (
\once \override TextScript.avoid-slur = #'inside
%\once \override TextScript.outside-staff-priority = ##f
c4^\markup { \tiny \sharp } d4.) c8 |
\once \override Slur.outside-staff-priority = #500
c4( c^\markup { \tiny \sharp } d4.) c8 |
}
%%%

In addition: I don't understand too why it suggests:  "the
outside-staff-priority of the slur can be set to a numerical value to cause
it to be placed along with other outside-staff objects according to that
value". This doesn't seem a good idea to me, given that a Slur is not
supposed to be an outside-staff object...

Cheers,
P


Re: Issue on vertical spacing of a TupletBracket

2021-12-09 Thread Paolo Prete
On Fri, Dec 10, 2021 at 2:53 AM Paolo Prete  wrote:

>
> 1) the upper margin should be calculated from the BOTTOM of the
> TupletBracket
>

Then I wonder if is there a way to overlay a white filled box on the
TupletBracket, or a white vertical line at its bottom, in a way that the
new padding is calculated from it. I don't know if this would help, but it
could be a starting point.


>


Re: Issue on vertical spacing of a TupletBracket

2021-12-09 Thread Paolo Prete
Hello,

Unfortunately your work-around can't be applied because the issue happens
for every articulation, not only for the staccato. In addition, it would
not affect the midi output of the articulate script.
Note that the issue is not on the staccato dot, it is on the gap between
the accidental and the bracket. What is faulty is the second bracket, not
the first one.
I just verified that TupletBracket has the outside-staff-priority set to
##f as default.
If I give it a value, the brackets result aligned:

%
{
\time 6/4
\override TupletBracket.direction = #UP
\override TupletBracket.outside-staff-priority = #1000
\tuplet 3/2 { a'' a'' ais''-. }
s
\tuplet 3/2 { a'' a'' ais'' }
s
}
%

However, this messes up slurs, because it won't be possible anymore to put
the bracket inside them.
I think that there are two issues at the same time on the calculated
TupletBracket.padding:

1) the upper margin should be calculated from the BOTTOM of the
TupletBracket
2) the lower margin should take into account every visibile accidental

Let's hope there's at least a work-around for this, I think it is very
important.

Cheers,
Paolo


Issue on vertical spacing of a TupletBracket

2021-12-09 Thread Paolo Prete
Hello,

please look at this snippet (tested with 2.22.0):

%
{
\time 5/4
\override TupletBracket.direction = #UP
\tuplet 3/2 { a'' a'' ais''-.}
s
\tuplet 3/2 { \once \hide Accidental a'' a'' ais''}
}
%

As you can see, the vertical gap between the staccato dot and the tuplet
bracket is shorter than the gap between the same bracket and the
accidental; however, this is not taken into account and the result is
visually faulty.
Is there a way to fix this?

Thanks!
P


How to place slurs above multiple objects

2021-12-09 Thread Paolo Prete
Hello,

Suppose that I have a slur that must be placed ABOVE a note which is part
of a a TupletBracket and an OttavaBracket .

As the documentation explains, TupletBrackets and OttavaBrackets  need to
have the outside-staff-priority property set to false in order to be
printed inside slurs.

However, with this method, I loose the benefits of the avoid-collisions
properties applied to these objects, because these properties are ignored
if outside-staff-priority property is set to false.

Then I wonder if is there a way to preserve the outside-staff-priority for
these objects and have a command that draws a slur regardless to its
collisions with them. In this way I would manually resolve collisions for
only one object (the slur) instead of two.

Thanks,

P


Re: (Re-post) Printing page numbers from a given page

2021-12-03 Thread Paolo Prete
Thanks Aaron, this is precious!!

On Fri, Dec 3, 2021 at 2:44 AM Aaron Hill  wrote:

> On 2021-12-02 4:55 pm, Paolo Prete wrote:
> > I re-post this because I noted later that the answer I obtained does
> > not
> > fit what I asked.
> > I wonder if is there a way to start printing page numbers of a score
> > from a
> > given page.
> >
> > For example: if I want to start printing page numbers from page 3, page
> > numbers 1 and 2, on first and second page, have to be omitted.
> >
> > (note that this is not the property:  first-page-number = 3; it is
> > instead
> > somewhat similar to print-first-page-number = ##f, but extended to
> > multiple
> > pages)
>
> Customize the header:
>
> 
> \version "2.22.0"
>
> #(define ((page-number-on-or-after num) layout props arg)
>(if (< (chain-assoc-get 'page:page-number props -1) num)
> empty-stencil (interpret-markup layout props arg)))
>
> \paper {
>#(set-paper-size "a7landscape")
>
>oddHeaderMarkup =
>\markup \fontsize #12 \fill-line {
>  \null
>  \on-the-fly #(page-number-on-or-after 3)
>\fromproperty #'page:page-number-string
>}
>evenHeaderMarkup = ##f
>
>page-count = #5
> }
>
> { \repeat unfold 68 { b'4 4 2 } \bar "|." }
> 
>
>
> -- Aaron Hill
>


(Re-post) Printing page numbers from a given page

2021-12-02 Thread Paolo Prete
Hello,

I re-post this because I noted later that the answer I obtained does not
fit what I asked.
I wonder if is there a way to start printing page numbers of a score from a
given page.

For example: if I want to start printing page numbers from page 3, page
numbers 1 and 2, on first and second page, have to be omitted.

(note that this is not the property:  first-page-number = 3; it is instead
somewhat similar to print-first-page-number = ##f, but extended to multiple
pages)

Thanks!

P


Re: CPU stress tests for LilyPond

2021-12-02 Thread Paolo Prete
On Thu, Dec 2, 2021 at 9:21 PM David Wright 
wrote:

> On Thu 02 Dec 2021 at 09:05:08 (+0100), Thomas Scharkowski wrote:
> > On Thu, Dec 2, 2021 at 2:41 AM Paolo Prete wrote:
>
> > > With my processor (Intel Celeron N3350) it took 96 seconds to compile
> MSDN.ly
> > >
> > > But my CPU is listed with score 287:
>
> That too seems slow. What OS is it running?
>
>
Thanks for noting this.  I re-ran the tests, and I confirm that it took 96
secs on LilyPond 2.20.0-1 on Lubuntu (newest version). Same time without
the X environment. However, with LilyPond 2.22.0-1 it took 55 seconds. This
is a huge difference. Now, if I compare this last result with the Apple
Mini of Jacques, I obtain 55 seconds versus 39 seconds. But the Gzip test
shows 91 versus 40, then the Gzip test is not a reliable parameter too for
our test.



> > >
> https://openbenchmarking.org/vs/Processor/Apple%20M1,Intel%20Celeron%20J3455
> > >
> > > (note that it compares Apple M1 with Celeron J3455, which is NOT my
> CPU, but it should be very similar for single-core tests.)
> > >
> > > The result is 91 / 40 which is very similar to 96 seconds / 40 seconds
> (Jacque's test)  . I don't know if this is a coincidence and please, if you
> all have more data, share it.
>
> I can't get results from that site because only the
> fastest machine above matches: there's nothing comparable
> even to the middle one, and the slowest probably raises
> some eyebrows.
>

Yeah, there are not many machines for the Gzip test. But did you check for
a similar CPU on the big list?

https://openbenchmarking.org/test/pts/compress-gzip

Anyway, we have to fix some points before doing further tests:

1) which version of LilyPond should we use? I would propose 2.22.0
2) which test can we use, as a reference? Geekbench 5 has the disadvantage
I said before, and Gzip doesn't seem to me the best one, give the
discrepancy between 55/39 and 91/40

Cheers,
Paolo




>
> Cheers,
> David.
>


ANN: Spontini-Editor version 1.8

2021-12-02 Thread Paolo Prete
Hello,

I just created a new release (1.8) of Spontini-Editor.

https://github.com/paopre/Spontini

It is still under test: then, it is not yet included inside the "releases"
page of the project, but it should already work and you can download it
from the main page.

Here are the new features:

* Added "Toggle JSSVG" tool (you can hide on the fly the editor's objects
for modifying the score with the mouse)
* Added user settable renderSvgTextWithGeometricPrecision (prevents
Chrome's latest version issues when rendering text)
* Added tools for fonts (list all fonts, search font, search font file)
* Fixed goToPage() issue, when the compiled score has less pages than the
previous one.
* Added better looking input dialogs for search/replace
* Tested compatibility with LilyPond 2.23.5

In addition, thanks to the suggestion of David Wright, a filter can be
set/unset/saved/deleted on the fly, without modifying the text of the ly
file. This filter can be used for including/excluding on the fly sections,
pages or even systems or single measures of the score.

HTH,

P


Re: CPU stress tests for LilyPond

2021-12-01 Thread Paolo Prete
Note too that there's a list of the results for the Gzip test:

https://openbenchmarking.org/test/pts/compress-gzip

>From this list it appears to me that Intel Core i5-11600k could be the
"gold" PC for LilyPond...

On Thu, Dec 2, 2021 at 2:41 AM Paolo Prete  wrote:

> Hello Hans,
>
> I don't think this test can give reliable results for what we need to
> compare.
> With my processor (Intel Celeron N3350) it took 96 seconds to compile
> MSDN.ly
>
> But my CPU is listed with score 287:
> https://browser.geekbench.com/processors/intel-celeron-n3350
> ---> (1712 / 287)
>
> From what I see,  is it true that geekbench 5 is single core, but it
> intensively uses RAM and the test we need should not be focused on RAM. I
> would consider a Gzip compression test, instead.
>
>
> https://openbenchmarking.org/vs/Processor/Apple%20M1,Intel%20Celeron%20J3455
>
> (note that it compares Apple M1 with Celeron J3455, which is NOT my CPU,
> but it should be very similar for single-core tests.)
>
> The result is 91 / 40 which is very similar to 96 seconds / 40 seconds
> (Jacque's test)  . I don't know if this is a coincidence and please, if you
> all have more data, share it.
>
>
>
>
>
> On Tue, Nov 30, 2021 at 5:56 PM Hans Åberg  wrote:
>
>> So, to illustrate the idea of using the benchmark at the list below, it
>> might be the Mac mini (Late 2020) with single-core score 1712 and the other
>> Macs of this year have a similar performance. It gives for the iMac 2008
>> used a single-core score 372 (depending on model), and it took 4–5 minutes
>> to compile the same example. Then 1712/407 = 4.6, and dividing 4 minutes
>> with that gives 53 seconds, and this ignores speedups in lilypond self, but
>> it seems one can get a rough idea of performance this way.
>>
>> https://browser.geekbench.com/mac-benchmarks
>>
>>
>> > On 30 Nov 2021, at 16:36, Jacques Menu  wrote:
>> >
>> > Hello,
>> >
>> > Here is what I get for this 102 page score:
>> >
>> > jacquesmenu@macmini > time lilypond MSDM.ly
>> > GNU LilyPond 2.22.1
>> > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
>> > ;;;   or pass the --no-auto-compile argument to disable.
>> > … … … …
>> > real  0m39.590s
>> > user  0m37.119s
>> > sys   0m2.285s
>> >
>> > jacquesmenu@macmini > ls -sal MSDM.*
>> >8 -rw---@ 1 jacquesmenu  staff2695 Nov 17  2016 MSDM.ly
>> >   88 -rw-r--r--  1 jacquesmenu  staff   42641 Nov 30 16:32 MSDM.mid
>> > 1888 -rw-r--r--  1 jacquesmenu  staff  963019 Nov 30 16:32 MSDM.pdf
>> >
>> > The machine is a Mac Mini M1, 8GB RAM, 256 GB disk.
>> >
>> > JM
>> >
>> >> Le 30 nov. 2021 à 15:28, Hans Åberg  a écrit :
>> >>
>> >>
>> >>> On 30 Nov 2021, at 14:26, Paolo Prete  wrote:
>> >>>
>> >>> I need to buy a new PC, more powerful than the one I own. The CPU and
>> RAM must be chosen on the time required to produce LilyPond output. Are
>> there any test sheets with different CPUs and the time they take to output
>> a score that takes a long time to compile? In case this doesn't exist
>> specifically for LilyPond, is there anything equivalent I can use?
>> >>
>> >> There are general benchmarks, like those below, maybe the single core
>> ones can be useful.
>> >>
>> >> https://browser.geekbench.com
>> >> https://browser.geekbench.com/mac-benchmarks
>> >>
>> >>
>> >>
>> >
>>
>>


Re: CPU stress tests for LilyPond

2021-12-01 Thread Paolo Prete
Hello Hans,

I don't think this test can give reliable results for what we need to
compare.
With my processor (Intel Celeron N3350) it took 96 seconds to compile
MSDN.ly

But my CPU is listed with score 287:
https://browser.geekbench.com/processors/intel-celeron-n3350
---> (1712 / 287)

>From what I see,  is it true that geekbench 5 is single core, but it
intensively uses RAM and the test we need should not be focused on RAM. I
would consider a Gzip compression test, instead.

https://openbenchmarking.org/vs/Processor/Apple%20M1,Intel%20Celeron%20J3455

(note that it compares Apple M1 with Celeron J3455, which is NOT my CPU,
but it should be very similar for single-core tests.)

The result is 91 / 40 which is very similar to 96 seconds / 40 seconds
(Jacque's test)  . I don't know if this is a coincidence and please, if you
all have more data, share it.





On Tue, Nov 30, 2021 at 5:56 PM Hans Åberg  wrote:

> So, to illustrate the idea of using the benchmark at the list below, it
> might be the Mac mini (Late 2020) with single-core score 1712 and the other
> Macs of this year have a similar performance. It gives for the iMac 2008
> used a single-core score 372 (depending on model), and it took 4–5 minutes
> to compile the same example. Then 1712/407 = 4.6, and dividing 4 minutes
> with that gives 53 seconds, and this ignores speedups in lilypond self, but
> it seems one can get a rough idea of performance this way.
>
> https://browser.geekbench.com/mac-benchmarks
>
>
> > On 30 Nov 2021, at 16:36, Jacques Menu  wrote:
> >
> > Hello,
> >
> > Here is what I get for this 102 page score:
> >
> > jacquesmenu@macmini > time lilypond MSDM.ly
> > GNU LilyPond 2.22.1
> > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> > ;;;   or pass the --no-auto-compile argument to disable.
> > … … … …
> > real  0m39.590s
> > user  0m37.119s
> > sys   0m2.285s
> >
> > jacquesmenu@macmini > ls -sal MSDM.*
> >8 -rw---@ 1 jacquesmenu  staff2695 Nov 17  2016 MSDM.ly
> >   88 -rw-r--r--  1 jacquesmenu  staff   42641 Nov 30 16:32 MSDM.mid
> > 1888 -rw-r--r--  1 jacquesmenu  staff  963019 Nov 30 16:32 MSDM.pdf
> >
> > The machine is a Mac Mini M1, 8GB RAM, 256 GB disk.
> >
> > JM
> >
> >> Le 30 nov. 2021 à 15:28, Hans Åberg  a écrit :
> >>
> >>
> >>> On 30 Nov 2021, at 14:26, Paolo Prete  wrote:
> >>>
> >>> I need to buy a new PC, more powerful than the one I own. The CPU and
> RAM must be chosen on the time required to produce LilyPond output. Are
> there any test sheets with different CPUs and the time they take to output
> a score that takes a long time to compile? In case this doesn't exist
> specifically for LilyPond, is there anything equivalent I can use?
> >>
> >> There are general benchmarks, like those below, maybe the single core
> ones can be useful.
> >>
> >> https://browser.geekbench.com
> >> https://browser.geekbench.com/mac-benchmarks
> >>
> >>
> >>
> >
>
>


CPU stress tests for LilyPond

2021-11-30 Thread Paolo Prete
Hello,

I need to buy a new PC, more powerful than the one I own. The CPU and RAM
must be chosen on the time required to produce LilyPond output. Are there
any test sheets with different CPUs and the time they take to output a
score that takes a long time to compile? In case this doesn't exist
specifically for LilyPond, is there anything equivalent I can use?

Thanks!
P


Re: Header inside the score context

2021-11-29 Thread Paolo Prete
On Mon, Nov 29, 2021 at 5:59 AM David Wright 
wrote:

> On Wed 24 Nov 2021 at 19:44:59 (+0100), Paolo Prete wrote:
>
>
>
> If you do this regularly, I would suggest that that's just
> what you do, copy your source through a simple filter to a
> temporary file and compile that.
>
> [cut]


Hello David,

Your tip about a filter is an *excellent* idea and, I think, the only
proper way to manage this task for *many* reasons.
I'm adding it to my editor right now (a new release will follow ASAP).

Thanks sincerely for your help!

Cheers,

Paolo

>
>


Re: Embedding images into a score created with -dbackend=svg

2021-11-27 Thread Paolo Prete
On Sat, Nov 27, 2021 at 1:45 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> I’m not saying that your approach is meaningless. Drawing paths as SVG and
> then transforming them into a Lilypond path is a sensible workflow for
> creating custom glyphs. But I’m just explaining why this would not work as
> a
> generic method for embedding SVG images into our score.


Hello Valentin,

I don't agree with this. This method was not intended for embedding generic
SVG images into a score: it was intended for putting stylized images for
*notes*, not only for glyphs, which is common in notes of contemporary
scores. This kind of shapes are mostly stylized, then they can be easily
translated into paths and nothing else. And LP provides all the
corresponding commands. Think for example about a hand for fingering:

https://www.dummies.com/wp-content/uploads/288877.image0.jpg

I would not like to have a raster image for it. And it's better if you
avoid the  tag (see below)


>
> In your example the linked SVG does not exists, but if I replace it with
> an
> existing one like
> https://jsfiddle.net/utxfgyLb/


> I do not get any blur. Also if I’m using scale transforms on it I do not
> get
> any pixelation, as I’d expect on enlarging a rastered image. I’ve tried it
> on
> Firefox and on Konqueror/QtWebEngine (Chromium based).
>
> So if this happens it should probably be considered a bug of the viewer.
> And
> we cannot try to have Lilypond circumvent any bug that might exist in some
> viewing software.
>
>
This happens because modern browsers have a "surplus" of features and not
because the old viewer doesn't observe the SVG specs. Then, the blurry
image on older versions of FF should not be considered a bug. Look at this
page:

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image

"[...] SVG files displayed with   *are treated as an image*:
external resources aren't loaded, :visited styles aren't applied, and they
cannot be interactive. To include dynamic SVG elements, try  with an
external URL. To include SVG files and run scripts inside them, try
 inside of ."

Then, embedding  into  is not a reliable way to do what we are
talking about. The clean solution is to inline .

Cheers,
Paolo


Re: Embedding images into a score created with -dbackend=svg

2021-11-27 Thread Paolo Prete
On Sat, Nov 27, 2021 at 3:51 AM Valentin Petzel  wrote:

> Hello Paolo,
>
> The viewer needs to rasterize the svg, how else is it supposed to display
> it?
> Also it’s not you who is supposed to add the image tag, but the svg
> backend.
>
>
Hello Valentin,

This is not what I meant. SVG embedded into an  tag gets rasterized
regardless of its vector nature, thus producing a blurry or pixeled image
after some transforms are done. Look at the blurry image of the fiddle
inside the link of my previous message:

https://jsfiddle.net/godawnpL/

The embedded svg file is managed as a raster image and this is unwanted
(then it's preferrable to inline the svg tree)

If you want to have a score in some markup, just do
> \markup { bla bla bla \score{ ... } bla bla }
>
>
And this is the answer I really required! Thanks!! I got crazy in the past
days trying to create a markup with a fragment of score, and I did not know
that this was possible (and so simple). I sent a message to the ml (
https://lists.gnu.org/archive/html/lilypond-user/2021-11/msg00489.html )
about the problem, few days ago, but did not get an answer with a working
solution for it. Thanks again.


There is nothing on this example page
> that would require importing anything.[



> And the problem with your approach of turning an svg into a Lilypond path
> is
> than the lilypond drawing commands are significantly less powerful than
> SVG.
> So you cannot process all graphics files using your method.
>
>
Yes and no. I still think it's necessary for what I have to do. I have to
create notes for contemporary scores, where it is very easy to have images
around the fragment of the staff, in addition to the notes. Therefore I
need a tool for making this kind of notes, where the "score" part is, let's
say, 50%. Think for example at clarinet or flute scores, where multiphonics
or special sounds together with special fingerings have to be used.
Normally, an image of the instrument + fingerings + other special symbols
has to be attached both in the score and into the notes on the initial
pages. Of course there are some prebuilt objects for this (
https://lilypond.org/doc/v2.22/Documentation/notation/woodwind-diagrams ),
but I think it's much better to have a tool for making your custom images,
because the shape of these symbols much depend on your particular score,
there's not a shared standard. And these images require paths and nothing
else, they are pretty simple: therefore the set of commands provided by LP
cover completely their concrete drawing on SVG. Just pick a raster image as
a model, then draw paths above its shape with Inkscape, then convert these
paths to LP paths. Then my notes Will be a mixture of a \score part, as you
suggested, and a "path" part made with the procedure I explained.

Best,
Paolo


Re: Embedding images into a score created with -dbackend=svg

2021-11-26 Thread Paolo Prete
On Fri, Nov 26, 2021 at 7:18 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> I’m not exactly sure what you mean by „inline-svg”. The discussion you
> linked
> to is about manually converting svg paths into lilypond paths. While this
> is
> possible it surely would get very complicated with more advanced svg.
>
> But it should be quite easy to use the -tag svg gives us by it’s
> specifications to embed any sort of jpeg, png or svg image.
>

Hello Valentin,

using the  tag has one big disadvantage, at least in my case, AFAIK:
it can easily happen that the embedded image is automatically rasterized by
the viewer. See:
https://stackoverflow.com/questions/30582159/avoiding-rasterization-with-svg-image-so-that-transforms-work-in-firefox
.
In addition: how would I create the  tag with Lilypond? If I have to
do manipulation on the svg file after it is created by LilyPond, then I
would prefer inline svg, which means: nesting a  tree inside another
 tree (..). Then I would avoid rasterization
(and I would not have clashing ids, AFAIK). But I still prefer to do all on
the LilyPond side, not after the output is created.
Let's consider my specific case. I have to put some measures with few notes
as examples on the initial pages of the score. Something like this (+ staff
lines and clefs):

http://www.jameselkins.com/pianofiles/wp-content/uploads/2014/10/Screen-Shot-2014-10-29-at-11.11.39-AM-1024x653.jpg

I think the best solution is to convert svg paths to LP paths. I just found
a very useful tool for Inkscape, which transforms SVG paths in a way that
can be quite easily converted to LP paths:

https://github.com/Klowner/inkscape-applytransforms

Here is my (alfa) procedure:

1) create a snippet and save it as snippet.ly. Compile it with SVG backend
(output file: snippet.svg)
2) process snippet.svg with CLI of Inkscape (with the Klowner transform
filter), so to convert all the objects to path (output file:
snippet-paths-only, tested on Linux, Inkscape 1.1)

inkscape --batch-process
--actions="select-all;ObjectFlipVertically;object-to-path;select-all:all;com.klowner.filter.apply_transform.noprefs;export-filename:snippet-paths-only.svg;export-do"
snippet.svg

3) feed a script which translates snippets-path-only.svg to LilyPond syntax
(output file: snippet-to-markup.ly). I created a "svg-paths-to-ly-paths.py"
script for this job:

python3 svg-paths-to-ly-paths.py snippet-paths-only.svg snippet-to-markup.ly

4) compile snippet-to-markup.ly with LP and voila.

First results are very promising, and I can already use this system for
real cases. The size of the stems can be more accurate, but there's an easy
fix for this: replacing the  associated to the stem with a , so
to have a proper conversion of the object to a .

I attach to this message all the files of my test.

Best,
P
\paper {
  print-first-page-number = ##f
  oddFooterMarkup = \markup \fill-line { " " }
  evenFooterMarkup = \markup \fill-line { " " }
}

{
\time 3/4 c'' c'''->\mf cis' r d''8[ c''] r
}\markup { \overlay {
\override #'(line-cap-style . round)
\override #'(line-join-style . round)
\path #0.1 #'(
(moveto 0 0)
(moveto 14.2764 9.35354)
(lineto 45.8993 9.35354)
)

\override #'(line-cap-style . round)
\override #'(line-join-style . round)
\path #0.1 #'(
(moveto 0 0)
(moveto 14.2764 10.3535)
(lineto 45.8993 10.3535)
)

\override #'(line-cap-style . round)
\override #'(line-join-style . round)
\path #0.1 #'(
(moveto 0 0)
(moveto 14.2764 11.3535)
(lineto 45.8993 11.3535)
)

\override #'(line-cap-style . round)
\override #'(line-join-style . round)
\path #0.1 #'(
(moveto 0 0)
(moveto 14.2764 12.3535)
(lineto 45.8993 12.3535)
)

\override #'(line-cap-style . round)
\override #'(line-join-style . round)
\path #0.1 #'(
(moveto 0 0)
(moveto 14.2764 13.3535)
(lineto 45.8993 13.3535)
)

\override #'(filled . #t)
\path #0.05 #'(
(moveto 0 0)
(moveto 30.3432 8.45354)
(lineto 31.9485 8.45354)
(curveto 32.0039 8.45354 32.0485 8.40894 32.0485 8.35354)
(curveto 32.0485 8.29814 32.0039 8.25354 31.9485 8.25354)
(lineto 30.3432 8.25354)
(curveto 30.2878 8.25354 30.2432 8.29814 30.2432 8.35354)
(curveto 30.2432 8.40894 30.2878 8.45354 30.3432 8.45354)
(closepath)
)

\override #'(filled . #t)
\path #0.05 #'(
(moveto 0 0)
(moveto 26.5593 15.4535)
(lineto 28.3156 15.4535)
(curveto 28.371 15.4535 28.4156 15.4089 28.4156 15.3535)
(curveto 28.4156 15.2981 28.371 15.2535 28.3156 15.2535)
(lineto 26.5593 15.2535)
(curveto 26.5039 15.2535 26.4593 15.2981 26.4593 15.3535)
(curveto 26.4593 15.4089 26.5039 15.4535 26.5593 15.4535)
(closepath)
)

\override #'(filled . #t)
\path #0.05 #'(
(moveto 0 0)
(moveto 26.5593 14.4535)
(lineto 28.3156 14.4535)
(curveto 28.371 14.4535 28.4156 14.4089 28.4156 14.3535)
(curveto 28.4156 14.2981 28.371 14.2535 28.3156 14.2535)
(lineto 26.5593 14.2535)
(curveto 26.5039 14.2535 26.4593 14.2981 26.4593 14.3535)
(curveto 26.4593 14.4089 26.5039 14.4535 26.5593 14.4535)
(closepath)
)

\override #'(filled . #t)
\path #0.05 #'(
(moveto 0 0)
(moveto 34.3009 

Re: Embedding images into a score created with -dbackend=svg

2021-11-26 Thread Paolo Prete
Here's an alternative way to do it:

https://groups.google.com/g/musicnotation/c/G3j-lmc2H1w/m/7N2I2ksP5IcJ

Let's see if it works without too much effort...

On Fri, Nov 26, 2021 at 5:27 PM Paolo Prete  wrote:

>
> Hello Valentin,
>
>
>> The proper solution would probably to add a function like \embed-image
>> which
>> makes use of the SVG  tag. But that one only specifies jpeg, png
>> and
>> svg. This means that for any other format it is the choice of the viewing
>> software if they want to support it.
>
>
> this is why IMHO, for svg backend it would be even better to have a
> function that adds inline svg.
> IIRC there was, in this ml, an attempt to create it, but I can't find the
> corresponding message.
> Anyway, I would like to avoid conversions and, at the current state of
> art, I think that a way to  work-around is to draw a rect with the img
> size, and replace it with inline svg through some external utility.
>
> Best,
> Paolo
>


Re: Embedding images into a score created with -dbackend=svg

2021-11-26 Thread Paolo Prete
Hello Valentin,


> The proper solution would probably to add a function like \embed-image
> which
> makes use of the SVG  tag. But that one only specifies jpeg, png
> and
> svg. This means that for any other format it is the choice of the viewing
> software if they want to support it.


this is why IMHO, for svg backend it would be even better to have a
function that adds inline svg.
IIRC there was, in this ml, an attempt to create it, but I can't find the
corresponding message.
Anyway, I would like to avoid conversions and, at the current state of art,
I think that a way to  work-around is to draw a rect with the img size, and
replace it with inline svg through some external utility.

Best,
Paolo


Embedding images into a score created with -dbackend=svg

2021-11-26 Thread Paolo Prete
Hello,

AFAIK, there's no  way to embed an eps image, using the \epsfile command,
into a score made with SVG output (I would suggest to add this note into
the doc, BTW).
Is there an alternative for this?
Maybe in some way I can inline SVG?

Many thanks for your help!
P


Re: Vertical space of a fragment of score inside a list

2021-11-26 Thread Paolo Prete
Hello,

I can't put this variable into the \paper block: it would affect the entire
score, but I want to have this only for the fragment inside the list. I
searched for a \layout variable too, but could not find any.
Thanks for your help,

Paolo

On Thu, Nov 25, 2021 at 11:01 PM Leo Correia de Verdier <
leo.correia.de.verd...@gmail.com> wrote:

> I think what you’re after, since you already have the vSpace in the markup
> is
>
>  score-markup-spacing = #'((basic-distance . 0)
>(minimum-distance . 0)
>(stretchability . 0)
>(padding . 0))
>
> in the paper block. Was that what you wanted?
>
> You could also include the vSpace in the space between the score and
> markup, like
>
> #`((basic-distance . ,vSpace) …
>
> Instead of putting it in the markup. There is also markup-system-spacing
> and markup-markup-spacing to play around with.
>
> HTH
> /Leo
>
> > 25 nov. 2021 kl. 18:48 skrev Paolo Prete :
> >
> > Hi all,
> >
> > please consider the following snippet:
> >
> > %%
> > #(define vSpace 1.7)
> >
> > \paper { ragged-last = ##f  }
> >
> > \markup { "Text 1" }
> >
> > \markup { \vspace #vSpace "Text 2" }
> >
> > \score {
> >   { c' d' e' f' }
> >   \layout { indent = #0 ragged-last = ##t }
> > }
> >
> > \markup { \vspace #vSpace "Text 3" }
> >
> > \markup { \vspace #vSpace "Text 4" }
> >
> > \markup { \vspace #vSpace "Text 5" }
> > %%
> >
> > I need that the space between "text 3" and the score below "text 2" is
> exactly #vSpace.  How can I do that?
> >
> > Thanks!
> > P
> >
>
>


Vertical space of a fragment of score inside a list

2021-11-25 Thread Paolo Prete
Hi all,

please consider the following snippet:

%%
#(define vSpace 1.7)

\paper { ragged-last = ##f  }

\markup { "Text 1" }

\markup { \vspace #vSpace "Text 2" }

\score {
  { c' d' e' f' }
  \layout { indent = #0 ragged-last = ##t }
}

\markup { \vspace #vSpace "Text 3" }

\markup { \vspace #vSpace "Text 4" }

\markup { \vspace #vSpace "Text 5" }
%%

I need that the space between "text 3" and the score below "text 2" is
exactly #vSpace.  How can I do that?

Thanks!
P


Re: Header inside the score context

2021-11-24 Thread Paolo Prete
Hello Valentin,

I see what you mean (thanks for your further explanation) but it would not
work for what I want to achieve. I try to explain why.
My example is focused on _rendering_. With your procedure, I would
statically fix portions to be rendered separately, and each portion would
be a separate file. This is good when writing parts, or when writing
movements of a composition. But in my case, all the sections dynamically
vary because they represents what to be rendered.
This means that, for example, when a section takes too much time to be
rendered, I can decide to shrink it. Then, for example, I fix a problem,  I
verify the problem has fixed (---> rendering) and then I enlarge it to its
original size ( == amount of rendered measures). This is what I do very
often (it saves much time!) and this is why I comment/comment out portions
of the score.

Best,
P



On Wed, Nov 24, 2021 at 7:07 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> you've missunderstood what I meant. If you have each section in a separate
> file you can simly compile that file instead of uncommenting stuff. And you
> can have header and first section in the same file.
>
> Cheers,
> Valentin
>
> 24.11.2021 18:08:50 Paolo Prete :
>
> Hello Valentin,
>
> thanks for your help!
>
> I try to explain better what I need to do. Suppose that my score is
> divided into three sections. The first one has not only notes, but a title
> too.
> I need to render the sections all together or individually. The first
> obvious way to do that is write the score in the form:
>
>
> %
> \markup { "My-Title" }
> {
> % SECTION 1 (title + notes)
> { c'1 c' d' d'\pageBreak }
>
> %SECTION 2
> { c'1 c' d' d'\sustainOn\pageBreak }
>
> %SECTION 3
> { c'1 c'\sustainOff d' d' }
>
> }
> %
>
> and then comment or comment out parts of the score that I don't need to
> render. So, for example, if I need to render only section 2, I would
> comment section 3 and section 1 but I have to comment the markup block
> separately as well: this is unwanted, because the markup belongs to section
> 1 context. Instead, it would be more appropriate to exclude automatically
> the markup block when section one is not included.
> Note that putting the sections into separate files, as you suggested, does
> not solve the problem: instead of commenting blocks of code, I would have
> to exclude both the file associated to the markup and the file associated
> to section 1, if I want to render section 2.
> Now, if I try to by-pass the problem with a \book context, I can embed the
> markup into section 1:
>
> %
> \book {
>
> % SECTION 1 (title + notes)
> \markup { "My-Title" }
> { c'1 c' d' d'\pageBreak }
>
> %SECTION 2
> { c'1 c' d' d'\sustainOn\pageBreak }
>
> %SECTION 3
> { c'1 c'\sustainOff d' d' }
>
> }
> %
>
> In this way, I could embed the markup into section 1, but it won't work
> for another reason: the presence of the pedal needs that all the sections
> belong to the same context. Note too that if I tweak sections of a score
> into separate scores, I would have a logical mismatch between the syntax
> used for blocks of code and what that blocks of code effectively represent,
> which is unwanted too.
>
> Hope this is more clear. Unfortunately the problem is tricky (and I hope
> I'm wrong, so that there is already a right approach for it)
>
> Best,
>
> Paolo
>
>
>
>
> On Wed, Nov 24, 2021 at 5:00 PM Valentin Petzel 
> wrote:
>
>> Hello Paolo,
>>
>> I don’t really understand what you want to do. But if you only want
>> render
>> parts of your project I advise against commenting out and commenting in
>> stuff.
>> Instead (since you have a new section there anyway) put the different
>> sections
>> into different scores (you can tweak the second score so that it does not
>> in
>> fact look like it’s a new score) in different files. Then you could have
>> a
>> file header.ly which contains the header, a file secI.ly which contains
>> the
>> first section, secII.ly which contains the second section and so on. And
>> then
>> you could simply do
>>
>> \include "header.ly"
>> \include "secI.ly"
>> \include "secII.ly"
>>
>> and so on. If you want to render one section you just need to render the
>> particular file.
>>
>> If you don’t want separate scores you could do use files which define the
>> different parts in variables and stitch them together in the score.
>>
>> Like if you have a duetto with flauto dolce and bass tuba for example
>> (marvellous combination!) you could have in
>> secI.

Re: Header inside the score context

2021-11-24 Thread Paolo Prete
Hello Valentin,

thanks for your help!

I try to explain better what I need to do. Suppose that my score is divided
into three sections. The first one has not only notes, but a title too.
I need to render the sections all together or individually. The first
obvious way to do that is write the score in the form:


%
\markup { "My-Title" }
{
% SECTION 1 (title + notes)
{ c'1 c' d' d'\pageBreak }

%SECTION 2
{ c'1 c' d' d'\sustainOn\pageBreak }

%SECTION 3
{ c'1 c'\sustainOff d' d' }

}
%

and then comment or comment out parts of the score that I don't need to
render. So, for example, if I need to render only section 2, I would
comment section 3 and section 1 but I have to comment the markup block
separately as well: this is unwanted, because the markup belongs to section
1 context. Instead, it would be more appropriate to exclude automatically
the markup block when section one is not included.
Note that putting the sections into separate files, as you suggested, does
not solve the problem: instead of commenting blocks of code, I would have
to exclude both the file associated to the markup and the file associated
to section 1, if I want to render section 2.
Now, if I try to by-pass the problem with a \book context, I can embed the
markup into section 1:

%
\book {

% SECTION 1 (title + notes)
\markup { "My-Title" }
{ c'1 c' d' d'\pageBreak }

%SECTION 2
{ c'1 c' d' d'\sustainOn\pageBreak }

%SECTION 3
{ c'1 c'\sustainOff d' d' }

}
%

In this way, I could embed the markup into section 1, but it won't work for
another reason: the presence of the pedal needs that all the sections
belong to the same context. Note too that if I tweak sections of a score
into separate scores, I would have a logical mismatch between the syntax
used for blocks of code and what that blocks of code effectively represent,
which is unwanted too.

Hope this is more clear. Unfortunately the problem is tricky (and I hope
I'm wrong, so that there is already a right approach for it)

Best,

Paolo




On Wed, Nov 24, 2021 at 5:00 PM Valentin Petzel  wrote:

> Hello Paolo,
>
> I don’t really understand what you want to do. But if you only want render
> parts of your project I advise against commenting out and commenting in
> stuff.
> Instead (since you have a new section there anyway) put the different
> sections
> into different scores (you can tweak the second score so that it does not
> in
> fact look like it’s a new score) in different files. Then you could have a
> file header.ly which contains the header, a file secI.ly which contains
> the
> first section, secII.ly which contains the second section and so on. And
> then
> you could simply do
>
> \include "header.ly"
> \include "secI.ly"
> \include "secII.ly"
>
> and so on. If you want to render one section you just need to render the
> particular file.
>
> If you don’t want separate scores you could do use files which define the
> different parts in variables and stitch them together in the score.
>
> Like if you have a duetto with flauto dolce and bass tuba for example
> (marvellous combination!) you could have in
> secI.ly:
> FluteSecI = { music }
> TubaSecI = { music }
>
> And similar in secI.ly. Then in the score you can stitch them together like
> Flute = { \FluteSecI \pageBreak \FluteSecI }
> And similar.
>
> Then to get an output in your separate file you can create a separate
> score,
> only containing the section (which is something you could probably quickly
> do
> using templates.
>
> You can then assign this score to a variable like thisscore=\score{...}
> and
> then do something like
> #(if (not (defined? 'included)) (add-score thisscore))
>
> Then you can do #(define included 0) (or whatever value) before you
> include
> these files, and thus these scores will not be output if you compile the
> full
> score, but if you compile the files themselves they are.
>
> Cheers,
> Valentin
>
>
> Am Mittwoch, 24. November 2021, 13:01:11 CET schrieb Paolo Prete:
> > Hello,
> >
> > Given a header like this:
> >
> > 
> > \markuplist {
> >
> > \fill-line {
> >   \override #'(font-name . "Liberation Sans")
> >   \override #'(font-size . 6)
> >   "Author"
> > }
> >
> > \vspace #4
> >
> > \fill-line {
> >   \override #'(font-name . "Liberation Sans")
> >   \override #'(font-size . 15)
> >   "Title"
> > }
> >
> > \vspace #2
> >
> > \fill-line {
> >   \override #'(font-name . "Liberation Sans")
> >   \override #'(font-size . 10)
> >   "Subtitle"
> > }
> >
> > \vspace #6
> >
> > }
> >
> > {

Header inside the score context

2021-11-24 Thread Paolo Prete
Hello,

Given a header like this:


\markuplist {

\fill-line {
  \override #'(font-name . "Liberation Sans")
  \override #'(font-size . 6)
  "Author"
}

\vspace #4

\fill-line {
  \override #'(font-name . "Liberation Sans")
  \override #'(font-size . 15)
  "Title"
}

\vspace #2

\fill-line {
  \override #'(font-name . "Liberation Sans")
  \override #'(font-size . 10)
  "Subtitle"
}

\vspace #6

}

{

%section 1
c'1 c' c' \break c' c'

\pageBreak

%section 2
e'1 e' f' \break f' f'

}

%

... I would like to put it inside the score context. Is it possible ?
In this way, given that the above header is only bound to the first page of
the score, if I want to render only page 2 I would not need two block
comments  (page 1 and header), but I would use only one block comment.

(Maybe by using the following hacky way to have multiple marks on the same
bar:
https://lilypond.org/doc/v2.23/Documentation/snippets/expressive-marks
(Creating simultaneous rehearsal marks) ?)

Thanks!

P


  1   2   3   4   5   >