MCPcopy Create free account
hub / github.com/VCVRack/Befaco / onSampleRateChange

Method onSampleRateChange

src/StereoStrip.cpp:267–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 3

getSampleRateMethod · 0.80
setCutoffMethod · 0.80
setParamsMethod · 0.80

Tested by

no test coverage detected