Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add
signal
node:here, the callback passed to
signal
will be executed each time the input gets positive.In this case, the callback will be called 4 times per second.
The value returned from the callback will be sent to the audio thread to be used as the new value for the signal node.
You can also schedule updates manually, and return nothing / undefined.
The callback gets
time
(this.playPos) andid
(of signal) as arguments.Like the CC ugen, the Signal ugen can be updated via
setControl
.The Signal ugen will send a
SIGNAL_TRIGGER
whenever its input goes from 0 to positive.I've already implemented a simple strudel scheduler using signals, which will follow in another PR.
Signals seem useful for general sequencing operations that should not run at audio rate.
It's also comparable to hydra, where you can pass a function to a node to feed values from the main thread (hydra is fixed to 60fps, whereas kabelsalat signals are triggered based on the input)
Limitation 1: on evaluation, the signals of the old graph stop to work atm.
With longer fadeTimes, this gets audible. There should be a way to improve this in the future.
Limitation 2: on evaluation, all signal values reset. It would be smoother if the current value could somehow be passed aloong. This probably only works if the id stays the same.