[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: override-auto-beam-settings
From: |
Jan Nieuwenhuizen |
Subject: |
Re: override-auto-beam-settings |
Date: |
Tue, 11 Jan 2005 18:50:24 +0100 |
Ruud van Silfhout writes:
> I already thought that someting like that was the problem, thats the reason
> I posted it on the devel rather that the user list. . So w.r.t this issue
> lily is not backwards compatible.
Indeed, this is but one of many non-backward compatibilities. Worse,
this is not even forward compatible. Not much attention was paid to
this, apparently.
> The piece I am working on contains some odd 15 voices or so, so I would
> prefer a solution fitting in the \layout section and more pieces coming up.
> Is there someone who could make this work? If an example project is needed I
> can send one privately.
I see two solutions for 2.4, both of which require messing with
non-documented internals.
One solution is changing the context variable, the other is to make a
(override-auto-beam-settings) that works on score level.
See below.
Jan
%% Copy from scm/auto-beam.scm; because not public there
#(define (override-property-setting context context-prop setting value)
"Like the C++ code that executes \\override, but without type
checking. "
(ly:context-set-property! context context-prop
(cons (cons setting value)
(ly:context-property context context-prop))))
%% Copy of override-auto-beam-setting, but apply at Score level iso at Voice
#(define-public (score-override-auto-beam-setting setting num den . rest)
(ly:export
(context-spec-music
(make-apply-context (lambda (c)
(override-property-setting
c 'autoBeamSettings
setting (ly:make-moment num den))))
(if (and (pair? rest) (symbol? (car rest)))
(car rest)
'Score))))
\layout {
\context {
\Staff
%% fix 1
autoBeamSettings = #(cons
(cons '(end * * * *) (ly:make-moment 1 2))
default-auto-beam-settings)
}
}
<<
\new Staff {
\time 6/4
a8 a a b b b
a8 a a b b b
}
\new Staff {
a8 a a b b b
a8 a a b b b
}
%% fix 2
#(score-override-auto-beam-setting '(end * * * *) 1 2)
>>
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien | http://www.lilypond.org