Or even:

\version "2.18.2"

altBracket = #(define-music-function (parser location tag) (string?)
  #{ \set Score.repeatCommands = #(list (list 'volta (markup #:number
tag))) #})

altBracketEnd = { \set Score.repeatCommands = #'((volta #f)) }

{
  c'1
  \once\override Score.VoltaBracket.shorten-pair = #'(0 . 1)
  \altBracket "1."
  c'
  \altBracket "2."
  c'
  \altBracketEnd
}

Cheers,
Pierre

2016-09-06 17:24 GMT+02:00 Sven Axelsson <sven.axels...@gmail.com>:

> Hello Lilyponders!
>
> For the kind of music I mostly typeset, it is common to have alternative
> bars or even alternative notes in the middle of a measure. At the moment I
> handle this by setting score.repeatCommands like so:
>
> % Used when substituting a single bar or just a few notes to show
> alternative.
> altBracket = #(define-music-function (parser location tag) (string?)
>   #{ \set Score.repeatCommands = #(list (list 'volta (markup #:text tag)))
> #})
>
> % End previous altBracket thingy.
> altBracketEnd = { \set Score.repeatCommands = #'((volta #f)) }
>
> And use it like:
>
> ... music
> \altBracket "1."
> music
> \altBracket "2."
> music
> \altBracketEnd
>
> This works, but the result looks a bit different from \repeat volta ...
> \alternative
>
> I'd appreciate any hints on how to get the same font and bracket look as
> with \repeat volta.
>
> Thanks,
> Sven Axelsson
>
> --
> ++++++++++[>++++++++++>+++++++++++>++++++++++>++++++
> >++++<<<<<-]>++++.+.++++.>+++++.>+.<<-.>>+.>++++.<<.
> +++.>-.<<++.>>----.<++.>>>++++++.<<<<.>>++++.<----.
>
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to