Re: GrandStaff vertical distance

2018-10-17 Thread Brian Barker

At 14:40 17/10/2018 -0500, David Wright wrote:
The # wiki notes that British Telecom used the term "square" for 
hash at one time.


Surely not? Rather, they presumably used the term "square" for square 
- which is what was on the spare key on early designs of keyboard now 
occupied by the hash character. See

http://www.britishtelephones.com/t94xx.htm .

I guess this was before the British public had an unambiguous name 
for it, "pound" being verboten, ...


Indeed: "pound" would have been as silly as "dollar" or "yen" or whatever.


... "number" rare, ...


UK usage is "No.", of course.


... and "hash" not quite proper in polite society.


Really? Always appropriate in my company!

Brian Barker  



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


Re: Baseline align in TextSpanner

2018-10-17 Thread Trevor Bača
Hi Davide,

Avoid the the LilyPond \tempo command entirely: then use markup (in text
spanner bound-details) for everything. Alignment (baseline and otherwise)
can then be controlled with text spanner bound-details.

If you need an empty region of of whitespace between two elements in your
(possibly enchained) text spanners, play with the dash fraction / dash
period of the text spanner to make the dashes disappear, leaving only your
markup visible.

Trevor.



On Sun, Oct 14, 2018 at 2:17 PM Davide Liessi 
wrote:

