Re: Instructions to install lilypond onto Raspberry Pi

2018-10-12 Thread Engraver



It means you don't have all the required dependencies installed. Beginning 
with guile-1.8, plus all the others in the error message. The way forward 
is to install each of them. I'm my experience it was quite a puzzle to find 
all the right package names. It took al lot of googling. Unfortunately I 
did not write them down. For guile I do remember you have to install the 
guile-1.8-dev package. If your distribution is debian based, installing is 
done by typing


sudo apt-get install guile-1.8-dev

At leat the error message about guile should disappear.

I managed to compile lilypond on my arm based tablet, create a deb-package 
from and used that to install lilypond on one of my raspberries. If you are 
interested I could sent it to you. I 'm not at home at the moment so it'll 
have to wait till I get back.


Regards,
Auke


Op 11 oktober 2018 17:41:49 schreef Vivyan :

Im following you instructions Jamie Ching this is what the compiler says
after the first configure:

WARNING: Please consider installing optional programs or files:
guile-2.0 < 1.9.0 (installed: 2.0.13)

ERROR: Please install required programs:  International New Century
Schoolbook fonts (make sure the fc-list utility can see them, or use
--with-ncsb-dir) bison flex FlexLexer.h (flex package) mf-nowin mf mfw
mfont mpost kpsewhich metapost CTAN package (texlive-metapost)
guile-config (guile-devel, guile-dev or libguile-dev package) or
guile1-config (guile1-devel package) libguile (libguile-dev,
guile-devel or guile-dev package). GUILE-with-rational-bugfix
fontforge t1asm makeinfo texi2html dblatex bibtex pdflatex pdfetex
pdftex etex texi2pdf texindex epsf.tex lh CTAN package
(texlive-lang-cyrillic or texlive-texmf-fonts) pngtopnm convert

See INSTALL.txt for more information on how to build LilyPond


its not quite clear what I do next can you show me?...sorry for my ignorance



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

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




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


Re: Define new articulation with markup or path (instead of glyph)

2018-10-12 Thread Thomas Morley
Hi Urs,

Am Sa., 13. Okt. 2018 um 00:00 Uhr schrieb Urs Liska :

> > %% Not sure if needed, though, better be paranoid and work on a copy of
> > %% default-script-alist to avoid possible bleed-over.
> > #(define my-script-alist default-script-alist)
>
> Except that this doesn't *create* a copy but only a reference, isn't it?
> So your changes to my-script-alist also affect default-script-alist.

Well, if I add

#(pretty-print
  (lset-difference
equal?
my-script-alist
default-script-alist))

at the end of my file, I get:

