| 265 | } |
| 266 | |
| 267 | void onSampleRateChange() override { |
| 268 | bool forceUpdate = true; |
| 269 | updateEQsIfChanged(forceUpdate); |
| 270 | |
| 271 | // at low sample rates (e.g. 24kHz), shelf filter is at Nyquist! |
| 272 | const float shelfSampleRate = std::min(0.4f * APP->engine->getSampleRate(), 12000.0f); |
| 273 | |
| 274 | for (int c = 0; c < 16; c += 4) { |
| 275 | for (int side = 0; side < 2; ++side) { |
| 276 | highpass[c / 4][side].setCutoff(25.0f, 0.8f, AeFilterType::AeHIGHPASS); |
| 277 | highshelf[c / 4][side].setParams(shelfSampleRate, 0.8f, -5.0f, AeEQType::AeHIGHSHELVE); |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void updateEQsIfChanged(bool forceUpdate = false) { |
| 283 | float highGain = params[HIGH_PARAM].getValue(); |
nothing calls this directly
no test coverage detected