Basic distortion plugin!
This commit is contained in:
parent
c226177453
commit
a32ece06df
3 changed files with 12 additions and 3 deletions
|
@ -13,6 +13,9 @@ namespace Dynamite {
|
|||
case DRIVE:
|
||||
drive = (const float *)data;
|
||||
break;
|
||||
case THRESHOLD:
|
||||
threshold = (const float *)data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +24,11 @@ namespace Dynamite {
|
|||
|
||||
for(uint32_t pos = 0; pos < n_samples; pos++) {
|
||||
output[pos] = input[pos] * coeff;
|
||||
if(output[pos] > *threshold) {
|
||||
output[pos] = *threshold;
|
||||
} else if (output[pos] < -*threshold) {
|
||||
output[pos] = -*threshold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue