Skip to content

Commit ed76985

Browse files
add delay set length for midi mapping
1 parent a694677 commit ed76985

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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)