MIDI: fix regtest failure
[lilypond/patrick.git] / input / regression / automatic-polyphony-context-id.ly
blob31b42a36a337e01788607ed6ac64f655db1de641
1 \version "2.13.12"
3 \header {
4 texidoc = "The bottom-level contexts in polyphony shorthand are
5 allocated a context id in order of creation, starting with
6 @code{\"1\"}.
7 This snippet will fail to compile if either voice has an invalid
8 @code{context-id} string.
12 assertContextId =
13 #(define-music-function (parser location id) (string?)
14 (let ((music (make-music 'ApplyContext
15 'procedure
16 (lambda (ctx)
17 (and
18 (not (string=? (ly:context-id ctx) id))
19 (ly:error "context-id mismatch found: expecting ~s, got ~s"
21 (ly:context-id ctx)))))))
22 music))
24 \relative c'' {
27 \assertContextId "1"
28 c4 d e2
32 \assertContextId "2"
33 a,4 b c2