| (jumping into the middle of this thread..)
I suppose they would do different things (each takes a number in turn
from the rng), but might not be fully independent.
Because of my limited experience with different compilers and operating
systems, I have often wondered about things like rand(). If the C
library function is used, my understanding is that calls to it from
anywhere within the same process (ie a Csound run) will get the next
number in the sequence, so it is in effect a pseudo-operating system
service. The only way round that, therefore, is to provide a private
random number generator on a per-instrument basis - which is what I
understood the Csound rand generator does (I have not got round to
looking at the code), so that seeding the rng in one instrument would
not affect any other instruments. That still begs the question of
whether it is possible to have two or more independent rngs within the
same instrument - or does 'seed' apply globally within an instrument?
If there are compositional tasks that require such independence, the
only solution that I can see is to provide, OOP-style, the ability for
an instrument to have any number of private, independent rngs; so
compiler-level library functions could not be used at all, anywhere.
It's certainly ~possible~, but it must demand a fair bit of coding.
At least this would guarantee consistency across all platforms - so long
as wordsizes etc were unambiguous. There is a sort of precedent for this
in the delay opcodes, where each read/write pair forms an independent
object, but how practical this would be for a set of rngs I am not at
all sure.
I would be interested to know what compositional applications Csounders
have in mind for per-instrument multiple rngs.
Richard Dobson
Paul Winkler wrote:
>
> Josep M Comajuncosas wrote:
>
> > Which is the usability of a
> > random opcode, no matter its length, if it always outputs the same sequence?? It
> > won´t work for multiple chorus, nor for algorithmic composition, nothing... just as
> > "noise"...
>
> Hmm. I haven't yet used any of the random opcodes very much, but
> personally, this sounds like a much bigger problem than the word length.
> If I had an instrument using random numbers for any purpose, and I
> called it twice like this:
>
> i1 0 1 ...
> i1 0 1 ...
>
> ... I would want the two notes to do different things. Are you saying
> they wouldn't? That's no good!
> |