I want to use Overtone
purely for purposes of sending data to midi instruments. Is there a quick way to load Overtone
without SuperCollider
support? I figured out that midi support can be added to a program by using overtone.studio.midi
, but I'm also interested in loading all the helpers that make working with data that represents music easier. Figuring out which files to load and which ones to exclude is a time consuming task, hence the question.
Overtone without SuperCollider
418 Views Asked by t6d AtThere are 2 best solutions below

You can use overtone.core and get at a lot of the studio functionality without actually connecting to the server. You can't definst or defsynth or anything that would trigger any OSC communication to the SC server, but you have full access to Overtone's own OSC facilities. You can make listeners and handlers. You also have access to the MIDI subsystem and the event system.
You should be able to do everything you want to with overtone.core. All of the following code will work without running (connect-external-server) or any of the other related functions:
(ns beatboxchad-live.midi
[:require [overtone.core :refer :all]
[beatboxchad-live.sooperlooper]
]
)
(def fcb (midi-mk-full-device-key (midi-find-connected-device "mio")))
(def overtone-osc (osc-server 9960 "osc-overtone"))
(defn loop-setting [loop-index setting value]
(osc-send engine
(format "/sl/%s/set" loop-index)
setting
value
)
)
(def loop-ops
{0 {:action "record" :hit false}
1 {:action "overdub" :hit false}
2 {:action "trigger" :hit true}
3 {:action "pause" :hit true}
4 {:action "reverse" :hit true}
}
)
(on-event (conj fcb :note-on)
(fn [e]
(let [note (:note e)]
(let [loop-index (int (/ note 10))
cmd (mod note 10)
loop-op (if (:hit (get loop-ops cmd))
"hit"
"down")
]
(beatboxchad-live.sooperlooper/loop-op
loop-index
(:action (get loop-ops cmd))
loop-op
)
)
)
)
::fcb-note-on
)
(on-event (conj fcb :note-off)
(fn [e]
(let [note (:note e)]
(let [loop-index (int (/ note 10))
cmd (mod note 10)
]
(if-not (:hit (get loop-ops cmd))
(beatboxchad-live.sooperlooper/loop-op
loop-index
(:action (get loop-ops cmd))
"up"
)
)
)
)
)
::fcb-note-off
)
This code controls Sooperlooper over OSC based on MIDI from my Behringer FCB1010. It's super simple to send MIDI events out to a device, too. See: https://github.com/overtone/overtone/wiki/MIDI#sending-midi-messages
Nope, all of Overtone is relied upon Supercollider, you could do some hacks but it will be a very painful one. I would recommend checking out Pink from Steven Yi, he has implemented java sound with Clojure where you can connect clojure to midi devices trough javasound.
https://github.com/kunstmusik/pink