Re: Profondo: note symbols in TupletBracket

2015-09-03 Thread Thomas Morley
2015-09-02 20:17 GMT+02:00 tisimst :
> David,
>
> On 8/31/2015 5:55 AM, David Stephen Grant [via Lilypond] wrote:
>
> Hi all,
> I'm using Abraham's Profondo font, but having some trouble with
> TupletBrackets.
>
> I would like to indicate the duration of some feathered beamed groups
with a
> TupletBracket showing the total duration. The following simplified code
> works fine with the default font, but the symbol in the first bracket
> doesn't print when I switch to Profondo. I also get the error: warning:
> Found infinity or nan in output. Substituting 0.0
>
> \version "2.19.25"
> \include "profondo.ily"
> {
>   \override TupletBracket.padding = #1.5
>   \override TupletBracket.bracket-visibility = ##t
>
>   \once \override TupletNumber.text = \markup { \note #"4" #UP }
>   \tuplet 5/8 { a'16 a' a' a' a' }
>
>
>   \revert Staff.TupletNumber.font-name
>   \once \override TupletNumber.text = \markup { \note #"4" #UP }
>   \tuplet 5/8 { a'16 a' a' a' a' }
>
>   \override Staff.TupletNumber.font-name = #"ProfondoTupletNumbers"
>   \tuplet 5/8 { a'16 a' a' a' a' }
> }
>
> As most TupletBrackets should be using the Profondo tuplet number font I
> thought about reverting to the default for these brackets, but ideally I
> would prefer not to have to remember to turn Profondo back on afterwards
as
> in the above code.
>
> Any ideas?
>
>
> I've been thinking about this since you first sent it and it is starting
to
> drive me crazy! I've poured over the code that creates the \note stencil
and
> I can't find anything that would cause it to go crazy like this. The only
> font it even refers to is the music font, so I don't know why the \markup
> has a hard time with it. In the example you show (not sure if you are
doing
> anything more complex in the actual score), the \markup doesn't use any
text
> from ProfondoTupletNumbers at all when it draws the \note, so I have to
> assume the error is caused by the \markup command itself, though I haven't
> been able to prove that yet.
>
> One way around this (at least to make it less of a typing hassle) is to
> remove the \override from the \layout block and instead encapsulate it in
> variables so you can use them on-the-fly, like this:
>
> %
>
> profondoTupletNumeralsOn = \override Staff.TupletNumber.font-name =
> #"ProfondoTupletNumbers"
> profondoTupletNumeralsOff = \revert Staff.TupletNumber.font-name
>
> %
>
> It's probably more than you want to do, but this might be the best thing
to
> do for the time being. Do you use the \note function in your tuplet
markings
> a lot?
>
> Best,
> Abraham


Hi,

I did some research on this topic, focusing on \note-by-number, which is
called in \note.

I've found that \note-by-number is _always_ disturbed, if _any_ font-name
is set. But \musicglyph not, for _every_ font-name-setting.

The difference seems to be that \musicglyph clears font-name, setting it to
#f.
\note-by-number does not.

Coding the same in \note-by-number seems to solve the issue. This needs
more testing, though, and _if_ it's the way to go, should be done in
\rest-by-number as well.


Code-examples:

\version "2.19.26"

%% The following _always_ works
%%{
\markup {
  \typewriter #"\\musicglyph #\"noteheads.s0\""
  \musicglyph #"noteheads.s0"
}

\markup {
  \typewriter "\\note #\"8.\" #UP"
  \note #"8." #UP
  \typewriter #"\\note #\"1.\" #UP"
  \note #"1." #UP
}
%}

%% The following _never_ works, regardless which font-name is specified.
%%{
\markup
  \override #'(font-name . "Times New Roman")
  {
  \typewriter #"\\musicglyph #\"noteheads.s0\""
  \musicglyph #"noteheads.s0"
}

\markup
  \override #'(font-name . "Times New Roman")
  {
  \typewriter "\\note #\"8.\" #UP"
  \note #"8." #UP
  \typewriter #"\\note #\"1.\" #UP"
  \note #"1." #UP
}
%}
 And the following bug can be observed (not related to the current
topic,
 I think), was ok with 2.18.2:
%%{
\markup \override #'(font-name . "Times New Roman") "\\<==what?"
%}


Replacing note-by-number in define-markup-commands.scm with the code below
seems to solve the issue (changes between the semicolon-lines) and the
reported problem with other fonts like profondo, etc
Please test.


(define-markup-command (note-by-number layout props log dot-count dir)
  (number? number? number?)
  #:category music
  #:properties ((font-size 0)
(flag-style '())
(style '()))
  "
@cindex notes within text by log and dot-count

Construct a note symbol, with stem and flag.  By using fractional values for
@var{dir}, longer or shorter stems can be obtained.
Supports all note-head-styles.
Supported flag-styles are @code{default}, @code{old-straight-flag},
@code{modern-straight-flag} and @code{flat-flag}.

@lilypond[verbatim,quote]
\\markup {
  \\note-by-number #3 #0 #DOWN
  \\hspace #2
  \\note-by-number #1 #2 #0.8
}
@end lilypond"
  (define (get-glyph-name-candidates dir log style)
(map (lambda (dir-name)
   (format #f "noteheads.~a~a" dir-name
   (if (a

Re: Profondo: note symbols in TupletBracket

2015-09-02 Thread tisimst
David,

On 8/31/2015 5:55 AM, David Stephen Grant [via Lilypond] wrote:
> Hi all,
> I'm using Abraham's Profondo font, but having some trouble with 
> TupletBrackets.
>
> I would like to indicate the duration of some feathered beamed groups 
> with a TupletBracket showing the total duration. The following 
> simplified code works fine with the default font, but the symbol in 
> the first bracket doesn't print when I switch to Profondo. I also get 
> the error: warning: Found infinity or nan in output. Substituting 0.0
>
> \version "2.19.25"
> \include "profondo.ily"
> {
>   \override TupletBracket.padding = #1.5
>   \override TupletBracket.bracket-visibility = ##t
>   \once \override TupletNumber.text = \markup { \note #"4" #UP }
>   \tuplet 5/8 { a'16 a' a' a' a' }
>   \revert Staff.TupletNumber.font-name
>   \once \override TupletNumber.text = \markup { \note #"4" #UP }
>   \tuplet 5/8 { a'16 a' a' a' a' }
>   \override Staff.TupletNumber.font-name = #"ProfondoTupletNumbers"
>   \tuplet 5/8 { a'16 a' a' a' a' }
> }
>
> As most TupletBrackets should be using the Profondo tuplet number font 
> I thought about reverting to the default for these brackets, but 
> ideally I would prefer not to have to remember to turn Profondo back 
> on afterwards as in the above code.
>
> Any ideas?

I've been thinking about this since you first sent it and it is starting 
to drive me crazy! I've poured over the code that creates the \note 
stencil and I can't find anything that would cause it to go crazy like 
this. The only font it even refers to is the music font, so I don't know 
why the \markup has a hard time with it. In the example you show (not 
sure if you are doing anything more complex in the actual score), the 
\markup doesn't use any text from ProfondoTupletNumbers at all when it 
draws the \note, so I have to assume the error is caused by the \markup 
command itself, though I haven't been able to prove that yet.

One way around this (at least to make it less of a typing hassle) is to 
remove the \override from the \layout block and instead encapsulate it 
in variables so you can use them on-the-fly, like this:

%

profondoTupletNumeralsOn = \override Staff.TupletNumber.font-name = 
#"ProfondoTupletNumbers"
profondoTupletNumeralsOff = \revert Staff.TupletNumber.font-name

%%%%%

It's probably more than you want to do, but this might be the best thing 
to do for the time being. Do you use the \note function in your tuplet 
markings a lot?

Best,
Abraham




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Profondo-note-symbols-in-TupletBracket-tp180478p180620.html
Sent from the User mailing list archive at Nabble.com.___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Profondo: note symbols in TupletBracket

2015-08-31 Thread David Stephen Grant
Hi all,
I'm using Abraham's Profondo font, but having some trouble with
TupletBrackets.

I would like to indicate the duration of some feathered beamed groups with
a TupletBracket showing the total duration. The following simplified code
works fine with the default font, but the symbol in the first bracket
doesn't print when I switch to Profondo. I also get the error: warning:
Found infinity or nan in output. Substituting 0.0

\version "2.19.25"
\include "profondo.ily"
{
  \override TupletBracket.padding = #1.5
  \override TupletBracket.bracket-visibility = ##t

  \once \override TupletNumber.text = \markup { \note #"4" #UP }
  \tuplet 5/8 { a'16 a' a' a' a' }


  \revert Staff.TupletNumber.font-name
  \once \override TupletNumber.text = \markup { \note #"4" #UP }
  \tuplet 5/8 { a'16 a' a' a' a' }

  \override Staff.TupletNumber.font-name = #"ProfondoTupletNumbers"
  \tuplet 5/8 { a'16 a' a' a' a' }
}

As most TupletBrackets should be using the Profondo tuplet number font I
thought about reverting to the default for these brackets, but ideally I
would prefer not to have to remember to turn Profondo back on afterwards as
in the above code.

Any ideas?

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