Skip to content

Commit

Permalink
Int and Power on Runnign Voices and Groups for procs
Browse files Browse the repository at this point in the history
1. Int values snap every block from zone (voice) and group (group)
   meaning running voices experience and reset int params
2. The power/bypass button works on voices and groups for processors.
   this does change the voice allocation pattern slightly in that
   we init a processor on voice on whether active or not since we
   don't want to do mid-init power on for a bypassed processor which
   becomes unbypassed, but we don't run it, just init it

Addresses #957
  • Loading branch information
baconpaul committed Sep 13, 2024
1 parent dbf3cc2 commit 92dd1b0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dsp/processor/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ struct Processor : MoveableOnly<Processor>, SampleRateSupport
const ProcessorStorage &ps, float *fp, int *ip, bool needsMetadata);

public:
bool bypassAnyway{false};

size_t preReserveSize[16]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
size_t preReserveSingleInstanceSize[16]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

Expand Down
3 changes: 3 additions & 0 deletions src/dsp/processor/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ inline void runSingleProcessor(int i, float fpitch, Processor *processors[engine
Mix &outLev, Endpoints *endpoints, bool &chainIsMono,
float input[2][N], float output[2][N])
{
if (processors[i]->bypassAnyway)
return;

namespace mech = sst::basic_blocks::mechanics;

float tempbuf alignas(16)[2][N];
Expand Down
9 changes: 9 additions & 0 deletions src/engine/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ template <bool OS> void Group::processWithOS(scxt::engine::Engine &e)

if (processors[0] || processors[1] || processors[2] || processors[3])
{
for (int i = 0; i < processorsPerZoneAndGroup; ++i)
{
if (processors[i])
{
memcpy(&processorIntParams[i][0], processorStorage[i].intParams.data(),
sizeof(processorIntParams[i]));
processors[i]->bypassAnyway = !processorStorage[i].isActive;
}
}

#define CALL_ROUTE(FNN) \
if constexpr (OS) \
Expand Down
11 changes: 10 additions & 1 deletion src/voice/voice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,15 @@ template <bool OS> bool Voice::processWithOS()

if (processors[0] || processors[1] || processors[2] || processors[3])
{
for (int i = 0; i < processorsPerZoneAndGroup; ++i)
{
if (processors[i])
{
memcpy(&processorIntParams[i][0], zone->processorStorage[i].intParams.data(),
sizeof(processorIntParams[i]));
processors[i]->bypassAnyway = !zone->processorStorage[i].isActive;
}
}
switch (zone->outputInfo.procRouting)
{
case engine::HasGroupZoneProcessors<engine::Zone>::procRoute_linear:
Expand Down Expand Up @@ -686,7 +695,7 @@ void Voice::initializeProcessors()
memcpy(&processorIntParams[i][0], zone->processorStorage[i].intParams.data(),
sizeof(processorIntParams[i]));

if ((processorIsActive[i] && processorType[i] != dsp::processor::proct_none) ||
if ((/* processorIsActive[i] && */ processorType[i] != dsp::processor::proct_none) ||
(processorType[i] == dsp::processor::proct_none && !processorIsActive[i]))
{
processors[i] = dsp::processor::spawnProcessorInPlace(
Expand Down

0 comments on commit 92dd1b0

Please sign in to comment.