hsc3-0.21: Haskell SuperCollider
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Sc3.Ugen.Event

Description

Continous controller event and Ctl systems for external control interfaces.

Synopsis

Cc Event

type CcEvent t = (Int, t, t, t, t, t, t, t, t, t, t) Source #

(v, w, x, y, z, o, rx, ry, p, px, _)

v = voice, w = gate, z = force/pressure, o = orientation/angle, r = radius, p = pitch

cc_event_from_list :: Num t => Int -> [t] -> CcEvent t Source #

Translate list to Event.

type CcEventMeta t = (t, t, t) Source #

(ccEventAddr, ccEventIncr, ccEventZero)

ccEventAddr = k0 = index of control bus zero for event system, ccEventIncr = stp = voice index increment, ccEventZero = c0 = offset for event voices at current server

ccEventAddr :: (Ugen, Ugen, Ugen) -> Int -> CcEvent Ugen Source #

c = event number (zero indexed)

ccEventVoicerAddr :: CcEventMeta Ugen -> Int -> (CcEvent Ugen -> Ugen) -> Ugen Source #

c0 = index of voice (channel) zero for event set, n = number of voices (channels)

ccEventVoicer :: Int -> (CcEvent Ugen -> Ugen) -> Ugen Source #

eventVoicerAddr with default (addr, inct, zero).

voicer :: Int -> (CcEvent Ugen -> Ugen) -> Ugen Source #

Synonym for ccEventVoicer.

ccEventVoicerParam :: Int -> (CcEvent Ugen -> Ugen) -> Ugen Source #

eventVoicerAddr with control inputs for eventAddr, eventIncr and eventZero.

ccEventGateReset :: Ugen -> Ugen -> (Ugen, Ugen) Source #

Given w|g and p fields of an CcEvent derive a gateReset from g and a trigger derived from monitoring w|g and p for changed values.

Ctl

type Ctl8 = (Ugen, Ugen, Ugen, Ugen, Ugen, Ugen, Ugen, Ugen) Source #

Sequence of 8 continous controller inputs in range (0-1).

ctl8At :: Int -> Ctl8 Source #

k0 = index of control bus zero

ctl8Voicer :: Int -> (Int -> Ctl8 -> Ugen) -> Ugen Source #

ctlVoicerAddr with control inputs for CtlAddr and CtlZero.

type Ctl16 = (Ctl8, Ctl8) Source #

Sequence of 16 continous controller inputs arranged as two Ctl8 sequences.

ctl16Voicer :: Int -> (Int -> Ctl16 -> Ugen) -> Ugen Source #

ctl16VoicerAddr with control inputs for CtlAddr and CtlZero.

Names

type ControlSpec t = (String, t, (t, t, String)) Source #

Control Specificier. (name,default,(minValue,maxValue,warpName))

control_spec_parse :: String -> ControlSpec Double Source #

Comma separated, no spaces.

control_spec_seq_parse :: String -> [ControlSpec Double] Source #

Semicolon separated, no spaces.

>>> control_spec_seq_parse "freq:220,110,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin"
[("freq",220.0,(110.0,440.0,"exp")),("amp",0.1,(0.0,1.0,"amp")),("pan",0.0,(-1.0,1.0,"lin"))]

control_spec_print :: ControlSpec Double -> String Source #

Comma separated, 6 decimal places, no spaces.

control_spec_seq_print :: [ControlSpec Double] -> String Source #

Semicolon separated, no spaces.

>>> control_spec_seq_print (control_spec_seq_parse "freq:220,220,440,exp;amp:0.1,0,1,amp;pan:0,-1,1,lin")
"freq:220.0,220.0,440.0,exp;amp:0.1,0.0,1.0,amp;pan:0.0,-1.0,1.0,lin"

sc3_control_spec :: Fractional t => [ControlSpec t] Source #

See SCClassLibraryCommonControl/Spec:ControlSpec.initClass

"ControlSpec defines the range and curve of a control"

This list adds default values.

kyma_event_value_ranges :: Fractional t => [ControlSpec t] Source #

See Kyma X Revealed, p.403

"The following EventValue names are associated with initial ranges other than (0,1). EventValue names are not case-sensitive."

This list adds curve specifiers as strings and default values.

>>> Data.List.intersect (map control_spec_name sc3_control_spec) (map control_spec_name kyma_event_value_ranges)
["beats","boostcut","freq","rate"]
>>> let f i = filter ((== i) . control_spec_name)
>>> let c (p,q) = (f p sc3_control_spec, f q kyma_event_value_ranges)
>>> c ("lofreq","freqlow")
([("lofreq",20.0,(0.1,100.0,"exp"))],[("freqlow",120.0,(0.0,1000.0,"exp"))])
>>> c ("midfreq","freqmid")
([("midfreq",440.0,(25.0,4200.0,"exp"))],[("freqmid",1200.0,(1000.0,8000.0,"exp"))])
>>> find ((==) "freqhigh" . control_spec_name) kyma_event_value_ranges
Just ("freqhigh",12000.0,(8000.0,24000.0,"exp"))