ComposeWithMe

Download Stems (Zip)

Download every track's original audio as a single zip

Overview

Downloads every track in a song as a single zip of the original audio files — the practical counterpart to GarageBand import. It's explicitly not a .band project: GarageBand's projectData format has no public schema (see that doc), so a faithful re-import bundle isn't buildable. This is the raw audio, named, zipped, ready to drag into any DAW instead.

How it works

  • downloadStemsZip() fetches every track's downloadUrl (GitHub raw URL or public Blob URL), adds each as a file to a JSZip archive under its track name, then generates the zip as a Blob client-side.
  • The zip is downloaded via a synthetic <a download> click on an URL.createObjectURL(blob) link, immediately revoked after the click — no server round-trip beyond the original per-track fetches.
  • The zip filename is derived from the song name, slugified ({song-slug}-stems.zip).

Key files

FileRole
src/lib/exportStems.tsdownloadStemsZip()
src/components/MultiTrackPlayer.tsx"Download stems" button, wires song name → zip filename

Limitations / notes

  • Everything happens in the browser tab — all track audio is fetched and held in memory before zipping, so very large songs (many/large tracks) could be memory-heavy on lower-end devices.
  • Available to any signed-in user who can view the song, not just the owner — the song page itself isn't owner-gated (any authenticated user can open any song by id), and track download URLs are public/no-auth once known.