File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ class Tremolo : public AudioEffect {
282
282
class Delay : public AudioEffect {
283
283
public:
284
284
// / e.g. depthPercent=50, ms=1000, sampleRate=44100
285
- Delay (uint16_t duration_ms=1000 , uint8_t depthPercent=50 , uint32_t sampleRate=44100 ) {
285
+ Delay (uint16_t duration_ms=1000 , float depthPercent=50 , uint32_t sampleRate=44100 ) {
286
286
this ->sampleRate = sampleRate;
287
287
p_percent = depthPercent;
288
288
p_ms = duration_ms;
@@ -298,7 +298,7 @@ class Delay : public AudioEffect {
298
298
return p_ms;
299
299
}
300
300
301
- void setDepth (uint8_t percent){
301
+ void setDepth (float percent){
302
302
p_percent = percent;
303
303
}
304
304
@@ -315,7 +315,7 @@ class Delay : public AudioEffect {
315
315
// add actual input value
316
316
p_history->write (input);
317
317
// mix input with result
318
- return (value * p_percent / 100 ) + (input * (100 - p_percent)/ 100 );
318
+ return (value * p_percent) + (input * (1.0 - p_percent));
319
319
}
320
320
321
321
Delay *clone () {
@@ -324,7 +324,7 @@ class Delay : public AudioEffect {
324
324
325
325
protected:
326
326
RingBuffer<effect_t >* p_history=nullptr ;
327
- uint8_t p_percent;
327
+ float p_percent;
328
328
uint16_t p_ms;
329
329
uint16_t sampleCount=0 ;
330
330
uint32_t sampleRate;
You can’t perform that action at this time.
0 commit comments