From 8382e83899567bc720d9e2557e1ddfc048e91065 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Sun, 12 May 2024 11:04:38 +0200 Subject: [PATCH] feat(DmSynth): transfer `key_group` -> `exclusiveClass` generator --- src/Performance.c | 6 +++++- src/util/Tsf.c | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Performance.c b/src/Performance.c index d30e37f..e39c221 100644 --- a/src/Performance.c +++ b/src/Performance.c @@ -723,7 +723,11 @@ static void DmPerformance_handleSegmentMessage(DmPerformance* slf, DmMessage_Seg // The message starts at the indicated message's time but aligned at zero based on the start offset. uint32_t mt = slf->time + m->time - start; - DmMessageQueue_add(&slf->control_queue, m, mt, DmQueueConflict_REPLACE); + if (m->type != DmMessage_NOTE) { + DmMessageQueue_add(&slf->control_queue, m, mt, DmQueueConflict_REPLACE); + } else { + DmMessageQueue_add(&slf->control_queue, m, mt, DmQueueConflict_APPEND); + } } // If we don't yet have a command, add it! diff --git a/src/util/Tsf.c b/src/util/Tsf.c index e88e417..be6e839 100644 --- a/src/util/Tsf.c +++ b/src/util/Tsf.c @@ -30,6 +30,7 @@ enum { kInitialAttenuation = 48, kSampleID = 53, kSampleModes = 54, + kExclusiveClass = 57, kSamplePadding = 46, }; @@ -230,9 +231,9 @@ static DmResult Dm_createHydraSkeleton(DmDls* dls, struct tsf_hydra* res) { // -> We need one sample for each instrument region res->shdrNum += ins->region_count; - // -> We need 6 generators for the implicit 'kKeyRange', 'kVelRange', 'kAttackVolEnv', - // 'kInitialAttenuation', 'kSampleModes' and 'kSampleID' for each zone - res->igenNum += ins->region_count * 6; + // -> We need 7 generators for the implicit 'kKeyRange', 'kVelRange', 'kAttackVolEnv', + // 'kInitialAttenuation', 'kSampleModes', 'kSampleID', 'kExclusiveClass' for each zone + res->igenNum += ins->region_count * 7; // -> We need one generator for each instrument-level articulator connection for (size_t a = 0; a < ins->articulator_count; ++a) { @@ -362,6 +363,10 @@ static DmResult Dm_createHydra(DmDls* dls, struct tsf_hydra* hydra, float** pcm, hydra->igens[igen_ndx].genAmount.wordAmount = shdr_ndx; igen_ndx++; + hydra->igens[igen_ndx].genOper = kExclusiveClass; + hydra->igens[igen_ndx].genAmount.wordAmount = reg->key_group; + igen_ndx++; + // Additional sample configuration. struct tsf_hydra_shdr* hdr = &hydra->shdrs[shdr_ndx]; *hdr = default_shdrs[reg->link_table_index];