vertical position of OttavaBracket

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

vertical position of OttavaBracket

Malte Meyn-3
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
   c''''4 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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

ottavation-markups.png (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Robin Bannister-2
In reply to this post by Malte Meyn-3
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

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user

ottavaText.ily (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Malte Meyn-3
In reply to this post by Andrew Bernard


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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Malte Meyn-3
In reply to this post by Robin Bannister-2


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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Robin Bannister-2
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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Robin Bannister-2
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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

Malte Meyn-3


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
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: vertical position of OttavaBracket

David Kastrup
In reply to this post by Robin Bannister-2
Robin Bannister <[hidden email]> writes:

> 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.

What's wrong with using #{...#} ?  Seriously.

You could use

$(make-concat-markup (map make-box-markup '("X" "Y" "Z")))

if you insist on avoiding #{...#} but why bother?

--
David Kastrup