Re: vertical position of OttavaBracket

2019-07-14 Thread Malte Meyn



Am 15.07.19 um 08:12 schrieb Robin Bannister:

It is normal 'automagic' for
    \box { "X" "Y" "Z"}
to be mapped into
    { \box "X" \box "Y" \box "Z" }
giving you 3 boxes in a markup list
to which \concat can be applied.


Seems like that magic happens only for LilyPond syntax markups.


The mapping case
    \markup \concat \box { "X" "Y" "Z" }
gives 3 boxes without complaint, but
    #(markup #:concat #:box ("X" "Y" "Z"))
is errored.

Reformulating it as
    #(markup (make-concat-markup (make-box-markup ("X" "Y" "Z"
is also errored.


So if magic doesn’t work, one can do it by hand:

#(markup (make-concat-markup (map make-box-markup (list "X" "Y" "Z"

This looks like for my usecase it’s easier to use the LilyPond syntax …

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


Re: vertical position of OttavaBracket

2019-07-14 Thread Robin Bannister

Robin Bannister wrote:


One explanation is that
- concat wants to be given (markup-list?)
- general-align wants to be given (markup?)
So the two should be swapped:
  #(markup #:general-align Y UP #:concat ("16" #:teeny "ma"))


This of course implies that your #{ #} version shouldn't work either.
But there is maybe some automagic at work here ?
   - like the automatic application of \line when omitted before { }


Oh dear, that was half-baked thinking.
Markup lists have tripped me up yet again.

It is normal 'automagic' for
   \box { "X" "Y" "Z"}
to be mapped into
   { \box "X" \box "Y" \box "Z" }
giving you 3 boxes in a markup list
to which \concat can be applied.

So that mapping mechanism will do the same for
   \general-align Y UP
as it does for \box.



The non-mapping cases
   \markup \box \concat { "X" "Y" "Z" }
and
   #(markup #:box #:concat ("X" "Y" "Z"))
give one box without complaints


The mapping case
   \markup \concat \box { "X" "Y" "Z" }
gives 3 boxes without complaint, but
   #(markup #:concat #:box ("X" "Y" "Z"))
is errored.

Reformulating it as
   #(markup (make-concat-markup (make-box-markup ("X" "Y" "Z"
is also errored.

And here I get stuck, just like the markup-list does.


Cheers,
Robin

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


Re: vertical position of OttavaBracket

2019-07-14 Thread Robin Bannister

Malte Meyn wrote:


