How to encode slurs in **kern data.

Slurs

Slurs are indicated by adding ( to a token for the slur start, and ) for a slur end.

**kern
*M4/4
=1
(4c
4d
4e
4f
=2
4g
4f
4e
4c)
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

Nested slurs

Slurs can be nested by opening another slur while another one is active. The first slur closing will affect the closest slur opening to it.

**kern
*M4/4
=1
(4c
(>4d
(4e
(>4f
=2
4g)
4f)
4e)
4c)
==
*-
!!!RDF**kern: > = above
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

Notice the direction RDF character which can be used to force the direction of a slur.

Crossing slurs

Slurs can cross each other by prefixing an ampersand (&) in front of a slur marker which crosses another slur. For more than one crossing slur at a time, additional & characters can be added to the slur prefix.

**kern
*M4/4
=1
(4c
&(>4d
4e)
(4f&)
=2
&(4g
&&(4f
4e)
4c&)
=3
1d&&)
==
*-
!!!RDF**kern: > = above
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

Slur orientation

There are two ways to control the placement of slurs on the staff. When a slur needs to be placed in an arbitrary position, use one of the following two systems.

By layout parameters

**kern
*M4/4
=1
(4c
4d)
!LO:S:a
(4e
4f)
=2
(4cc
4dd)
!LO:S:b
(4ee
4ff)
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

The !LO:S: layout prefix indicates that the layout parameter applies to the slur in the next data token in the spine. To force the slur above the staff, add the parameter a, which is short for a=true. To force the slur below the staff, add the parameter b.

By RDF records

When slur orientations need to be adjusted often in a score, a more compact way of encoding them is to use an RDF record:

**kern
*M4/4
=1
(4c
4d)
(>4e
4f)
=2
(4cc
4dd)
(<4ee
4ff)
==
*-
!!!RDF**kern: < = below
!!!RDF**kern: > = above
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

