duserrnd Signal Generators:Random (Noise) Generators duserrnd duserrnd Discrete USER-defined-distribution RaNDom generator. Description Discrete USER-defined-distribution RaNDom generator. Syntax aout duserrnd ktableNum iout duserrnd itableNum kout duserrnd ktableNum Initialization itableNum -- number of table containing the random-distribution function. Such table is generated by the user. See GEN40, GEN41, and GEN42. The table length does not need to be a power of 2 Performance ktableNum -- number of table containing the random-distribution function. Such table is generated by the user. See GEN40, GEN41, and GEN42. The table length does not need to be a power of 2 duserrnd (discrete user-defined-distribution random generator) generates random values according to a discrete random distribution created by the user. The user can create the discrete distribution histogram by using GEN41. In order to create that table, the user has to define an arbitrary amount of number pairs, the first number of each pair representing a value and the second representing its probability (see GEN41 for more details). When used as a function, the rate of generation depends by the rate type of input variable XtableNum. In this case it can be embedded into any formula. Table number can be varied at k-rate, allowing to change the distribution histogram during the performance of a single note. duserrnd is designed be used in algorithmic music generation. duserrnd can also be used to generate values following a set of ranges of probabilities by using distribution functions generated by GEN42 (See GEN42 for more details). In this case, in order to simulate continuous ranges, the length of table XtableNum should be reasonably big, as duserrnd does not interpolate between table elements. For a tutorial about random distribution histograms and functions see: D. Lorrain. "A panoply of stochastic cannons". In C. Roads, ed. 1989. Music machine. Cambridge, Massachusetts: MIT press, pp. 351 - 379. Examples Here is an example of the duserrnd opcode. It uses the file duserrnd.csd. Example of the duserrnd opcode. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. Its output should include lines like these: i 1 time 0.00067: 8.00000 i 1 time 0.00133: 8.00000 i 1 time 0.00200: 8.00000 i 1 time 0.00267: 8.00000 i 1 time 0.00333: 2.00000 i 1 time 0.00400: 8.00000 i 1 time 0.00533: 8.00000 i 1 time 0.00600: 8.00000 .......... See also Random (Noise) Generators Credits Author: &namegabriel; New in Version 4.16