#{ \markup \concat \general-align #Y #UP { "16" \teeny "ma" } #}
works but
(markup #:concat #:general-align Y UP ("16" #:teeny "ma"))
doesn’t and I don’t know why …



One explanation is that
  - concat wants to be given (markup-list?)
  - general-align wants to be given (markup?)
So the two should be swapped:
#(markup #:general-align Y UP #:concat ("16" #:teeny "ma"))


This of course implies that your #{ #} version shouldn't work either.
But there is maybe some automagic at work here ?
 - like the automatic application of \line when omitted before { }



Cheers,
Robin

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


Re: vertical position of OttavaBracket

2019-07-14 Thread Malte Meyn



Am 14.07.19 um 16:21 schrieb Robin Bannister:

Malte Meyn wrote:



How can this made be top- or bottom-aligned (or aligned depending
according to the 'direction property)?


Inside a #(define-markup-command (command-name layout props arg1 arg2 …)
you can collect 'direction as follows:
   (let* ((dir-prop (chain-assoc-get 'direction props  1)))


It seems as if my question was unclear here: How could the dashed line 
(not the text) be aligned different?



P. S.: I tried Scheme syntax for the markups in the code above but
#(markup #:concat #:general-align Y UP ("16" #:teeny "ma"))
doesn’t work. What am I doing wrong?


Well, you get the error:
warning: cannot find property type-check for `ottavationMarkups'


That’s a new feature I would like to add, that’s why I commented it out 
;) The feature itself works, and

#{ \markup \concat \general-align #Y #UP { "16" \teeny "ma" } #}
works but
(markup #:concat #:general-align Y UP ("16" #:teeny "ma"))
doesn’t and I don’t know why …

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


Re: vertical position of OttavaBracket

2019-07-14 Thread Malte Meyn



Am 14.07.19 um 13:15 schrieb Andrew Bernard:
Provide the mechanism, sure, but don't prescribe a single appearance. I 
don't even think there is a default that would suit everybody, that's 
the point.


Of course I wouldn’t change LilyPond’s default. The markups I showed 
would be only an example for snippets/docs.


My question was more about the position of the line that I would change 
in that same example to match the text. By the way: Elaine Gould 
recommends top-/bottom-aligned dashed lines ;)


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


Re: Jazz chords layout question

2019-07-14 Thread Robin Bannister

Oh dear, that recommendation was for your first code.
The bass clef code needs a LeftEdge.Y-offset of -5


Cheers,
Robin


On 14.07.2019 12:10, Robin Bannister wrote:

Jacques Menu wrote:


Didn’t find a way to hide the empty part of the staff to the left of it, 
stopStaff/startStaff didn’t help.



Sorry.
This simplistic pseudoIndent is too fragile for general use.
It needs to be made robust re vertical extents.


In your case you need a LeftEdge.Y-offset of -4
and
you should also uncomment the BarNumber.X-offset line.

The attachment shows the result for \pseudoIndent #53.


Cheers,
Robin



___
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: vertical position of OttavaBracket

2019-07-14 Thread Robin Bannister

Malte Meyn wrote:



How can this made be top- or bottom-aligned (or aligned depending
according to the 'direction property)?


Inside a #(define-markup-command (command-name layout props arg1 arg2 …)
you can collect 'direction as follows:
  (let* ((dir-prop (chain-assoc-get 'direction props  1)))





P. S.: I tried Scheme syntax for the markups in the code above but
#(markup #:concat #:general-align Y UP ("16" #:teeny "ma"))
doesn’t work. What am I doing wrong?


Well, you get the error:
warning: cannot find property type-check for `ottavationMarkups'


It seems that 2.21.0 doesn't know about ottavaText either.

So, referring to
https://lists.gnu.org/archive/html/lilypond-user/2017-02/msg00406.html
you could try
 - including Harm's code from there (see attachment)
 - renaming ottavationMarkups to ottavaText


Cheers,
Robin
% Harm's ottavation code, lifted from 
% https://lists.gnu.org/archive/html/lilypond-user/2017-02/msg00406.html

\version "2.19.52"

%% Define new context-property 'ottavaText'

#(define (define-translator-property symbol type? description)
  (if (not (and (symbol? symbol)
(procedure? type?)
(string? description)))
  (ly:error "error in call of define-translator-property"))
  (if (not (equal? (object-property symbol 'translation-doc) #f))
  (ly:error (_ "symbol ~S redefined") symbol))

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

#(for-each
  (lambda (x)
(apply define-translator-property x))
`((ottavaText
   ,list?
   "An alist of pairs with ottavation-number and markup.")))

%% Redefine 'make-ottava-set'
#(define (make-ottava-set music)
  "Set context properties for an ottava bracket."
  (let ((octavation (ly:music-property music 'ottava-number))
(labels
  '((2 . "15ma")
(1 . "8va")
(0 . #f)
(-1 . "8vb")
(-2 . "15mb"

(list (context-spec-music
   (make-apply-context
(lambda (context)
  (let* ((offset (* -7 octavation))
 (ctx-label-list
   (ly:context-property context 'ottavaText))
 (string
   (assoc-get octavation
  (if (null? ctx-label-list)
  labels
  ctx-label-list
(set! (ly:context-property context 'middleCOffset) offset)
(set! (ly:context-property context 'ottavation) string)
(ly:set-middle-C! context
   'Staff

%% Redefine 'ottava'
ottava =
#(define-music-function (octave) (integer?)
   (_i "Set the octavation.")
   (make-music 'OttavaMusic
   'elements-callback make-ottava-set
   'ottava-number octave))

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


Re: tabstaff minimumfret behaving badly

2019-07-14 Thread Carl Sorensen


From: Immanuel Litzroth 
Date: Sunday, July 14, 2019 at 4:42 AM
To: 
Subject: tabstaff minimumfret behaving badly

This score gives a strange result (uses open string for the b and the e).

>
\version "2.19.81"
\language "english"
\new TabStaff {
  \set TabStaff.minimumFret = #3
  \relative c' {}
}
>

Am I doing something wrong? Is there a way to fix this?

Set #restrainOpenStrings to #t: 
http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-fretted-strings#custom-tablatures

\set TabStaff.restrainOpenStrings = ##t



HTH,

Carl


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


Re: Bug with transpose in functions

2019-07-14 Thread Simon Albrecht

On 12.07.19 20:04, Werner LEMBERG wrote:

Functions like transpose act destructively on their argument, so you
need a copy or the original will get changed.  [...]

How can Joe User find out whether a function is acting destructively?



The Extending Manual tells him about using $ in music function bodies, IIRC.

Best, Simon


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


Re: vertical position of OttavaBracket

2019-07-14 Thread Andrew Bernard

Hi Malte,

Well this is interesting. What you have shown is perfectly normal in 
many editions. Some editions line up the dash with the top of the va 
abbrev., and some on the baseline, and some in the middle. It's a matter 
of personal taste. Trying to force one way of typesetting is not in the 
general spirit of things. Also, the very old fashioned style of putting 
abbreviations as superscript, such as in English No, for number, where 
the o is superscripted looks dreadfully dated. But some like this. I 
don't, for one. The only case remaining for superscript abbreviations is 
the degree symbol in scientific context.


Provide the mechanism, sure, but don't prescribe a single appearance. I 
don't even think there is a default that would suit everybody, that's 
the point.



Andrew


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


Re: tabstaff minimumfret behaving badly

2019-07-14 Thread Immanuel Litzroth
Thanks,
I also found that indicating string numbers works.
Immanuel

On Sun, Jul 14, 2019 at 12:53 PM Malte Meyn  wrote:

>
>
> Am 14.07.19 um 12:42 schrieb Immanuel Litzroth:
> > Am I doing something wrong? Is there a way to fix this?
>
> minimum-fret allows open strings because you don’t need the left hand
> for them. You can disallow that behaviour:
>
> \set TabStaff.restrainOpenStrings = ##t
>
> ___
> 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: tabstaff minimumfret behaving badly

2019-07-14 Thread Malte Meyn



Am 14.07.19 um 12:42 schrieb Immanuel Litzroth:

Am I doing something wrong? Is there a way to fix this?


minimum-fret allows open strings because you don’t need the left hand 
for them. You can disallow that behaviour:


\set TabStaff.restrainOpenStrings = ##t

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


tabstaff minimumfret behaving badly

2019-07-14 Thread Immanuel Litzroth
This score gives a strange result (uses open string for the b and the e).

>
\version "2.19.81"
\language "english"
\new TabStaff {
  \set TabStaff.minimumFret = #3
  \relative c' {}
}
>

Am I doing something wrong? Is there a way to fix this?
Immanuel


tmp.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


vertical position of OttavaBracket

2019-07-14 Thread Malte Meyn

Hi list,

I’m currently working on a patch that would make the default ottavation 
texts/markups (currently "8va"/"15ma" and "8vb"/"15mb") changeable by 
the user without having to \set Staff.ottavation after each \ottava, see 
the following code and attached picture:


%
\version "2.21.0"
.
  %{
  \set Staff.ottavationMarkups =
  #`(( 2 . ,#{ \markup \concat \general-align #Y #UP { "16" \teeny "ma" 
} #})
 ( 1 . ,#{ \markup \concat \general-align #Y #UP { "8" \teeny "va" 
} #})

 (-1 . ,#{ \markup \concat { "8" \teeny "va bassa" } #})
 (-2 . ,#{ \markup \concat { "16" \teeny "ma bassa" } #}))
  %}
  c''4 4 4 4
  \ottava 1
  c'''4 4 4 4
  \ottava 2
  c4 4 4 4
  \ottava -1
  c'4 4 4 4
  \ottava -2
  c4 4 4 4
  \ottava 0
  c''4 4 4 4
}
%

The superscript/top-aligned "va"/"ma" that I’ve seen sometimes in sheet 
music doesn’t work well with the center-aligned OttavaBracket dashed 
line. How can this made be top- or bottom-aligned (or aligned depending 
according to the 'direction property)?


Cheers,
Malte

P. S.: I tried Scheme syntax for the markups in the code above but
#(markup #:concat #:general-align Y UP ("16" #:teeny "ma"))
doesn’t work. What am I doing wrong?
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Jazz chords layout question

2019-07-14 Thread Robin Bannister

Jacques Menu wrote:


Didn’t find a way to hide the empty part of the staff to the left of it, 
stopStaff/startStaff didn’t help.



Sorry.
This simplistic pseudoIndent is too fragile for general use.
It needs to be made robust re vertical extents.


In your case you need a LeftEdge.Y-offset of -4
and
you should also uncomment the BarNumber.X-offset line.

The attachment shows the result for \pseudoIndent #53.


Cheers,
Robin

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


Re: Jazz chords layout question

2019-07-14 Thread Thomas Morley
Hi Jacques,


Am So., 14. Juli 2019 um 01:30 Uhr schrieb Jacques Menu :
>
> Hello Robin,
>
> Thanks, the result is already better, with the seconda volta at the right 
> place after adjusting the parameter of \pseudoIndent.
>
> Didn’t find a way to hide the empty part of the staff to the left of it, 
> stopStaff/startStaff didn’t help.

Basically Robin's code gives LeftEdge a stencil with x- and y-extent.
It's an (otherwise) empty-stencil, which should white-out the StaffSymbol.
Though, the y-extent is hardcoded to (cons -3 3). Which is does not
match StaffSymbol's y-extent here.

To watch the stencil you could add \showLeftEdge (as defined below) to
the call of 'pseudoIndent'

showLeftEdge =
\once \override Score.LeftEdge.after-line-breaking =
  #(lambda (grob)
(ly:grob-set-property! grob 'stencil
  (box-stencil
(ly:grob-property grob 'stencil)
0.2 0)))

Probably the most simple sollution is to have the y-extent as an
optional argument in 'pseudoIndent', making for:

% cheap alternative to \new Score;  fragile wrt. Y positioning
pseudoIndent =
#(define-music-function (parser location y-ext indent) ((pair? '(-3 .
3)) number?)
   #{
 %\once \override Score.BarNumber.X-offset = #(- indent 2)
 \once \override Score.LeftEdge.X-extent = #(cons 0 indent)
 \once \override Score.LeftEdge.Y-offset = 0
 \once \override Score.LeftEdge.stencil =
 #(lambda (grob) (stencil-whiteout-box
  (ly:make-stencil empty-stencil  (cons 0 indent) y-ext)))
   #})

Doing \pseudoIndent #'(-7 . 0) #55 works for me.
Though, as Robin already stated, the y-positioning _will_ stay
fragile, and may change with changing layout.
You likely will need to readjust #'(-7 . 0) frequently.

Cheers,
  Harm

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


Re: Jazz chords layout question

2019-07-14 Thread Michael Hendry
> On 14 Jul 2019, at 00:30, Jacques Menu  wrote:
> 
> Hello Robin,
> 
> Thanks, the result is already better, with the seconda volta at the right 
> place after adjusting the parameter of \pseudoIndent.
> 
> Didn’t find a way to hide the empty part of the staff to the left of it, 
> stopStaff/startStaff didn’t help.
> 
> But I can use the score as is for my needs. I left the notes in the staff to 
> help visualize what happens.
> 
> Thanks again!
> 
> JM
> 

Morning, Jacques,

I know that what you were originally trying to achieve was the closest approach 
to the original (staff-free) chord sheet but…

You could have kept the standard four-bars-per-line layout of a leadsheet by 
starting the first repeat at bar 5, and having four bars for both first and 
second alternatives.  

Or, since the first and second alternatives differ only in the last bar, you 
could have had a five-bar line with both (one-bar) alternatives on it. (The 
Real Book 6th Edition presents “Take the A Train” like this).

The %-repeats don’t add to clarity and are best avoided on leadsheets; it’s 
assumed (in the absence of an “N.C.” markup) that a chord will continue until 
it is replaced or it carries on to a new line, when it will be explicitly named 
again.

…and I’m not going to go anywhere near the D7#11 D7b5 controversy!

Good luck!

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