RandomNumbers.doc -- documentation for RandomNumbers.paccess 17 Oct 97 ------------------------------------------------------------ Version 1.1 (first public release) (v40.11 14 Sep 97) * * NB: RandomNumbers.paccess was compiled as 68030 code. If you want or need a * version for a different processor, let me know (addresses are at the bottom of * this file). Also, this accessory requires mathieeedoubbas.library and * mathieeedoubtrans.library in your friendly neighborhood LIBS: directory. * ToolID == RNMB RandomNumbers.paccess intercepts call to Bars&Pipes' random number generator (i.e., functions->random()). This will give you a better -- or, at least, different -- palette of random numbers for tools that use random numbers, such as Articulation Modifier, Velocity Modifier, and Random Notes, among others. You can choose between three replacement random number generators: RangeRand(), FastRand() (which are both amiga.lib calls), or lrand48() (from scm.lib). Both RangeRand() and lrand48() allow you to set a seed (< 65535 due to limitations inherent in proportional gadgets) for the generator with the Seed gadgets. Usually it's easier to set the seed with the string gadget. If none of the replacement generators is selected, the accessory calls the usual functions->random() (which is, I believe, FastRand() in reality). The Reseed gadget reseeds the random number generator. Whenever you enter a new seed with either of the Seed gadgets, the generator is automatically reseeded. Use this gadget if you want to reseed at any other time. In addition to replacing the random number generator, you can also select a random distribution to use. Some of the distribution choices allow you to set parameters with sliders in the bottom of the box. Linear: A linear distribution. Small values are more likely than large ones. Inverse Linear: Large values are more likely than small ones. Triangle: Values in the middle of the range are most likely. Rand-Rand: A recursive random distribution, it is similar to an exponential distribution, but more variable. Poisson: The distribution is controlled by the Spread parameter, which is the mean of the distribution. Cauchy (+): This isn't a true Cauchy distribution; the negative part is folded to positive. If this were not true, the distribution would be similar to a Gaussian distribution but approaching zero more slowly at the extremes. The Spread parameter determines the horizontal dispersion of values. Beta: The two parameters, Prob0 and Prob1, control the shape of the curve. Prob0 contols the occurrence of values at the low end of the range; Prob1 controls the high end. Smaller values increase the probability of values at the respective end of the range. If the parameters are equal the curve is symmetrical around the middle of the range; otherwise, the curve tilts in favor of the smaller parameter. If both Prob0 and Prob1 are set to 1.0, the output is a uniform distribution. If Prob0 and Prob1 are greater than 1.0, the output will resemble a Gaussian curve. Note that if they are _too much_ greater than 1.0 the system will slow down due to increased numerical crunching. Gauss: Your basic bell-shaped curve (ok, it's really an approximation). The StdDev parameter controls the standard deviation. The mean is automatically half the range the functions gets. Gamma: A continuous, asymmetrical curve whose shape is governed by the Spread parameter. Values for Spread greater than 10.0 are to be avoided as the resulting curve gets increasinlgly Gaussian. Exponential: Well, what do you know, it's an exponential curve. Values at the low end of the range are most likely, and the probability of large values decreases exponentially. The Spread parameter controls the dispersion: Large values increase the likelihood of small results. Random Walk: The new value is +/- 1 from the previous value. A (not terribly) special trick is employed: The starting point for the walk is set to half the range of the first call to the function following selection of the Random Walk gadget. (Weibull: This used to be in the empty slot, but it is sort of broken and has been removed until I get around to being motivated to fix it.) As an extra added bonus, if the RandomNumbers accessory window is open when you save a song, it will automagically open when you reload that song ... usually. Haven't tracked down why it only usually opens; there are other mysteries to pursue. © 1997 Michael Rees 217 Huckleberry Road Farmington, New York 14425-7051 USA (Developed on an Amiga 2000 w/68030 + 11M with SAS/C v6.56 and Bars & Pipes Professional v2.5c beta2 (7/20/94).) This accessory is freely distributable, so long as it is distributed for free. I'm not responsible for any nasty things that happen as a result of your using this software. I believe it to be bug free, but if you find something I missed please let me know. If you like it or if you don't or if you have a suggestion or if you have a complaint (about the accessory, that is), let me know too. And if you would care to provide code for additional random number generators, ship it my way, please.