# Polymetrics in Sibelius (vs. LilyPond)

Recently I published an article about polymetric notation to demonstrate how LilyPond provides easy solutions for desires that Finale leaves unfulfilled. Now I got some excerpts from the Sibelius manual showing how that program deals with the task of polymetric notation, and I think this is a good opportunity to have a look at the different approaches to this topic. The following quotes are from the Sibelius 7 manual, with my comments interspersed.

#### “Multiple time signatures (from the Sibelius 7 manual)

Occasionally scores have two simultaneous time signatures with the same bar-length, such as 2/4 against 6/8. To input this sort of case:

• Create a `2/4` time signature and input the `2/4` music as normal
• Input the `6/8` music as triplet eighths (quavers), but use the `Note Input > Triplet > Other` dialog at least for the first tuplet, switching on `None` and switching off `Bracket`, so it won’t show that they’re triplets
• You can copy the first `6/8` bar as a quick way to get the triplet rhythm for subsequent bars
• When all of the music has been inputted, delete the `2/4` time signature and drag the first note rightwards until there’s enough space for a replacement time signature
• Type the `2/4` and `6/8` using text – start with nothing selected and use Time signatures (one staff only), which you can create from the `Text > Styles > Style` menu, in the `Time signatures (special)` category
• Click where you want to put the time signature to type it in as text, with a `Return` (on the main keyboard) after the top number.”

Wow, that’s neat 😉 . Given that procedure I would really like to know how Sibelius would respond to the request of changing anything in such a polymetric construct.

Basically it’s a very similar approach to what we’d do with LilyPond, except that we would scale the durations while Sibelius users create tuplets only to conceal they are tuplets. If we apply the example from the previous post to the one from the Sibelius manual we see that the steps are much more straightforward in LilyPond:

• Use a `2/4` time signature and input the `2/4` music as normal
• In the `6/8` staff tell LilyPond to
• display a `6/8` time signature: `\set Staff.timeSignatureFraction = 6/8`
• compress the music accordingly: `scaleDurations 2/3 { ... }`
• enter the `6/8` music as normal
```\version "2.19.6"

one = \relative c' {
\time 2/4
c8 c c c
}

two = \relative c' {
\time 2/4
\set Staff.timeSignatureFraction = 6/8
\scaleDurations 2/3 {
c8[ c c] c[ c c]
}
}

\score {
<<
\new Staff \one
\new Staff \two
>>
}```

I would like to stress that from this example only two lines are relevant to the polymetric issue, and once this has been established in the input file it is completely robust. If you want to change anything in the content or the relation of the timings you can simply modify the input code without any hassles regarding breaking anything through improper undo operations.

I assume that Sibelius wouldn’t treat the beaming in a `9/8` tuplet correctly either, so the drawback that I admitted in the previous post isn’t really a drawback – at least not compared to the competitors. And of course we have a solution in LilyPond, given by Simon Albrecht in his comment to that post.

But now we’re coming to the ugly part:

#### (Multiple Time Signatures, continued, from the Sibelius 7 manual)

“In cases where two or more time signatures with different bar lengths are required, such as `4/4` and `5/4`:

• Calculate the lowest common multiple between the two time signatures – in this case, `20/4` – and create that as the time signature
• When all of the music has been inputted, delete the `20/4` time signature and drag the first note rightwards until there’s enough space for a replacement time signature
• Type the `4/4` and `5/4` using text – to do this you’ll need to create a new text style (see above)
• Add the extra barlines using the vertical line from the `Notations > Lines > Line` gallery. This method has the advantage of ensuring that systems end at coinciding barlines. If simultaneous time signatures always have barlines in different places, adopt the same procedure, but remove the barlines in one staff (see `Hiding barlines on some staves only` in `b 4.5 Barlines`), then use the vertical line `Notations > Lines > Line` to draw in suitable barlines where you want them.”

In LilyPond we simply move the responsibility for the timing from the `score` to the `staff` context and can then simply enter music in independent meters. I have shown that extensively in the previous post.

But apart from the fact that LilyPond’s approach is much more straightforward here, Sibelius’ technique has a number of severe flaws:

