Debian Codegraph @

documentation/source/api/functions/conv.rst

raw
1 Conversions
2 =======================
3
4 Functions that perform the conversion of values from one range to another range.
5
6 .. currentmodule:: pyo
7
8 Functions in this category
9 ------------------------------
10
11 - :py:func:`midiToHz` : Converts a midi note value to frequency in Hertz.
12 - :py:func:`midiToTranspo` : Converts a midi note value to transposition factor (central key = 60).
13 - :py:func:`sampsToSec` : Returns the duration in seconds equivalent to the number of samples given as an argument.
14 - :py:func:`secToSamps` : Returns the number of samples equivalent to the duration in seconds given as an argument.
15 - :py:func:`beatToDur` : Converts a beat value (multiplier of a quarter note) to a duration in seconds.
16 - :py:func:`linToCosCurve` : Creates a cosinus interpolated curve from a list of points.
17 - :py:func:`rescale` : Converts values from an input range to an output range.
18 - :py:func:`floatmap` : Converts values from a 0-1 range to an output range.
19 - :py:func:`distanceToSegment` : Find the distance from a point to a line or line segment.
20 - :py:func:`reducePoints` : Douglas-Peucker curve reduction algorithm.
21
22
23 *midiToHz*
24 ---------------------------------
25
26 .. autofunction:: midiToHz(x)
27
28 *midiToTranspo*
29 ---------------------------------
30
31 .. autofunction:: midiToTranspo(x)
32
33 *sampsToSec*
34 ---------------------------------
35
36 .. autofunction:: sampsToSec(x)
37
38 *secToSamps*
39 ---------------------------------
40
41 .. autofunction:: secToSamps(x)
42
43 *beatToDur*
44 ---------------------------------
45
46 .. autofunction:: beatToDur(beat, bpm=120)
47
48 *linToCosCurve*
49 ---------------------------------
50
51 .. autofunction:: linToCosCurve(data, yrange=[0, 1], totaldur=1, points=1024, log=False)
52
53 *rescale*
54 ---------------------------------
55
56 .. autofunction:: rescale(data, xmin=0.0, xmax=1.0, ymin=0.0, ymax=1.0, xlog=False, ylog=False)
57
58 *floatmap*
59 ---------------------------------
60
61 .. autofunction:: floatmap(x, min=0.0, max=1.0, exp=1.0)
62
63 *distanceToSegment*
64 ---------------------------------
65
66 .. autofunction:: distanceToSegment(p, p1, p2, xmin=0.0, xmax=1.0, ymin=0.0, ymax=1.0, xlog=False, ylog=False)
67
68 *reducePoints*
69 ---------------------------------
70
71 .. autofunction:: reducePoints(pointlist, tolerance=0.02)
72