Skip to content
Soundscape Mixer

Soundscape Mixer

Soundscape Mixer (hereinafter the “Application”) is a free web app for mixing ambience, such as a tavern, a forest or a storm, to focus to or to play tabletop sessions over. You switch sounds on, set how loud each one is, and the Application plays them together.

The live instance is available at https://soundscape.spellware.dev.

  1. Open the page. Nothing plays yet, because browsers only allow sound after you interact with a page.
  2. Select a scene, or move the volume slider of any sound up from zero. Either one starts playback.
  3. Adjust the sounds to taste. Changes are heard at once.
  4. Select Pause to stop everything, and Play to carry on.

Select Switch everything off to silence every sound but keep your master volume.

There are 60 sounds in seven categories. Each has its own volume slider.

CategorySounds
TavernQuiet murmur, busy hall, next room, clinking tankards, mugs on wood, lute, tin whistle, creaking door, footsteps, crowd cheer
ForestBirdsong, cuckoo, owl, crickets, cicadas, frogs, rustling leaves, woodpecker, wolf howl, crows
Storm and weatherLight rain, steady rain, downpour, rain on a roof, rain on leaves, breeze, howling gale, blizzard, hail, distant thunder, thunderclaps
WaterBabbling stream, wide river, waterfall, ocean waves, lapping lake, seagulls
FireCampfire, hearth, roaring bonfire, torch flame
Dungeon and arcaneCave drone, deep rumble, dripping water, whispers, rattling chains, tolling bell, wind chimes, arcane hum, singing bowl
FocusWhite noise, pink noise, brown noise, desk fan, starship hum, ticking clock, page turns, ambient pad, music box, harp

A card is marked Loop, Random or Music:

KindWhat it does
LoopPlays continuously, such as rain or a crowd
RandomFires now and then, such as thunder or an owl. A second slider, How often, makes it rarer or more frequent
MusicPlays short phrases made up as it goes, such as the lute, the tin whistle and the harp. How often sets the gap between phrases

Use the search box to find a sound by name, and tick Only sounds that are on to see just the ones you are using.

A scene is a ready-made mix. Selecting one sets every sound and leaves your master volume alone. There are 14 built-in scenes:

KeyScene
1Busy tavern
2Quiet inn by the fire
3Thunderstorm camp
4Misty forest dawn
5Night in the woods
6Seaside cliffs
7Dungeon crawl
8Haunted manor
9Deep focus
NoneRainy library, Wizard’s study, Blizzard camp, Riverside camp and Starship bridge

To keep your own mix, type a name and select Save scene. Saving a scene with the same name replaces it. Saved scenes appear under Your scenes, and each has a Delete button.

Select Copy share link. Anyone who opens the link hears the same mix, with the same volumes and the same How often settings. The mix is carried in the part of the address after the #, so it is never sent to a server.

The master slider changes the overall volume, and Mute silences everything without changing your mix. The sleep timer can be set to 15, 30, 45, 60, 90 or 120 minutes. It counts down on the page, fades the sound out over the last 30 seconds, and then pauses.

KeyAction
SpacePlay or pause, unless a button has focus
MMute or unmute
[ and ]Lower and raise the master volume
1 to 9Load a built-in scene
0Switch everything off

The shortcuts do nothing while you are typing in a box.

Every sound can be synthesised, and 29 of them also have a real recording that plays instead. These are CC0 recordings from Freesound, covering rain, the ocean, fire, crickets, crowds, thunder, owls, wolves, bells, door creaks and more. The author of each one is credited in a file published at https://soundscape.spellware.dev/samples/CREDITS.md.

A recording is only downloaded when you switch its sound on, so the first time takes a moment to start. If it cannot be loaded, the Application plays the synthesised version instead.

Your browser may offer to install the Application. Once the page has loaded, it works without a connection. Synthesised sounds always work offline. A recording works offline once you have played that sound while online.

  1. Check that the master volume is up, Mute is off and the sound you want is above zero.
  2. Press Play. Nothing starts until you interact with the page.
  3. Check that the sleep timer has not already paused playback.
  4. Check your device volume and that the browser tab is not muted.

The Application is a static single page app written in TypeScript with Vite and React. There is no server component and no database. Every synthesised sound is generated in the browser with the Web Audio API.

Terminal window
pnpm install
pnpm dev
ScriptPurpose
pnpm devStarts the Vite dev server on port 8002
pnpm buildType checks, then writes the production build to dist/
pnpm previewServes the production build on port 8002
pnpm lintRuns ESLint with zero warnings allowed
pnpm testRuns Vitest with coverage
PathContents
src/coreThe framework free logic: the sound engine, the mix state, scenes, the sleep timer, share links, persistence and the sample loader
src/core/synthThe building blocks that sounds are made from
src/core/soundsThe catalogue: one recipe for each of the 60 sounds, grouped by category
src/uiThe React interface and the hooks that connect it to the engine
public/samplesThe recordings, manifest.json and CREDITS.md
testThe Vitest suites

The sounds are built from a small set of parts: looping noise (white, pink and brown), filters, low frequency oscillators, parameters that drift to random values, one shot tones, bursts of filtered noise, struck bells made from several partials, plucked strings from a Karplus-Strong model, and sung vowels made with formant filters. Crowd chatter is many voices that shift between vowels and pause at random. It is not recorded speech.

