a music composition language

FARM 2016 (Nara, Japan)

 

https://github.com/alda-lang/alda

Dave Yarwood • @dave_yarwood

First, some background.

(that's me!)

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>HTML</title>
</head>
<body>
  <div class="sort-of-important">
    <p>I'm a paragraph!</p>
  </div>
</body>
</html>
(defun fibonacci (N)
  "Compute the N'th Fibonacci number."
  (if (or (zerop N) (= N 1))
    1
    (+ (fibonacci (- N 1)) (fibonacci (- N 2)))))

abc

 X:1
 T:The Legacy Jig
 M:6/8
 L:1/8
 R:jig
 K:G
 GFG BAB | gfg gab | GFG BAB | d2A AFD |
 GFG BAB | gfg gab | age edB |1 dBA AFD :|2 dBA ABd |:
 efe edB | dBA ABd | efe edB | gdB ABd |
 efe edB | d2d def | gfe edB |1 dBA ABd :|2 dBA AFD |]
\score {
  \new Staff {
    \key d \major
    \numericTimeSignature
    \time 2/4
    <cs' d'' b''>16 <cs' d'' b''>8.
    ~
    <cs' d'' b''>8 [ <b d'' a''> ]
  }
}

LilyPond

#timebase 480
#title "The M.GAKKOU KOUKA"
#copyright "Music Composed by Kenkichi Motoi 2009 Wikimedia version 2012"
A t160
A o3l4 V12
A @1 ed8ce8 gg8er8 aa8>c<a8 g2r
A aa8ga8 >cc8d<r8 ee8de8 c2r
A dd8dd8 dd8dr8 ed8ef8 g2r
A aa8ga8 >cc8<ar8 >dc8de8 d2<r
A >ee8dc8< ab8>cc8< gg8ea8 g2r
A >cc8<ge8 cd8ea8 gg8de8 c2r

Music Macro Language (MML)

Clojure

(defn fibonacci
  "Compute the nth Fibonacci number."
  [n]
  (if (or (zero? n) (= n 1))
    1
    (apply + (map fibonacci [(- n 1) (- n 2)]))))
(let [counter (atom 0)]
   (dotimes [_ 10]
     (future (swap! counter inc)))
   (Thread/sleep 500)
   @counter)
(import '[javax.sound.midi MidiSystem])

(let [synth   (doto (MidiSystem/getSynthesizer) .open)
      channel (aget (.getChannels synth) 0)]
   (doseq [note [36 38 40 41 43 45 47 48]]
     (.noteOn channel note 127)
     (Thread/sleep 300)
     (.noteOff channel note)))

clojure.org

Let the demo begin!

Try it for yourself!

https://github.com/alda-lang/alda

alda: a music composition language

By Dave Yarwood

alda: a music composition language

  • 1,167