Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
newtype Synth (args :: [Symbol]) Source #
This enforces type safety of the arguments -- e.g. if you have a synthdef
> let x = sd (3 ::I "foo") bar > s <- synth x ()
Then this won't typecheck (because "bar" isn't an argument to x):
> set s (4 ::I "bar")
Note that if you don't want this type safety, you can e.g.
> Synth n <- synth foo () > setG n (0.1 ::I "vol")
Or:
> ns <- mapM (flip synth ()) [foo, bar, baz] > map (setG (0::I "asdf") . unSynth) ns
Or:
> n <- synthG foo ()
(You also may want to look at shrinkSynthArgs
if you want to construct a list
which has synthdefs or nodes of different types)
Instances
Eq (Synth args) Source # | |
Ord (Synth args) Source # | |
Read (Synth args) Source # | |
Show (Synth args) Source # | |
SynthOrNodeId (Synth x) Source # | |
Defined in Vivid.SCServer.Types | |
IsNode (Synth a) Source # | |
shrinkSynthArgs :: Subset new old => Synth old -> Synth new Source #
So let's say you have a node:
foo :: Synth '["amp", "freq", "phase"]
and you want to add it to a list of nodes:
ns :: [Synth '["freq", "phase"]]
If you don't plan on setting the "amp" argument, you can "shrink" to the compatible arguments:
ns' = shrinkSynthArgs foo : ns
(The same thing exists for SynthDefs -- shrinkSDArgs
)
class IsNode a => SynthOrNodeId a Source #
For gradually-typed free
Instances
SynthOrNodeId NodeId Source # | |
Defined in Vivid.SCServer.Types | |
SynthOrNodeId (Synth x) Source # | |
Defined in Vivid.SCServer.Types |