#lang music is a project that Michael Gunantra and I did for IU's C424 class. It's a music notation language inspired by MML, but instead of manipulating and concatenating strings, it's a structured language with full support for manipulating notes and bars.
It was done in Racket and outputs MIDI data. The playback routine is still a little buggy but it's a fun prototype to play with nonetheless.
Here's the intro to Sweet Child O' Mine that Michael coded up.
<syntaxhighlight lang="Scheme"> (defseq bass2a
< < d4. > f#4. f#8 g8 > a4 b8 a8 < g8 f#8 d8 < r32 c32 e32 g32 c2 > g2 > d8 c4 d4. c8 < < r32 g32 > b32 d32 < g2. > r8 r32 g32 > b32 d32 g)
< < f#2. r4 r d2 r2 r > b2. r4 > b )
< a2. r4 r g2 r2 r > d2. r4 > d < )
< < d d > >)
< a a >)
< d d >)
"sweet.mid" (play (together (with-voice electric-guitar-clean (seq (loop 8 lead1) (loop 2 lead2) (loop 2 lead3) (loop 2 lead4) (loop 2 lead2))) (with-voice electric-bass-finger bass1) (loop 0 (with-voice side-stick (drumseq lead1))) ) (together (seq (loop 2 lead2) (loop 2 lead3) (loop 2 lead4) lead5) (seq bass2a bass3a) (seq bass2b bass3b) (seq bass2c bass3c) )))