bool SPECTACLE2_BASE::set_freqrange(float min, float max, const char *type) { if (min != _minfreq || max != _rawmaxfreq) { _rawmaxfreq = max; if (max == 0.0f) max = _nyquist; if (max < min) _fswap(&min, &max); if (max > _nyquist) max = _nyquist; _minfreq = _fclamp(0.0f, min, max); update_bin_groups(_bin_groups, _minfreq, max, _control_table_size, type); return true; } return false; }
// --------------------------------------------------------- set_eq_freqrange -- // Similar to set_freqrange in base class, but for _eq_bin_groups. bool SPECTACLE2::set_eq_freqrange(float min, float max) { if (min != _eq_minfreq || max != _eq_rawmaxfreq) { _eq_rawmaxfreq = max; if (max == 0.0f) max = _nyquist; if (max < min) _fswap(&min, &max); if (max > _nyquist) max = _nyquist; _eq_minfreq = _fclamp(0.0f, min, max); update_bin_groups(_eq_bin_groups, _eq_minfreq, max, _eqtablen, "EQ"); return true; } return false; }
bool SpectacleBase::set_freqrange(float min, float max) { if (min != _minfreq || max != _maxfreq) { if (max == 0.0f) max = _nyquist; if (max < min) _fswap(&min, &max); if (max > _nyquist) max = _nyquist; _maxfreq = max; _minfreq = _fclamp(0.0f, min, max); update_bin_groups(_bin_groups, NULL, _minfreq, max, _control_table_size); return true; } return false; }
// ------------------------------------------------------ set_delay_freqrange -- // Similar to set_freqrange in base class, but for _delay_bin_groups. bool Spectacle::set_delay_freqrange(float min, float max) { if (min != _delay_minfreq || max != _delay_maxfreq) { if (max == 0.0f) max = _nyquist; if (max < min) _fswap(&min, &max); if (max > _nyquist) max = _nyquist; _delay_maxfreq = max; _delay_minfreq = _fclamp(0.0f, min, max); update_bin_groups(_delay_bin_groups, _delay_binmap_table, _delay_minfreq, max, _delay_table_size); return true; } return false; }