Skip to content

Instantly share code, notes, and snippets.

@pixelpusher
Last active February 10, 2017 11:52
Show Gist options
  • Save pixelpusher/d7c2da2320f9ec7a9fd9e01ae98f70cb to your computer and use it in GitHub Desktop.
Save pixelpusher/d7c2da2320f9ec7a9fd9e01ae98f70cb to your computer and use it in GitHub Desktop.
let p5osc = Shape {
params = [ S "imgMode" Nothing, -- mirror, left, right, none
S "colorMode" Nothing, -- invert, firey, cool
F "brightness" (Just 1.0),
S "storm" Nothing, -- big, small, tiny, etc...
S "gsmode" Nothing --gray scott diffusion modes
],
cpsStamp = False,
C.latency = 0
}
p5oscSlang = OscSlang {
path = "/tc",
timestamp = NoStamp,
namedParams = False,
preamble = []
}
p5oscStream = do
s <- makeConnection "127.0.0.1" 12000 p5oscSlang
stream (Backend s $ (\_ _ _ -> return ())) p5osc
imgMode = makeS p5osc "imgMode"
colorMode = makeS p5osc "colorMode"
brightness = makeF p5osc "brightness"
storm = makeS p5osc "storm"
gsmode = makeS p5osc "gsmode"
-- start stream
p1 <- p5oscStream
--try this with gsMode as "", it doesn't appear to send
-- then set it to any string like "stuff" and it should
p1 $
every 4 ((#storm "big") . (# colorMode "invert") . slow 8) $
brightness (slow 4 $ scale 0 1 $ sine1)
# imgMode "[left right]/4"
# storm "none"
# colorMode "cool"
# gsf "0.1"
# gsk "0.2"
# gsmode ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment