packages feed

tidal-0.1: Datadirt.lhs

> module Datadirt where

> import Stream
> import Pattern
> import Control.Applicative

Define the OSC message.  Each datum has:
 
o An OSC type: S (string), F(float) or I (int)
o A unique name
o And a default value, prefixed by "Just" or if there is no default,
  "Nothing".

> datadirt :: OscShape
> datadirt = OscShape {path = "/trigger",
>                      params = [ S "sound" Nothing,
>                                 F "speed" (Just 1),
>                                 F "shape" (Just 0),
>                                 F "pan" (Just 0),
>                                 F "panTo" (Just 0),
>                                 F "volume" (Just 1),
>                                 S "envName" (Just "none"),
>                                 F "anafeelS" (Just 0),
>                                 F "anafeelF" (Just 0),
>                                 F "accellerate" (Just 0),
>                                 S "vowel" (Just ""),
>                                 S "scale" (Just ""),
>                                 F "loops" (Just 1),
>                                 F "duration" (Just 0),
>                                 F "delay" (Just 0),
>                                 F "delay2" (Just 0),
>                                 F "cutoff" (Just 0),
>                                 F "resonance" (Just 0)
>                               ],
>                      timestamp = True
>                     }

Make some methods for setting particular parameters

> sound        = makeS datadirt "sound"
> speed        = makeF datadirt "speed"
> shape        = makeF datadirt "shape"
> pan          = makeF datadirt "pan"
> panTo        = makeF datadirt "panTo"
> volume       = makeF datadirt "volume"
> envName      = makeS datadirt "envName"
> anafeelS     = makeF datadirt "anafeelS"
> anafeelF     = makeF datadirt "anafeelF"
> accellerate  = makeF datadirt "accellerate"
> vowel        = makeS datadirt "vowel"
> scaleName    = makeS datadirt "scaleName"
> loops        = makeF datadirt "loops"
> duration     = makeF datadirt "duration"
> delay        = makeF datadirt "delay"
> delay2       = makeF datadirt "delay2"
> cutoff       = makeF datadirt "cutoff"
> resonance    = makeF datadirt "resonance"
> offset       = makeT datadirt

Give the port number and your OscShape, and get back an MVar to put
your Osc patterns in.

> datadirtStream client server name = stream client server name "127.0.0.1" 7770 datadirt