Skip to content

Commit 8f2b7ba

Browse files
committed
Documentation updated.
1 parent 394b22e commit 8f2b7ba

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

shared-bindings/audiodelays/MultiTapDelay.c

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,27 @@
3333
//| samples_signed: bool = True,
3434
//| channel_count: int = 1,
3535
//| ) -> None:
36-
//| """Create a MultiTapDelay effect where you hear the original sample play back, at a lesser volume after
37-
//| a set number of millisecond delay. The delay timing of the echo can be changed at runtime
38-
//| with the delay_ms parameter but the delay can never exceed the max_delay_ms parameter. The
39-
//| maximum delay you can set is limited by available memory.
36+
//| """Create a delay effect where you hear the original sample play back at varying times, or "taps".
37+
//| These tap positions and levels can be used to create rhythmic effects.
38+
//| The timing of the delay can be changed at runtime with the delay_ms parameter but the delay can
39+
//| never exceed the max_delay_ms parameter. The maximum delay you can set is limited by available
40+
//| memory.
4041
//|
41-
//| Each time the echo plays back the volume is reduced by the decay setting (echo * decay).
42+
//| Each time the delay plays back the volume is reduced by the decay setting (delay * decay).
4243
//|
4344
//| The mix parameter allows you to change how much of the unchanged sample passes through to
4445
//| the output to how much of the effect audio you hear as the output.
4546
//|
46-
//| :param int max_delay_ms: The maximum time the echo can be in milliseconds
47-
//| :param float delay_ms: The current time of the echo delay in milliseconds. Must be less the max_delay_ms
48-
//| :param synthio.BlockInput decay: The rate the echo fades. 0.0 = instant; 1.0 = never.
47+
//| :param int max_delay_ms: The maximum time the delay can be in milliseconds.
48+
//| :param float delay_ms: The current time of the delay in milliseconds. Must be less than max_delay_ms.
49+
//| :param synthio.BlockInput decay: The rate the delay fades. 0.0 = instant; 1.0 = never.
4950
//| :param synthio.BlockInput mix: The mix as a ratio of the sample (0.0) to the effect (1.0).
5051
//| :param tuple taps: The positions and levels to tap into the delay buffer.
51-
//| :param int buffer_size: The total size in bytes of each of the two playback buffers to use
52-
//| :param int sample_rate: The sample rate to be used
52+
//| :param int buffer_size: The total size in bytes of each of the two playback buffers to use.
53+
//| :param int sample_rate: The sample rate to be used.
5354
//| :param int channel_count: The number of channels the source samples contain. 1 = mono; 2 = stereo.
54-
//| :param int bits_per_sample: The bits per sample of the effect
55-
//| :param bool samples_signed: Effect is signed (True) or unsigned (False)
55+
//| :param int bits_per_sample: The bits per sample of the effect.
56+
//| :param bool samples_signed: Effect is signed (True) or unsigned (False).
5657
//|
5758
//| Playing adding a multi-tap delay to a synth::
5859
//|
@@ -64,14 +65,14 @@
6465
//|
6566
//| audio = audiobusio.I2SOut(bit_clock=board.GP20, word_select=board.GP21, data=board.GP22)
6667
//| synth = synthio.Synthesizer(channel_count=1, sample_rate=44100)
67-
//| effect = audiodelays.MultiTapDelay(max_delay_ms=1000, delay_ms=850, decay=0.65, buffer_size=1024, channel_count=1, sample_rate=44100, mix=0.7, freq_shift=False)
68+
//| effect = audiodelays.MultiTapDelay(max_delay_ms=500, delay_ms=500, decay=0.65, mix=0.5, taps=((2/3, 0.7), 1), buffer_size=1024, channel_count=1, sample_rate=44100)
6869
//| effect.play(synth)
6970
//| audio.play(effect)
7071
//|
7172
//| note = synthio.Note(261)
7273
//| while True:
7374
//| synth.press(note)
74-
//| time.sleep(0.25)
75+
//| time.sleep(0.05)
7576
//| synth.release(note)
7677
//| time.sleep(5)"""
7778
//| ...
@@ -139,7 +140,7 @@ static void check_for_deinit(audiodelays_multi_tap_delay_obj_t *self) {
139140

140141

141142
//| delay_ms: float
142-
//| """Maximum time to delay the incoming signal in milliseconds."""
143+
//| """Time to delay the incoming signal in milliseconds. Must be less than max_delay_ms."""
143144
//|
144145
static mp_obj_t audiodelays_multi_tap_delay_obj_get_delay_ms(mp_obj_t self_in) {
145146
audiodelays_multi_tap_delay_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -177,7 +178,7 @@ MP_PROPERTY_GETSET(audiodelays_multi_tap_delay_decay_obj,
177178
(mp_obj_t)&audiodelays_multi_tap_delay_set_decay_obj);
178179

179180
//| mix: synthio.BlockInput
180-
//| """The rate the echo mix between 0 and 1 where 0 is only sample, 0.5 is an equal mix of the sample and the effect and 1 is all effect."""
181+
//| """The mix of the effect between 0 and 1 where 0 is only sample, 0.5 is an equal mix of the sample and the effect and 1 is all effect."""
181182
static mp_obj_t audiodelays_multi_tap_delay_obj_get_mix(mp_obj_t self_in) {
182183
return common_hal_audiodelays_multi_tap_delay_get_mix(self_in);
183184
}
@@ -194,11 +195,11 @@ MP_PROPERTY_GETSET(audiodelays_multi_tap_delay_mix_obj,
194195
(mp_obj_t)&audiodelays_multi_tap_delay_get_mix_obj,
195196
(mp_obj_t)&audiodelays_multi_tap_delay_set_mix_obj);
196197

197-
//| taps: Tuple[float|Tuple[float, float], ...]
198+
//| taps: Tuple[float|int|Tuple[float|int, float|int], ...]
198199
//| """The position or position and level of delay taps.
199-
//| The position is a number from 0.0 (start) to 1.0 (end) as a relative position in the delay buffer.
200-
//| The level is a number from 0.0 (silence) to 1.0 (full volume).
201-
//| If only a float is provided as an element of the tuple, the level is assumed to be 1.0.
200+
//| The position is a number from 0 (start) to 1 (end) as a relative position in the delay buffer.
201+
//| The level is a number from 0 (silence) to 1 (full volume).
202+
//| If only a float or integer is provided as an element of the tuple, the level is assumed to be 1.
202203
//| When retrieving the value of this property, the level will always be included."""
203204
//|
204205
static mp_obj_t audiodelays_multi_tap_delay_obj_get_taps(mp_obj_t self_in) {

0 commit comments

Comments
 (0)