From 2b2a373b13985b8931f76db52149c910d2dcc9f8 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Wed, 23 Sep 2020 01:10:24 +0200 Subject: [PATCH] Add FM synthesis --- src/sfizz/Voice.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 8d5479e2..ae49816a 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -757,11 +757,15 @@ void sfz::Voice::fillWithGenerator(AudioSpan buffer) noexcept break; case 1: // PM synthesis - return; // Note(jpc): not yet implemented + // Note(jpc): not implemented, just do FM instead + goto fm_synthesis; break; case 2: // FM synthesis - return; // Note(jpc): not yet implemented + fm_synthesis: + fill(*detuneSpan, 1.0f); + multiplyAdd(*modulatorSpan, *frequencies, *frequencies); + oscCar.processModulated(frequencies->data(), detuneSpan->data(), tempSpan->data(), buffer.getNumFrames()); break; }