dampened symbol in tablature when using fonts other than Feta

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

dampened symbol in tablature when using fonts other than Feta

Federico Bruni-2
I use a different font for TabStaff:

\override TabStaff.TabNoteHead #'font-name = #"Nimbus Sans L Bold"

But when a score contains \deadNote I'm forced to comment the line above
and switch back to Feta, otherwise lilypond can't find noteheads.s2cross
(the Feta glyph for dampened notes).

There's any workaround which allows to have both (different font and
cross glyph on TabStaff)?

Thanks,
Federico



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Federico Bruni-2
Il giorno dom, 10/04/2011 alle 11.53 +0200, Federico Bruni ha scritto:

> I use a different font for TabStaff:
>
> \override TabStaff.TabNoteHead #'font-name = #"Nimbus Sans L Bold"
>
> But when a score contains \deadNote I'm forced to comment the line above
> and switch back to Feta, otherwise lilypond can't find noteheads.s2cross
> (the Feta glyph for dampened notes).
>
> There's any workaround which allows to have both (different font and
> cross glyph on TabStaff)?
>
> Thanks,
> Federico

Maybe my question is not clear? Or am I just spoiled by the quick
answers I'm used to get in this mailing list?

I think this is an issue, unless I'm missing something.
Let's say I want to write a tablature book using a different font for
tablature. If just one song in the book contains \deadNote, I'm forced
to use Feta in all the songs; or just in that song, losing consistency
with the rest.

Here's a minimal example.
Please let me know what you think about it.


\version "2.13.58"

music = \relative c' {
  % try any font in your system other than Feta
  \override TabStaff.TabNoteHead #'font-name = #"Nimbus Sans L Bold"
  c4 d \deadNote dis e |
}

\score {
  \new StaffGroup <<
    \new Staff { \clef "G_8" \music }
    \new TabStaff { \clef "moderntab" \music }
  >>
}



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Carl Sorensen



On 4/12/11 3:28 PM, "Federico Bruni" <[hidden email]> wrote:

> Il giorno dom, 10/04/2011 alle 11.53 +0200, Federico Bruni ha scritto:
>> I use a different font for TabStaff:
>>
>> \override TabStaff.TabNoteHead #'font-name = #"Nimbus Sans L Bold"
>>
>> But when a score contains \deadNote I'm forced to comment the line above
>> and switch back to Feta, otherwise lilypond can't find noteheads.s2cross
>> (the Feta glyph for dampened notes).
>>
>> There's any workaround which allows to have both (different font and
>> cross glyph on TabStaff)?

How about redefining \deadNote so it contains

\once \override TabStaff.TabNoteHead #'font-name = #"Feta"


HTH,

Carl



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Federico Bruni-2
Il giorno mar, 12/04/2011 alle 15.38 -0600, Carl Sorensen ha scritto:
> How about redefining \deadNote so it contains
>
> \once \override TabStaff.TabNoteHead #'font-name = #"Feta"

Thanks.
However, I'm not sure if I know how to redefine existing commands.
The following code is not working, because it prints the normal notehead
(instead of the crosshead) in both Staff and Tabstaff.

... maybe I've overwritten the command instead of just adding the
override?


\version "2.13.58"

deadNote = {
  \once \override TabStaff.TabNoteHead #'font-name = #"Feta"
}

music = \relative c' {
  % try any font in your system other than Feta
  \override TabStaff.TabNoteHead #'font-name = #"Nimbus Sans L Bold"
  c4 d \deadNote dis e |
}

\score {
  \new StaffGroup <<
    \new Staff { \clef "G_8" \music }
    \new TabStaff { \clef "moderntab" \music }
  >>
}



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Carl Sorensen



On 4/12/11 4:21 PM, "Federico Bruni" <[hidden email]> wrote:

> Il giorno mar, 12/04/2011 alle 15.38 -0600, Carl Sorensen ha scritto:
>> How about redefining \deadNote so it contains
>>
>> \once \override TabStaff.TabNoteHead #'font-name = #"Feta"
>
> Thanks.
> However, I'm not sure if I know how to redefine existing commands.
> The following code is not working, because it prints the normal notehead
> (instead of the crosshead) in both Staff and Tabstaff.
>
> ... maybe I've overwritten the command instead of just adding the
> override?

