XnoiseMidi(dist=0, freq=1.00, x1=0.50, x2=0.50, scale=0, mrange=(0, 127), mul=1, add=0)
X-class midi notes pseudo-random generator.
XnoiseMidi implements a few of the most common noise distributions. Each distribution generates integer values in the range defined with `mrange` parameter and output can be scaled on midi notes, hertz or transposition factor.
Parent class : PyoObject
Notes:
Available distributions are: - uniform - linear minimum - linear maximum - triangular - exponential minimum - exponential maximum - double (bi)exponential - cauchy - weibull - gaussian - poisson - walker (drunk) - loopseg (drunk with looped segments) Depending on the distribution, `x1` and `x2` parameters are applied as follow (names as string, or associated number can be used as `dist` parameter): 0 - uniform no parameter 1 - linear_min no parameter 2 - linear_max no parameter 3 - triangle no parameter 4 - expon_min x1 : slope {0 = no slope -> 10 = sharp slope} 5 - expon_max x1 : slope {0 = no slope -> 10 = sharp slope} 6 - biexpon x1 : bandwidth {0 = huge bandwidth -> 10 = narrow bandwidth} 7 - cauchy x1 : bandwidth {0 = narrow bandwidth -> 10 = huge bandwidth} 8 - weibull x1 : mean location {0 -> 1} x2 : shape {0.5 = linear min, 1.5 = expon min, 3.5 = gaussian} 9 - gaussian x1 : mean location {0 -> 1} x2 : bandwidth {0 = narrow bandwidth -> 10 = huge bandwidth} 10 - poisson x1 : gravity center {0 = low values -> 10 = high values} x2 : compress/expand range {0.1 = full compress -> 4 full expand} 11 - walker x1 : maximum value {0.1 -> 1} x2 - maximum step {0.1 -> 1} 12 - loopseg x1 : maximum value {0.1 -> 1} x2 - maximum step {0.1 -> 1}
Parameters:
dist : string or int, optional Distribution type. Defaults to 0. freq : float or PyoObject, optional Polling frequency. Defaults to 1. x1 : float or PyoObject, optional First parameter. Defaults to 0.5. x2 : float or PyoObject, optional Second parameter. Defaults to 0.5. scale : int {0, 1, 2}, optional Output format. 0 = Midi, 1 = Hertz, 2 = transposition factor. In the transposition mode, the central key (the key where there is no transposition) is (`minrange` + `maxrange`) / 2. Defaults to 0. mrange : tuple of int, optional Minimum and maximum possible values, in Midi notes. Available only at initialization time. Defaults to (0, 127).
Methods:
setDist(x) : Replace the `dist` attribute. setFreq(x) : Replace the `freq` attribute. setX1(x) : Replace the `x1` attribute. setX2(x) : Replace the `x2` attribute. setScale(x) : Replace the `scale` attribute. setRange(x, y) : Changes min and max range values and centralkey.
Attributes:
dist : string or int. Distribution type. freq : float or PyoObject. Polling frequency. x1 : float or PyoObject. First parameter. x2 : float or PyoObject. Second parameter. scale : int. Output format.
Examples:
>>> s = Server().boot() >>> s.start() >>> l = Phasor(.1, 0, .5, 0) >>> a = XnoiseMidi('loopseg', freq=8, x1=1, x2=l, scale=1, mrange=(60,96)) >>> b = Sine(a, mul=.3).out()
Methods details:
XnoiseMidi.setDist(x): Replace the `dist` attribute. Parameters: x : string or int new `dist` attribute. XnoiseMidi.setFreq(x): Replace the `freq` attribute. Parameters: x : float or PyoObject new `freq` attribute. XnoiseMidi.setX1(x): Replace the `x1` attribute. Parameters: x : float or PyoObject new `x1` attribute. XnoiseMidi.setX2(x): Replace the `x2` attribute. Parameters: x : float or PyoObject new `x2` attribute. XnoiseMidi.setScale(x): Replace the `scale` attribute. Possible values are: 0 -> Midi notes 1 -> Hertz 2 -> transposition factor (centralkey is (`minrange` + `maxrange`) / 2 Parameters: x : int {0, 1, 2} new `scale` attribute. XnoiseMidi.setRange(mini, maxi): Replace the `mrange` attribute. Parameters: mini : int minimum output midi range. maxi : int maximum output midi range.