Compilers · FIB-UPC

JSBach Interpreter

Write music with code. JSBach is a custom programming language where you can define procedures, use variables, loops, and conditionals — and play musical notes. Try the examples or write your own!

<:> C4 play a note   <!> "text" print   x <- 5 assign   |: ... :| block

Examples

Code Editor

About this project

Originally built with ANTLR4 and Python for a compilers course at FIB-UPC. The language supports procedures, recursion, arithmetic, lists, conditionals, loops, and musical note playback. This browser version uses a hand-written parser and the Web Audio API for sound synthesis.