Composers reuse melodic material across different instruments. I would like
to do that in Vivid. I would keep a sequence of values and send it
sometimes to one parameter of one synth, sometimes to a different parameter
of a different synth.
To do that I would have to coerce those numbers to values of type `I a`,
where the string `a` is known only at runtime. I tried to write a function
to do that:
import GHC.TypeLits
toIOf :: (Real n, GHC.TypeLits.KnownSymbol a) => String -> n -> I a
toIOf "freq" n = toI n :: I "freq"
toIOf "amp" n = toI n :: I "amp"
but it won't compile, because the outputs of `toIOf "freq"` and `toIOf
"amp"` have different types.
Is this possible?
--
Jeff Brown | Jeffrey Benjamin Brown
Website <https://msu.edu/~brown202/> | Facebook
<https://www.facebook.com/mejeff.younotjeff> | LinkedIn
<https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss
messages here) | Github <https://github.com/jeffreybenjaminbrown>
_______________________________________________
Livecode mailing list -- livecode_at_we.lurk.org
To unsubscribe send an email to livecode-leave_at_we.lurk.org
Received on Wed Jul 04 2018 - 12:30:49 BST