The engine owns the audio context and builds a sound only while it is switched on, so an idle sound costs nothing. Every sound feeds a master gain, and that feeds a compressor used as a limiter, so stacking many sounds cannot clip. Each sound has a trim value, set from measured loudness, so that a slider at the same position gives roughly the same loudness whichever sound it controls.

Random and music sounds are scheduled with timers. The How often setting scales the gap between events from four times longer, at 0, to four times shorter, at 100, with 50 leaving it alone. The page also plays a silent clip in a media element, which is what makes the operating system’s media controls appear.

public/samples/manifest.json maps a sound id to its files and a gain:

{
"rain-steady": { "files": ["rain-steady-1.mp3"], "gain": 0.65 },
"owl": { "files": ["owl-1.mp3", "owl-2.mp3"] }
}
  • The Application fetches only the manifest at first play. A sound’s files are downloaded and decoded when that sound is switched on, and kept until the page reloads.
  • Until a recording is ready the sound stays silent, so it never starts synthesised and then changes character. If the files fail to load, or take longer than 10 seconds, the sound falls back to synthesis. A recording that arrives late is still used.
  • A loop sound loops its first file, so it must be a seamless loop. A random or music sound plays one of its files each time it fires.
  • The gain matches a recording to the loudness of the synthesised sound it replaces. Entries for unknown sound ids, and files that fail to load, are ignored.
  • Use MP3, because Safari cannot play Ogg Vorbis. Delete manifest.json to use fully synthesised sound.

The Application keeps two values in the browser’s local storage. Nothing is sent to a server by the Application itself.

KeyHolds
soundscape.mixYour current mix, as text such as m=70&s=rain-steady:60:50
soundscape.scenesThe scenes you have saved

pnpm build writes a static site to dist/. nginx serves that directory at soundscape.spellware.dev, as configured in the nginx-configs repository. The page, the service worker and the manifest are sent with Cache-Control: no-cache, the content hashed files in assets/ are cached for a year, and the recordings in samples/ are cached for a day. An unknown path returns a 404 and is sent to the company 404 page.

The service worker precaches the application shell, and caches recordings and the shared SpellWare assets as they are fetched.

index.html loads the shared SpellWare headers script from https://cdn.spellware.dev/headers/index.js, with no features excluded. It adds the SpellWare header and footer, the page metadata and icons, the community popup, and the services listed in the legal section below. The Application’s own styles use the shared design tokens, with a fallback for each, so that the page still looks right if the script cannot load. The Application sits inside <main>, which the script turns into the page card. The page title beside the logo is taken from the document title.

The Application inherits SpellWare’s global legal documents:

  1. Privacy Policy: https://docs.spellware.dev/#/privacy
  2. Terms of Service: https://docs.spellware.dev/#/terms
  3. License: https://docs.spellware.dev/#/license

The Application has no accounts and no server side storage. It keeps two values, in your own browser:

DataKept
Your current mixIn your browser’s local storage, so that the page opens as you left it
Your saved scenesIn your browser’s local storage, until you delete them or clear your site data

A share link holds a mix in the part of the address after the #, which browsers never send to a server. All sound is made or decoded in your browser.

The recordings are dedicated to the public domain under Creative Commons Zero 1.0. Each one was checked on its own Freesound page, and the authors are credited in samples/CREDITS.md even though CC0 does not require it.

Like our other websites, the page loads the shared SpellWare headers script, which loads the following services. A consent banner asks for your choices. Their use of your data is covered by the Privacy Policy and by each provider’s own terms.

ServicePurpose
Secure PrivacyThe cookie consent banner
Google AnalyticsMeasuring how the site is used
HubSpotSite tracking and the chat widget
Google AdSenseAdvertising
Tree-NationThe tree planting widget in the footer

The Application’s repository is private, and it does not accept code contributions. Feedback and bug reports are welcome in the #bug-reports and #feature-requests forum channels in our Discord community.

For maintainers, the project uses:

  • TypeScript with the shared ESLint and TypeScript configs, and a zero warnings policy.
  • Vitest for tests, with 100% coverage enforced on src/core.
  • pnpm for package management.
Terminal window
pnpm install
pnpm lint
pnpm test
pnpm build
  1. Write the recipe in the right file in src/core/sounds, using the parts in src/core/synth, and add it to that file’s list. Give it a unique id in lower case with hyphens.
  2. Set its trim so that it is as loud as the others. Render it and measure its loudness rather than guessing.
  3. Run pnpm test. The catalogue tests build every sound with several random number sources and check the metadata, so a recipe that throws or has no summary fails.
  4. Add it to a scene in src/core/presets.ts if it belongs in one. The tests check that every scene only uses sounds that exist.
  1. Use a CC0 recording, and confirm the licence on the source page. Credit its author in public/samples/CREDITS.md.
  2. Convert it to mono MP3. For a loop, crossfade the end into the start so that it loops without a click, and check the seam.
  3. Normalise the loudness, then list it in manifest.json with a gain that matches the sound it replaces.