lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom drumstyle-tables with custom noteheads?


From: Carl D. Sorensen
Subject: Re: custom drumstyle-tables with custom noteheads?
Date: Mon, 9 Feb 2009 14:27:28 -0700



On 2/9/09 1:30 PM, "Tao Cumplido" <address@hidden> wrote:

> 
> 
> -------- Original-Nachricht --------
>> Datum: Mon, 9 Feb 2009 11:26:19 -0700
>> Von: "Carl D. Sorensen" <address@hidden>
>> An: Tao Cumplido <address@hidden>, "address@hidden"
>> <address@hidden>
>> Betreff: Re: custom drumstyle-tables with custom noteheads?
> 
> 
> The notehead.cc file is very cryptic for me and I don't see how it could help
> me since I don't see anywhere a definition of 'cross or 'diamond.
> Note_head::print is too abstract for me. I don't get how 'cross tells
> ly:note-head:print to print the cross-head stencils from the feta font.

Yes, the .cc files are very hard to understand.  But after you look at a
bunch of them, it gets better....

You can see where the styles are actually used to get glyph names in
scm/output-lib.scm.


>> Since the drumStyleTable uses note styles to set the note heads, if you
>> want
>> to create your own drumStyleTable, I think you'll need to add a new
>> notehead
>> style.  And I have no idea how to do that.
> 
> Yes, I think so too, but if even you don't know what to do I think I should
> rather drop this problem for now.

No, don't drop this problem just because *I* don't know what to do!  I'm
only an expert in fret diagrams, because I wrote the code for that.  I'm
only a bit above novice in the other LilyPond areas.  You might choose
instead to start a new thread (probably on lilypond-devel) that asks about
how one would go about defining a new notehead style with a program to
define the notehead, rather than a font glyph.  There *are* people around
who know how to do this.

> 
> Hmm... maybe it is possible to write a function that checks on the position of
> each note in the drumStyle hashtable and override the style accordingly?!

Maybe, but this seems like too much of a hack to me.  But it's possible, I
suppose.  But if I were going to do it in this fashion, I think I'd add a
new style to the drumStyleTable and then try to write a new print function
that checks the style, and if it's parallelogram, use the parallelogram
print routine, otherwise, use the regular notehead print routine.

Now that I think about it, this approach is a promising way to do this
without needing to add any font glyphs (which I think would be needed to
define a new style).  You already have a template for how to do this in your
parallelogram function that Neil wrote.  It checks the grob, and if its
duration is 2, it writes the parallelogram.  Otherwise, it calls the regular
notehead stuff.

You can do this with an override to DrumVoice #'stencil

\override DrumVOice #'stencil = #'my-drum-print

And then define a function my-drum-print that will check the style of each
NoteHead to see if it calls parallelogram or calls ly:note-head::print to
handle the rest of the stuff.

But I think the output will likely be better if you define new glyphs in the
font and define a new style.

HTH,

Carl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]