Skip to content

E-mu disk images: share the audio of a sample between the zones which play it - #374

Merged
git-moss merged 2 commits into
git-moss:mainfrom
douglas-carmichael:emu-image-sample-sharing
Aug 21, 2026
Merged

E-mu disk images: share the audio of a sample between the zones which play it#374
git-moss merged 2 commits into
git-moss:mainfrom
douglas-carmichael:emu-image-sample-sharing

Conversation

@douglas-carmichael

Copy link
Copy Markdown
Contributor

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 space and no presets at all - and since the message is logged and the run then reports Finished., it reads like a successful conversion which found nothing:

Reading Emulator III bank 'Stereo Strings' with 13 preset(s) and 14 sample(s).
Java heap space
Finished.

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):

before after
audio held while reading 3521 MB 192 MB
distinct copies of audio 21903 1480
smallest heap which reads the image over 512 MB, fails 512 MB
Analyse run, 4 GB heap 9.7 s 7.8 s

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.

…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.
@git-moss
git-moss merged commit fd57e80 into git-moss:main Aug 21, 2026
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.

2 participants