GestureSynth.me

Music calculator

Audio Sample Memory Calculator

Estimate sampler bank RAM for equal PCM assets, including per-asset block padding. Compare raw data, allocated bytes and binary mebibytes.

audio sample memory calculator

Audio Sample Memory Calculator guide

Sample banks can occupy more memory than the combined PCM payload when a sampler reserves each waveform in whole blocks. Enter frames per asset, number of equal assets, stored bytes per frame and the allocator's block size. The per-asset and whole-bank results make the overhead visible.

Play the instrument ↑
Default result
32768 bytes allocated

Calculation and units

Multiply frames by stored bytes per frame for one payload. Divide by the allocation unit, round up to a whole number of blocks, then multiply by the block size. Apply this rounding separately to each asset before multiplying by the count.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Sixteen short mono assets

Frames per sample asset = 1000 · Number of equal assets = 16 · Stored bytes per frame = 2 · Allocation block (bytes) = 256.

32768 bytes allocated. 2048 bytes reserved per asset · 2000 bytes of PCM per asset · 768 bytes total padding · 0.03125 MiB for the bank. Each asset begins on a new allocation block.

Each two-thousand-byte waveform occupies eight blocks. Padding applies separately to each waveform, so packing the combined payload only once would understate memory.

One sample asset

Frames per sample asset = 1000 · Number of equal assets = 1 · Stored bytes per frame = 2 · Allocation block (bytes) = 256.

2048 bytes allocated. 2048 bytes reserved per asset · 2000 bytes of PCM per asset · 48 bytes total padding · 0.001953 MiB for the bank. Each asset begins on a new allocation block.

Use one asset to audit the allocation unit against the sampler's memory display. Then multiply the per-asset cost by the number of equally sized items.

Perfect block fit

Frames per sample asset = 1024 · Number of equal assets = 16 · Stored bytes per frame = 2 · Allocation block (bytes) = 256.

32768 bytes allocated. 2048 bytes reserved per asset · 2048 bytes of PCM per asset · 0 bytes total padding · 0.03125 MiB for the bank. Each asset begins on a new allocation block.

Each waveform ends on a block boundary. The library incurs no end padding in this configuration, though a real sampler may store headers elsewhere.

One frame beyond a boundary

Frames per sample asset = 1025 · Number of equal assets = 16 · Stored bytes per frame = 2 · Allocation block (bytes) = 256.

36864 bytes allocated. 2304 bytes reserved per asset · 2050 bytes of PCM per asset · 4064 bytes total padding · 0.035156 MiB for the bank. Each asset begins on a new allocation block.

Two extra payload bytes trigger an additional block for every waveform. Small changes in sample length can produce a step in the bank total.

Stereo packed 24-bit

Frames per sample asset = 1000 · Number of equal assets = 16 · Stored bytes per frame = 6 · Allocation block (bytes) = 256.

98304 bytes allocated. 6144 bytes reserved per asset · 6000 bytes of PCM per asset · 2304 bytes total padding · 0.09375 MiB for the bank. Each asset begins on a new allocation block.

Three stored bytes per channel make a six-byte stereo frame. A sampler that stores each channel in a four-byte word needs a different frame size.

Byte-packed storage

Frames per sample asset = 1000 · Number of equal assets = 16 · Stored bytes per frame = 2 · Allocation block (bytes) = 1.

32000 bytes allocated. 2000 bytes reserved per asset · 2000 bytes of PCM per asset · 0 bytes total padding · 0.030518 MiB for the bank. Each asset begins on a new allocation block.

An allocation unit of one byte removes all alignment overhead. This gives the raw payload for comparison with the blocked allocation model.

Interpreting the result

Measure or document the sampler's internal storage width. Stereo sixteen-bit PCM uses four packed bytes per frame. A player that expands samples to floating point may store eight bytes per stereo frame even when its source file uses fewer bytes.

Measurement and model limits

The estimate covers equal-length assets with independent aligned allocations. Separate loop tables, metadata, guards, stream buffers and duplicated layers can consume additional RAM. A player that references one shared waveform for many voices may need only one sample allocation.

Answers before you play

Common questions

How do I handle several asset lengths?

Group files by frame count and storage layout, calculate each group separately, then add the allocated byte totals. Rounding one average length can give the wrong result.

What does MiB mean?

One mebibyte contains 1,048,576 bytes. A decimal megabyte contains 1,000,000 bytes, so identical allocations produce different numeric values.

Is the number of voices the asset count?

Count independently stored waveforms. Multiple voices can play one shared sample buffer, depending on the sampler architecture.

Can I model an unaligned bank?

Use a block size of one byte when the format packs consecutive payloads without allocation padding. Account separately for any bank header or index.