From 3ac3543a67705856fb8eeb9dde19b292a2a095cb Mon Sep 17 00:00:00 2001 From: Roland Rabien Date: Tue, 3 Oct 2023 18:27:12 -0700 Subject: [PATCH] Version 1.0.9 --- CMakeLists.txt | 2 +- Changelist.txt | 4 ++++ modules/gin | 2 +- plugin/Source/WavetableVoice.cpp | 28 +++++++++++++++++++++++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1b554d..63fcbea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required (VERSION 3.16.0 FATAL_ERROR) # Set for each plugin # set (PLUGIN_NAME Wavetable) -set (PLUGIN_VERSION 1.0.8) +set (PLUGIN_VERSION 1.0.9) set (BUNDLE_ID com.socalabs.wavetable) set (AU_ID WavetableAU) set (LV2_URI "https://socalabs.com/wavetable/") diff --git a/Changelist.txt b/Changelist.txt index 0fd7b1a..bb4bf69 100644 --- a/Changelist.txt +++ b/Changelist.txt @@ -1,3 +1,7 @@ +1.0.9: + +- Tweaked the way phase works with unison oscillators + 1.0.8: - Fixed loading custom Wavetables in second oscillator diff --git a/modules/gin b/modules/gin index 38741ae..ef1b80a 160000 --- a/modules/gin +++ b/modules/gin @@ -1 +1 @@ -Subproject commit 38741aed5ba543ba7bac2ce41b025a3b96dc5d68 +Subproject commit ef1b80ac128815eb18c6a309e95ddf4b044940cc diff --git a/plugin/Source/WavetableVoice.cpp b/plugin/Source/WavetableVoice.cpp index 40a10d3..b08a874 100644 --- a/plugin/Source/WavetableVoice.cpp +++ b/plugin/Source/WavetableVoice.cpp @@ -52,7 +52,33 @@ void WavetableVoice::noteStarted() snapParams(); for (auto idx = 0; auto& osc : oscillators) - osc.noteOn (proc.oscParams[idx++].retrig->getBoolValue() ? 0.0f : proc.rng.nextFloat()); + { + auto& params = proc.oscParams[idx++]; + auto retrig = params.retrig->getBoolValue(); + auto voices = params.voices->getUserValue(); + + if (voices == 1) + { + osc.noteOn (retrig ? 0.0f : proc.rng.nextFloat()); + } + else if (retrig) + { + float phases[8] = { 0.0f }; + + for (auto i = 0; i < voices; i++) + phases[i] = 1.0f / voices * i; + + osc.noteOn (phases); + } + else + { + float phases[8]; + for (auto& p : phases) + p = proc.rng.nextFloat(); + + osc.noteOn (phases); + } + } noise.noteOn(); sub.noteOn (proc.subParams.retrig->getBoolValue() ? 0.0f : proc.rng.nextFloat());