[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Barline type before \time change
From: |
Jan-Peter Voigt |
Subject: |
Re: Barline type before \time change |
Date: |
Fri, 13 Apr 2012 09:49:46 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
Hello Urs,
There are two possibilities:
1.: use a little music-function-helper:
--snip--
\version "2.15.36"
dbtime = #(define-music-function (parser location frac)(fraction?)
#{
\bar "||" \time $frac
#})
% example
\relative c' {
c4 e g b \dbtime 3/4 c des b | c2.
}
--snip--
but this means not using the standard \time command.
2.: If you want to have this effect on existing sources, you might want
to use a scheme-engraver.
This is based on a snippet, I took from this list ... I think David
Nalesnik wrote it(?)
--snip--
\version "2.15.36"
% this might work in 2.14 too?
DbBars = #(lambda (context)
(let ((time-signature '())
(last-fraction #f))
`((process-music
. ,(lambda (trans)
(let ((frac (ly:context-property context
'timeSignatureFraction)))
(if (and (null? time-signature)
(not (equal? last-fraction frac))
(fraction? frac))
(begin
(ly:context-set-property! context
'whichBar "||")
(set! last-fraction frac)
)))
))
(stop-translation-timestep
. ,(lambda (trans)
(set! time-signature '()))))
))
% example
\score {
\relative c' {
c4 e g b \time 3/4 c des b | c2.
}
\layout {
\context {
\Score
\consists \DbBars
}
}
}
--snip--
With the engraver, you should be able to include an existing file while
using this custom engraver globally:
--snip--
\layout {
\context {
\Score
\consists \DbBars
}
}
\include "mymusic.ly"
--snip--
HTH
Cheers, Jan-Peter
On 12.04.2012 16:29, Urs Liska wrote:
Hello list,
I'm sorry, but I can't find the relevant documentation.
I want to change lilyPond's default behaviour and tell it to use "||"
barlines before \time changes instead of normal ones.
Although it is quite easy to do this manually, I'd like to know where
and how I could change this setting, possibly in a \layout section.
Best
Urs
_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user