Csound Csound-dev Csound-tekno Search About

[Csnd] Possible random number problem with multiple instances

Date2019-10-18 20:08
From"Jeanette C."
Subject[Csnd] Possible random number problem with multiple instances
Hey hey,
I think I might have come up against a restriction of the random number 
generators, using several instances of one instrument simultaneously.

I use one instrument to generate a few random numbers and a gausstrig to then 
trigger another short impulse instrument. Each instance of these will output 
to a different channel/bus. Running multiple instances at the same time, the 
impulses don't sound so random between each other. Running the instruments in 
separate goes the result is quite random.

Here's an output of the simultaneous instrument calls:
https://www.dropbox.com/s/72ch84an0lbvnek/one_go.wav

And here's a mix of seperate renderings:
https://www.dropbox.com/s/fi1xb7sxm2a4np8/multi_go.wav

The triggering instrument looks something like this:

instr Trigger
   ; Variables from p-fields
   ktrig gausstrig 1, kfrequency, .7, 0, 1 ; star  trigger at random

   ; Use linrand, exprand, gauss to set up coordinates and sound parameters
   if ktrig == 1 then
     if iChannel == giLeft then
       kX = .1
       sChannel = "Sound.Left"
     elseif iChannel == giRight then
       kX = iWidth - .1
       SChannel = "Sound.Right"
     ...
     event "i", "SoundGenerator", 0, kLength, ... ; Can also make channel name
   endif ; ktrig == 1

   ; Read from channel
   aSound chnget SChannel
   aLeft, aRight m_3d_place_source aSound, kX, kY, kZ, ...
   outs aLeft, aRight
endin

This is called with different parameters for iChannel starting at the same 
time and running for the same duration.

You can also hear the high frequency artefact in the mixed solo-renditions. 
What might that be? I dcblock aSound and make sure that the SoundGenerator has 
an amplitude envelope that goes to 0. Channels remember their last value?

Can anyone help? Point me towards obvious pitfalls...

Best wishes and many thanks,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just hang around and you'll see,
There's nowhere I'd rather be <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here