Playing Gorilla.bas tune on NuttX

Now that I submitted the Audio Tone Generator to NuttX mainline I decided to search for some audio tunes to play. Then I searched for the Gorilla.bas game (I used to play this game in a 386 PC when I was child).

I found its source code here:

Looking the source code I found the tune and copy it on NuttX shell:

nsh> echo "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b" > /dev/tone0
nsh> echo "o2l16e-9n0e-d-d-n0e-n0e-n0e-d-d-d-n0e-9n0e-d-d-n0e-" > /dev/tone0
nsh> echo "o2l16g-9n0g-een0g-n0g-n0g-eeen0g-9n0g-een0g-" > /dev/tone0
nsh> echo "o2l16b9n0baan0g-n0g-n0g-eeen0o1b9n0baan0b" > /dev/tone0

These QBasic PLAY commands are a “modern” version of MML (Music Macro Language) :

Very nice! It worked fine.

Update: Ode to Joy:

nsh> echo "L8eefggfedccdeL6eL16dL4d" > /dev/tone0

Update2: Instead of implementing the QBasic Play I could have implemented the RTTTL monophonic format used on old cellphones:
More about RTTTL: