-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54cead0
commit 2360f9d
Showing
16 changed files
with
463 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"N":"package","version":"30","packageVersion":"1","saxonVersion":"SaxonJS 2.6","target":"JS","targetVersion":"2","name":"TOP-LEVEL","relocatable":"true","buildDateTime":"2024-08-12T21:04:55.681-07:00","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"co","id":"0","uniform":"true","binds":"6 4 2 3 1 5","C":[{"N":"template","flags":"os","module":"groove.xsl","slots":"200","name":"Q{}groove","line":"29","expand-text":"false","sType":"* ","C":[{"N":"sequence","role":"body","sType":"* ","C":[{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nMidiText Generated by github.com/infojunkie/musicxml-midi\nKeySig "}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"32","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"gVarRef","sType":"* ","name":"Q{}keysig","bSlot":"0","role":"select","line":"32"}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nTempo "}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"33","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"gVarRef","sType":"* ","name":"Q{}tempo","bSlot":"1","role":"select","line":"33"}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nGroove "}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"34","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"gVarRef","sType":"* ","name":"Q{}groove","bSlot":"2","role":"select","line":"34"}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nMidiMark Groove:"}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"35","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"gVarRef","sType":"* ","name":"Q{}groove","bSlot":"2","role":"select","line":"35"}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nSet Duration $( round( $_Time * 60000 / $_Tempo ) )\n "}]},{"N":"let","var":"Q{}chordSeq","slot":"0","sType":"* ","line":"38","C":[{"N":"fn","name":"tokenize","sType":"*AS","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"38","C":[{"N":"treat","as":"AS","diag":"0|0||fn:tokenize","C":[{"N":"check","card":"?","diag":"0|0||fn:tokenize","C":[{"N":"cvUntyped","to":"AS","diag":"0|0||fn:tokenize","C":[{"N":"check","card":"?","diag":"0|0||fn:tokenize","C":[{"N":"data","diag":"0|0||fn:tokenize","C":[{"N":"gVarRef","name":"Q{}chords","bSlot":"3"}]}]}]}]}]},{"N":"str","val":"\\s*,\\s*"}]},{"N":"callT","bSlot":"4","sType":"* ","name":"Q{}measure","line":"39","C":[{"N":"withParam","name":"Q{}i","slot":"0","sType":"1ADI","C":[{"N":"int","val":"0","sType":"1ADI","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"40"}]},{"N":"withParam","name":"Q{}count","slot":"0","sType":"* ","C":[{"N":"gVarRef","name":"Q{}count","bSlot":"5","sType":"* ","role":"select","line":"41"}]},{"N":"withParam","name":"Q{}chordSeq","slot":"0","sType":"*","C":[{"N":"varRef","name":"Q{}chordSeq","slot":"0","sType":"*","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"42"}]}]}]}]}]}]},{"N":"co","id":"1","uniform":"true","binds":"1","C":[{"N":"template","flags":"os","module":"groove.xsl","slots":"200","name":"Q{}measure","line":"46","expand-text":"false","sType":"* ","C":[{"N":"sequence","role":"body","sType":"* ","C":[{"N":"param","name":"Q{}i","slot":"0","sType":"* ","as":"* ","flags":"","line":"47","C":[{"N":"str","sType":"1AS ","val":"","role":"select"},{"N":"supplied","role":"conversion","slot":"0","sType":"* "}]},{"N":"param","name":"Q{}count","slot":"1","sType":"* ","as":"* ","flags":"","line":"48","C":[{"N":"str","sType":"1AS ","val":"","role":"select"},{"N":"supplied","role":"conversion","slot":"1","sType":"* "}]},{"N":"param","name":"Q{}chordSeq","slot":"2","sType":"* ","as":"* ","flags":"","line":"49","C":[{"N":"str","sType":"1AS ","val":"","role":"select"},{"N":"supplied","role":"conversion","slot":"2","sType":"* "}]},{"N":"choose","sType":"* ","line":"50","C":[{"N":"gc","op":"<","comp":"GAC|http://www.w3.org/2005/xpath-functions/collation/codepoint","card":"1:1","sType":"1AB","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","line":"50","C":[{"N":"data","diag":"1|0||gc","C":[{"N":"varRef","name":"Q{}i","slot":"0"}]},{"N":"data","diag":"1|1||gc","C":[{"N":"varRef","name":"Q{}count","slot":"1"}]}]},{"N":"sequence","sType":"* ","C":[{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":"\nMidiMark 0 Measure:"}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"52","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"varRef","sType":"*","name":"Q{}i","slot":"0","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"52"}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"valueOf","sType":"1NT ","C":[{"N":"str","sType":"1AS ","val":": $Duration\n"}]},{"N":"valueOf","flags":"l","sType":"1NT ","line":"53","C":[{"N":"fn","name":"string-join","role":"select","C":[{"N":"forEach","sType":"*AS ","C":[{"N":"data","sType":"*A ","C":[{"N":"mergeAdj","C":[{"N":"filter","sType":"*","flags":"p","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"53","C":[{"N":"varRef","name":"Q{}chordSeq","slot":"2"},{"N":"arith","op":"+","calc":"a+a","C":[{"N":"int","val":"1"},{"N":"arith","op":"mod","calc":"a%a","C":[{"N":"check","card":"?","diag":"1|0||arith","C":[{"N":"data","diag":"1|0||arith","C":[{"N":"varRef","name":"Q{}i","slot":"0"}]}]},{"N":"fn","name":"count","C":[{"N":"varRef","name":"Q{}chordSeq","slot":"2"}]}]}]}]}]}]},{"N":"fn","name":"string","sType":"1AS ","C":[{"N":"dot"}]}]},{"N":"str","sType":"1AS ","val":" "}]}]},{"N":"callT","bSlot":"0","sType":"* ","name":"Q{}measure","line":"54","C":[{"N":"withParam","name":"Q{}i","slot":"0","sType":"?A","C":[{"N":"arith","op":"+","calc":"a+a","sType":"?A","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"55","C":[{"N":"check","card":"?","diag":"1|0||arith","C":[{"N":"data","diag":"1|0||arith","C":[{"N":"varRef","name":"Q{}i","slot":"0"}]}]},{"N":"int","val":"1"}]}]},{"N":"withParam","name":"Q{}count","slot":"1","sType":"*","C":[{"N":"varRef","name":"Q{}count","slot":"1","sType":"*","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"56"}]},{"N":"withParam","name":"Q{}chordSeq","slot":"2","sType":"*","C":[{"N":"varRef","name":"Q{}chordSeq","slot":"2","sType":"*","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"57"}]}]}]},{"N":"true"},{"N":"empty","sType":"0 "}]}]}]}]},{"N":"co","binds":"","id":"2","vis":"PUBLIC","ex:uniform":"true","C":[{"N":"globalParam","name":"Q{}groove","sType":"* ","slots":"200","module":"groove.xsl","flags":"r","as":"","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"str","sType":"1AS ","val":"","role":"select"}]}]},{"N":"co","binds":"","id":"3","vis":"PUBLIC","ex:uniform":"true","C":[{"N":"globalParam","name":"Q{}chords","sType":"* ","slots":"200","module":"groove.xsl","as":"","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"str","val":"z","sType":"1AS","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"24"}]}]},{"N":"co","binds":"","id":"4","vis":"PUBLIC","ex:uniform":"true","C":[{"N":"globalParam","name":"Q{}tempo","sType":"* ","slots":"200","module":"groove.xsl","as":"","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"int","val":"120","sType":"1ADI","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"25"}]}]},{"N":"co","binds":"","id":"5","vis":"PUBLIC","ex:uniform":"true","C":[{"N":"globalParam","name":"Q{}count","sType":"* ","slots":"200","module":"groove.xsl","as":"","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"int","val":"4","sType":"1ADI","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"26"}]}]},{"N":"co","binds":"","id":"6","vis":"PUBLIC","ex:uniform":"true","C":[{"N":"globalParam","name":"Q{}keysig","sType":"* ","slots":"200","module":"groove.xsl","as":"","ns":"xml=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~","C":[{"N":"str","val":"C","sType":"1AS","ns":"= xml=~ fn=~ xsl=~ xs=~ mma=http://www.mellowood.ca/mma musicxml=http://www.w3.org/2021/06/musicxml40 map=~ array=~ ","role":"select","line":"27"}]}]},{"N":"co","binds":"","id":"7","C":[{"N":"mode","onNo":"TC","flags":"","patternSlots":"0","prec":""}]},{"N":"overridden"},{"N":"output","C":[{"N":"property","name":"Q{http://saxon.sf.net/}stylesheet-version","value":"30"},{"N":"property","name":"method","value":"text"},{"N":"property","name":"media-type","value":"text/plain"},{"N":"property","name":"omit-xml-declaration","value":"yes"}]},{"N":"decimalFormat"}],"Σ":"d33985c9"} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
Generate a Musical MIDI Accompaniment (MMA) script for a given groove. | ||
--> | ||
|
||
<xsl:stylesheet | ||
version="3.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:mma="http://www.mellowood.ca/mma" | ||
xmlns:musicxml="http://www.w3.org/2021/06/musicxml40" | ||
xmlns:map="http://www.w3.org/2005/xpath-functions/map" | ||
xmlns:array="http://www.w3.org/2005/xpath-functions/array" | ||
exclude-result-prefixes="#all" | ||
> | ||
|
||
<xsl:output method="text" media-type="text/plain" omit-xml-declaration="yes"/> | ||
|
||
<!-- | ||
User-defined arguments. | ||
--> | ||
<xsl:param name="groove" required="yes"/> | ||
<xsl:param name="chords" select="'z'"/> | ||
<xsl:param name="tempo" select="120"/> | ||
<xsl:param name="count" select="4"/> | ||
<xsl:param name="keysig" select="'C'"/> | ||
|
||
<xsl:template name="groove"> | ||
<xsl:text> | ||
MidiText Generated by github.com/infojunkie/musicxml-midi | ||
KeySig </xsl:text><xsl:value-of select="$keysig"/><xsl:text> | ||
Tempo </xsl:text><xsl:value-of select="$tempo"/><xsl:text> | ||
Groove </xsl:text><xsl:value-of select="$groove"/><xsl:text> | ||
MidiMark Groove:</xsl:text><xsl:value-of select="$groove"/><xsl:text> | ||
Set Duration $( round( $_Time * 60000 / $_Tempo ) ) | ||
</xsl:text> | ||
<xsl:variable name="chordSeq" select="fn:tokenize($chords, '\s*,\s*')"/> | ||
<xsl:call-template name="measure"> | ||
<xsl:with-param name="i" select="0"/> | ||
<xsl:with-param name="count" select="$count"/> | ||
<xsl:with-param name="chordSeq" select="$chordSeq"/> | ||
</xsl:call-template> | ||
</xsl:template> | ||
|
||
<xsl:template name="measure"> | ||
<xsl:param name="i"/> | ||
<xsl:param name="count"/> | ||
<xsl:param name="chordSeq"/> | ||
<xsl:if test="$i < $count"> | ||
<xsl:text> | ||
MidiMark 0 Measure:</xsl:text><xsl:value-of select="$i"/><xsl:text>: $Duration | ||
</xsl:text><xsl:value-of select="$chordSeq[1 + ($i mod count($chordSeq))]"/> | ||
<xsl:call-template name="measure"> | ||
<xsl:with-param name="i" select="$i+1"/> | ||
<xsl:with-param name="count" select="$count"/> | ||
<xsl:with-param name="chordSeq" select="$chordSeq"/> | ||
</xsl:call-template> | ||
</xsl:if> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.