VST SDK GUI Switch without¶
- Author or source: ti.oohay@odrasotniuq
- Created: 2004-09-08 12:49:11
In VST GUI an on-vaue is represented by 1.0 and off by 0.0.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Say you have two signals you want to switch between when the user changes a switch. You could do: if(fSwitch == 0.f) //fSwitch is either 0.0 or 1.0 output = input1 else output = input2 However, you can avoid the branch by doing: output = input1 * (1.f - fSwitch) + input2 * fSwitch Which would be like a quick mix. You could make the change clickless by adding a simple one-pole filter: smooth = filter(fSwitch) output = input1 * (1.f - smooth) + input2 * smooth