lilypond-user
[Top][All Lists]
Advanced

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

Re: On popular demand: Free Meter :-)


From: Ted Walther
Subject: Re: On popular demand: Free Meter :-)
Date: Wed, 10 Oct 2007 12:08:01 -0700
User-agent: Mutt/1.5.16 (2007-06-11)

Thank you Rune!

Ted

On Wed, Oct 10, 2007 at 06:27:30PM +0200, Rune Zedeler wrote:
Rune Zedeler skrev:
\hardbar "||"

(And btw don't think it would be possible with current lilypond)

Well, inspired by Mats' latest post, I see that it indeed is possible:

%%% BEGIN %%%
increaseBarNumber = \applyContext
#(lambda (x)
  (let ((measurepos (ly:context-property x 'measurePosition)))
   ; Only increase bar number if not at start of measure.
   ; This way we ensure that you won't increase bar number twice
   ; if two parallel voices call increaseBarNumber simultanously:
   (if (< 0 (ly:moment-main-numerator measurepos)) ; ugh. ignore grace part
    (begin
     (ly:context-set-property!
      (ly:context-property-where-defined x 'internalBarNumber)
      'internalBarNumber
      (1+ (ly:context-property x 'internalBarNumber)))
     (ly:context-set-property!
      (ly:context-property-where-defined x 'currentBarNumber)
      'currentBarNumber
      (1+ (ly:context-property x 'currentBarNumber)))
     ; set main part of measurepos to zero, leave grace part as it is:
     (ly:context-set-property!
      (ly:context-property-where-defined x 'measurePosition)
      'measurePosition
      (ly:make-moment 0 1
       (ly:moment-grace-numerator measurepos)
       (ly:moment-grace-denominator measurepos)))))))

% Named Increasing BAR
nibar = #(define-music-function (parser location x) (string?)
#{
  \bar $x
  \increaseBarNumber
#})

% Increasing BAR
ibar = \nibar "|"

{
  \new Staff \with { \remove Time_signature_engraver } {
    \cadenzaOn
    #(set-accidental-style 'modern-cautionary)
    \key a \major
    \repeat unfold 2 {
      c'8 dis' eis'  eis' \ibar
      c'4 dis'  e' eis' \nibar "||"
      c' dis' eis'8 dis' eis' \ibar
      c'1 dis' eis' eis'2 \nibar "|."
    }
  }
}
%%% END %%%

Valentin, will you update LSR?

-Rune

--
           There's a party in your skull.  And you're invited!

Name:    Ted Walther
Phone:   778-320-0644
Email:   address@hidden
Skype:   tederific
Address: 3422 Euclid Ave, Vancouver, BC V5R4G4 (Canada)




reply via email to

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