Prepare the coeffs initially in filter-based effects
This commit is contained in:
parent
1ba834a892
commit
98b44d7097
4 changed files with 20 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ namespace fx {
|
|||
void Eq::setSampleRate(double sampleRate)
|
||||
{
|
||||
_filter.init(sampleRate);
|
||||
prepareFilter();
|
||||
}
|
||||
|
||||
void Eq::setSamplesPerBlock(int samplesPerBlock)
|
||||
|
|
@ -46,6 +47,7 @@ namespace fx {
|
|||
void Eq::clear()
|
||||
{
|
||||
_filter.clear();
|
||||
prepareFilter();
|
||||
}
|
||||
|
||||
void Eq::process(const float* const inputs[], float* const outputs[], unsigned nframes)
|
||||
|
|
@ -93,5 +95,10 @@ namespace fx {
|
|||
return absl::make_unique<Eq>(desc);
|
||||
}
|
||||
|
||||
void Eq::prepareFilter()
|
||||
{
|
||||
_filter.prepare(_desc.frequency, _desc.bandwidth, _desc.gain);
|
||||
}
|
||||
|
||||
} // namespace fx
|
||||
} // namespace sfz
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ namespace fx {
|
|||
*/
|
||||
static std::unique_ptr<Effect> makeInstance(absl::Span<const Opcode> members);
|
||||
|
||||
private:
|
||||
void prepareFilter();
|
||||
|
||||
private:
|
||||
sfz::FilterEq _filter;
|
||||
EQDescription _desc;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ namespace fx {
|
|||
void Filter::setSampleRate(double sampleRate)
|
||||
{
|
||||
_filter.init(sampleRate);
|
||||
prepareFilter();
|
||||
}
|
||||
|
||||
void Filter::setSamplesPerBlock(int samplesPerBlock)
|
||||
|
|
@ -48,6 +49,7 @@ namespace fx {
|
|||
void Filter::clear()
|
||||
{
|
||||
_filter.clear();
|
||||
prepareFilter();
|
||||
}
|
||||
|
||||
void Filter::process(const float* const inputs[], float* const outputs[], unsigned nframes)
|
||||
|
|
@ -96,5 +98,10 @@ namespace fx {
|
|||
return absl::make_unique<Filter>(desc);
|
||||
}
|
||||
|
||||
void Filter::prepareFilter()
|
||||
{
|
||||
_filter.prepare(_desc.cutoff, _desc.resonance, _desc.gain);
|
||||
}
|
||||
|
||||
} // namespace fx
|
||||
} // namespace sfz
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ namespace fx {
|
|||
*/
|
||||
static std::unique_ptr<Effect> makeInstance(absl::Span<const Opcode> members);
|
||||
|
||||
private:
|
||||
void prepareFilter();
|
||||
|
||||
private:
|
||||
sfz::Filter _filter;
|
||||
FilterDescription _desc;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue