This is a part Tidal - part Haskell question. Having some issues wrapping my brain around ControlPatterns.
I can’t seem to find the syntax for recursively mapping an arithmetic function over all of the gain values (or all the values) in a ControlPattern. I’m sure this is pretty basic, but its stumping me.
I do have slightly more complex operations in mind. For example, if I want to invert values normalized between 0 and 1, I could make a simple function:
invert x = 1 - x
and this gives the kind of result I want when applied to a Pattern String, e.g.,
pt = "0.0 0.25 1.0*4"
gain (invert pt)
But what I’m looking for is something that could take advantage of the operations available on ControlPatterns. I’d like to be able to get the same result with
invert (gain pt)
so that I could apply it to more elaborate expressions like