Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdsp::Switch. simple example needed for testing #75

Open
steeley opened this issue Aug 10, 2022 · 3 comments
Open

pdsp::Switch. simple example needed for testing #75

steeley opened this issue Aug 10, 2022 · 3 comments

Comments

@steeley
Copy link

steeley commented Aug 10, 2022

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".

@npisanti
Copy link
Owner

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

@steeley
Copy link
Author

steeley commented Aug 11, 2022

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?

@npisanti
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants