Skip to content

Commit

Permalink
improve clefs
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Nov 24, 2019
1 parent 81004b9 commit fac8cbd
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions mei2pae.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,26 @@
<xsl:template match="mei:beamSpan" mode="plaineAndEasie" />

<!-- MEI clef -->
<xsl:template name="setClef" match="mei:clef|@*[starts-with(name(),'clef')]" mode="plaineAndEasie">
<xsl:param name="clefShape" select="(//@shape|ancestor-or-self::*/@clef.shape)[1]" />
<xsl:template name="setClef" match="mei:clef" mode="plaineAndEasie">
<xsl:param name="clefShape">
<xsl:choose>
<xsl:when test="((//@shape|ancestor-or-self::*/@clef.shape)[1] = 'G') and ((//@dis|ancestor-or-self::*/@clef.dis)[1] = '8')">
<xsl:value-of select="'g'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="(//@shape|ancestor-or-self::*/@clef.shape)[1]" />
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:param name="clefLine" select="(//@line|ancestor-or-self::*/@clef.line)[1]" />
<xsl:value-of select="concat('%', $clefShape, '-', $clefLine)" />
<xsl:choose>
<xsl:when test="contains(ancestor-or-self::*/@notationtype, 'mensural')">
<xsl:value-of select="concat('%', $clefShape, '+', $clefLine)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('%', $clefShape, '-', $clefLine)" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!-- MEI chord -->
Expand Down

0 comments on commit fac8cbd

Please sign in to comment.