Closed tap closed 9 years ago
Or the new type could be called GainValue, which might make more sense...
Bailing on this initiative.
The following code won't work because you can't pass a negative number into the literal code, e.g.
my_gain.gain = -12_db; // should assign roughly 0.25
Instead it strips the negative sign. What you can do is create a class then assign, then do the unary- operator overload, but by then we've already done the assignment the wrong way.
As an additional point of punishment it then makes accessing parameters of a GainValue class more complicated because you have a couple of classes to hop through when trying to fetch the linear value e.g. in the process method.
Not sure what to call this type since Gain is used already for a Ugen -- or maybe the Gain Ugen can be renamed something else like Scale or Fader or something?