186 |
const bool isGStFilter = isGStFilterType(pRegion->VCFType); |
const bool isGStFilter = isGStFilterType(pRegion->VCFType); |
187 |
|
|
188 |
if (pRegion->VCFCutoffControllerInvert) ccvalue = 127 - ccvalue; |
if (pRegion->VCFCutoffControllerInvert) ccvalue = 127 - ccvalue; |
189 |
if (isGStFilter) { |
// interpret "minimum cutoff" not simply as hard limit, rather |
190 |
// VCFVelocityScale in this case means "minimum cutoff" for GSt |
// restrain it to min_cutoff..127 range, but spanned / remapped over |
191 |
if (ccvalue < MinCutoff()) ccvalue = MinCutoff(); |
// the entire controller range (0..127) to avoid a "dead" lower |
192 |
} else { |
// controller zone (that is to avoid a certain CC value range where |
193 |
// for our own filter types we interpret "minimum cutoff" |
// the controller would not change the cutoff frequency) |
194 |
// differently: GSt handles this as a simple hard limit with the |
ccvalue = MinCutoff() + (ccvalue / 127.f) * float(127 - MinCutoff()); |
|
// consequence that a certain range of the controller is simply |
|
|
// dead; so for our filter types we rather remap that to |
|
|
// restrain within the min_cutoff..127 range as well, but |
|
|
// effectively spanned over the entire controller range (0..127) |
|
|
// to avoid such a "dead" lower controller zone |
|
|
ccvalue = MinCutoff() + (ccvalue / 127.f) * float(127 - MinCutoff()); |
|
|
} |
|
195 |
|
|
196 |
float cutoff = CutoffBase * ccvalue; |
float cutoff = CutoffBase * ccvalue; |
197 |
if (cutoff > 127.0f) cutoff = 127.0f; |
if (cutoff > 127.0f) cutoff = 127.0f; |