Midi Ditty Notation
Midi Ditty Bot uses a compact notation to serve you tiny songs. Midi Ditty Notation (MDN) is not infinitely expressive, nor particularly readable - it is intended for the digestion of simple tunes by the bot.
A MDN tune consists of a series of notes separated by spaces – nothing more. Each note has a pitch and a duration. Pitches lie in a two-octave range, from middle C up. The first octave is lowercase (c, d, e, … b) and the second octave is uppercase (C, D, E, … B). Chromaticism is applied with a lowercase “s” for “sharp.” Rests are indicated by “r.”
A note’s duration is a number 0, 1, 2, or 3. 0s are eighth notes at 120bpm., 1s are quarters, 2s halfs, and 3s wholes. A dot (”.”) adds half of the note duration. Multiple dots are not supported; nor are ties.
New: you can specify sixteenth notes with “/”
The following are examples of properly formatted notes:
- cs0 (low C-sharp eighth note)
- Cs3. (high C-sharp dotted whole note)
- r0 (eighth note rest)
- D1. (high D dotted quarter note)
- Bs2 (high B-sharp half note)
The following is an example of a valid request to Midi Ditty Bot:
@mididittyBOT "c1 g1 C1. b0 as0 g0 e0 cs0 d1 g1 c1 r1 c2"
Invalid requests will make Midi Ditty Bot whine at you. There are also an occasional few false negatives that I haven’t been able to figure out.
Midi Ditty Bot runs on a little web API I cooked up in Mathematica Glitch (bot and API). Give it a query with “/update?tune=[your ditty].“