mercury-lang
Version:
Parser for the mercury live coding language
261 lines (260 loc) • 5.12 kB
JSON
{
"parseTree": {
"global": {
"randomSeed": [
0
],
"highPass": [
5,
0
],
"lowPass": [
18000,
0
],
"silence": false
},
"variables": {},
"objects": {},
"groups": {
"all": []
},
"print": [],
"display": [],
"comments": [
"// set randomSeed 4839",
"// print random(4 0 12)",
"// print getSeed()",
"// set randomSeed 2940",
"// print random(4 0 12)",
"// print getSeed()",
"// set randomSeed add(getSeed() 100)",
"// print getSeed()",
"// list divs [1/4 1/4.32 3.14/2.18]",
"// list val chromaToRelative([0 2 4])",
"// new input default time(1/8)",
"// list adds +([1 2 3] [10 11 12])",
"// list prg chordsFigured(I IIm V7 VIsus2)",
"// list prg2 chordsFromNames(C Dm G7 Asus2)",
"// list prg2 chordsNamed(C Dm G7 Asus2)",
"// list spr spread(10)",
"// list nspr norm(spr)",
"// list snspr snorm(spr)",
"// list prg2 repeat(makeChords(I IIm V7) [3 4 2])",
"// list inf infinitySeries()",
"// list inf infinitySeries(20)",
"// list inf2 infinitySeries(10 [1 2])",
"// list vals random(4 0 12)",
"// print vals",
"// display [1 2 3]",
"// display 'hello world'",
"// print reverse(vals)",
"// new polySynth saw name(chordSaw) ",
"// display vals",
"// display shuffle(vals)",
"// new sample kick gain(randomFloat(5 0 1))",
"// set all play(clave(8))",
"// set myKick shape(1/8 5/4)",
"// new sample kick name(myKick) time(1/16) play([1 0 1 1 0]) gain(0.3) ",
"// list myList join(coin(8) spread(5) random(5 20 100) choose(4 [100 200 300]))",
"// set volume join(randomFloat(1 0.1 1.5) random(1 50 5000))",
"// print join(coin(8) spread(5) random(5 20 100) choose(4 [100 200 300]))",
"// list a1 [0 1 2 3]"
]
},
"syntaxTree": {
"@main": [
{
"@global": {
"@comment": "// set randomSeed 4839"
}
},
{
"@global": {
"@comment": "// print random(4 0 12)"
}
},
{
"@global": {
"@comment": "// print getSeed()"
}
},
{
"@global": {
"@comment": "// set randomSeed 2940"
}
},
{
"@global": {
"@comment": "// print random(4 0 12)"
}
},
{
"@global": {
"@comment": "// print getSeed()"
}
},
{
"@global": {
"@comment": "// set randomSeed add(getSeed() 100)"
}
},
{
"@global": {
"@comment": "// print getSeed()"
}
},
{
"@global": {
"@comment": "// list divs [1/4 1/4.32 3.14/2.18]"
}
},
{
"@global": {
"@comment": "// list val chromaToRelative([0 2 4])"
}
},
{
"@global": {
"@comment": "// new input default time(1/8)"
}
},
{
"@global": {
"@comment": "// list adds +([1 2 3] [10 11 12])"
}
},
{
"@global": {
"@comment": "// list prg chordsFigured(I IIm V7 VIsus2)"
}
},
{
"@global": {
"@comment": "// list prg2 chordsFromNames(C Dm G7 Asus2)"
}
},
{
"@global": {
"@comment": "// list prg2 chordsNamed(C Dm G7 Asus2)"
}
},
{
"@global": {
"@comment": "// list spr spread(10)"
}
},
{
"@global": {
"@comment": "// list nspr norm(spr)"
}
},
{
"@global": {
"@comment": "// list snspr snorm(spr)"
}
},
{
"@global": {
"@comment": "// list prg2 repeat(makeChords(I IIm V7) [3 4 2])"
}
},
{
"@global": {
"@comment": "// list inf infinitySeries()"
}
},
{
"@global": {
"@comment": "// list inf infinitySeries(20)"
}
},
{
"@global": {
"@comment": "// list inf2 infinitySeries(10 [1 2])"
}
},
{
"@global": {
"@comment": "// list vals random(4 0 12)"
}
},
{
"@global": {
"@comment": "// print vals"
}
},
{
"@global": {
"@comment": "// display [1 2 3]"
}
},
{
"@global": {
"@comment": "// display 'hello world'"
}
},
{
"@global": {
"@comment": "// print reverse(vals)"
}
},
{
"@global": {
"@comment": "// new polySynth saw name(chordSaw) "
}
},
{
"@global": {
"@comment": "// display vals"
}
},
{
"@global": {
"@comment": "// display shuffle(vals)"
}
},
{
"@global": {
"@comment": "// new sample kick gain(randomFloat(5 0 1))"
}
},
{
"@global": {
"@comment": "// set all play(clave(8))"
}
},
{
"@global": {
"@comment": "// set myKick shape(1/8 5/4)"
}
},
{
"@global": {
"@comment": "// new sample kick name(myKick) time(1/16) play([1 0 1 1 0]) gain(0.3) "
}
},
{
"@global": {
"@comment": "// list myList join(coin(8) spread(5) random(5 20 100) choose(4 [100 200 300]))"
}
},
{
"@global": {
"@comment": "// set volume join(randomFloat(1 0.1 1.5) random(1 50 5000))"
}
},
{
"@global": {
"@comment": "// print join(coin(8) spread(5) random(5 20 100) choose(4 [100 200 300]))"
}
},
{
"@global": {
"@comment": "// list a1 [0 1 2 3]"
}
}
]
},
"errors": []
}