lilypond-user
[Top][All Lists]
Advanced

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

Re: straight-flag and no-flag


From: Reinhold Kainhofer
Subject: Re: straight-flag and no-flag
Date: Thu, 22 Jan 2009 23:35:58 +0100
User-agent: KMail/1.10.3 (Linux/2.6.27-9-generic; KDE/4.1.3; i686; ; )

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Donnerstag, 22. Januar 2009 23:01:50 schrieb address@hidden:
> Quoting Reinhold Kainhofer <address@hidden>:
> > By setting the #'flag property instead of #'flag-style ;-)
> >
> > \relative c' {
> >         \autoBeamOff
> >         \override Stem #'flag = #modern-straight-flag
> >         g'8 g g g g g g g |
> >         \override Stem #'flag = #no-flag
> >         g8 g g g g g g g |
> > }
>
> thanks for your suggestion, reinhold, it was one of the first things i
> tried before posting to the list. but is it supposed to work? 

yes, it is working here (I copied it right out of my test file, which compiled 
just fine). 

> as i see it, the problem lies precisely in the discrepancy between the
> property "flag" for the straight flags and "flag-style" for no-flag.

Please notice that I'm using the 'flag property for no-flag, too! Also notice 
that there is no ' in front of no-flag (as opposed to 'no-flag when you use 
'flag-style).

> the temporary solution i found is using \revert Stem #'flag before
> \override Stem #'flag-style = #'no-flag. quite dirty...

Actually, no, that's no dirtty hack. Tat's just the other alid way to create 
no flags. The way it works internally is as follows:

- -) The 'flag property is a function, which creates the flag object. 
- -) By default it is set to a function that looks at the 'flag-style property 
and looks up a font glyph from the lilypond font, depending on the 'flag-
style.
- -) You override it with the function 'modern-straight-flag, which does not 
look at 'flag-style at all, but always directly generates a straight flag 
object.
- -) To get no flags, you can either set 'flag to a function that creates an 
empty flag object (that function is called no-flag), like I did in my example. 
Alternatively, you can reset the 'flag property to the default function and 
then change 'flag-style to a value 'no-flag (which is not interpreted as a 
function, but simply as a name for the style), which is what you found out. 
Both ways work and produce the exact same results, although the internal 
implementation is  bit different.

So, summarized, you can either use the no-flag function:
      \override Stem #'flag = #no-flag
(setting 'flag-style to something else will still have no effect) or use the 
default flag function and indicate the style that it should use:
       \revert Stem #'flag
       \override Stem #'flag-style = #'no-flag

Both are valid and work. It might be a bit confusing that there are two 
equally valid ways, one of which uses 'no-flag and one of which uses no-flag 
without the quote, though...

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
 * Financial & Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJePTPTqjEwhXvPN0RAs4wAJ91bKm076udbHfZvAjQ8aBNZxIDJwCcDcIT
lOmOBQGIlyjx7dDPlwdhgCA=
=RQrq
-----END PGP SIGNATURE-----




reply via email to

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