diff --git a/shared-bindings/synthio/__init__.c b/shared-bindings/synthio/__init__.c index 2739d81e88..de1366717c 100644 --- a/shared-bindings/synthio/__init__.c +++ b/shared-bindings/synthio/__init__.c @@ -80,7 +80,7 @@ static const mp_arg_t envelope_properties[] = { //| //| :param float attack_time: The time in seconds it takes to ramp from 0 volume to attack_volume //| :param float decay_time: The time in seconds it takes to ramp from attack_volume to sustain_volume -//| :param float release_time: The time in seconds it takes to ramp from sustain_volume to release_volume. When a note is released before it has reached the sustain phase, the release is done with the same slope indicated by ``release_time`` and ``sustain_level`` +//| :param float release_time: The time in seconds it takes to ramp from sustain_volume to release_volume. When a note is released before it has reached the sustain phase, the release is done with the same slope indicated by ``release_time`` and ``sustain_level``. If the ``sustain_level`` is ``0.0`` then the release slope calculations use the ``attack_level`` instead. //| :param float attack_level: The level, in the range ``0.0`` to ``1.0`` of the peak volume of the attack phase //| :param float sustain_level: The level, in the range ``0.0`` to ``1.0`` of the volume of the sustain phase relative to the attack level //| """ diff --git a/shared-module/synthio/__init__.c b/shared-module/synthio/__init__.c index a7b2e0c25c..2bca3db439 100644 --- a/shared-module/synthio/__init__.c +++ b/shared-module/synthio/__init__.c @@ -89,7 +89,7 @@ void synthio_envelope_definition_set(synthio_envelope_definition_t *envelope, mp envelope->release_step = -convert_time_to_rate( sample_rate, fields[2], - envelope->decay_step + envelope->sustain_level ? envelope->sustain_level : envelope->attack_level); }