← All modules
AvailableInstrument

Granular

A recording split into a playable grain cloud.

Engine preview

Not built for macOS, Windows or Linux

About

A granular synthesis instrument over the site's public-domain takes: a stream of short windowed slices, grains, whose position, size, density, pitch and direction you shape live. Hold a note and you are not looping the take, you are standing somewhere inside it.

Build evidence

Every row below is a recorded build row or the recorded absence of one. Nothing here is inferred from what this module is meant to support.

Module
music.codex.granular v0.1.0
Built at
no recorded row carries a build time; the browser lanes record none
Closure hash
not a Processor — no lowering closure
Toolchain
  • scriptc 64acce1ae3b8…
  • moduleToolchainDist c621ffab721d…
  • pluginShellKitRuntime bca003784692…
  • faceShellGeneration 8533207ab81f…
  • uiPreservation cd28dbd7e3d6…
  • packagerVersion 3
Build result and download for each format
FormatResultDownload
Browser package (JS)Not built by this module's lane

this module has no release.json; its packager lane records no browser program rows

Not built for the browser
Browser package (WASM)Not built by this module's lane

this module has no release.json; its packager lane records no browser program rows

Not built for the browser
VST3Not built — the native export is blocked

native-export.json records nativeEligibility "blocked"

Not built for macOS, Windows or Linux
Audio UnitNot built — the native export is blocked

native-export.json records nativeEligibility "blocked"

Not built for macOS
CLAPNot built — the native export is blocked

native-export.json records nativeEligibility "blocked"

Not built for macOS, Windows or Linux
Standalone appNot built — the native export is blocked

native-export.json records nativeEligibility "blocked"

Not built for macOS, Windows or Linux

Parity

No lane recorded an artifact; there is no parity evidence.

Presets

Start from a named sound, then adjust the instrument to make it yours.

InitDefault

Signal graph.

Experimental

Migration fallback: approximated from parameter groups, not a runtime wiring diagram.

How it works.

A grain is a short slice of the take, twenty milliseconds to half a second, wrapped in an amplitude window that starts and ends at exactly zero. That zero-endpoint window is the entire trick: it is what lets the instrument start and stop dozens of slices per second with no clicks, because every grain's edge is a fade, not a cut. Five window shapes are published, and they are timbres as much as envelopes: a Hann grain is smooth, an Expodec grain is a struck one.

A held note is a scheduled stream. A single 25 ms timer walks every sounding voice and schedules all grains due in the next 120 ms against the audio clock, so grains land sample-accurately even when the main thread stutters. Each grain draws its start offset, duration, playback rate, direction and stereo position from pure, seeded random functions (granular-bank.ts), the character of the cloud is testable arithmetic, and the voice pool only turns numbers into nodes.

Density and Size together set the overlap, at 18 grains a second and 90 ms each, roughly 1.6 grains sound at any instant, and overlapping grains sum. The pool compensates with a gain of one over the square root of the expected overlap: square root rather than linear because uncorrelated grains add in power, not amplitude. That is why sweeping Density changes the texture from rhythm to wash without also being a volume knob.

Reverse grains cost nothing at play time because the take is reversed once at load: a reversed copy of the buffer is built alongside the forward one, and a backwards grain is a forwards read of the reversed copy at the mirrored offset. The reverse knob is a probability per grain rather than a switch, which is what makes 50% sound like time losing its direction rather than like a tape flip.

Pitch is playback rate, exactly as on the classic granular samplers: a grain an octave up reads its slice twice as fast, so rising pitch also shrinks how much of the take each grain carries. Keytrack decides whether the keyboard drives that rate. On, the pool is an instrument, middle C is unity and every key transposes. Off, every key fires the identical cloud, which turns the keyboard into a trigger pad for a texture whose pitch you set by hand.

The take is fetched and decoded when selected, not bundled: the sources are the site's own public-domain guitar takes, credited in public/audio/CREDITS.json. A note struck before the decode lands starts its envelope immediately and the grains join the moment the buffer arrives, a deliberate echo of the wavetable module's rule that silence indistinguishable from breakage is the one thing a module must not produce.

Goes well with.

Preview

Wavetable

Single-cycle waves with continuous position morphing.

PreviewNot built for macOS, Windows or Linux
Preview

Gamelan

Modelled bronze instruments with flexible tuning.

Preview
Preview

Space Mini

Convolution reverb: eight synthesized spaces, twenty-five real cabinets.

PreviewNo build recorded