Per voice (subpatch) unique random value?


#1

I'm getting back into Axoloti after a while, so I'm (again) following the "Axoloti basic synthesis tutorial" on youtube.

I've created my voice subpatch, and my main synth patch.
I want to have polyphony using X instantiations of my voice patch.

What I'd like to do is add some random to my voice patch, so that when I play a few notes in a chord - instancing say 4 voices - every voice has a slight random variation.
Let's say I'd like every voice instance to have a slightly different attack than any other (when playing notes at exactly the same time).

What I'm wondering is what the "cheapest"" (CPU wise) random is that will actually give me a new random per instantiated voice.
(I hope you get what I mean?)


#2

the "cheapest" effort wise would be to just modulate your random value in the subpatch with a polyindex object which gives you the voice number. or, "retrigger" the RNG with note ons.

other people will have to chime in on CPU cheapness...

generally though i always assumed that if you have a random algorithm within a subpatch it will always be initiated differently for each voice so you'd have unique randomness between the voices anyways?


#3

Do you hav the random objects located inside the subpatch? If you have it should give you a random value for each voice.


#4

What I was basically wondering is whether the randoms are seeded the same for each instance, if so they'd give the same "random" value for each voice. If they are seeded by f.e. the current cpu tick count they'd be different for each voice.
That could be different per implementation, so what I'm basically after is which random is seeded uniquely with every instance..

Being able to seed the random Initially with the poly index should work too, I haven't looked into whether it's possible to do that. (I'm not near my Axoloti / laptop now so can't try)


#5

I don't think the random objects are seeded with the same number, they are not when you use them monophonically. When setting an amount of voices, you are basically setting how many copies of an subpatch you want, so I think you are good :slight_smile:

When you trigger several randoms the show different results, which means that they are seeded differently pr. instance. And I am sure it is the same inside a poly subpatch.


#6

Cheers, that's exactly what I needed to hear! :slight_smile:


#7

Those rand objects aren’t based on the hardware RNG in the STM32?


#8

yes i think they are


#9

Yes, they are using the hardware, and yes, they use a seed. (I checked the code).

Bottom line, the rand objects should be very fast, and will return unique values for each call.