Skip to content

Commit 9979e1a

Browse files
committed
Update LFO implementation detail notes based on Dan's feedback
(& re-wrap some paragraphs, sorry)
1 parent bf10008 commit 9979e1a

File tree

1 file changed

+16
-14
lines changed
  • shared-bindings/synthio

1 file changed

+16
-14
lines changed

shared-bindings/synthio/LFO.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ STATIC const uint16_t triangle[] = {0, 32767, 0, -32767};
4343
//|
4444
//| If `waveform` is None, a triangle waveform is used.
4545
//|
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.
4748
//|
4849
//| `waveform` must be a ``ReadableBuffer`` with elements of type ``'h'``
4950
//| (16-bit signed integer). Internally, the elements of `waveform` are scaled
@@ -59,21 +60,22 @@ STATIC const uint16_t triangle[] = {0, 32767, 0, -32767};
5960
//| should be considered an implementation detail, though it affects how LFOs
6061
//| behave for instance when used to implement an integrator (``l.offset = l``).
6162
//|
62-
//| An LFO's output is not updated in any other way than when its associated
63-
//| synthesizer updates it. For instance, if an LFO is created and its "first"
64-
//| output is non-zero, its output is 0 until it is updated by its associated synthesizer.
65-
//| Similarly, it is not updated when its inputs like ``scale`` and ``offset`` are changed.
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.
6668
//|
67-
//| The interpolation of the waveform is necessarily different depending on the ``once``
68-
//| property. Consider a LFO with
69-
//| ``waveform=np.array([0, 32767], dtype=np.int16), interpolate=True, once=True, rate=1``.
70-
//| Over 1 second this LFO's output will change
71-
//| from ``0`` to ``32767``, and will remain at ``32767`` thereafter, creating
72-
//| a "bend out" over a duration of 1 second.
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.
7374
//|
74-
//| However, when ``once=False``, this creates a sawtooth waveform with a period of 1 second.
75-
//| Over about the first half second the input will increase from ``0`` to ``32767``,
76-
//| then during the second half of the second it will decrease back to ``0``.
75+
//| However, when ``once=False``, this creates a sawtooth 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``.
7779
//|
7880
//| The time of the peak output is different depending on the value of ``once``:
7981
//| At 1.0s for ``once=True`` and at 0.5s for ``once=False``.

0 commit comments

Comments
 (0)