From 55242db4079af39c8a8c8c9db5c1747adbe6a52b Mon Sep 17 00:00:00 2001 From: HiveBeats Date: Fri, 8 Sep 2023 17:00:58 +0400 Subject: [PATCH] refactor: oscillator "process" method name --- inc/Adder.h | 2 +- inc/Oscillator.h | 2 +- src/Oscillator.cpp | 2 +- src/Synth.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/Adder.h b/inc/Adder.h index 186bf9d..e12a3eb 100644 --- a/inc/Adder.h +++ b/inc/Adder.h @@ -13,7 +13,7 @@ struct Adder { for (size_t i = 0; i < sample_count; i++) { float sample = 0.0f; for (Oscillator* osc : oscillators) { - sample += osc->GenerateSample(); + sample += osc->Process(); } signal[i] = sample; diff --git a/inc/Oscillator.h b/inc/Oscillator.h index 6944653..d655075 100644 --- a/inc/Oscillator.h +++ b/inc/Oscillator.h @@ -31,5 +31,5 @@ class Oscillator { float GetFreq() { return m_freq; } void SetFreq(float freq); void Reset(); - float GenerateSample(); + float Process(); }; diff --git a/src/Oscillator.cpp b/src/Oscillator.cpp index ce1f78a..6abe4b7 100644 --- a/src/Oscillator.cpp +++ b/src/Oscillator.cpp @@ -45,7 +45,7 @@ void Oscillator::SetFreq(float freq) { m_phase_dt = (this->*m_dt_function)(freq); } -float Oscillator::GenerateSample() { +float Oscillator::Process() { return (this->*m_osc_function)() * m_volume; } diff --git a/src/Synth.cpp b/src/Synth.cpp index d4b2591..0e49675 100644 --- a/src/Synth.cpp +++ b/src/Synth.cpp @@ -71,7 +71,7 @@ void Synth::Trigger(Note input) { } void Synth::apply_filter_lfo() { - float dt = m_lfo->GenerateSample(); + float dt = m_lfo->Process(); Filter* filter = (Filter*)m_effects[1]; float freq = filter->GetFreq(); //todo: check formula