kopia lustrzana https://github.com/jameshball/osci-render
15 wiersze
328 B
C++
15 wiersze
328 B
C++
#include "EffectApplication.h"
|
|
#include <numbers>
|
|
#include "../MathUtil.h"
|
|
|
|
void EffectApplication::resetPhase() {
|
|
phase = 0.0;
|
|
}
|
|
|
|
double EffectApplication::nextPhase(double frequency, double sampleRate) {
|
|
phase += 2 * std::numbers::pi * frequency / sampleRate;
|
|
phase = MathUtil::wrapAngle(phase);
|
|
|
|
return phase;
|
|
}
|