ofxPDSP icon indicating copy to clipboard operation
ofxPDSP copied to clipboard

pdsp::Switch. simple example needed for testing

Open steeley opened this issue 1 year ago • 3 comments

I've looked at the documentation but I cannot understand how 'switch' works. There appears to be no method for setting a switch to a particular "position".

steeley avatar Aug 10 '22 17:08 steeley

pdsp::Switch takes multiple inputs (patched to the input( int i ) method and outputs just one of the signals.

there is not a method to switch input, which input is selected is decided by the values going to the in_select() input port, you can also just send float values to it with the >> operator

npisanti avatar Aug 11 '22 17:08 npisanti

ok so its not really a proper switch then, more a weird multiplexer. :( So what is the correct way to switch a signal on and off? guess I could use an Amp with 0.0 and 1.0 maybe?

steeley avatar Aug 11 '22 19:08 steeley

yes, using an amp and putting 0.0f / 1.0f into in_mod() is the correct way to switch a signal off, when the in_mod() of pdsp::Amp goes to zero all the signal patched into the in_signal() are not processed

npisanti avatar Aug 21 '22 16:08 npisanti