> Dear Kieren,
>
> Il giorno ven 5 ott 2018 alle ore 15:11 Kieren MacMillan
>  ha scritto:
> > This works for me:
> [...]
>
> your solution works well to keep all TextSpanners baseline-aligned,
> but it still does not solve my real problem, which indeed was not
> apparent in my first message.
> I'm trying to make TextSpanners and tempo markings look the same,
> including being aligned at the same baseline.
> The reason is to follow the recommendations of Gould for tempo
> alteration markings (example at page 184).
>
> A slightly more realistic example follows: I would like to align
> \tempo markings and TextSpanners to the same baseline.
> As you can see using your trick on both does achieve the desired result.
> I renamed the \test function to a more specific \baseline-align.
> I'm cc-ing also Harm / Thomas Morley because I'm using his code, so he
> may have some insights or suggestions.
>
> Thanks for your help so far.
> Best wishes!
> Davide
>
> %%% new example
> \version "2.19.81"
>
> #(define (lists-map function ls)
>"Apply @var{function} to @var{ls} and all of it sublists.
> First it recurses over the children, then the function is applied to
> @var{ls}."
>(if (list? ls)
>(set! ls (map (lambda (y) (lists-map function y)) ls))
>ls)
>(function ls))
>
> #(define baseline-align-proc
>(lambda (e)
>  (if (and (list? e) (member 'glyph-string e))
>  (begin
>   (for-each
>(lambda (x)
>  (begin
>   (set-car! (cadr x) 0)
>   x))
>(cadr (last e)))
>   e)
>  e)))
>
> #(define-markup-command (baseline-align layout props glyph-name)
>(markup?)
>(let* ((stil (interpret-markup layout props glyph-name))
>   (new-stile-expr
>(lists-map
> baseline-align-proc
> (ly:stencil-expr stil
>
>  (ly:make-stencil
>   new-stile-expr
>   (ly:stencil-extent stil X)
>   ;(cons 0 (cdr (ly:stencil-extent stil Y)))
>   (ly:stencil-extent stil Y)
>   )))
>
> startTempoSpan =
> #(define-event-function
>   (left-text)
>   (markup?)
>   #{
> \tweak bound-details.left.text \markup {
>   \combine \transparent "Tj"
>   #left-text
> }
> \tweak font-shape #'upright
> \tweak font-size 1
> \tweak font-series #'bold
> \startTextSpan
>   #})
> stopTempoSpan = \stopTextSpan
>
> {
>   R1 |
>   \tempo \markup { \baseline-align \large "a" }
>   R1 |
>   \tempo \markup { \baseline-align \large "p" }
>   R1 |
>   <>\startTempoSpan "a"
>   R1
>   <>\stopTempoSpan |
>   R1 |
>   <>\startTempoSpan "p"
>   R1
>   <>\stopTempoSpan |
>   R1
>   \tempo \markup { \large \combine \transparent "Tj" "a" }
>   R1 |
>   \tempo \markup { \large \combine \transparent "Tj" "p" }
>   R1 |
> }
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


-- 
Trevor Bača
www.trevorbaca.com
soundcloud.com/trevorbaca
___
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-17 Thread Trevor Bača
Hi Urs,

I went through this a couple of months ago, and it *seems* possible to use
markups (and paths) as legitimately new articulations (maybe -- and happily
-- in contradiction to the assumption in your original post, if I'm reading
correctly).

Here's the pattern as a MWE:

%%% BEGIN NOVEL ARTICULATION USING MARKUP %%%

baca-damp-markup =
\markup
\scale #'(0.75 . 0.75)
\combine
\bold
\override #'(font-name . "Times") "O"
\path #0.15
#'(
(moveto -.4 .7)
(rlineto 2.4 0)
(closepath)
(moveto .8 -.5)
(rlineto 0 2.4)
)

#(append! default-script-alist
   (list
`("bacadamp"
   . (
   (stencil . ,ly:text-interface::print)
   (text . ,baca-damp-markup)
   (avoid-slur . around)
   (padding . 0.20)
   (script-priority . 125)
   (side-relative-direction . ,DOWN)
   (skyline-horizontal-padding . 0.20)
   ;;(toward-stem-shift . 0.5)
   

baca-damp = #(make-articulation "bacadamp")

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

%%% END %%%


You can then write ...

\new Staff { c'4 \baca-damp }

... and get ...

[image: novel-articulation.png]

... as output.

To note:

1. Apologies for not yet crediting the various posts in the archives that
made this possible; it was a weekend or two of reading through various
breadcrumbs on the list that made the pattern possible.

2. The baca- prefix is a namespacing convention since I'm always mixing
with modules in Python. Replace as necessary if the snippet works for you.

3. Wrt to your three initial criteria, the example above demonstrates #1
("no postfix operator"). Because the symbol created is a legit script,
overrides like "\override Script.staff-padding = 5" do work. So maybe this
helps meet your #2 ("common vertical baseline"). I'm not certain about your
#3 ("pushes notecolumns to obtain the necessary space"). But some testing
seems to show that **if you explicitly specify the font of markup** then
Lily can find a stencil (and move note columns).

%%% BEGIN WIDE EXAMPLE %%%

estr-markup =
\markup
\override #'(font-name . "Times")
"ESTREMAMENTE"

#(append! default-script-alist
   (list
`("articestr"
   . (
   (stencil . ,ly:text-interface::print)
   (text . ,estr-markup)
   (avoid-slur . around)
   (padding . 0.20)
   (script-priority . 125)
   (side-relative-direction . ,DOWN)
   (skyline-horizontal-padding . 0.20)
   ;;(toward-stem-shift . 0.5)
   

estr = #(make-articulation "articestr")

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

%%% END %%%


Then ...

\new Staff {

c'4
d'4
\estr
e'4
f'4

}

... gives ...

[image: wide-articulation.png]

... as output.

Note that if you use "bald" markup (without a font override) Lily finds no
stencil and produces no output for the articulation.

Trevor.



On Sat, Oct 13, 2018 at 3:07 AM Urs Liska  wrote:

> Hi Aaron,
>
> althought this has long left the original thread's purpose I find this
> extremely interesting. Would you be interested in adding some content to
> https://scheme-book.ursliska.de, maybe somewhere below
> https://scheme-book.ursliska.de/scheme/lists/? There is always need for
> explanations that go to substantially more length than the concise Guile
> manual.
>
> Best
> Urs
>
>
> Am 13.10.2018 um 10:03 schrieb Aaron Hill:
> > On 2018-10-13 12:29 am, Aaron Hill wrote:
> >> According to the docs [1], assoc-set! (and family) may modify the
> >> original alist.  So whether a copy is made or not depends on an
> >> implementation detail.  Near as I can tell, the original alist is
> >> modified in-place when the key is found within.  But when the key is
> >> new, the result of using acons to append the new key/value to the head
> >> of the list results in a copy being returned.
> >>
> >> [1]:
> >>
> https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Adding-or-Setting-Alist-Entries.html#Adding-or-Setting-Alist-Entries
> >>
> >
> > Nope, I'm wrong about copying.  acons (and therefore assoc-set!) does
> > not copy (shallow or deep).  Consider the following:
> >
> > guile> (define a '((one . 1) (two . 2)))
> > guile> (define b (assoc-set! a 'three 3))
> > guile> a
> > ((one . 1) (two . 2))
> > guile> b
> > ((three . 3) (one . 1) (two . 2))
> > guile> (define c (assoc-set! a 'three 3))
> > guile> c
> > ((three . 3) (one . 1) (two . 2))
> > guile> (eq? b c)
> > #f
> > guile> (equal? b c)
> > #t
> > guile> (eq? a (cdr b))
> > #t
> > guile> (eq? (cdr b) (cdr c))
> > #t
> > guile> (set! a (assoc-set! a 'two 2.2))
> > guile> a
> > ((one . 1) (two . 2.2))
> > guile> b
> > ((three . 3) (one . 1) (two . 2.2))
> > guile> c
> > ((three . 3) (one . 1) (two . 2.2))
> >
> > While "b" and "c" are unique as far as the initial node in their
> > respective 

Drawing extenders for the full duration of a note

2018-10-17 Thread Lucas Werkmeister
Hi everyone,

I’m transcribing an old choral score for LilyPond (full source at [1]),
and while I’ve been mostly successful so far, one thing I haven’t
figured out yet is the extenders. In the original score, several notes
have extenders in the lyrics, to indicate the duration of the note
relative to the other voices, and those extenders span the full duration
of the note (see [2] for an example). This short snippet can be used to
test the behavior:

<<
  { c'1 r } \addlyrics { o __ }
  \relative c' { c8 d e f g f e d c4 g' c,2 }
>>

The second voice ensures a certain minimal width for the whole bar, and
I would like the extender in the lyrics for the first voice to span this
whole width, as that’s how long the note is. I can get close to this by
manually tweaking the LyricExtender’s minimum-length (if there’s no rest
after the extender, even setting it to +inf.0 works, it automatically
terminates at the next lyrics), but I’d prefer a solution that doesn’t
require eyeballing a close-enough value.

Cheers,
Lucas

[1]: https://github.com/lucaswerkmeister/il-est-bel-et-bon
[2]: https://i.imgur.com/9GQ0cJH.png

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


Re: Braille scores

2018-10-17 Thread Aaron Hill

On 2018-10-17 11:35 am, Jacques Menu wrote:

Last questions : in a programming language a C or Python, what should
one write as character strings to obtain the code for example Example
1.8.1-1, and what font or tool should one use to get it displayed as
shown in the PDF doc?


Braille can be easily represented as a 6-bit or 8-bit value, depending 
on whether you need the fourth row.  Unicode supports Braille and has 
allocated code points 2800-28FF for this purpose.  This follows the 
scheme where each dot corresponds to a particular bit in the byte, where 
dot "1" (upper-left) is the least significant, and dot "8" (lower-right) 
the most significant.  This means the basic three-row Braille are mapped 
to 2800-283F.


Ideally, a font will support the Unicode standard so the code points 
will render appropriately, but some fonts may have been created before 
the code points were allocated.  In these cases, there can be some 
variation in the mapping scheme.  Braille symbols may be mapped to 
numerals and digits in a natural fashion rather than in the Unicode 
binary scheme.  This may be easier for end-users, but it presents a 
challenge for computers.  You are best off using a look-up table in that 
case.


Most fonts that I have found online only show a visual indicator for the 
raised dots.  However, you can find a few fonts that include outlines as 
well.  But Braille should be easy enough to render manually without 
needing a font.  Just make sure to do the research on the correct sizing 
and spacing.


-- Aaron Hill

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


Re: Braille scores

2018-10-17 Thread David Wright
On Wed 17 Oct 2018 at 20:35:22 (+0200), Jacques Menu wrote:
> Hello Hwaen and Aaron,
> 
> Thanks Aaron for the very useful link at www.brailleauthority.org.
> What I meant by non confidential examples is exactly that, small scores with 
> full Braille Music code and the corresponding western, graphical scores.
> 
> IIUC the original post about MusicXML export, translating MusicXML to Braille 
> would be welcomed by blind musicians. Is that so?
> 
> Last questions : in a programming language a C or Python, what should one 
> write as character strings to obtain the code for example Example 1.8.1-1, 
> and what font or tool should one use to get it displayed as shown in the PDF 
> doc?

Braille is in Unicode. Would something like
http://www.ltg.ed.ac.uk/~richard/utf-8.cgi?input=283c=hex
be an appropriate code for the first character?

Cheers,
David.

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


Re: ScholarLY

2018-10-17 Thread Craig Dabelstein
\setOption stylesheets.span.use-colors ##f
did the trick.

Thanks Urs


On Wed, 17 Oct 2018 at 15:40, Urs Liska  wrote:

>
>
> Am 17.10.2018 um 03:00 schrieb Craig Dabelstein:
>
> Hi all,
>
> Is this the right code to use to turn off the colors in ScholarLy? I'm
> using the latest version, but I'm using the \editorialMarkup commands.
>
> This line is having no effect. I'm sure I'm doing something wrong
> somewhere.
>
> \setOption scholarly.annotate.use-colors ##f
>
>
> Does it really have *no* effect? I can't reproduce that, so you should
> provide a MWE.
> However, what you will probably want to do in addition is
>
> \setOption stylesheets.span.use-colors ##f
>
> because the span provides its own coloring. Concretely: the span colors
> the whole annotated music expression while the annotation colors the
> *anchor* element *on top* of that.
>
> HTH
> Urs
>
>
> Craig
>
> --
> *Craig Dabelstein*
> Maxime's Music
> craig.dabelst...@gmail.com
> *http://maximesmusic.com *
>
>
> ___
> lilypond-user mailing 
> listlilypond-user@gnu.orghttps://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


-- 
*Craig Dabelstein*
Maxime's Music
craig.dabelst...@gmail.com
*http://maximesmusic.com *
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: GrandStaff vertical distance

2018-10-17 Thread David Wright
On Wed 17 Oct 2018 at 15:43:40 (+0200), Thomas Morley wrote:

> I'd like to propose the code below. Attached as well.
> 
> It stores the info in a string, which is converted to a nested list
> suitable for 'systemStartDelimiterHierarchy'. It can be nested in
> arbitrary depth.
> 
> I used the following signs:
> [] indicating start/end of SystemStartBracket
> {} indicating start/end of SystemStartBrace
> <> indicating start/end of SystemStartSquare
> () indicating start/end of SystemStartBar
> Other elements should be of string-length 1
> 
> I'm not that happy with the ones for SystemStartSquare and
> SystemStartBar. Though I looked for signs mirroring each others and
> not hard to type.

Would ## work for SystemStartSquare and || for SystemStartBar?
I think they're on most computer keyboards.
(I have no idea whether they'd need escaping, or would be ambiguous
in the locations you intend for them.)

The # wiki notes that British Telecom used the term "square" for hash
at one time. I guess this was before the British public had an
unambiguous name for it, "pound" being verboten, "number" rare, and
"hash" not quite proper in polite society.

Cheers,
David.

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


Re: Braille scores

2018-10-17 Thread Jacques Menu
Hello Hwaen and Aaron,

Thanks Aaron for the very useful link at www.brailleauthority.org.
What I meant by non confidential examples is exactly that, small scores with 
full Braille Music code and the corresponding western, graphical scores.

IIUC the original post about MusicXML export, translating MusicXML to Braille 
would be welcomed by blind musicians. Is that so?

Last questions : in a programming language a C or Python, what should one write 
as character strings to obtain the code for example Example 1.8.1-1, and what 
font or tool should one use to get it displayed as shown in the PDF doc?

Thanks!

JM

> Le 17 oct. 2018 à 16:00, Aaron Hill  a écrit :
> 
> On 2018-10-16 11:38 pm, Jacques Menu wrote:
>> Hello folks,
>> I read in the recent Export to MusicXML thread about braille scores.
>> Sorry if this is offtrack : I didn’t find on the Internet how such
>> scores are structured (the details of notes and the like is there
>> alright) and what font(s) should be used to display them.
> 
> Wikipedia has a pretty informative article:
> https://en.wikipedia.org/wiki/Braille_music
> 
> There are a number of links provided to additional resources, such as:
> http://www.brailleauthority.org/music/Music_Braille_Code_2015.pdf
> 
> This related project has the Goldberg Variations as examples:
> bmc.blind.guru/
> 
> 
> -- Aaron Hill
> 
> ___
> 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: GrandStaff vertical distance

2018-10-17 Thread Thomas Morley
Am Mi., 17. Okt. 2018 um 15:43 Uhr schrieb Thomas Morley
:

> I'd like to propose the code below.
>
> It stores the info in a string, which is converted to a nested list
> suitable for 'systemStartDelimiterHierarchy'. It can be nested in
> arbitrary depth.
>
> I used the following signs:
> [] indicating start/end of SystemStartBracket
> {} indicating start/end of SystemStartBrace
> <> indicating start/end of SystemStartSquare
> () indicating start/end of SystemStartBar
> Other elements should be of string-length 1
>
> I'm not that happy with the ones for SystemStartSquare and
> SystemStartBar. Though I looked for signs mirroring each others and
> not hard to type.
> After adding the definition for 'remove-whitespace' from 2.19.xx and
> 'parser'/'location' as the default arguments for a music-function it
> works in 2.18.2 as well.
>
>
> What do you think?
>
> Cheers,
>   Harm
>
>
> \version "2.18.2"
>
> %% build in since 2.19.xx, c/p here to make it work with 2.18.2
> #(define (remove-whitespace strg)
> "Remove characters satisfying @code{char-whitespace?} from string @var{strg}"
>   (if (guile-v2)
>   (string-delete char-whitespace? strg)
>   (string-delete strg char-whitespace?)))
>
> #(define (string->raw-system-start-hierarchy-list strg)
> "Takes the string @var{strg} which may contain {}[]<>().
> Those are transformed according to the local 'ref-list' and are returned as
> pairs where the cdr is the nesting-level.
> Other elements are supposed to be of string-length 1 and are transformed to 
> #f.
> Both will build a list.
> The finally returned result is a pair, containing the final list and the
> greatest nesting level.
> Example:
> \"-[--]-\"
> ->
> ((#f (SystemStartBracket . 1) SystemStartBracket #f #f (#t . 1) #f) . 1)
> "
>   (let* ((cleared-strg (remove-whitespace strg))
>  (ref-list
>'((#\{ . SystemStartBrace)
>  (#\[ . SystemStartBracket)
>  (#\( . SystemStartBar)
>  (#\< . SystemStartSquare)
>  (#\} . #t)
>  (#\] . #t)
>  (#\) . #t)
>  (#\> . #t)
>  ))
>  (nest-lvl 0)
>  (max-nest-lvl 0)
>  (ready-list
>(append-map
>  (lambda (x)
>;; Look into 'ref-list'
>;;   (a) - if a symbol is returned, return it as pair with its
>;; 'nest-lvl'
>;;   - increase 'nest-lvl'
>;;   - probably increse 'max-nest-lvl' as well
>;;   (b) - if it returns #t, return it as pair with its
>;; 'nest-lvl'
>;;   - decrease 'nest-lvl'
>;;   (c) if it returns #f, return it
>;; All are wrapped into a list to make outer append-map work
>(let* ((el (assoc-get x ref-list)))
>  (cond ((symbol? el)
>   (set! nest-lvl (1+ nest-lvl))
>   (if (> nest-lvl max-nest-lvl)
>   (set! max-nest-lvl nest-lvl))
>   ;; Urgh, adding another 'el' is a ugly hack to make
>   ;; 'split-list-by-separator' work later
>   (list (cons el nest-lvl) el))
>(el
>  (set! nest-lvl (1- nest-lvl))
>  (list (cons el (1+ nest-lvl
>(else
>  (list el)
> (string->list cleared-strg
> (cons ready-list max-nest-lvl)))
>
> #(define (helper l nest-lvl)
> "Creates a nested list relying on whether the given list 'l' contains
> pairs and the there stored nesting level.
> Starting with the given 'nest-lvl', which is supposed to be the
> maximum nesting level for the most inner of the resulting sub-list(s).
> 'l' should be supplied by 'string->raw-system-start-hierarchy-list'."
>   (if (zero? nest-lvl)

To match the default behaviour, please replace:
>   l
with:
  ;; unnest one lvl if cdr is '()
  (if (and (pair? l) (null? (cdr l)))
  (car l)
  l)

Cheers,
  Harm

>   (let* ((splitted-ls
> (split-list-by-separator
>   l
>   (lambda (x) (and (pair? x) (eq? (cdr x) nest-lvl)
>  (result
>(append-map
>  (lambda (el)
>(if (and (pair? el) (symbol? (car el)))
>(list el)
>el))
>  splitted-ls)))
> (helper result (1- nest-lvl)
>
> #(define (system-start-hierarchy-list strg)
>   (let ((lst (string->raw-system-start-hierarchy-list strg)))
> (helper (car lst) (cdr lst
>
> %% For conveniance
> setSystemStartDelimiterHierarchy =
> #(define-music-function (parser location strg) (string?)
> "Derived from @var{strg} a nested list suitable for setting
> @code{systemStartDelimiterHierarchy} 

Re: Braille scores

2018-10-17 Thread Aaron Hill

On 2018-10-16 11:38 pm, Jacques Menu wrote:

Hello folks,

I read in the recent Export to MusicXML thread about braille scores.

Sorry if this is offtrack : I didn’t find on the Internet how such
scores are structured (the details of notes and the like is there
alright) and what font(s) should be used to display them.


Wikipedia has a pretty informative article:
https://en.wikipedia.org/wiki/Braille_music

There are a number of links provided to additional resources, such as:
http://www.brailleauthority.org/music/Music_Braille_Code_2015.pdf

This related project has the Goldberg Variations as examples:
bmc.blind.guru/


-- Aaron Hill

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


Re: GrandStaff vertical distance

2018-10-17 Thread Thomas Morley
Hi Lukas-Fabian,

I finally found the time to look deeper into it.

Am So., 14. Okt. 2018 um 15:07 Uhr schrieb Lukas-Fabian Moser :

> For me, there are the following issues with the systemStartDelimiterHierarchy 
> design:
>
> 1) There's an overlap between systemStartDelimiter and 
> systemStartDelimiterHierarchy, namely
> systemStartDelimiterHierarchy = #'(SystemStartBrace)
> is equivalent to (and in fact overrides, if there's a conflict)
> systemStartDelimiter = #'SystemStartBrace
> Might be ugly, might be convenient. Not sure.

I don't have a problem here.
>
> 2) The docs state that systemStartDelimiterHierarchy
> "... takes an alphabetical list of the number of staves produced. Before each 
> staff a system start delimiter can be given. It has to be enclosed in 
> brackets and takes as much staves as the brackets enclose. Elements in the 
> list can be omitted, but the first bracket takes always the complete number 
> of staves. The possibilities are SystemStartBar, SystemStartBracket, 
> SystemStartBrace, and SystemStartSquare."
> First, this seems to be plain wrong ("brackets" instead of "parentheses"). 
> Second, I have no idea what an "alphabetical list" is supposed to be. The 
> example given in the docs uses a,b,c,d as placeholders for the staves, but in 
> fact, any symbol (not equal to SystemStartBar etc.) may be used; they even 
> may be identical. I use this heavily in my code (but tbh I did not look at 
> the implementation of the systemStartDelimiterHierarchy interface).

This part of the docs should be fixed.
>
> 3) systemStartDelimiterHierarchy allows for heavy nesting:
>
> \new StaffGroup \with {
>   systemStartDelimiterHierarchy = #'((a (a (SystemStartBrace a) a) a))
> }
> <<
>   \new Staff a
>   \new Staff a
>   \new Staff a
>   \new Staff a
>   \new Staff a
>   \new Staff a
>   \new Staff a
>   \new Staff a
> >>
>
> While this is neat (and I think the syntax is in fact quite well suited for 
> constructions of this kind), I would assume that it is almost never used. Of 
> course it should stay being supported, but I would expect 99% of all use 
> cases comprise of <= 2 layers of nesting, most commonly one or several 
> top-level Brackets with some sub-Braces/Squares.
> The code I gave is tailored for a subset of this use-case, namely that in 
> which there is only one top-lavel Bracket/Square/Bar... comprising the whole 
> StaffGroup (and arbitrarily many first-order subgroups). If you want several 
> disjunct top-level Brackets and still use my function, you have to create 
> several StaffGroups - and hence you affect spacing. For the use cases I have 
> in mind, this is fine, but maybe I'm wrong. Of course this might be changed.
>
>
> So, basically I think we should
> - keep systemStartDelimiterHierarchy as it is

yep

> - improve the docs for this (I could try and come up with an improved 
> explanation)

Would be very nice.

> - provide a simple function (like the \setDelimiters I proposed) that allows 
> for easier setting of delimiters in the common use-case of <= 2 nesting 
> levels.
>
> What do you think?

I'd like to propose the code below. Attached as well.

It stores the info in a string, which is converted to a nested list
suitable for 'systemStartDelimiterHierarchy'. It can be nested in
arbitrary depth.

I used the following signs:
[] indicating start/end of SystemStartBracket
{} indicating start/end of SystemStartBrace
<> indicating start/end of SystemStartSquare
() indicating start/end of SystemStartBar
Other elements should be of string-length 1

I'm not that happy with the ones for SystemStartSquare and
SystemStartBar. Though I looked for signs mirroring each others and
not hard to type.
After adding the definition for 'remove-whitespace' from 2.19.xx and
'parser'/'location' as the default arguments for a music-function it
works in 2.18.2 as well.


What do you think?

Cheers,
  Harm


\version "2.18.2"

%% build in since 2.19.xx, c/p here to make it work with 2.18.2
#(define (remove-whitespace strg)
"Remove characters satisfying @code{char-whitespace?} from string @var{strg}"
  (if (guile-v2)
  (string-delete char-whitespace? strg)
  (string-delete strg char-whitespace?)))

#(define (string->raw-system-start-hierarchy-list strg)
"Takes the string @var{strg} which may contain {}[]<>().
Those are transformed according to the local 'ref-list' and are returned as
pairs where the cdr is the nesting-level.
Other elements are supposed to be of string-length 1 and are transformed to #f.
Both will build a list.
The finally returned result is a pair, containing the final list and the
greatest nesting level.
Example:
\"-[--]-\"
->
((#f (SystemStartBracket . 1) SystemStartBracket #f #f (#t . 1) #f) . 1)
"
  (let* ((cleared-strg (remove-whitespace strg))
 (ref-list
   '((#\{ . SystemStartBrace)
 (#\[ . SystemStartBracket)
 (#\( . SystemStartBar)
 (#\< . SystemStartSquare)
 (#\} . #t)
 (#\] . #t)

Re: Test direction within event-function

2018-10-17 Thread David Kastrup
Urs Liska  writes:

> Hi,
>
> I'm trying to write an event-function that creates both a slur and a
> markup on opposite sides. I can do that by manually specifying the
> directions:
>
> \version "2.19.82"
>
> testDirection =
> #(define-event-function ()()
>#{
>  _(
>  ^"Text"
>#})
>
> {
>   c' \testDirection d' )
> }
>
> but I have to make it possible to do it both ways (top/bottom and
> bottom/top).
> I know how to set the directions with an extra (optional) function
> argument, but I would prefer if I could extract the direction directly
> from within the event-function.

You can't.  It is set after calling the event-function.  You can use
tweaks/callbacks for the respective grob functions (most likely
"direction") where you use event-cause to get the originating event, get
the event direction from there and either use or invert it.

Am badly available for a few days.  Sister's wedding.

-- 
David Kastrup

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


Execution order of callback functions

2018-10-17 Thread Urs Liska

Hi,

I am wondering about the execution order of the callback functions. I 
would have assumed that the 'stencil callback would *always* be executed 
before or after the 'after-line-breaking callback. However, when I tried 
to investigate this I found that in


\version "2.19.82"

{
  c'
  -\tweak after-line-breaking
  #(lambda (grob)
 (ly:message "Text after-line-breaking ~a"
   (ly:stencil-extent
(ly:text-interface::print grob) X) ))
  ^"Text"
  -\tweak stencil
  #(lambda (grob)
 (ly:message "Slur stencil ~a"
   (ly:stencil-extent
(ly:slur::print grob) X)))
  _(
  d' )
}

the slur's callback function is *always* executed after the text's, 
regardless of which callback I override.


I came to the conclusion that this must be caused by the slur only being 
calculated when its *end* is processed, and this happens only after the 
text is fully processed (although I still don't fully understand why 
this happens). Is that correct?


What I wanted to do is save some information about the slur's stencil 
somewhere in a global variable or a closure and then use it to offset 
the text's stencil, but if my observations are correct then this doesn't 
seem possible, right?


Another approach would be to only override the text's callback, access 
the NoteColumn and find the slur from there. But this would suffer from 
the same lack of knowledge about the slur's stencil.


So is there a way to find a slur that is attached to the same note as a 
text and offset the text's stencil depending on the slur's stencil-extent?


 * I think I can't (easily) simply add the markup-stencil in the slur's
   callback because I wouldn't know how to reliably place the text at
   the opposite side of the slur (not knowing what else is going on in
   the staff at that point).
 * What I *could* do if it helps is to do the calculation at the *end*
   of the slur

Any suggestions?
Thanks
Urs

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


Test direction within event-function

2018-10-17 Thread Urs Liska

Hi,

I'm trying to write an event-function that creates both a slur and a 
markup on opposite sides. I can do that by manually specifying the 
directions:


\version "2.19.82"

testDirection =
#(define-event-function ()()
   #{
 _(
 ^"Text"
   #})

{
  c' \testDirection d' )
}

but I have to make it possible to do it both ways (top/bottom and 
bottom/top).
I know how to set the directions with an extra (optional) function 
argument, but I would prefer if I could extract the direction directly 
from within the event-function.


Using \displayMusic I see that an explicit direction is "known" to the 
event function:


\void \displayMusic ^\testDirection
=>
(make-music
  'PostEvents
  'direction
  1
  'elements
  (list (make-music
  'SlurEvent
  'direction
  -1
  'span-direction
  -1)
(make-music
  'TextScriptEvent
  'direction
  1
  'text
  "Text")))

(the 'direction PostEvent takes either 1 or -1, or is missing if no 
explicit direction is given). But I have no idea if/how I can access 
that information from within the function to decide how to create the 
slur and the text event.


Thanks Urs

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


Re: Braille scores

2018-10-17 Thread Hwaen Ch'uqi
Greetings Jacques,

Could you further clarify your questions? Are you asking how Braille
music is generally structured on the physical page? And what is meant
by a non confidential example?

Hwaen Ch'uqi


On 10/17/18, Jacques Menu  wrote:
> Hello folks,
>
> I read in the recent Export to MusicXML thread about braille scores.
>
> Sorry if this is offtrack : I didn’t find on the Internet how such scores
> are structured (the details of notes and the like is there alright) and what
> font(s) should be used to display them.
>
> Accessing non confidential examples would be a great help too I guess.
>
> Thanks if you can help!
>
> JM
>
>
> ___
> 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


Braille scores

2018-10-17 Thread Jacques Menu
Hello folks,

I read in the recent Export to MusicXML thread about braille scores.

Sorry if this is offtrack : I didn’t find on the Internet how such scores are 
structured (the details of notes and the like is there alright) and what 
font(s) should be used to display them.

Accessing non confidential examples would be a great help too I guess.

Thanks if you can help!

JM


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