(("path"
  (avoid-slur . inside)
  (padding . 0.5)
  (stencil . #)
  (side-relative-direction . -1))
 ("polygon"
  (avoid-slur . inside)
  (padding . 0.5)
  (stencil . #)
  (side-relative-direction . -1)))

If default script-alist would be changed as well, then the result should be '().

Or am I thinking wrongly?

Cheers,
  Harm

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


Re: Define new articulation with markup or path (instead of glyph)

2018-10-12 Thread Urs Liska

Hi Harm,

sorry, I forgot to reply to that until now.


Am 12.10.2018 um 14:35 schrieb Thomas Morley:

Hi Urs,

sorry for the late reply.
Right now I've a cold (not working in my regular job), so I've more
time to look into lilypond-tasks.
While waiting for a guile-complie to finish...

Am So., 30. Sep. 2018 um 12:01 Uhr schrieb Urs Liska :


Creating a new articulation (or overwriting the definition of an existing one) 
seems tempting using something like

 #(append! default-script-alist
(list
 `("scriptDownbow"
. ((script-stencil . (feta . ("dfermata" . "ufermata")))
   ; any other properties
   (toward-stem-shift-in-column . 0.0)
   (padding . 1)
   (avoid-slur . around)
   (direction . ,UP)
   ))
 ))

 % create postfix commands to use the articulations
 downbow = #(make-articulation "scriptDownbow")

This successfully makes \downbow use the fermata instead of the regular glyph. 
However, it seems there's no way to make that use a markup or a path instead of 
an Emmentaler glyph (if this old information 
(https://www.mail-archive.com/lilypond-user@gnu.org/msg64645.html) still holds 
true).

Still true.
As long as you try to fill "script-stencil" you are limited to the
script-glyphs Emmentaler provides.
But there is no need to go for script-stencil, you may let it unset
and define only stencil, perhaps with different result for up/down.
See below.


That is good to know. I think this would make for a very useful tutorial 
post, explaining things a bit more in-depth so others (like me) may 
become somewhat more familiar with the stuff.




[...]

So, is there any reasonable way to create something (function, articulation, 
dynamics) with the following characteristics:

can be written like articulations/dynamics (i.e. with or without postfix 
operator)
can be forced to a common vertical baseline with other elements
pushes notecolumns to obtain the necessary space (like \textLengthOn does for 
markup)

?

Any advice would be appreciated!
Urs

In the code below two new articulations are defined: path and polygon.
The polygon-definition is after a idea by Torsten, I even extended it
a bit. Probably too complicated for a simple
proof-of-concept-example...


Probably right, but nevertheless I managed to boil it down to do (only) 
what I currently need.




Nevertheless here all the code:

\version "2.19.82"

%% Not sure if needed, though, better be paranoid and work on a copy of
%% default-script-alist to avoid possible bleed-over.
#(define my-script-alist default-script-alist)


Except that this doesn't *create* a copy but only a reference, isn't it? 
So your changes to my-script-alist also affect default-script-alist.





HTH,
   Harm


Indeed, thank you very much. Here's my solution, I created the "strich" 
articulation:


#(define strich-stencil
   (lambda (grob)
 (grob-interpret-markup grob
   #{
 \markup
 \path
 #0.19
 #`((moveto 0 0)
(lineto 0 0.75))
   #})))

#(define strich-list
   `("strich" .
  ((avoid-slur . inside)
   (padding . 0.5)
   (stencil . ,strich-stencil)
   (side-relative-direction . ,DOWN

%% A macro setting the lists from above in the copy of `default-script-alist´
%% For now, every new script has to be inserted in a single run.
%% TODO
%% Probably better to do simpler list processing with append, cons etc
#(define-macro (set-my-script-alist! ls-1 ls-2)
   "Creates a new key-value-pair, taken from ls-2, in ls-1"
   `(set! ,ls-1
  (if (and (pair? ,ls-2) (pair? (cadr ,ls-2)))
  (assoc-set! ,ls-1 (car ,ls-2) (cdr ,ls-2))
  (begin
   (ly:warning (_"Unsuitable list\n\t~a \n\tdetected, ignoring. ") 
,ls-2)
   ,ls-1

#(set-my-script-alist! default-script-alist strich-list)

\layout {
  \context {
\Score
scriptDefinitions = #default-script-alist
  }
}

strich = #(make-articulation "strich")

Best
Urs

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


Hacktoberfest

2018-10-12 Thread Urs Liska
DigitalOceans and GitHub launch (for the fifth time I think) the 
"Hacktoberfest" https://hacktoberfest.digitalocean.com/. It's a kind of 
small incentive to get one's feet wet with open source projects.


Essentially it works like this: if you are among the first 50.000 
registered participants who have opened five pull requests on GitHub by 
Oct 31 you will earn a Hacktoberfest T-shirt :-)


Some repositories that would welcome pull requests:

 * https://github.com/lilypond/lilypond
 * https://github.com/wbsoft/frescobaldi
 * https://github.com/jperon/lyluatex
 * https://github.com/openlilylib (all repositories below that)
 * https://github.com/uliska/lycritrprt
 * https://github.com/uliska/lilyglyphs
 * https://github.com/uliska/musxmp
   (as a reimplementation supporting lyluatex of
   https://github.com/uliska/musicexamples)

Of course other repositories are valuable targets too ;-)
And of course we'd accept pull requests *after* October as well ...

Best
Urs

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


Re: Combine two markups in a toplevel markup

2018-10-12 Thread Thomas Morley
Am Fr., 12. Okt. 2018 um 20:57 Uhr schrieb Urs Liska :
>
> Hi Harm,
>
>
> Am 12.10.2018 um 18:58 schrieb Thomas Morley:
> > Hi Urs,
> >
> > not sure I understand correctly, probably something like below?
> >
> > one = \markup \score { d'1 }
> > two = \markup \italic "whatever"
> >
> > \markup \halign #CENTER \center-column { \one "|" \two }
> >
>
> AAHH.
> Well, nearly:
>
> \markup \center-column { \one "|" \two }
>
> is what I need.
>
> Thanks for embarrassing me that way ;-)

lol

> And Gute Besserung
> Urs

Danke,
  Harm

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


Re: Combine two markups in a toplevel markup

2018-10-12 Thread Urs Liska

Hi Harm,


Am 12.10.2018 um 18:58 schrieb Thomas Morley:

Hi Urs,

not sure I understand correctly, probably something like below?

one = \markup \score { d'1 }
two = \markup \italic "whatever"

\markup \halign #CENTER \center-column { \one "|" \two }



AAHH.
Well, nearly:

\markup \center-column { \one "|" \two }

is what I need.

Thanks for embarrassing me that way ;-)
And Gute Besserung
Urs


Cheers,
   Harm



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


Re: shortInstrumentName vertical spacing

2018-10-12 Thread David Sumbler
Apologies.  I have no idea why, but this afternoon my code appeared to
have no effect on the spacing; this evening it works.  Yet I haven't
changed a thing.  Clearly something changed, but I have no idea what.

At least my original thought that "this ought to work" was correct!

David

-Original Message-
From: David Sumbler 
Reply-To: da...@aeolia.co.uk
To: lilypond-user@gnu.org
Subject: shortInstrumentName vertical spacing
Date: Fri, 12 Oct 2018 17:02:14 +0100

In string parts, I often use more than one stave where a section is
divisi.  I write, for instance,

\set Staff.shortInstrumentName = "2."

when one player (or sub-section) is required, or

\set Staff.shortInstrumentName = \markup \column { "3." "4." }

if two players need to play this line.  The default settings are fine
for this.

But I have a stave now which applies to 3 players.  If I put 

\set Staff.shortInstrumentName = \markup \column { "2." "3." "4." }

it takes up rather too much space vertically, so I want to move the
numbers closer together.  But nothing I have tried so far makes the
slightest difference.  My latest version is:

\set Staff.shortInstrumentName = 
  \markup { \override #'(baseline-skip . 6)
\column { "2." "3." "4." } } 

I felt sure that this would work, but it doesn't.  ("6" is a value just
for testing - obviously the value I want actually to use will be much
smaller.)

What am I doing wrong?

David





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


Re: Combine two markups in a toplevel markup

2018-10-12 Thread Thomas Morley
Am Fr., 12. Okt. 2018 um 17:52 Uhr schrieb Urs Liska :
>
> Hi,
>
> basically this is a follow-up question to the one where I needed to
> align a text over a slur. I wanted to apply the techniques I learned
> from your valuable help but ran against the next wall (or: I didn't see
> that there is no wall after all ...).
>
> The overall goal now is to create a centered score with a centered
> caption below it. Of course I don't know how wide both the score and the
> caption will be.
>
> My first attempt was quite straightforward: produce both the score and
> the markup as markups centered with \fill-line.
>
> While this worked perfectly at aligning the score and markup it turned
> out not to be good enough: While this centers perfectly on the page I
> can't get correctly cropped output because the bounding box seems to
> reach both line ends, resulting in uncropped whitespace to the left and
> right of the score/caption.
>
> If there's a solution to this problem everything below can be ignored.
>
> So I thought to make this *one* markup stencil, align the two parts
> manually against each other and print the result as one (left-aligned)
> markup, so it should be properly cropped. Now while I feel quite
> confident that I would manage to deal with the alignment and stencil
> issues this time I don't see how I can get at them at the right moment
> when I'm dealing with a top-level markup (and not inside some music).
>
> What I *have* is two markups (one regular and one score wrapped in a
> markup), both stored in variables.
>
> What I *need* is a way to combine these markups to one and use the
> result as a top-level markup, the problem being that I need to access
> the resulting extents of the markups in order to properly align them
> against each other.
>
> Any suggestions? (In fact I'd actually prefer suggestions over solutions
> this time ...)
>
> Best
> Urs

Hi Urs,

not sure I understand correctly, probably something like below?

one = \markup \score { d'1 }
two = \markup \italic "whatever"

\markup \halign #CENTER \center-column { \one "|" \two }



Cheers,
  Harm

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


Re: GrandStaff vertical distance

2018-10-12 Thread Aaron Hill

On 2018-10-12 9:12 am, Lukas-Fabian Moser wrote:
  \new Staff = "Staff_bassd" \with { instrumentName = #"Double Bass" } 
{ a }
  \new Staff = "Staff_basst" \with { instrumentName = #"Triple Bass" } 
{ a }
  \new Staff = "Staff_bassq" \with { instrumentName = #"Quadruple Bass" 
} { a }


Are we getting into sub-harmonics with the last one?  ;-)

-- Aaron Hill

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


Re: GrandStaff vertical distance

2018-10-12 Thread Lukas-Fabian Moser

Hi,


The StartDelimiterHierarchy gives the possibility to change the first
bracket by anything you want, for instance:

[...]

It would be interesting if your function can manage also that!
I guess this is what happens when you start coding before agreeing on a 
desirable user interface ;-).


Here we go:

\version "2.19.82"

\layout {
  indent = 35
}

#(define (make-n-copies x n)
   (if (> n 0)
   (cons x (make-n-copies x (- n 1)))
   '()))

#(define (symbol-or-list? x) (or (list? x) (symbol? x)))

#(define easy-delimiter-alist '((brace . SystemStartBrace)
    (bracket . SystemStartBracket)
    (square . SystemStartSquare)
    (barlineOnly . SystemStartBar)
    (barline . SystemStartBar)
    ))

#(define (make-delimiter-hierarchy magic-list)
   ; expects
   ; - either a symbol (brace, bracket, square, barline[Only])
   ; - or a list,
   ;   the first entry of which is such a symbol (may be missing, then 
taken to be 'bracket)

   ; defining the delimiter for the whole staffGroup,
   ;   followed by
   ;   - pairs of the form (symbol . number of staves), and/or
   ;   - placeholder symbols [which should never be an easy-delimiter 
magic word, so preferably 'staff or 'void)

   ; designating single skipped staves.

   (if (list? magic-list)
   (let* ((total-delimiter (assq-ref easy-delimiter-alist (car 
magic-list)))
  (actual-total-delimiter (if (eq? total-delimiter #f) 
'SystemStartBracket total-delimiter))
  (sub-delimiter-magic-list (if (eq? total-delimiter #f) 
magic-list (cdr magic-list

 (cons actual-total-delimiter
   (apply append (map (lambda (entry)
    (if (pair? entry)
    (let ((delim (assq-ref 
easy-delimiter-alist (car entry

  (if (eq? delim #f)
  (make-n-copies 'some-staff 
(cdr entry))
  (list (cons delim 
(make-n-copies 'void (cdr entry))

    '(void)))
   sub-delimiter-magic-list
   (list (assq-ref easy-delimiter-alist magic-list


setDelimiters =
#(define-music-function (magic-list) (symbol-or-list?)
   #{
 \set StaffGroup.systemStartDelimiterHierarchy = 
#(make-delimiter-hierarchy magic-list)

   #})

\new StaffGroup \with {
  \setDelimiters #'barlineOnly
  % ALSO TRY THE FOLLOWING:
  % \setDelimiters #'(barlineOnly)
  % \setDelimiters #'(barlineOnly skip (brace . 2))
  % \setDelimiters #'(skip (brace . 2))
  % \setDelimiters #'(bracket skip (brace . 2))
  % \setDelimiters #'(skip (brace . 2) (skip . 2) (brace . 2))

  % Single-staff braces/brackets are not supported at the moment.

} <<
  \new Staff = "Staff_violinI" \with { instrumentName = #"Violin I" } { a }
  \new Staff = "Staff_violinII" \with { instrumentName = #"Violin II" } 
{ a }

  \new Staff = "Staff_viola" \with { instrumentName = #"Viola" } { a }
  \new Staff = "Staff_cello" \with { instrumentName = #"Cello" } { a }
  \new Staff = "Staff_bassd" \with { instrumentName = #"Double Bass" } 
{ a }
  \new Staff = "Staff_basst" \with { instrumentName = #"Triple Bass" } 
{ a }
  \new Staff = "Staff_bassq" \with { instrumentName = #"Quadruple Bass" 
} { a }

>>


Best
Lukas

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


Re: shortInstrumentName vertical spacing

2018-10-12 Thread Noeck
Dear David,

Am 12.10.2018 um 18:02 schrieb David Sumbler:
> \set Staff.shortInstrumentName = 
>   \markup { \override #'(baseline-skip . 6)
> \column { "2." "3." "4." } } 

Well, that works here.

{
  \set Staff.shortInstrumentName =   \markup {
\override #'(baseline-skip . 1.2)
\column { "2." "3." "4." } }
  a1 \break a
}

What is wrong with the outcome? How do you use it?
To be more safe against the fact that the staffs settings might already
be defined when you use \set, you could use it in a \with block.

Cheers,
Joram

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


shortInstrumentName vertical spacing

2018-10-12 Thread David Sumbler
In string parts, I often use more than one stave where a section is
divisi.  I write, for instance,

\set Staff.shortInstrumentName = "2."

when one player (or sub-section) is required, or

\set Staff.shortInstrumentName = \markup \column { "3." "4." }

if two players need to play this line.  The default settings are fine
for this.

But I have a stave now which applies to 3 players.  If I put 

\set Staff.shortInstrumentName = \markup \column { "2." "3." "4." }

it takes up rather too much space vertically, so I want to move the
numbers closer together.  But nothing I have tried so far makes the
slightest difference.  My latest version is:

\set Staff.shortInstrumentName = 
  \markup { \override #'(baseline-skip . 6)
\column { "2." "3." "4." } } 

I felt sure that this would work, but it doesn't.  ("6" is a value just
for testing - obviously the value I want actually to use will be much
smaller.)

What am I doing wrong?

David




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


Combine two markups in a toplevel markup

2018-10-12 Thread Urs Liska

Hi,

basically this is a follow-up question to the one where I needed to 
align a text over a slur. I wanted to apply the techniques I learned 
from your valuable help but ran against the next wall (or: I didn't see 
that there is no wall after all ...).


The overall goal now is to create a centered score with a centered 
caption below it. Of course I don't know how wide both the score and the 
caption will be.


My first attempt was quite straightforward: produce both the score and 
the markup as markups centered with \fill-line.


While this worked perfectly at aligning the score and markup it turned 
out not to be good enough: While this centers perfectly on the page I 
can't get correctly cropped output because the bounding box seems to 
reach both line ends, resulting in uncropped whitespace to the left and 
right of the score/caption.


If there's a solution to this problem everything below can be ignored.

So I thought to make this *one* markup stencil, align the two parts 
manually against each other and print the result as one (left-aligned) 
markup, so it should be properly cropped. Now while I feel quite 
confident that I would manage to deal with the alignment and stencil 
issues this time I don't see how I can get at them at the right moment 
when I'm dealing with a top-level markup (and not inside some music).


What I *have* is two markups (one regular and one score wrapped in a 
markup), both stored in variables.


What I *need* is a way to combine these markups to one and use the 
result as a top-level markup, the problem being that I need to access 
the resulting extents of the markups in order to properly align them 
against each other.


Any suggestions? (In fact I'd actually prefer suggestions over solutions 
this time ...)


Best
Urs


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


Re: Define new articulation with markup or path (instead of glyph)

2018-10-12 Thread Thomas Morley
Hi Urs,

sorry for the late reply.
Right now I've a cold (not working in my regular job), so I've more
time to look into lilypond-tasks.
While waiting for a guile-complie to finish...

Am So., 30. Sep. 2018 um 12:01 Uhr schrieb Urs Liska :

> Creating a new articulation (or overwriting the definition of an existing 
> one) seems tempting using something like
>
> #(append! default-script-alist
>(list
> `("scriptDownbow"
>. ((script-stencil . (feta . ("dfermata" . "ufermata")))
>   ; any other properties
>   (toward-stem-shift-in-column . 0.0)
>   (padding . 1)
>   (avoid-slur . around)
>   (direction . ,UP)
>   ))
> ))
>
> % create postfix commands to use the articulations
> downbow = #(make-articulation "scriptDownbow")
>
> This successfully makes \downbow use the fermata instead of the regular 
> glyph. However, it seems there's no way to make that use a markup or a path 
> instead of an Emmentaler glyph (if this old information 
> (https://www.mail-archive.com/lilypond-user@gnu.org/msg64645.html) still 
> holds true).

Still true.
As long as you try to fill "script-stencil" you are limited to the
script-glyphs Emmentaler provides.
But there is no need to go for script-stencil, you may let it unset
and define only stencil, perhaps with different result for up/down.
See below.

[...]
> So, is there any reasonable way to create something (function, articulation, 
> dynamics) with the following characteristics:
>
> can be written like articulations/dynamics (i.e. with or without postfix 
> operator)
> can be forced to a common vertical baseline with other elements
> pushes notecolumns to obtain the necessary space (like \textLengthOn does for 
> markup)
>
> ?
>
> Any advice would be appreciated!
> Urs

In the code below two new articulations are defined: path and polygon.
The polygon-definition is after a idea by Torsten, I even extended it
a bit. Probably too complicated for a simple
proof-of-concept-example...

Nevertheless here all the code:

\version "2.19.82"

%% Not sure if needed, though, better be paranoid and work on a copy of
%% default-script-alist to avoid possible bleed-over.
#(define my-script-alist default-script-alist)

#(define my-polygon-stil
  ;; After an idea by Torsten
  ;; different stencils are returned relying on 'direction
  (lambda (grob)
(let* ((th 0.1)
   (dir (ly:grob-property grob 'direction))
   (nmbr
 (if (positive? dir)
 6
 3))
   ;; Value @code{6} returns a hexagon, try others.
   (alpha-step (/ (* 2 PI) nmbr))
   (alpha-start (/ alpha-step 2))
   (radius 0.7)
   (polypoints-list
 (let loop ((alpha alpha-start))
   (if (> alpha (* 2 PI))
   '()
   (cons (* (abs radius) (sin alpha))
 (cons (- 0 (* (abs radius) (cos alpha)))
   (loop (+ alpha alpha-step)))
   (polypoints-pairs
 (let lp ((ppts polypoints-list))
   (if (or (null? ppts) (odd? (length polypoints-list)))
   '()
   (cons (cons (list-ref ppts 0) (list-ref ppts 1))
 (lp (drop ppts 2))
   (x-ext
 (cons
   (reduce min +inf.0 (map car polypoints-pairs))
   (reduce max -inf.0 (map car polypoints-pairs
   (y-ext
 (cons
   (reduce min +inf.0 (map cdr polypoints-pairs))
   (reduce max -inf.0 (map cdr polypoints-pairs)

(ly:make-stencil
  `(polygon ',polypoints-list  ,th #f)
  x-ext
  y-ext

#(define my-path-stil
  (lambda (grob)
(let* ((dir (ly:grob-property grob 'direction)))
(grob-interpret-markup grob
  #{
\markup
  \path
  #0.17
  #`((moveto 0 0)
(lineto ,(if (> dir 0) 0 0.75) 0.75))
  #}


#(define my-polygon-list
  `("polygon"
. (
   (avoid-slur . inside)
   (padding . 0.50)
   (stencil . ,my-polygon-stil)
   (side-relative-direction . ,DOWN

#(define my-path-list
  `("path"
. (
   (avoid-slur . inside)
   (padding . 0.50)
   (stencil . ,my-path-stil)
   (side-relative-direction . ,DOWN

%% A macro setting the lists from above in the copy of `default-script-alist´
%% For now, every new script has to be inserted in a single run.
%% TODO
%% Probably better to do simpler list processing with append, cons etc
#(define-macro (set-my-script-alist! ls-1 ls-2)
"Creates a new key-value-pair, taken from ls-2, in ls-1"
 `(set! ,ls-1
(if (and (pair? ,ls-2) (pair? (cadr ,ls-2)))
(assoc-set! ,ls-1 (car ,ls-2) (cdr ,ls-2))
(begin
  (ly:warning (_"Unsuitable list\n\t~a \n\tdetected, ignoring. ") ,ls-2)
  ,ls-1


Re: Modified slur stencil with added markup

2018-10-12 Thread Torsten Hämmerle
Urs Liska-3 wrote
> What is 'interval-center'?


Hi Urs,

Harm already revealed where interval-center is being defined.

But why did I use it?
A stencil x-extent is a pair of left and right extent, and in order to know
the total extent, we'll have to add up (car x-extent) and (cdr x-extent) and
divide it by 2 in order to get the centre. This could be done manually or by
using interval-center.

Using the horizontal centre of both markup and slur, the necessary x-shift
can be easily calculated.

In this case, it is important to know that ly:stencil-combine-at-edge uses
the reference point for alignment and the stencil will stick out to the left
if the left extent is negative.
The slur has a positive (!) left extent, and that's why it is shiftet to the
right with regards to the reference point (at the left edge of the
notehead).
In your original attempt, centering the slur destroyed this slight shift and
moved the whole lot to the left.

All the best,
Torsten



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

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


Re: GrandStaff vertical distance

2018-10-12 Thread foxfanfare
Lukas-Fabian Moser wrote
> Hi,
> 
>> Thank you for this little function Lukas! It is very good and useful.
>> Would
>> it be possible to add to the list the choice for "square" or "bracket"?
>> Some
>> editions are using squares for grouping Violins 1-2.
>>
> Ah, do you mean an extra bracket? No problem. I also added the 
> possibility to skip single staffs without having to issue a pair, e.g.
> #'((extraBracket . 2) skip skip (brace . 3))
> would mean: connect the first 2 staves with an extra bracket, then skip 
> 2 staves, then join the next 3 staves with a brace:
> 
> \version "2.19.82"
> 
> \layout {
>    indent = 35
> }
> 
> #(define (make-n-copies x n)
>     (if (> n 0)
>     (cons x (make-n-copies x (- n 1)))
>     '()))
> 
> #(define (make-delimiter-hierarchy group-list)
>     ; expects a list of pairs of the form (symbol . number) where
>     ; symbol is either brace, noBrace or extraBracket
>     ; number is the number of staves connected by a brace/extra 
> bracket/nothing
>     ; an arbitrary non-pair entry is interpreted as a single staff
>     (apply append (map (lambda (entry)
>      (if (pair? entry)
>      (cond
>   ((equal? (car entry) 'brace)
>    (list (cons 'SystemStartBrace 
> (make-n-copies 'staff (cdr entry)
>   ((equal? (car entry) 'extraBracket)
>    (list (cons 'SystemStartBracket 
> (make-n-copies 'staff (cdr entry)
>   (else
>    (make-n-copies 'some-staff (cdr entry
>      '(some-staff)))
>     group-list)))
> 
> 
> 
> setBraces = #(define-music-function (group-list) (list?) #{
>    \set StaffGroup.systemStartDelimiterHierarchy = 
> #(make-delimiter-hierarchy group-list)
>     #})
> 
> \new StaffGroup \with {
>    \setBraces #'((extraBracket . 2) skip skip (brace . 3))
> } <<
>    \new Staff = "Staff_violinI" \with { instrumentName = #"Violin I" } { a
> }
>    \new Staff = "Staff_violinII" \with { instrumentName = #"Violin II" } 
> { a }
>    \new Staff = "Staff_viola" \with { instrumentName = #"Viola" } { a }
>    \new Staff = "Staff_cello" \with { instrumentName = #"Cello" } { a }
>    \new Staff = "Staff_bassd" \with { instrumentName = #"Double Bass" } 
> { a }
>    \new Staff = "Staff_basst" \with { instrumentName = #"Triple Bass" } 
> { a }
>    \new Staff = "Staff_bassq" \with { instrumentName = #"Quadruple Bass" 
> } { a }
>  >>
> 
>> As suggested by David, it would be then enough "user-level" and complete
>> to
>> be documented, don't you think?
> I'm afraid the threshold for additions to the set of "stock" functions 
> shipped with Lilypond is quite high (regarding quality of code, 
> bug-freeness, robustness, universality etc.). Maybe one could turn this 
> into a snippet, but I've never done this.
> 
> Best
> Lukas
> 
> ___
> lilypond-user mailing list

> lilypond-user@

> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi,

I've added to the list the square:

\version "2.19.81"

\layout {
   indent = 35
}

#(define (make-n-copies x n)
(if (> n 0)
(cons x (make-n-copies x (- n 1)))
'()))

#(define (make-delimiter-hierarchy group-list)
; expects a list of pairs of the form (symbol . number) where
; symbol is either brace, noBrace or extraBracket
; number is the number of staves connected by a brace/extra
bracket/nothing
; an arbitrary non-pair entry is interpreted as a single staff
(apply append (map (lambda (entry)
 (if (pair? entry)
 (cond
  ((equal? (car entry) 'brace)
   (list (cons 'SystemStartBrace
(make-n-copies 'staff (cdr entry)
  ((equal? (car entry) 'extraBracket)
   (list (cons 'SystemStartBracket
(make-n-copies 'staff (cdr entry)
  ((equal? (car entry) 'square)
   (list (cons 'SystemStartSquare
(make-n-copies 'staff (cdr entry)
  (else
   (make-n-copies 'some-staff (cdr entry
 '(some-staff)))
group-list)))



setBraces = #(define-music-function (group-list) (list?) #{
   \set StaffGroup.systemStartDelimiterHierarchy =
#(make-delimiter-hierarchy group-list)
#})

\new StaffGroup \with {
   \setBraces #'((square . 2) skip (extraBracket . 2) (brace . 2))
} <<
   \new Staff = "Staff_violinI" \with { instrumentName = #"Violin I" } { a }
   \new Staff = "Staff_violinII" \with { instrumentName = #"Violin II" }
{ a }
   \new Staff = "Staff_viola" \with { instrumentName = #"Viola" } { a }
   \new Staff = "Staff_cello" \with { instrumentName = 

Re: Modified slur stencil with added markup

2018-10-12 Thread Thomas Morley
Am Fr., 12. Okt. 2018 um 09:59 Uhr schrieb Urs Liska :

> What is 'interval-center'? Grepping the source doesn't show a
> definition, so I'd assume it's in the C++ domain? I haven't found
> anything about that in the documentation (or through Google).

Hi Urs,

~/lilypond-git (master)$ git grep "interval-center"
Documentation/misc/ChangeLog-2.10:  (interval-center): new function.
scm/bar-line.scm:  (interval-center
(staff-symbol-line-span
scm/bar-line.scm: (set! anchor (interval-center x-extent))
scm/bar-line.scm: (set! anchor (interval-center
scm/define-markup-commands.scm: (center (interval-center
(ly:stencil-extent number-stencil Y)))
scm/define-markup-commands.scm:
   (car num-x) (- (interval-center num-y) dy)
scm/define-markup-commands.scm:
   (cdr num-x) (+ (interval-center num-y) dy))
scm/define-markup-commands.scm: (interval-center
(ly:stencil-extent rest-glyph Y))
scm/define-markup-commands.scm:(interval-center
(ly:stencil-extent mmr-stil X)))
scm/define-markup-commands.scm:(interval-center
(ly:stencil-extent mmr-number-stil X
scm/lily-library.scm:(define-public (interval-center x)
scm/output-lib.scm:(interval-center note-head-w)))
scm/output-lib.scm: (c (interval-center height)))
scm/output-lib.scm: (y-center (interval-center elt-y-ext)))
scm/output-lib.scm: (interval-center extent
scm/stencil.scm:(interval-center x-ext)
scm/stencil.scm:(interval-center y-ext))
scm/stencil.scm:(interval-center x-ext)
scm/stencil.scm:(interval-center y-ext))
scm/stencil.scm:(interval-center x-ext)
scm/stencil.scm:(interval-center y-ext))
scm/stencil.scm:(cons 0 (interval-center extent

So it's defined in scm/lily-library.scm

Cheers,
  Harm

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


Re: Markup and Score from scheme function

2018-10-12 Thread Thomas Morley
Am Fr., 12. Okt. 2018 um 08:10 Uhr schrieb Jan-Peter Voigt :
>
> Hello Sebastian,
>
> what do you mean with "return"? Do want to add the score immediatly or
> do you want to return an object containing both?
> You used the parser-location arguments in your scheme-function, so I
> guess you are using stable (2.18). I created an example for 2.18
> (incomplete) and one for 2.19.82. For three possible functions.
>
> HTH
> Jan-Peter

Hi,

for immediate addings, why not the simpler:

example =
#(define-void-function (mrkp scr) (markup? ly:score?)
  (add-text mrkp)
  (add-score scr))

\example
 \markup \bold "Test"
 \score { c'4 }

\example
 \markup \italic "Test"
 \score { cis'4 }

Cheers,
  Harm

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


Re: Modified slur stencil with added markup

2018-10-12 Thread Urs Liska

Hi Torsten,


Am 12.10.2018 um 00:56 schrieb Torsten Hämmerle:

Hi Urs,

The centering of the slur stencil destroys its alignment (i.e. reference
point), so I'd just leave it alone and center-align the text by explicitly
calculating the necessary markup x shift from the stencil extents.


%%
\version "2.19.82"

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

{
   \annotatedSlur
   %\markup \score { c''' }
   \markup "hin."
   c''4 ( g' g' c'' )
}
%%

HTH,
Torsten


Thank you very much, this indeed fixes the horizontal alignment problem 
in a clean and understandable way - although I wouldn't have known how 
to do it. What is 'interval-center'? Grepping the source doesn't show a 
definition, so I'd assume it's in the C++ domain? I haven't found 
anything about that in the documentation (or through Google).


Urs

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


Re: Markup and Score from scheme function

2018-10-12 Thread Sebastian Käppler
Thanks for your help, I found the add-score function to work in the way I
want it to. Never stumbled across it in the documentation, though...

Jan-Peter, I want to add both the markup and the score immediately.

Another question, is it possible to determine inside the function if it is
called from a score context, that means to distinguish these two cases:

A:
\score {
 \myfunction
}

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


Re: Markup and Score from scheme function

2018-10-12 Thread Jan-Peter Voigt
Hello Sebastian,

what do you mean with "return"? Do want to add the score immediatly or
do you want to return an object containing both?
You used the parser-location arguments in your scheme-function, so I
guess you are using stable (2.18). I created an example for 2.18
(incomplete) and one for 2.19.82. For three possible functions.

HTH
Jan-Peter


Am 11.10.2018 um 10:22 schrieb Sebastian Käppler:
> Hello,
> 
> I wonder if it is possible to return markup AND score from a single
> scheme function, something like this:
> 
> example = #(define-scheme-function (parser location) ()
> #{
>     \markup "Test"
>     \score {
>        c'4
>     }
> #}
> )
> 
> I created some scripts for teaching and want to include task-markup
> before each score. Using markup and my functions outside of scheme
> works, but I couldn't get  it to work from a single function.
> 
> Kind regards
> 
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 

\version "2.19.82"


% What do you want to achieve with this function?

% return an object containing markup and score
exampleA =
#(define-scheme-function ()()
   ; create a
   (list
(cons
 'mup
 #{
   \markup "Test"
 #})
(cons
 'mus
 #{
   \score {
 c'4
   }
 #})
))

exA = \exampleA

\exA.mup
\exA.mus



% add the markup and the score immediatly
exampleB =
#(define-scheme-function () ()
   (add-score
(list #{
  \markup "Test"
  #}))
   (add-score
#{
  \score {
c'4
  }
#}
))

\exampleB




% return a function that adds markup and score
exampleC =
#(define-scheme-function (mup mus) (markup? ly:score?)
   (define-void-function ()()
 (add-score
  (list mup))
 (add-score mus)
  ))

exC = \exampleC Test \score { c'4 }

\exC

\version "2.18.2"


% What do you want to achieve with this function?

% return an object containing markup and score
exampleA =
#(define-scheme-function (parser location) ()
   ; create a
   (list
(cons
 'mup
 #{
   \markup "Test"
 #})
(cons
 'mus
 #{
   \score {
 c'4
   }
 #})
))

exA = \exampleA

% this is much nicer in 2.19.82 ...
$(ly:assoc-get 'mup exA)
$(ly:assoc-get 'mus exA)



% add the markup and the score immediatly
exampleB =
#(define-scheme-function (parser location) ()
   (add-score (ly:parser-clone parser)
 (list #{
   \markup "Test"
   #}))
   (add-score (ly:parser-clone parser)
 #{
   \score {
 c'4
   }
 #}
 ))

\exampleB




% return a function that adds markup and score
exampleC =
#(define-scheme-function (parser location) ()
   (define-void-function (parser location)()
 (add-score (ly:parser-clone parser)
   (list #{
 \markup "Test"
 #}))
 (add-score (ly:parser-clone parser)
   #{
 \score {
   c'4
 }
   #}
   )))

exC = \exampleC

\exC

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