piano: o5 c4 c+ d d+ e f f+ g g+ a a+ b > c
By playing that piece of code in Alda, a DSL, you can hear the fifth octave on a piano.
To play the first four measures of Ode to Joy by Beethoven in Alda:
piano: o4 f4 f g a | a g f e | d d e f | f4. e8 e2
Here’s what it means, broken down.
The first section states the instrument. I could change it to violin, flute or any other instrument.
piano:
Next is the octave, which in this case is the fourth.
o4
f4 is the note and its duration—4 means a quarter note.
f4
Then, there are the other notes, along with separating pipe symbols to represent measures. They’re ignored by the program but make the code easier to understand.
Finally, that brings us to f4., which is a dotted note. For those who don’t know what dotted notes are, they’re 3/2 of the original note.
f4.
That’s not all, though. You can also add variables.
Example:
volone = (vol 25)
voltwo = (vol 50)
volthree = (vol 100)
notes = c2/e/g
piano:
volone notes
voltwo notes
volthree notes
This code would play the C Major chord at three different volumes — 25, 50, and 100.
You can download Alda and find the tutorial at alda.io.
(/\*>*)/\