Skip to content

Commit b3ea313

Browse files
Merge pull request #97 from marcel-licence/add_midi_ifc_function_for_delay
update delay function to allow direct call from MIDI map
2 parents 75a13a6 + 08298fe commit b3ea313

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ML_SynthTools",
3-
"version": "2.0.12",
3+
"version": "2.0.13",
44
"keywords": "ML_SynthTools, Synthesizer, Filter, Audio, ESP32, ESP32S2, ESP32S3, STM32, RP2040",
55
"description": "Synthesizer Tools; contains waveform generators etc.",
66
"repository":

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ML SynthTools
2-
version=2.0.12
2+
version=2.0.13
33
author=Marcel Licence <[email protected]>
44
maintainer=Marcel Licence <[email protected]>
55
sentence=Synthesizer Tools

src/ml_delay.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,20 @@ void Delay_SetOutputLevel(uint8_t unused __attribute__((unused)), uint8_t value)
403403
void Delay_SetLength(uint8_t unused __attribute__((unused)), float value)
404404
{
405405
delayLen = (uint32_t)(((float)delayLenMax - 1.0f) * value);
406+
if (delayLen < 1)
407+
{
408+
delayLen = 1;
409+
}
406410
Status_ValueChangedFloat("Delay_SetLength", value);
407411
}
408412

413+
void Delay_SetLength(uint8_t unused __attribute__((unused)), uint8_t value)
414+
{
415+
float value_f = value;
416+
value_f *= 1.0f / 127.0f;
417+
Delay_SetLength(unused, value_f);
418+
}
419+
409420
void Delay_SetLength(uint8_t unused __attribute__((unused)), uint32_t value)
410421
{
411422
if (value != delayLen)

src/ml_delay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void Delay_SetOutputLevel(uint8_t unused __attribute__((unused)), float value);
6161
void Delay_SetOutputLevel(uint8_t unused __attribute__((unused)), uint8_t value);
6262
void Delay_SetLength(uint8_t unused __attribute__((unused)), float value);
6363
void Delay_SetLength(uint8_t unused __attribute__((unused)), uint32_t value);
64+
void Delay_SetLength(uint8_t unused __attribute__((unused)), uint8_t value);
6465
void Delay_SetShift(uint8_t unused __attribute__((unused)), float value);
6566

6667

0 commit comments

Comments
 (0)