-
Notifications
You must be signed in to change notification settings - Fork 237
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
[switch~] block computation issue #2134
Comments
If you bang a switched off subpatch, you only force DSP computation in that subpatch (and all its subpatches). However, this does not affect DSP computation of the parent patch. AFAICT, it is always(?) a mistake to use single-step DSP in a subpatch that exchanges audio data with an outer canvas. |
Ok, the actual problem is this: if a subpatch is reblocked to a larger blocksize, DSP is triggered every time the inlet~ buffer have been filled. When you send a "bang" to In practice this shouldn't be a problem; it doesn't really make sense to use single-step DSP with signals that come from outside the subpatch, even less so when reblocking. This behavior could be mentioned in the help patch, but it is such an edge case that I'm not sure it's worth it. It might even cause more confusion than it would help to solve. In danger of stating the obvious: you typically wouldn't reblock the subpatch to 4096 to compute 4096 samples; instead you would just bang 64 times in a row (64 * 64 = 4096).
Now here you actually hit a real bug! I have opened dedicated ticket (#2136) as it is only tangentially related to this issue. |
if this is correct I would exploit that and use the "correctly triggered and filled" buffer. this was my initial intention.
I would want DSP to start once inlet~ was filled (as if done it via a [bang~]).
say I want to reverse a bunch of 4096 samples (not a bunch of 64 samples). I would want to use single-step DSP.
but if I want to fill a 4096 array? (see above).
thanks for looking at it. Unneeded explanation: I'm not at home with my computers but essentially I grabbed [tabsend~] code and inserted something I want to do in the |
But then the "bang" message wouldn't be synchronous. Even worse: since you can't know the current phase, you wouldn't even know when DSP has finished.
I'm not sure you would want to use single-step DSP for this task in the first place...
If you want to fill a 4096 point array with a signal from outside the subpatch, just write it to an array with I'm tempted to close this issue as "not a bug". We could document that you can't really use input/output signals from parent canvases in single-step DSP, but for me at least that has always been obvious... @porres What do you think?
I would suggest writing to the Pd list and describing in detail what you want to achieve. People may come up with various solutions. All I can say is: single-step DSP in a reblocked subpatch isn't one of them :)
I might be wrong, but wouldn't that be a simple look-ahead limiter? The idea is to delay the input signal, so you can analyze it ahead of time and then apply precise compression to the delayed signal. |
I'm rather confused. You seem to be saying to me avoid "single-step DSP" but then you tell me to do so:
I know that a bang might be out of sync but it would be nice if we can put it (force it) in sync in a way that we can use it with inlet~. this would allow us to have a We can close this issue anyway if there's nothing more to say :) off-topic and not suitable for the ticket system.
yes. but here in a simple look ahead (each 4096 samples) the side-chain generation fails (or naturally breaks) at the beginning and ending of the scan. This is still unresolved. may be some overlapped arrays stuff might help. array1 is just one sample and inlet~ has a 20hz sine fade in. |
I'm not sure how you got this impression. I only said that you shouldn't use reblocking where it isn't necessary. Again, if you want to grab audio from outside the subpatch, just write it into a table with Reblocking is just the wrong tool for the job here. (Even if it did work, it would artificially limit yourself to power-of-two samples sizes and it would only work for a single DSP step.)
I'm not sure what you mean by this...
Again, this does not work on a fundamental level because while you bang a |
I'm totally confused and I lost the 2023 argentine ballotage. I'll do a confusion transfer in reverse order.
How is that? I just "switched" a sub patch.
For my example above i'll do this pseudo-code[*] in C and it will take place in the [*]: no implementation details at all (you should understand the following (i know you do))
EDIT: did't test this neither in |
so sorry :( |
Again, while you single-step DSP, the outer canvas stands still, i.e. there is nothing to get from the inlets. Reblocking is a bit of a special case in that you have access to the buffered content. However, when you find yourself triggering single-step DSP in regular intervals, you might just as well either a) use regular reblocking and do everything in the audio domain or b) just do everything in the control domain. Anyway, to me it seems you are trying to implement a look-ahead peek limiter. This can be done entirely in the audio domain. I have the feeling you are trying to use single-step DSP for something that shouldn't require it in the first place... Let's continue the discussion in the Pd list. I'll go ahead and close this issue now. |
Ok my confusion came where I thought that on inlet~ and outlet~ we have access to the buffer
Ok. Well it is my first DSP object :)
Thanks for any insight on the object. I'll post to the list and already move the object to this repo. |
I would expect this simple patch to send a block to an array from inside a switched off and re-blocked sub-patch but there are errors in the array.
Not sure if it's legal to do one block computation via a bang to [switch~] from an [inlet~].
here's a simple example patch:
switch~bug.zip
and to put it graphically:
The text was updated successfully, but these errors were encountered: