Phil Thalasso wrote:May I ask the question, whether anybody would know whether it is possible to program a ruby module that gets triggered by some input (poly for example) and the adds a probabilistic value from a normal distribution to it.
I'll split that into two questions...
1) Can a Ruby event of some kind be triggered from audio?
Kind of. Doing it with sample precision is
very CPU intensive though, as it would require turning audio streams into Ruby frames. Doing it in a "CPU light" way would be no more precise than doing it with 'green' (i.e. not very precise at all!) And Ruby can't interface with poly streams at all, so it would be no use for MIDI generated voices in synths.
2) Would the normal distribution algorithm require Ruby?
Very precise algorithms probably would need Ruby features (e.g. "while" or "until" loops). However, for the given application, a reasonable approximation of the distribution will most likely suffice. Approximated algorithms tend to struggle the most with the rarest values at the far ends of the distribution "tails" - but since sequencer parameters are bounded, you don't need the tails to extend very far; in fact, it would be better that they didn't. A very efficient approximation can be done by passing a uniformly generated random number through the
quantile function for the desired distribution, which could be implemented as an interpolated look-up table in green, poly or mono (and would allow approximating any distribution that you wanted.)