Skip to content

Commit

Permalink
Version 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
FigBug committed Oct 4, 2023
1 parent 8de9601 commit 3ac3543
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down
4 changes: 4 additions & 0 deletions Changelist.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/gin
28 changes: 27 additions & 1 deletion plugin/Source/WavetableVoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 3ac3543

Please sign in to comment.