-
Notifications
You must be signed in to change notification settings - Fork 757
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
TRand, TExpRand, TIRand are broken for audio-rate inputs #1278
Comments
Same on master. The reason seems not to be Compare:
The second one works fine. If I poll the inputs inside TRand:
I get values like this after a while:
|
I'm not sure I understand what you are trying to say. This has nothing to do with x = play {
var p = Impulse.ar(1);
var lo = DC.ar(0);
var hi = DC.ar(1);
var t = TRand.ar(lo, hi, p);
t.poll(p, "rand");
0
} Definitely x = play {
var p = Impulse.ar(1);
var lo = DC.kr(0);
var hi = DC.kr(1);
var t = TRand.ar(lo, hi, p);
t.poll(p, "rand");
0
} |
Ok, yes, you are right (and it is good that it doesn't). The problem goes away if you don't call
change to:
I don't know why this is though. |
This affects at least these UGens: |
It affects all UGens that call |
So in general, we can say that the following construction is broken for audio rate inputs:
(maybe it wasn't ever meant to work!) |
Is there a simple way to grep all the affected cases? |
this code is wrong: it breaks when input and output buffers are the |
I'll fix these first. |
I've added proper audio rate methods, too (d0d5907) |
Issue doesn't seem to be fixed. Original mcve still shows According to this forum thread, x = play {
var p = Impulse.ar(1);
var lo = \lo.ar(0);
var hi = \hi.ar(10);
var t = TIRand.ar(lo, hi, p);
t.poll(p, "rand");
0
}
-> Synth('temp__4' : 1004)
rand: 10
rand: 10
rand: 10
rand: 10
rand: 10
rand: 10 |
For an audio rate UGen and audio rate trigger, do we expect lo and hi to be able to change at audio rate as well, or only at kr? Are we 100% sure the forum issue matches this one? The forum issue is about getting random numbers outside the requested range, but the latest reproducer is quite different from that. |
that plot is way too short and uses a way too high frequency to show the problem. if you record longer (plot(1)) you'll see the bias. if you decrease the frequency below ControlRate, you see the bug (
{
var p = Impulse.ar(400);
var lo = \lo.ar(0);
var hi = \hi.ar(10);
var t = TIRand.ar(lo, hi, p);
t
}.plot(0.5)
) |
I took a look, I am unsure, perhaps it is this? https://github.com/telephon/supercollider/tree/topic/fix-aa-methods-of-triggered-rand I currently can't build, because of these annoying code signing issues, so I can't test. |
Some formatting is also improved. This fixes supercollider#1278.
This is SC 3.6.5, not tested with SC 3.7 yet:
The text was updated successfully, but these errors were encountered: