E-mu disk images: share the audio of a sample between the zones which play it - #374
Merged
git-moss merged 2 commits intoAug 21, 2026
Merged
Conversation
…h play it Reading a CD-ROM or hard disk image created its own copy of the audio of a sample for every zone which plays it. The presets of a bank map the same samples over and over - the first volume of the 'Emulator Standards' library plays 1480 samples from 25580 zones - so the image was expanded to many times its size while it was read: that 304 MB volume held 3.5 GB of audio instead of the 192 MB it contains, and the conversion ended with 'Java heap space' and no presets at all when the Java heap was smaller than that. The audio of a sample is now decoded once per channel selection and shared by all zones which play it, which the zones of a chorus pair already did. Reading that volume holds 192 MB, finishes in a 512 MB heap and delivers every one of its 25580 zones with byte-identical audio.
The Emulator III and the EOS samplers share the E-mu disk file system and neither of them can read the banks of the other, so the generic ISO/IMG format tries both of them on the same image. Reading the files of an image reads all of their content, so a full library CD-ROM was loaded a second time only to find that it holds no bank of the second format. The files are now read once and offered to both formats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converting from an E-mu library CD-ROM image runs out of memory on a normal Java heap, because reading the image creates a separate copy of the audio of a sample for every zone which plays it.
The presets of a bank map the same samples over and over: the first volume of the 'Emulator Standards' library plays 1480 samples from 25580 zones. Its 304 MB image therefore held 3.5 GB of audio while it was read, instead of the 192 MB it contains. With a Java heap smaller than that the run ends with
Java heap spaceand no presets at all - and since the message is logged and the run then reportsFinished., it reads like a successful conversion which found nothing:The audio of a sample is now decoded once per channel selection - stereo, or the single channel which is left when a zone mutes one side - and shared by all zones which play it, whether or not they belong to the same preset. The zones of a chorus pair already shared their data this way, and the Emulator IV and Kurzweil detectors already keep their sample data per sample instead of per zone.
The second commit fixes the same image being read twice: the Emulator III and the EOS samplers share the file system and neither can read the banks of the other, so the generic ISO/IMG format tries both on the same image, and reading the files of an image reads all of their content. The files are now read once and offered to both formats.
Measured on
Vol1_EmulatorStandards.iso(304 MB):Verified against the unchanged version by digesting every zone of the image - SHA-256 of its audio plus key range, root key, velocity range, tuning, gain, panning and loops: all 25580 zones of its 1255 presets are identical, as is the full log of an Analyse run. An EOS CD-ROM image (812 presets) also reads identically and still needs the same heap, since only its number of reads changes.