Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c7fb29c
Grainbox 0.1.0-experimental (draft): a granular texture effect for FX…
Dec 3, 2026
b3a3ec7
Grainbox: voiced for ambient (from the author's first trials)
Dec 3, 2026
6c46fee
Grainbox: the performance record (worst 381.5, 1.21x SPRING REV) and …
Dec 3, 2026
7c97794
Grainbox: TONE in place of DIRT, and FDBK 127 freezes the ring (the a…
Dec 3, 2026
481ff0a
Grainbox: performance record re-measured after TONE (worst 371.9, 1.1…
Dec 3, 2026
185a470
Grainbox: textures swell in at TAIL's rate instead of 5 ms (SPARK sti…
Dec 3, 2026
56dde4b
Grainbox: BLUR in place of RAND, grains to 130 ms, a smaller ring for…
Dec 3, 2026
a200c74
Grainbox: performance record re-measured with BLUR (worst 414.8, 1.32…
Dec 3, 2026
b6bdce0
Grainbox: BLUR in two all-pass stages (467, 359) so it installs (wors…
Dec 3, 2026
b917ca6
Grainbox: test procedure record for package 7ee24439 (steps 1-11 on t…
Dec 4, 2026
f82db54
Grainbox: the author's stage on 7ee24439 (kept, played, Part reload a…
Dec 4, 2026
6c6c5c5
Grainbox: screens captured on the author's unit (package 7ee24439), a…
Dec 4, 2026
24e8409
Grainbox: the code review's fixes (an endless freeze, SHAP's glide, a…
Dec 4, 2026
66016cd
Grainbox: the screens declared in the module record, and the performa…
Dec 4, 2026
e8191ca
Grainbox: test procedure record for package 192662ab (the review fixe…
Dec 4, 2026
ac29468
Grainbox: the author's stage on 192662ab (kept, played, Part reload a…
Dec 4, 2026
ade6095
Grainbox: the maintainer's text fixes; the qualification record from …
Dec 5, 2026
27a39b1
Grainbox: the author's words for 192662ab ("Everything power cycled f…
Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions sdk/drafts/grainbox/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MIT License

Copyright (c) 2026 jrs1717

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

This licence covers this module's own source code and documentation only. It
does not extend to any Elektron Music Machines firmware, which is not
distributed here and remains the property of its copyright holder. Nothing in
this module is endorsed by, supported by, or affiliated with Elektron.
Octatrack and Elektron are trademarks of Elektron Music Machines MAV AB, used
only to identify the hardware this module targets.
74 changes: 74 additions & 0 deletions sdk/drafts/grainbox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Grainbox

Version 0.1.0-experimental · by @jrs1717 · the test procedure passed on the author's MKII (package 192662ab, steps 1-11); the author kept it, played it and power-cycled: "Everything power cycled fine, sounds great".

## Overview

Grainbox is a granular texture effect for an audio track's FX2 slot. It keeps the last third of a second of the track and, on a note grid at the project's tempo, plays it as grains of 10 to 130 ms with three read heads:
- **CLOUD** sprays grains from the recent audio into an immediate wash.
- **ORBIT** takes grains from a window that sweeps slowly back and forth, for hypnotic drones.
- **SPARK** fires grains together as rhythmic onsets, each a pluck that decays.

Each type has variations A to D. Every grain fades in over its first quarter and out over its last on a rounded curve, is slightly detuned, and takes its own place in the stereo field; each head takes a new grain as it comes round, so textures are click-free. Textures swell in and fade out at TAIL's pace. TONE darkens the grains, BLUR smears them into a reverb-like wash, and FDBK feeds them back so a cloud builds and evolves; at 127 it freezes the moment into an endless pad. MIX sets how far the grains replace the track, and TAIL how long a texture lingers.

## Controls

| Page | Knob | Name | Range | Default | What it does |
|---|---|---|---|---|---|
| Main | A | TIME | 1/64, 1/32, 1/16, 1/8, 1/4, 1/2 | 1/16 | The grid at the project's tempo. Textures start only on it and last a slice; SPARK's onsets divide it. |
| Main | B | ACT | 0-127 | 64 | How often a slice plays as grains: 0 never, 127 every slice (a continuous texture). |
| Main | C | SHAP | 0-127 | 32 | The grain's length: 10 ms at 0 to 130 ms at 127. When a head plays slower than normal grains stop growing, so there is still room to spray: about 90 ms with a half-speed head (CLOUD D, ORBIT B and C, SPARK), 54 ms with a quarter-speed one (ORBIT D, SPARK B and D at times). The grain glides to a new SHAP value over about 0.1 s, so a turn or a lock never clicks. |
| Main | D | RPT | 1-8 | 4 | CLOUD: how far back grains are sprayed, in eighths of the capture ring; the reach stops short of the ring's far end by a few grains, so at long grains the top steps sound the same. ORBIT: how wide the sweep is, in grain lengths. SPARK: onsets a slice. |
| Main | E | MIX | 0-127 | 64 | Up to 96 the track plays dry between textures and ducks under each one; from 96 to 127 the dry fades out, so 127 is the grains alone. |
| Main | F | TAIL | 0-127 | 64 | How slowly a texture swells in and how long it lingers after it ends (about 50 ms at 0, 3 s at 127); how long a SPARK pluck rings. |
| Setup | A | TYPE | CLOUD, ORBIT, SPARK | CLOUD | Which kind of texture (above). |
| Setup | B | TONE | 0-127 | 127 | The grains' brightness: a low-pass from about 200 Hz at 0 to fully open at 127, on their stereo spread too. It sits before the feedback, so with FDBK each pass gets darker. |
| Setup | C | VAR | A-D | A | CLOUD: A plain, B an octave shimmer, C one head reversed, D deep (an octave and a fifth down). ORBIT: A a fifth and an octave up, B an octave down and up, C dark (an octave and a fourth down), D random speeds. SPARK: A a major arpeggio, B octaves, C stacked fifths, D random steps. |
| Setup | D | WIDE | 0-127 | 0 | Stereo: each of CLOUD's and ORBIT's grains takes a new place within this width; SPARK's onsets ping-pong. |
| Setup | E | BLUR | 0-127 | 0 | Diffusion: smears the grains through two all-pass stages into a reverb-like wash. It sits before the feedback, so with FDBK each pass gets denser. The diffusion is mono, so the stereo spread narrows to half at 127. |
| Setup | F | FDBK | 0-127 | 0 | Feedback: up to about 90 % of the grains' level goes back into the capture ring, so a cloud builds on itself and evolves. At 127 the ring freezes: nothing new is recorded and the grains play the held moment on every slice as an endless pad, even after the track stops, until you turn it down. |

## Usage

Select an audio track, hold FUNC and press FX2, turn LEVEL to GRAINBOX at the end of the list and press YES. Press FX2 for the main page (TIME, ACT, SHAP, RPT, MIX, TAIL); hold FUNC and press FX2 for the setup page (TYPE, TONE, VAR, WIDE, BLUR, FDBK).

## Quick tutorial

1. Put Grainbox on FX2 of a track playing a pad or a drum loop. At the defaults it is CLOUD A at 1/16 with 40 ms grains.
2. Turn ACT and MIX to 127 to hear only the grains, then hold FUNC and press FX2 and step TYPE through CLOUD, ORBIT and SPARK.
3. Raise SHAP for longer grains, RPT for a wider spray or sweep (or more SPARK onsets), and TAIL to let textures swell and linger.
4. On the setup page, raise BLUR to smear the grains and FDBK to let them build; turn FDBK to 127 to freeze the moment, and TONE down to darken it.
5. Turn MIX back to 64 to blend the grains with the track again.

## Compatibility and limitations

- FX2 only: the capture ring needs an FX2 slot's buffer (15,870 words, stopping short of Sidechain Compressor's key window). On FX1 it passes the track dry.
- Textures follow the project's tempo but not yet the pattern's steps, track speed or swing: free-running tempo slices until the base has a step clock for effects ([issue #2491](https://github.com/repeat98/modwerk/issues/2491)).
- After a second of silent input no texture starts; after four seconds any texture or tail stops. The watch listens to the track's own input, so feedback cannot keep a stopped track going.
- It prefers effect id 10, as Fuzzbox, Glitchbox, Loopbox and Midiverb do: over USB the base gives each its own id; in a card set only one of them fits.
- Declared incompatible with Analog BD, which currently requires the stock DSP effects, as every custom DSP effect is.

## Tests and measurements

See [TESTING.md](TESTING.md).

## Authorship and licences

Original code by @jrs1717 under the MIT licence in LICENSE. It starts from the author's own Loopbox engine. Inspired by granular effects in general, with no product's code, tables or names.

## Screens and audio

![FX2 SETUP page with an effect list ending in Grainbox, selected; knobs labelled ORBIT, TONE, VAR, WIDE, BLUR and FDBK.](media/ot-location.png)

Hold FUNC and press FX2: Grainbox is chosen at the end of the effect list, with TYPE (here ORBIT), TONE and VAR on the top row and WIDE, BLUR and FDBK below.

![FX2 main page titled Grainbox with knobs TIME, ACT, SHAP, RPT, MIX and TAIL.](media/ot-controls.png)

Press FX2 for the main page: TIME, ACT and SHAP on top, RPT, MIX and TAIL below.

Captured over USB on the author's Octatrack (OS 1.40C, base ddb56b72); see `media/capture.json`. No audio preview yet.

## Develop

- Hear it: `npm run module:dev -- grainbox --cycles 408 --cycles-kind executed --state 130 --buffer 15870 --slots fx2`.
- Check it: `npm run module:doctor -- --draft grainbox`; `python3 -B verify.py` holds the engine to `reference.py` in `dsp_host`, and `python3 -B test_reference.py` tests the model.
Loading
Loading