• Entering all the music in one bar spanning the whole section (at least until the barlines coincide) significantly scrambles the musical meaning. I mean, this `20/4` measure doesn’t have any notion of what is going on inside its intended `4/4` and `5/4` measures.
• What would you do if the measures only happen to coincide at the end of the piece (or at least after a number of systems)?
• You have to do all the beaming manually to mimic the individual time signatures.
While we’re at it, will Sibelius gracefully allow you to enter music like in my example: four groups of four quintuplets (with barlines in between), then start a new section (which happens to start at the 17th quintuplet in that fake measure), etc. And all this with interspersed n-tuplets going across barlines and meter changes?
• If you have changing meters (as in my previous post’s example) you’ll have to enter all time signatures manually as text.
• What’s more, you not only have to insert all barlines, you also have to position them. That may be OK with the manual’s `4/4`/`5/4` example, but I wouldn’t want to do that in my previous post’s score.
• When entering barlines and time signatures manually like this, what happens to the spacing?
• If you have such long measures, how will Sibelius behave when you have to change anything in between, say modify or add a nested tuplet? As far as I know, Sibelius (like Finale) is quite rough about its idea of “complete” measures…

Now lets look at the case of alternating time signatures.

#### “Alternating time signatures (from the Sibelius 7 manual)

To write music in e.g. alternating `2/4` and `3/4` time, signaled by a `2/4` `3/4` composite time signature:

• Input a `2/4` time signature and copy it to alternate bars
• Do the same for a `3/4` time signature in the remaining bars
• Input the music
• Then delete all the time signatures except the initial `2/4` (saying No when asked if you want to rewrite the music)
• Finally write a `3/4` time signature immediately after the initial 2/4 using text, as described in `Multiple time signatures` above.”

Well, this first made me scratch my head because I couldn’t instantly find a ready solution with LilyPond. No built-in function, nothing in the docs, no snippet. Some research turned out that there had been a snippet for a quite similar task, but this obviously had been considered obsolete when the `\compoundMeter` function was introduced in LilyPond. But `\compoundMeter` actually serves a different purpose than the snippet, and unfortunately the snippet can now only be found in some obscure mailing list discussions and copies of outdated manuals.

However, it became clear what the approach should be: overriding the TimeSignature stencil. Overriding a stencil essentially means telling LilyPond to print something else instead of a given object. Just recently we have seen some examples of that in Peter Bjuhr’s post about using SMuFL glyphs. It is a technique that may look somewhat frightening and is actually somewhat more involved. In the end it’s a very similar approach to the one suggested in the Sibelius manual: remove the default object and print some arbitrary glyphs instead. However, I think there are some substantial advantages in LilyPond’s approach:

• When you override a stencil LilyPond will take care of the spacing and collision handling automatically. There’s no need to “drag the first note rightwards until there’s enough space for a replacement time signature” (ugh). The new stencil still “is” a time signature for LilyPond, not just some meaningless text elements.
• You can write your music as normal, using `\time` commands to indicate the actual measuring. What will Sibelius do when you have to change a measure from `3/4` to `4/4` (or vice versa) after the music has been entered? While it is probably possible it’s definitely a scary thing to be confronted with …

After that you simply have to hide the time signatures for the alternating passage and unhide them to return to normal music.

In order to make this common notation generally available I have written a function. With this it is possible to write

`\alternatingTimeSignatures #'((3 8) (4 8) (5 8))`

to produce a – perfectly aligned – time signature consisting of an arbitrary number of items. After that you’ll `\omit Score.TimeSignature` to suppress the printing of time signatures, and then use a simple `\undo \omit Score.TimeSignature` to bring them back again.

(Click for full-size PDF)

The input file reveals that the function itself isn’t trivial, and regular users shouldn’t be expected to have to dig so deep. But it shows several nice things about LilyPond as an open source project:

• You can modify or extend LilyPond’s behavior, possibly up to its innermost gear-wheels.
• Once such a function has been implemented its use is very straightforward.
• A function like this can easily be made available publicly. Actually I intended to contribute this function (in a slightly modified form) to LilyPond itself, but the review process triggered a discussion about a modification of some underlying syntax, eventually making the function obsolete. Independently of the outcome you can inspect and use the function from the openLilyLib snippets repository,
• Usually you would ask about such functionality on the lilypond-user mailing list, and chances are pretty good that someone (or several people working together) will present you with a working solution. If it is generally useful it may also be incorporated either in LilyPond or in one of the libraries.

Well, I can only say: If you regularly have to struggle with polymetrics in Finale or Sibelius, or – much worse – if you are a composer and find yourself avoiding polymetrics because of Finale or Sibelius, you should really give LilyPond a closer look!

## 6 thoughts on “Polymetrics in Sibelius (vs. LilyPond)”

1. Urs Liska

Hi Pierre-Luc,

thank you for the report. I’ve updated the file (note that it may be necessary to refresh the browser’s cache).

1. Abel Cheung

Thanks for this trick. There are two points I find it favourable:

1. The simpler case works for mid-measure time signature change (!)

2. It avoids all kind of warnings and potential problems when using `\time`; those warnings could be related to issue #3888.