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:
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?