Welcome to my MCMusicBook Plugin for Spigot. It's an easy way to write music from Note Blocks into only one book and play it.
It's my first try for a Domain Specific Language with an Lazy Parser( so it only Evaluates when it has to).
Tutorial:
hrp f
wait 300
gui #G
WARNING: \ If there is something it is unable to parse the Program stops. There are also NO Comments
Explanation:
It is possible to play a Sound with "instrument note" for example:
hrp f //Plays with a Harp f
gui #G //Plays with a Guitar #G
A List with all possibles instruments is down below.
You can wait between two different Sounds with "wait"
wait 314 //Waits 314 Milliseconds
The Uppercase Letters for Notes are one octave Higher than the lower ones:
hrp g
wait 400
hrp G //one ocatve higher
If you want to play more than one note simultaneously you can specify more than one Note with "< Notes >" :
<hrp g hrp f> //Plays g and f on a harp
You can avoid writing something multiple times with the "def" keyword:
def w wait 500
hrp g
w //Waits 500 Millis
hrp g
Grammar:
start ::= instruction*
instruction ::= instrument sharp? note
| '<' sound* '>'
| 'wait' digit
| 'def' identifier instruction
| identifier
identifier ::= [a-zA-Z]+
sound ::= instrument sharp? note
instrument:
bass guitar bsg
bass drum bsd
snare sna
hat hat
bell bel
flute flu
chime chi
guitar gui
xylophone xyl
iron_xylophone ixy
cow_bell cbl
didgeridoo ddg
bit bit
banjo bnj
pling plg
harp hrp
note:
a b c d e f g A B C D E F G
Sharp:
Úse a # before the Note