That's right.

Look in ly/property-init.ly for the definition of \deadNote, and duplicate
it, but with the override added.

HTH,

Carl



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Federico Bruni-2
Il giorno mar, 12/04/2011 alle 17.11 -0600, Carl Sorensen ha scritto:
> > ... maybe I've overwritten the command instead of just adding the
> > override?
>
> That's right.
>
> Look in ly/property-init.ly for the definition of \deadNote, and
> duplicate
> it, but with the override added.

Thanks for the hint but I can't make it work.
What's wrong in the following examples?

deadNote = {
  \once \override TabNoteHead #'font-name = #"Feta"
  #(define-music-function (parser location note) (ly:music?)
   (_i "Print @var{note} with a cross-shaped note head.")
   (style-note-heads '(TabNoteHead NoteHead) 'cross note))
}

or

deadNote = \once \override TabNoteHead #'font-name = #"Feta" #xNote


PS
In ly/property-init.ly I see:

% Define aliases of cross-head notes for specific purposes
deadNotesOn  = \xNotesOn
deadNotesOff = \xNotesOff
deadNote     = #xNote

why #xNote?
I would expect to see \xNote



Reply | Threaded
Open this post in threaded view
|

Re: dampened symbol in tablature when using fonts other than Feta

Carl Sorensen



On 4/13/11 12:32 PM, "Federico Bruni" <[hidden email]> wrote:

> Il giorno mar, 12/04/2011 alle 17.11 -0600, Carl Sorensen ha scritto:
>>> ... maybe I've overwritten the command instead of just adding the
>>> override?
>>
>> That's right.
>>
>> Look in ly/property-init.ly for the definition of \deadNote, and
>> duplicate
>> it, but with the override added.
>
> Thanks for the hint but I can't make it work.
> What's wrong in the following examples?
>
> deadNote = {
>   \once \override TabNoteHead #'font-name = #"Feta"
>   #(define-music-function (parser location note) (ly:music?)
>    (_i "Print @var{note} with a cross-shaped note head.")
>    (style-note-heads '(TabNoteHead NoteHead) 'cross note))
> }
>

In this case, deadNote is a music function, and the \override needs to
become part of the function.

You might try

deadNote = #(define-music-function (parser location note) (ly:music?)
     #{
         \once \override TabNoteHead #'font-name = #"Feta"
         #(style-note-heads '(TabNoteHead NoteHead) 'cross $note)
     #})


or

deadNote = #(define-music-function (parser location note) (ly:music?)
  #{
      \once \override TabNoteHead #'font-name = #"Feta"
      \xNote $note
  #})
 

I think the second case is the more likely to work.

> or
>
> deadNote = \once \override TabNoteHead #'font-name = #"Feta" #xNote

This doesn't work because it doesn't call the music function; it just puts
the music function in the music stream.



>
>
> PS
> In ly/property-init.ly I see:
>
> % Define aliases of cross-head notes for specific purposes
> deadNotesOn  = \xNotesOn
> deadNotesOff = \xNotesOff
> deadNote     = #xNote
>
> why #xNote?
> I would expect to see \xNote

#xNote is referring to a Scheme function, rather than a LilyPond variable.

\xNote calls the Scheme function with an argument of the music expression
following \xNote.

This is fairly high-level Scheme magic.

Probably the right way to fix this is to have \deadNotesOn set the font to
Feta, and \deadNotesOff set the font to a saved font.  But we don't have
that capability currently implemented.

We also ought to have \deadNote (or better yet, xNote) use a tweak, instead
of an override, to set the Feta font.  The \once \override construct will
set *all* the noteheads at that timestep to use the Feta font.

I'd love to fix this for you, but right now I just don't have time.

If you'll post a report on bug-lilypond, I'll try to get to it as soon as I
can.

HTH,

Carl



>