@@ -43,7 +43,8 @@ STATIC const uint16_t triangle[] = {0, 32767, 0, -32767};
43
43
//|
44
44
//| If `waveform` is None, a triangle waveform is used.
45
45
//|
46
- //| `rate`, `phase_offset`, `offset`, `scale`, and `once` can be changed at run-time. `waveform` may be mutated.
46
+ //| `rate`, `phase_offset`, `offset`, `scale`, and `once` can be changed at
47
+ //| run-time. `waveform` may be mutated.
47
48
//|
48
49
//| `waveform` must be a ``ReadableBuffer`` with elements of type ``'h'``
49
50
//| (16-bit signed integer). Internally, the elements of `waveform` are scaled
@@ -58,6 +59,30 @@ STATIC const uint16_t triangle[] = {0, 32767, 0, -32767};
58
59
//| In the current implementation, LFOs are updated every 256 samples. This
59
60
//| should be considered an implementation detail, though it affects how LFOs
60
61
//| behave for instance when used to implement an integrator (``l.offset = l``).
62
+ //|
63
+ //| An LFO's output, which is reflected in its `value` property, is not
64
+ //| updated in any other way than when its associated synthesizer updates it.
65
+ //| For instance, if an LFO is created with ``offset=1``, its `value` will still
66
+ //| be ``0`` until it is updated by its associated synthesizer. Similarly, merely
67
+ //| updating its properties does not update its value property.
68
+ //|
69
+ //| The interpolation of the waveform is necessarily different depending on the
70
+ //| ``once`` property. Consider a LFO with ``waveform=np.array([0, 100],
71
+ //| dtype=np.int16), interpolate=True, once=True, rate=1``. Over 1 second this
72
+ //| LFO's output will change from ``0`` to ``100``, and will remain at
73
+ //| ``100`` thereafter, creating a "bend out" over a duration of 1 second.
74
+ //|
75
+ //| However, when ``once=False``, this creates a triangle waveform with a
76
+ //| period of 1 second. Over about the first half second the input will
77
+ //| increase from ``0`` to ``100``, then during the second half of the second
78
+ //| it will decrease back to ``0``.
79
+ //|
80
+ //| The time of the peak output is different depending on the value of ``once``:
81
+ //| At 1.0s for ``once=True`` and at 0.5s for ``once=False``.
82
+ //|
83
+ //| Because of this difference in interpolation, dynamically updating the
84
+ //| ``once`` flag except when the LFO is at a phase of 0 will cause a step in
85
+ //| the LFO's output.
61
86
//| """
62
87
//|
63
88
//| def __init__(
0 commit comments