Skip to content

Commit

Permalink
add support for mensural durations
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Jan 30, 2020
1 parent fac8cbd commit 153cd2c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Little XSLT to extract short incipits from MEI files encoded with [Plaine and Easie Code](https://www.iaml.info/plaine-easie-code).

### Usage
The template takes the first `<score>` element in the file as basis.
The stylesheet takes the first `<score>` element in the file as basis.
It takes following parameters:
* `staff` – selects the staff in the MEI file (default is 1)
* `layer` – selects the layer in the MEI file (default is 1)
Expand Down
26 changes: 25 additions & 1 deletion mei2pae.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@

<xsl:template name="setDuration">
<xsl:param name="durval" select="@dur" />
<!-- data.DURATION.cmn -->
<!-- data.DURATION -->
<xsl:choose>
<!-- data.DURATION.cmn -->
<xsl:when test="@dur = 'long'">
<xsl:text>0</xsl:text>
</xsl:when>
Expand Down Expand Up @@ -386,6 +387,29 @@
<xsl:when test="@dur = '128'">
<xsl:text>7</xsl:text>
</xsl:when>
<!-- data.DURATION.mensural -->
<xsl:when test="@dur = 'maxima'"></xsl:when>
<xsl:when test="@dur = 'longa'">
<xsl:text>0</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'brevis'">
<xsl:text>9</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'semibrevis'">
<xsl:text>1</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'minima'">
<xsl:text>2</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'semiminima'">
<xsl:text>4</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'fusa'">
<xsl:text>8</xsl:text>
</xsl:when>
<xsl:when test="@dur = 'semifusa'">
<xsl:text>6</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:message>Shorter durations than 128th are not supported.</xsl:message>
</xsl:otherwise>
Expand Down

0 comments on commit 153cd2c

Please sign in to comment.