Skip to content

Commit dfe9836

Browse files
committed
Update loop docstrings to demonstrate BlockInput implementation.
1 parent ce3e83d commit dfe9836

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

shared-bindings/synthio/Note.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ MP_PROPERTY_GETSET(synthio_note_waveform_obj,
203203
//| waveform_loop_start: BlockInput
204204
//| """The sample index of where to begin looping waveform data.
205205
//|
206-
//| Values outside the range ``0`` to ``waveform_max_length-1`` (inclusive) are rejected with a `ValueError`.
207-
//|
208-
//| Values greater than or equal to the actual waveform length are treated as 0."""
206+
//| The value is limited to the range ``0`` to ``len(waveform)-1`` (inclusive)."""
209207
static mp_obj_t synthio_note_get_waveform_loop_start(mp_obj_t self_in) {
210208
synthio_note_obj_t *self = MP_OBJ_TO_PTR(self_in);
211209
return common_hal_synthio_note_get_waveform_loop_start(self);
@@ -225,9 +223,7 @@ MP_PROPERTY_GETSET(synthio_note_waveform_loop_start_obj,
225223
//| waveform_loop_end: BlockInput
226224
//| """The sample index of where to end looping waveform data.
227225
//|
228-
//| Values outside the range ``1`` to ``waveform_max_length`` (inclusive) are rejected with a `ValueError`.
229-
//|
230-
//| If the value is greater than the actual waveform length, or less than or equal to the loop start, the loop will occur at the end of the waveform.
226+
//| The value is limited to the range ``waveform_loop_start+1`` to ``len(waveform)`` (inclusive).
231227
//|
232228
//| Use the `synthio.waveform_max_length` constant to set the loop point at the end of the wave form, no matter its length."""
233229
//|
@@ -336,9 +332,7 @@ MP_PROPERTY_GETSET(synthio_note_ring_waveform_obj,
336332
//| ring_waveform_loop_start: BlockInput
337333
//| """The sample index of where to begin looping waveform data.
338334
//|
339-
//| Values outside the range ``0`` to ``waveform_max_length-1`` (inclusive) are rejected with a `ValueError`.
340-
//|
341-
//| Values greater than or equal to the actual waveform length are treated as 0."""
335+
//| The value is limited to the range ``0`` to ``len(ring_waveform)-1`` (inclusive)."""
342336
static mp_obj_t synthio_note_get_ring_waveform_loop_start(mp_obj_t self_in) {
343337
synthio_note_obj_t *self = MP_OBJ_TO_PTR(self_in);
344338
return common_hal_synthio_note_get_ring_waveform_loop_start(self);
@@ -358,9 +352,7 @@ MP_PROPERTY_GETSET(synthio_note_ring_waveform_loop_start_obj,
358352
//| ring_waveform_loop_end: BlockInput
359353
//| """The sample index of where to end looping waveform data.
360354
//|
361-
//| Values outside the range ``1`` to ``waveform_max_length`` (inclusive) are rejected with a `ValueError`.
362-
//|
363-
//| If the value is greater than the actual waveform length, or less than or equal to the loop start, the loop will occur at the end of the waveform.
355+
//| The value is limited to the range ``ring_waveform_loop_start+1`` to ``len(ring_waveform)`` (inclusive).
364356
//|
365357
//| Use the `synthio.waveform_max_length` constant to set the loop point at the end of the wave form, no matter its length."""
366358
//|

0 commit comments

Comments
 (0)