Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure SF2 to not over-load #1390

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

baconpaul
Copy link
Contributor

The SF2 indexes samples by the preset/instrument/region but that resolves to a sample index. Since I was using P/I/R as SampleID that meant identical samples had different IDs and thus loaded multiple times. Defacto this made a 3MB SF2 with lots of instruments load as 90MB and stuff. Ugh.

So fix this in two ways

  1. Make loadeFromSF2 (p,i,r) remap the sample to index if needed
  2. Change the sample->load to be index based

and voila

The SF2 indexes samples by the preset/instrument/region
but that resolves to a sample index. Since I was using P/I/R
as SampleID that meant identical samples had different IDs
and thus loaded multiple times. Defacto this made a 3MB SF2
with lots of instruments load as 90MB and stuff. Ugh.

So fix this in two ways

1. Make loadeFromSF2 (p,i,r) remap the sample to index if needed
2. Change the sample->load to be index based

and voila
@baconpaul baconpaul merged commit 02099ff into surge-synthesizer:main Sep 29, 2024
12 checks passed
@baconpaul baconpaul deleted the sf2-sample-fix branch September 29, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant