Am 29.05.21 um 11:09 schrieb Will Godfrey:
I've made a confusing discovery concerning randomisation.
Doing a reseed works quite correctly, and then making a number of test calls
afterwards gives exact repeatable results. However, using this then playing a
complex sound such as Overdrive makes virtually no difference to the sound at
all!
Not sure if I understand you right here: is the very first note already random?
even after a reseed under controlled conditions? i.e. nothing else is going on
and the reseed happens right before processing the first buffer?
Going further and fixing the values of the reseeds in both SynthEngine and
OscilGen also seems to make very little (if any) difference - the sound is still
quite random.
Without having looked into any details -- the usual approach would be to dissect
such an unexplainable behaviour. The basic idea behind any such usages of
reproducible "randomness" is always the same, and it's also the same idea that
drives merkle trees and blockchains: you have to look at the data flow. If
we reseed a child PRNG from a parent stream of pseudorandom numbers at an
absolutely precise and reproducible point in the data stream, then all
chained generators will also be predictable.
But as soon as there is anything asynchronous in the mix, like handing over
MIDI events to another thread, then the whole chain breaks and sooner or
later we turn over to true randomness.
This doesn't bode well for tightly defined testing :(
I wouldn't say so.
As long as we can cover building blocks and reproduce the sound of those
building blocks, we still get the desired effect of test coverage. At the
end of the day, what we want, is a safety net to catch undesired side
effects of changes we do in the source code.
But guess you see why I am so keen to create a very straight forward
setup for those basic tests. Because, the less complex the scaffolding
is we need to get at running the code under test, the easier it is for
us to reason about behaviour we do not understand.
-- Hermann
_______________________________________________
Yoshimi-devel mailing list
Yoshimi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/yoshimi-devel