This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Manifest: | |
def __init__(self, **kw): | |
for k in kw: | |
setattr(self, k, kw[k]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m_Configuration = Manifest( | |
FULL_CANVAS = False, | |
DO_VORONOI = True, | |
TREE_DEPTH = 5, | |
FIELD_TIMER_INTERVAL = 0.033, | |
ASSETS_DIR = "/Users/nick/CASSIEL/FIELDWORKSPACE/" | |
) | |
m_Nested = Manifest( | |
A = Manifest(B = 6, C = "Hello"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns maxmsp-clojure-stopwatch.core | |
(:gen-class | |
:name clojure.Stopwatch | |
:prefix max- | |
:extends com.cycling74.max.MaxObject | |
:state lastsample | |
:init init) | |
(:import (com.cycling74.max Atom))) | |
(defn max-init [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; OSC listener. We use an agent containing a vector of encoder states. | |
(ns monome.listener | |
(:import (monome.types EncoderState)) | |
(:refer monome.types :only [initial-arc-state do-button do-delta])) | |
;; (Using :refer because we're still manually loading files.) | |
(defn interpret [m state] | |
"Interpret an OSC message, apply to an arc state." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns monome.display | |
(:refer monome.listener :only [a])) | |
(def my-block (.fill (net.loadbang.shado.Block. 64 4) (net.loadbang.shado.types.LampState. 0.05 0.0))) | |
(def mini-block (doto (net.loadbang.shado.Block. 4 4) (.fill net.loadbang.shado.types.LampState/ON))) | |
(def renderer (net.loadbang.shado.VariableRenderer. | |
64 4 | |
(net.loadbang.shado.ArcVariableOSCOutputter. "localhost" 10332 "/example"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; shado for the monome 64. | |
(def all-on (.fill (net.loadbang.shado.Block. 8 8) net.loadbang.shado.types.LampState/ON)) | |
(def all-off (net.loadbang.shado.Frame.)) | |
(def renderer (net.loadbang.shado.BinaryRenderer. | |
8 8 | |
(net.loadbang.shado.SerialOSCBinaryOutputter. "localhost" 16543 8 "/shado"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Our legacy Java OSC library: | |
(def transmitter (net.loadbang.osc.comms.UDPTransmitter. (java.net.InetAddress/getByName "localhost") 10332)) | |
; Seriously non-idiomatic code. I'm only 20% of the way through the Joy of Clojure book... | |
(defn xmit [enc buffer] | |
"Transmit to encoder number enc, buffer is a sequence of integers." | |
(let [m (doto (net.loadbang.osc.data.Message. "/example/ring/map") (.addInteger enc))] | |
(doseq [n buffer] (.addInteger m n)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OSC-level testing. | |
# $Id: arc-test-0.py,v 7e921a75f124 2011/04/07 16:26:54 nick $ | |
from net.loadbang.osc.comms import UDPTransmitter | |
from net.loadbang.osc.data import Message | |
from java.net import InetAddress | |
from java.lang import System | |
RINGSIZE = 64 | |
LEVELS = 16 |
NewerOlder