Skip to content

Instantly share code, notes, and snippets.

@devn
Created September 4, 2015 23:47
Show Gist options
  • Select an option

  • Save devn/691aa4f98912ea144468 to your computer and use it in GitHub Desktop.

Select an option

Save devn/691aa4f98912ea144468 to your computer and use it in GitHub Desktop.

Revisions

  1. devn created this gist Sep 4, 2015.
    27 changes: 27 additions & 0 deletions midijam.clj
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    ;; http://notahat.com/midi_patchbay/
    ;; Create a virtual input and virtual output in MIDI patchbay
    ;; input name: "Overtone"
    ;; output name: "yourchoice"

    ;; In Reason, Ableton, etc. select "yourchoice"
    ;; as the midi input for a channel.

    (ns jam.core
    (:use [overtone.live]))

    (def device-name "Overtone")

    (def midi-out
    (->> (midi-connected-receivers)
    (filter #(= device-name (:name %)))
    (first)))

    (defn play-mary-had-a-little-lamb! []
    (doseq [note [68 66 64 66 68 68 68
    66 66 66 68 71 71
    68 66 64 66 68 68 68
    66 66 68 66 64]]
    (midi-note midi-out note 127 500)
    (Thread/sleep 500)))

    (play-mary-had-a-little-lamb!)