File: internals.rst.txt

package info (click to toggle)
python-pyo 1.0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,332 kB
  • sloc: python: 135,133; ansic: 127,822; javascript: 16,116; sh: 395; makefile: 388; cpp: 242
file content (81 lines) | stat: -rw-r--r-- 2,086 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Internal objects
===================================

.. currentmodule:: pyo

These objects are mainly used by pyo itself, inside other objects.

Objects in this category
------------------------------

- :py:class:`Dummy` :     Dummy object used to perform arithmetics on PyoObject.
- :py:class:`InputFader` :     Audio streams crossfader.
- :py:class:`Mix` :     Mix audio streams to arbitrary number of streams.
- :py:class:`VarPort` :     Convert numeric value to PyoObject signal with portamento.
- :py:class:`Stream` :     Audio stream objects. For internal use only.

*Dummy*
-----------------------------------

.. autoclass:: Dummy
   :members:

   .. autoclasstoc::

*InputFader*
-----------------------------------

.. autoclass:: InputFader
   :members:

   .. autoclasstoc::

*Mix*
-----------------------------------

.. autoclass:: Mix
   :members:

   .. autoclasstoc::

*VarPort*
-----------------------------------

.. autoclass:: VarPort
   :members:

   .. autoclasstoc::

*Stream*
-----------------------------------

*class* **Stream**

Audio stream objects. For internal use only.

A Stream object must never be instantiated by the user.

A Stream is a mono buffer of audio samples. It is used to pass audio between objects and the server. 
A PyoObject can manage many streams if, for example, a list is given to a parameter.

A Sine object with only one stream:

    >>> a = Sine(freq=1000)
    >>> print(len(a))
    1

A Sine object with four streams:

    >>> a = Sine(freq=[250,500,750,100])
    >>> print(len(a))
    4

The first stream of this object contains the samples from the 250Hz waveform. The second stream contains the samples from the 500Hz waveform, and so on.

User can call a specific stream of an object by giving the position of the stream between brackets, beginning at 0. To retrieve only the third stream of our object:

    >>> a[2].out()

The method getStreamObject() can be called on a Stream object to retrieve the XXX_base object associated with this Stream. 
This method can be used by developers who are debugging their programs!