In the above example, the < character is defined as a qualification on the slur to force it below the staff, and > is used to force the slur above the staff. These characters must immediately follow the ( character representing the slur start. Other positions in the token will cause slur or beam to be oriented up or down, and placing the above/below signifiers after a note will move it to the next staff above or below the current one.

Slurs on chords

When a chord possesses two slurs, the two slurs will be moved to opposite sides of the chord automatically:

**kern
*M4/4
=1
(2c 2e 2g
2d 2f 2a)
=2
((2c 2e 2g
2d 2f 2a))
=3
(2c 2e (2g
2d) 2f 2a)
=4
2c 2e 2g((
2d 2f 2a))
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

The position of the slur in the chord is not important: the slur is attached to the chord, not to any individual notes in the chord.

Dashed and dotted slurs

Layout parameters can be prefixed to the starting token of a slur to display the slur as dotted or dashed lines.

**kern
*M4/4
=1
!LO:S:dash
(4c
4d
4e
4f)
=2
!LO:S:dot
(4c
4d
4e
4f)
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

The layout prefix !LO:S: means that the layout parameter applies to a slur in the next data token. To display the slur as a dashed line, add the parameter dash which is equivalent to dash=true. To display the slur as a dotted line, add the parameter dot.

Multiple slurs

Multiple slurs on notes or chords can be addressed individually within the layout parameter by adding the n parameter set to the number of the slur. For example, if there are two slurs, then the first one can be referenced by adding n=1 to the layout parameter, and n=2 for the second one.

**kern
*M4/4
=1
!LO:S:dash
((2c 2e
2f 2cc))
=2
!LO:S:dash:n=1
((2c 2e
2f 2cc))
=3
!LO:S:dash:n=2
((2c 2e
2f 2cc))
=4
!LO:S:dash:n=1
!LO:S:dot:n=2
((2c 2e
2f 2cc))
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

Coloring slurs

Slurs can be colored by giving an SVG color as a color layout parameter:

**kern
*M4/4
=1
!LO:S:color=hotpink
(4c
4d
4e
4f)
=2
!LO:S:dot
!LO:S:a
!LO:S:color=#00ff00
(4c
4d
4e
4f)
=2
!LO:S:n=1:dot:color=violet
!LO:S:n=2:dash:color=dodgerblue
((2c 2g
2d 2b))
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

Phrase marks

Phrase marks are similar to slurs but are used to mark analytic phrases in **kern data. The default rendering style for phrasing is an open bracket:

**kern
*M2/4
*k[b-]
*F:
{8.r
16ccL
8.ccJ
16cc
=1
4cc
4dd
=2
8.g}L
{16aJ
8.b-L
16ddJ
=3
4dd
4cc
=4
8.a}L
{16ccJ
8.ccL
16ffJ
=5
4ff
8.eeL
16ddJ
=6
4ee
4dd
=7
4cc
4r}
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty 4

Phrase rendering styles

Phrase marks can be rendered in a variety of styles and colors as illustrated below:

**kern
=1
!!LO:TX:b:t=bracket styles
{4c
4d
4e
4f}
=2
!LO:P:brack
{4c
4d
4e
4f}
=3
!LO:P:dot
{4c
4d
4e
4f}
=4
!LO:P:dash
{4c
4d
4e
4f}
=5
!LO:P:open
{4c
4d
4e
4f}
=6||
!!LO:TX:b:t=slur styles
!LO:P:slur
{4c
4d
4e
4f}
=7
!LO:P:slur:dot
{4c
4d
4e
4f}
=8
!LO:P:slur:dash
{4c
4d
4e
4f}
=9||
!!LO:TX:b:t=coloring
!LO:P:slur:dash:color=dodgerblue
{4c
!LO:P:dot:color=red
{4d
4e}
4f}
=10
!LO:P:dash:color=dodgerblue
{4c
!LO:P:dot:color=red
&{4d
4e}
4f&}
=11||
!!LO:TX:b:t=invisible
{y4c
4d
4e
4f}
=12
!LO:P:none
{4c
4d
4e
4f}
==
*-
Engraved by Verovio 5.2.0-dev-4660ee3-dirty bracket styles 4 slur styles 7 coloring 10 invisible

Default rendering style for phrases marks

An RDF record can be used to set the default rendering style of phrase marks.

**kern
*M2/4
*k[b-]
*F:
{8.r
16ccL
8.ccJ
16cc
=1
4cc
4dd
=2
8.g}L
{16aJ
8.b-L
16ddJ
=3
4dd
4cc
=4
8.a}L
{16ccJ
8.ccL
16ffJ
=5
4ff
8.eeL
16ddJ
=6
4ee
4dd
=7
4cc
4r}
==
*-
!!!RDF**kern: { = phrase, brack color=orange
Engraved by Verovio 5.2.0-dev-4660ee3-dirty 4

Various rendering styles:

style result
brack bracket
dot dotted bracket
dash dashed bracket
none no bracket
open open bracket (default)
slur slur
slur dot dotted slur
slur dash dashed slur

The default phrase style can also be given a color as in the above example.

Here is an example of suppressing phrase marks by default, but giving a local style to the last phrase:

**kern
*M2/4
*k[b-]
*F:
{8.r
16ccL
8.ccJ
16cc
=1
4cc
4dd
=2
8.g}L
{16aJ
8.b-L
16ddJ
=3
4dd
4cc
=4
8.a}L
!LO:P:dash:color=violet
{16ccJ
8.ccL
16ffJ
=5
4ff
8.eeL
16ddJ
=6
4ee
4dd
=7
4cc
4r}
==
*-
!!!RDF**kern: { = phrase, none
Engraved by Verovio 5.2.0-dev-4660ee3-dirty 4

Cross-staff slurs

Cross-staff slurs (in particular for piano music), can be created using an RDF record as in the following example:

**kern	**kern
*clefF4	*clefG2
*M4/4	*M4/4
=1	=1
*^	*^
N(4F	1FF	4cc/	2f\
4c	.	4ee/	.
2A\	.	2gg	4f
.	.	.	4gN)
*	*	*v	*v
*v	*v	*
=	=
*-	*-
!!!RDF**kern: N = linked
Engraved by Verovio 5.2.0-dev-4660ee3-dirty

The RDF record N = linked is used to create the link between the two slur endpoints in the data. The link signifier must come immediately in front of the tie signifiers in the data.