Skip to content

Commit

Permalink
More parsominous with clobbering wav metadata in sfz load (#1310)
Browse files Browse the repository at this point in the history
Basically don't clobber. Just the endpoints. Still not correct.
Will open an issue on correct behavior when merging htis.

But this closes #1308
  • Loading branch information
baconpaul authored Sep 11, 2024
1 parent bab2c50 commit a1f71d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/engine/zone.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ struct Zone : MoveableOnly<Zone>, HasGroupZoneProcessors<Zone>, SampleRateSuppor
bool attachToSample(const sample::SampleManager &manager, int index = 0,
SampleInformationRead sir = ALL);
bool attachToSampleAtVariation(const sample::SampleManager &manager, const SampleID &sid,
int16_t variation)
int16_t variation, SampleInformationRead sir = ALL)
{
variantData.variants[variation].sampleID = sid;
variantData.variants[variation].active = true;

return attachToSample(manager, variation);
return attachToSample(manager, variation, sir);
}

void setNormalizedSampleLevel(bool usePeak = false, int associatedSampleID = -1);
Expand Down
8 changes: 5 additions & 3 deletions src/sample/sfz_support/sfz_import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ bool importSFZ(const fs::path &f, engine::Engine &e)
z->mapping.velocityRange.velEnd == ve)
{
int idx = roundRobinPosition - 1;
z->attachToSampleAtVariation(*e.getSampleManager(), sid, idx);
z->attachToSampleAtVariation(*e.getSampleManager(), sid, idx,
engine::Zone::ENDPOINTS);
attached = true;
break;
}
Expand Down Expand Up @@ -304,7 +305,7 @@ bool importSFZ(const fs::path &f, engine::Engine &e)
}
else
{
SCLOG("Unsupported loop_mode : " << oc.value);
SCLOG("SFZ Unsupported loop_mode : " << oc.value);
}
}

Expand All @@ -326,7 +327,8 @@ bool importSFZ(const fs::path &f, engine::Engine &e)
}
}
}
zn->attachToSample(*e.getSampleManager());
zn->attachToSample(*e.getSampleManager(), 0,
engine::Zone::SampleInformationRead::ENDPOINTS);
group->addZone(zn);
}
if (firstGroupWithZonesAdded == -1)
Expand Down

0 comments on commit a1f71d3

Please sign in to comment.