diff --git a/.github/module-authors.json b/.github/module-authors.json index dc2d8b09ed..849b5683d9 100644 --- a/.github/module-authors.json +++ b/.github/module-authors.json @@ -22,6 +22,7 @@ "npp1993": 833410, "repeat98": 67785539, "sambanks": 3905846, + "seniorspiz": 137111931, "soejrd": 34421739, "stigmagit": 288131171, "sumedho": 8923447, diff --git a/public/octatrack-modules/bounce/0.4.0-experimental.mwrm b/public/octatrack-modules/bounce/0.4.0-experimental.mwrm new file mode 100644 index 0000000000..9261a2a155 Binary files /dev/null and b/public/octatrack-modules/bounce/0.4.0-experimental.mwrm differ diff --git a/scripts/build-module-packages.py b/scripts/build-module-packages.py index 63e83125c1..a2d644ae66 100644 --- a/scripts/build-module-packages.py +++ b/scripts/build-module-packages.py @@ -11,7 +11,7 @@ ORDER = ['miniverb', 'tapeecho', 'euclid', 'repitch', 'tapehead', 'airwindows-chorus', 'everb', 'bbd', 'lofi2', 'ring-sc', 'vibrato', 'resonator', 'mackity', 'midiverb', 'ringbank', 'void', 'fuzzbox'] # DSP code that stock code reaches through hooks. Output Matrix has no FX menu entry and is also a requested ColdFire module. HOOKED = ['sidechain-compressor', 'output-matrix'] -REQUESTED = ['analog-bassdrum', 'usb-audio-out-tracks-main-cue', 'quantizer', 'synth', 'vector', 'playmodes', 'mute-modes', 'recorder-loop-fix', 'poly8', 'output-matrix', 'quantize-live-rec-toggle', 'apply-scene', 'direct-jump-kyoti', 'dejavu', 'arp-key-locks', 'temp-save', 'tuner', 'scope', 'slow-lfo', 'bar-led', 'stem-rec', 'songbook', 'arr-rows', 'smart-reload', 'defrost'] +REQUESTED = ['analog-bassdrum', 'usb-audio-out-tracks-main-cue', 'quantizer', 'synth', 'vector', 'playmodes', 'mute-modes', 'recorder-loop-fix', 'poly8', 'output-matrix', 'quantize-live-rec-toggle', 'apply-scene', 'direct-jump-kyoti', 'dejavu', 'arp-key-locks', 'temp-save', 'tuner', 'scope', 'slow-lfo', 'bar-led', 'stem-rec', 'songbook', 'arr-rows', 'smart-reload', 'defrost', 'bounce'] UTILITIES = ['previewvol', 'cc-map'] ASSET_NAMES = ['dsp-packages.json', 'coldfire-packages.json', 'resident-dsp.json', 'rom-packages.json', 'bootstrap-package.json', 'menu-recipes.json', 'descriptor-recipes.json', 'platform-writes.json', 'requested-packages.json', 'utility-packages.json', 'usb-audio-packages.json'] diff --git a/sdk/catalog.json b/sdk/catalog.json index f445544ce5..a00e426f69 100644 --- a/sdk/catalog.json +++ b/sdk/catalog.json @@ -296,6 +296,11 @@ "id": "quick-fill-trig-condition", "version": "0.1.0-experimental", "addedAt": "2026-12-03T16:27:00Z" + }, + { + "id": "bounce", + "version": "0.4.0-experimental", + "addedAt": "2026-12-03T22:31:23Z" } ] } diff --git a/sdk/octatrack/modules/bounce/LICENSE b/sdk/octatrack/modules/bounce/LICENSE new file mode 100644 index 0000000000..84c1c7dc2a --- /dev/null +++ b/sdk/octatrack/modules/bounce/LICENSE @@ -0,0 +1,30 @@ +MIT License + +Copyright (c) 2026 seniorspiz + +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. diff --git a/sdk/octatrack/modules/bounce/README.md b/sdk/octatrack/modules/bounce/README.md new file mode 100644 index 0000000000..9cfa785077 --- /dev/null +++ b/sdk/octatrack/modules/bounce/README.md @@ -0,0 +1,108 @@ +# Bounce In Place + +Version 0.4.0 · by @seniorspiz · experimental: 0.4.0 passed the test procedure's unit steps on one MKII in RAM, and its developer's own test (a project save, reload and power cycle, the lamps and the popup) on the same unit, as reported ([TESTING.md](TESTING.md)). + +## Overview + +Bounce In Place records a track in place, the way bounce or freeze works in a DAW, without setting up the recorder's buffer, length and trigs by hand. It records the active track, and any other tracks you merge in, for exactly one pattern length (in per-track mode, the track's own length; merged tracks of different lengths, until their lengths meet), with their effects. When the take ends, the active track becomes a Flex machine playing the take: its FX are off, its AMP is stock's (HOLD and REL full, VOL and BAL centred), its LFOs no longer move it, its old trigs and locks are replaced by one trig on step 1, and the take is saved as a WAV (`B-YYMMDD-HHMM`) in the project's own `BOUNCES` folder, with the track's recorder buffer assigned to it, so once you save the project the take reloads with it. The other merged tracks are muted with stock's own mute. A Grain or synth track is bounced as it sounds, so its CPU is free once it plays the take as Flex. RESET TRACK turns any track back into a plain STATIC track. UNDO brings back what the last bounce or reset changed, until the next power cycle or project change. + +Category: **system**. It rewrites a track's Part and pattern when the musician asks, and uses no effect slot, DSP code or knob. + +## Controls + +| Control | What it does | +| --- | --- | +| DOWN held, then REC | Opens BOUNCE for the active track. REC alone stays stock. | +| FUNC+PART > BOUNCE > BOUNCE T*n* | Opens BOUNCE for the active track, from the Part Edit window. | +| Trig keys 1-8, while BOUNCE is open | Add or remove T1-T8 from the merge. The active track always stays in. Stock TRACK keys keep working as stock, so BOUNCE sits beside Track Solo. | +| YES, while BOUNCE is open | Arms the take: it starts with the next pattern start. Refused, with the reason, when the pass is over 64 steps, T8 is merged or chosen while MASTER TRACK is on, a merged track's cue level is 0, or the recorder is busy. | +| NO, while BOUNCE is open | Closes BOUNCE and changes nothing; cancels an armed or running take. | +| FUNC+PART > BOUNCE > RESET TRACK | Asks first, then makes the active track a STATIC track with a fresh project's settings (FX1 FILTER, FX2 DELAY, stock AMP, LFO, playback and recorder setup, its own slots), no trigs and no locks. Its length and scale stay. A Grain or synth track: pick STATIC in the machine chooser first. | +| After bouncing a Grain or synth track | The take is in, and a small popup reads TAKE RECORDED, CHANGE T*n* TO FLEX. Any key closes it; FUNC and SRC go straight on to the chooser. The bottom line then reads BOUNCED: T*n* PICK FLEX until you do. Pick FLEX for that track in the machine chooser: Bounce then makes it play the take. Until then the machine plays on unchanged. | +| FUNC+PART > BOUNCE > UNDO | Restores the last bounce's or reset's track: machine, FX, every page, slots, trigs, locks, and the merged tracks' mutes. | + +BOUNCE shows the merge as inverted track names and on trig keys 1-8 (the active track red, merged tracks green, every other track you can tap yellow; T8 dark while MASTER TRACK is on) until the take ends, then PRESS PLAY, WAIT or RECORDING ONE PASS, and at the end BOUNCED, SAVED AS with the file's name, or the reason it refused. While stock writes the WAV, its own screens show. + +## Usage + +1. Select the track to bounce into, then hold DOWN and press REC (or FUNC+PART > BOUNCE > BOUNCE T*n*). +2. Press trig keys 1-8 to merge other tracks in, then YES to arm; the take starts on the next pattern start. +3. When BOUNCE reads BOUNCED, SAVED AS, the track plays the take. Save the project to keep it; FUNC+PART > BOUNCE > UNDO goes back. + +### Quick tutorial + +1. Select the track to bounce into with its TRACK key, here T1. +2. Hold DOWN and press REC: BOUNCE opens with T1 inverted and its trig key red. +3. Press trig key 2 to merge T2 into the take, then YES to arm it; press PLAY if the sequencer is stopped. +4. After one pattern pass BOUNCE reads BOUNCED, SAVED AS with the WAV's name: T1 plays the take as a Flex machine and T2 is muted. Save the project to keep the link. +5. To go back, FUNC+PART > BOUNCE > UNDO. + +## How it works + +Every piece of work runs on a key press, once a step while a take is armed, or as a card job, never every frame or sample ([Keep the ColdFire cheap](../../../../docs/module-guides/README.md#keep-the-coldfire-cheap)). + +| Step | Where it runs | +| --- | --- | +| Check: audio tracks only, the pass fits RLEN (64 master steps), MASTER TRACK and T8, the merged tracks' cue levels, the active track's recorder is free | key press | +| Keep the active track's 12 recorder bytes, to put them back after the take | key press | +| One track: set its recorder's source to itself. Several: send the merged tracks to CUE for the take and record CUE | key press | +| Set the length to the pattern's (or the track's) and arm for the next step 1 | key press | +| Record, on the instrument's own tempo, scale and length | stock's recorder | +| See that the take ended | the UI tick, a few compares, only while armed | +| Light trig keys 1-8 with the merge: stock's steady LED bytes for those keys, put back as stock last drew them when the window closes | the UI tick, only while BOUNCE is open or armed | +| Snapshot the active track's Part bytes, its whole pattern record (trigs, locks, conditions, 2,330 bytes) and the mutes, for UNDO (module memory, not stock's shared undo buffer); a cancelled take leaves the last UNDO as it was | one bounded edit, at the take's end | +| Make the active track a Flex machine playing the take, FX1 and FX2 off, one trig on step 1 at full length; mute the merged tracks; restore the CUE routing (only the cue bits it set: mutes changed during the take stay) | one bounded edit | +| Save the take as a WAV in `/BOUNCES/` (made with stock's folder call the first time) and assign the track's recorder buffer to it: stock's SAVE THIS RECORDING past its naming keyboard, then its ASSIGN TO SELF (the chain stock's SAVE ALL RECORDINGS runs), a name that is free, and stock's done callbacks. SAVE SAMPLES TO is set to PROJ DIR for the two calls that build a path, and put back straight after each | stock's card jobs after the take | + +It has no code in the frame interrupt (no detour, no `rests` hook), so there is nothing for `ev_in_use` to rest. Its UI tick compares its phase and returns while BOUNCE is closed. It contributes its BOUNCE row to the base's `ot_part_menu` table. + +## Compatibility and limitations + +- Audio tracks only. MIDI tracks are refused. +- Merging several tracks uses CUE for the take, so the cue outputs carry the merged tracks while it records. The main outputs are untouched. +- `key:DOWN+REC` and `key:TRIG@BOUNCE` are declared in `compatibility.uiClaims`. Keys arrive through the base's shared `module_key` bus, so Bounce patches no stock key site. On stock, DOWN held + REC only toggles GRID RECORDING as REC alone does (emulator, TESTING.md); with Bounce, REC alone stays stock. +- With MASTER TRACK on, T8 carries the mix of T1-T7, so T8 cannot be a bounce destination then and is refused. +- Seen in the emulator (TESTING.md): CUE and SRC3 = the track both carry a track after its FX. The pattern's trig and lock layout is mapped. Still open: the same on a unit, Studio mode cue, MAIN TO CUE, and whether a take follows the track's LEVEL. +- The WAV is never deleted by Bounce: UNDO gives the track its old settings back and leaves the file on the card and the buffer's link to it. A later recording into the same buffer replaces the take in the buffer, as stock does. +- The trig key lamps are written in stock's steady LED bytes for keys 1-8 only while BOUNCE is open or armed, and patch no stock site. Another module that lights trig keys 1-8 at the same moment would be overdrawn until BOUNCE closes; none does today. +- 0.4.0 ran on one MKII (development twin, RAM only): bounce, merge and RESET TRACK, each undone; its developer saved, reloaded and power cycled a project with bounces. CPU: nothing measurable at rest; about 6 points of the frame interrupt while a take records (TESTING.md). Not yet run on an MKI. + +### What 0.4.0 does and does not do yet + +Its limits ([TESTING.md](TESTING.md)): + +- **A full card.** When the WAV can't be written (stock shows its own error, or no answer comes within 30 s), BOUNCE reads NOT SAVED: TAKE IN BUFFER / SAVE IT IN AUDIO EDITOR until you press a key. The track still plays the take from its recorder buffer: free some space, then save it from the Audio Editor (AED) before a power cycle empties the buffer. +- **Where the WAV goes.** Always `/BOUNCES/`, whatever SAVE SAMPLES TO says, so bounces stay with their project and out of the set's shared AUDIO pool. The project records it as `BOUNCES/.wav`. A project that was never saved has no folder yet; its bounces go to `/AUDIO/BOUNCES/`. PROJECT > SAVE TO NEW copies the `BOUNCES` folder into the new project, so the takes come along. +- **The WAV needs a project save.** The file is written at once, but the project names it only after you save the project, as with stock's SAVE THIS RECORDING. A power cycle before that leaves the WAV on the card and the buffer empty. +- **Passes over 64 master steps.** RLEN counts at most 64 master 16ths (4 bars at 1X), so a longer pass is refused with PASS OVER 64 STEPS. +- **Trig key lamps.** While the sequencer plays, stock redraws the trig keys each step; Bounce redraws its lamps on the next UI tick, so a key may flicker for up to 1/60 s. +- **Modwerk machines.** A Grain or synth track is bounced as it sounds; only the machine chooser switches a track off one (the base runs the machine's own leave), so you pick FLEX there yourself after the take, and STATIC before RESET TRACK. +- **Merged lengths.** The take runs until the merged tracks' passes meet (2 bars and 3 bars: 6 bars). Past 64 master steps it takes the longest pass instead, and the window reads PASS *n* (LONGEST). In PER TRACK mode the bounced track's length becomes the take's, at 1X. +- **Cue levels.** A merged track records at its cue level, so one at 0 is refused (T*n* CUE LEVEL IS 0). Other cue levels are taken as they are. +- **Recording with the sequencer stopped.** YES shows PRESS PLAY; the take starts with the next pattern start once the sequencer plays. STOP during the take cancels the bounce. + +## Tests and measurements + +See [TESTING.md](TESTING.md). + +## Authorship and licences + +Design and code by @seniorspiz, MIT (LICENSE). Track Solo's LED level handling and Stem Rec's recorder window are the nearest patterns; no code is taken from them. The stock addresses and the recorder mailbox word come from octabam's FREE LOOP adapter and firmware notes; the stock text call and the per-step lock index are as Pattern Sample Locks (twwwy) uses them, written anew here. The recorder length, end-of-take and pattern length findings come from Sam Banks' RLEN PLEN notes in octabam and from octabam's firmware notes (Bryan T, Tim Hastie). + +## Screens and audio + +Captured in the emulator from package `196de6d7` (MKII panel, [media/capture.json](media/capture.json)); no audio is published. + +| Screen | What it shows | +| --- | --- | +| [media/ot-select.png](media/ot-select.png) | BOUNCE for T1, with T2 merged | +| [media/ot-recording.png](media/ot-recording.png) | RECORDING ONE PASS | +| [media/ot-bounced.png](media/ot-bounced.png) | BOUNCED, SAVED AS with the WAV's name | +| [media/ot-undo.png](media/ot-undo.png) | FUNC+PART > BOUNCE: BOUNCE TRACK, RESET TRACK, UNDO | + +## Develop + +- Edit `bounce.c`, then `python3 sdk/octatrack/modules/bounce/generate.py` writes `unit.s` (`--check` fails when it is stale). +- Hear it: `npm run module:dev -- bounce` builds it and tries it on your unit over USB; `--watch` does that again on every save. +- Check it: `npm run module:doctor -- --draft bounce`. +- Measure the first build that runs: `npm run device:price -- `. diff --git a/sdk/octatrack/modules/bounce/TESTING.md b/sdk/octatrack/modules/bounce/TESTING.md new file mode 100644 index 0000000000..348e012527 --- /dev/null +++ b/sdk/octatrack/modules/bounce/TESTING.md @@ -0,0 +1,419 @@ +# Bounce In Place testing + +Record what you ran, on which build and which unit, and what you saw. "Not tested" is a valid answer; never write a result you did not observe, and keep emulator runs apart from hardware ones. + +Labels below: **measured** (seen in a run named here), **read** (from a document named here, not re-checked), **inferred** (follows from what is read, not seen), **open**. + +## Open questions, first + +Settle these before building the rest. Each decides part of the design. Addresses are OS 1.40C (MAIN OS SHA-256 of the `.bin` `34695b60…`); no stock bytes are kept here. + +| Question | Why it matters | Result | +| --- | --- | --- | +| Does another module already patch the REC key site? | One owner per stock byte. | **Read**, settled: over USB a module reads keys through the base's `module_key` bus ([OCTATRACK_API.md](../../../../docs/OCTATRACK_API.md#core-entry-points)) and patches no key site. Stem Rec's REC detour (`0x40048774`) is in card builds only. `modules:compat` finds no clash with `key:DOWN+REC`. | +| Does stock do anything with DOWN+REC? | A gesture must not move a stock shortcut. | **Measured** (emulator, below): DOWN held + REC (the transport record key ○, code `0x29`) does what REC alone does, toggling GRID RECORDING; DOWN adds nothing. With Bounce, REC alone stays stock and only the combination opens BOUNCE (Stem Rec's UP+REC is the same pattern). | +| Does stock do anything with YES+TRACK? | The fallback gesture. | No longer needed. YES alone on the main screen opens stock's ARM ALL popup (octabam `tools/panel/KEYMAP.md`, **read**), so YES+TRACK would be a poor fallback anyway. Not tested. | +| Does CUE carry a track after its FX? | Merging bakes the FX in by recording CUE. | **Measured in the emulator** (below), not on a unit: with FX1 LO-FI pushed hard, MAIN lost its highs and fell to 3 sample levels, and the CUE bus followed it sample for sample (r = 1.0000, one sample late on the left). CUE carries the track after FX1 and FX2, as core 0's mixdown suggests (octabam `docs/firmware/DSP.md`, "Core 0's frame", **read**). | +| Does a track's recorder take its own output after its FX (SRC3 = the track)? | The single-track bounce relies on it. | **Measured in the emulator** (below), not on a unit: with SRC3 = T1 and FX1 LO-FI, the take played back on a Flex track is T1's crushed output, sample for sample, exactly ten steps later. SRC3's values (**read**, octabam `docs/firmware/PARAM_PAGES.md`, displayed values confirmed on hardware by Bryan T): raw 0 `-`, 1-8 T1-T8, 9 MAIN, 10 CUE. Raw 1 = T1 is measured here; MAIN and CUE are read only. Open: whether the take follows T1's LEVEL (Stem Rec's per-track tap is before the fader; the recorder's own path is not checked). | +| Master track (T8) and Studio mode cue | A take must not record a track twice or miss one. | **Read**: with MASTER TRACK on, the mixdown sums slots 0-6 into T8's input and MAIN is slot 7 (DSP.md). Bounce must refuse T8 as a destination, or handle it, while MASTER TRACK is on. Studio mode: open. | +| Lengths: pattern length, per-track length and scale | The take is one pass of the pattern. | **Read** (octabam `modules/rlen-plen/README.md`, Sam Banks): RLEN counts master-clock 16ths and stops at 64, with no per-track scale term; at MAX the take ends at the next recorder trig. Pattern length and scale: record `0x400eb034 + p·0x8ed8 + b·0x9b340` (scale `+0`, length `−1`, a per-track flag `+1` selecting the track record `0x400e21e0 + t·0x91a`, length `+0x50`, scale `+0x51`). So Bounce computes the take's length from the pattern's or the track's length and scale, not from RLEN. | +| How Bounce sees that the take ended | Once a step while armed, nothing otherwise. | **Read**: a fixed-length take's end is posted at `0x40005e8e`, writing the track's LIMIT word (`0x46c7fe24[track]`); a MAX take never posts it (rlen-plen README). The stock arm writes LIMIT at `0x400069d6` (octabam `verify_rec_threshold.py`). | +| Part fields Bounce writes | Every write is one of these. | **Read** (octabam `docs/firmware/PARTS.md`, `tools/hw/ot_project.py`). Working Part `B + 0x8ed80 + p·0x18b2`, `B = 0x400e21e0 + bank·0x9b340`; per track t, RAM offsets: FX1 id `+0x00+t`, FX2 id `+0x08+t`, machine `+0x22+t` (0 STATIC, 1 FLEX, 2 THRU, 3 NEIGHBOR, 4 PICKUP), Flex slot `+0x2ca+5t+1` (`0x80`-`0x87` = recorder buffers 1-8), recorder setup `+0x602+12t` (INAB INCD RLEN TRIG SRC3 LOOP / FIN FOUT AB QREC QPL CD). A bank file's Part record is 9 bytes later. | +| Changing the machine | The engine must switch voices. | **Read**: stock's only path that runs a machine transition is Part Reload (`0x4004aab4`), which calls `0x400972fc(p, track, old machine)` for each track (PARTS.md). Bounce calls it the same way after writing the machine byte; the unsaved bit (`B + 0x95048`) is set as Part paste does. | +| Pattern trigs and locks of a track | UNDO snapshots and clears them. | **Measured in the emulator** (below), on top of octabam `docs/firmware/STEP_LOCKS.md` and `tools/hw/ot_bank.py` (**read**). A track's pattern record is `B + p·0x8ed8 + t·0x91a`, 0x91a bytes: eight 8-byte step masks at `+0x00` (big-endian, step s = byte 7 − (s−1)/8, bit (s−1) mod 8; mask 0 trigs, 2 trigless lock trigs, 4 recorder trigs A B, 5 C D, 6 SRC3; 1, 3 and 7 not decoded), track length `+0x50`, scale `+0x51`, then 64 steps of 32 lock bytes at `+0x59` (`0xff` = no lock; slots 0-5 PLAYBACK, 6-11 LFO, 12-17 AMP, 18-23 FX1, 24-29 FX2), then 0xc0 bytes not decoded. The current bank keeps a battery-backed copy at `0x1001614e` + the same offset, and its working Parts at `0x100a4ece` (PARTS.md), which stock writes beside the bank. So UNDO copies the whole 0x91a-byte record, undecoded bytes (trig conditions, micro timing) included, and writes both copies back, best through stock's track write `0x40029754(src, pattern, track)` as track paste does (**read**; whether it writes the battery copy itself is open). The board finding on stock's shared pattern undo buffer (#2485) applies: Bounce keeps its own snapshot. | +| Trig key colours, MKI and MKII | The merge display. | **Read**: each trig key has two LED bits, the odd one its second colour (KEYMAP.md, MKII). How BOUNCE takes and returns their lamps: open (Track Solo filters the transmitted row without changing stock's bitmaps). MKI: open. | + +## Emulator runs + +**2 December 2026, stock gesture probe.** `ot_emu` (octabam `f7d7290`, built on this Mac, arm64), the developer's unmodified MAIN OS from 1.40C, MKII panel, `--rtc host`, an empty staged project, transport stopped, no DSP. Keys through `--live`, a screenshot after each step: + +| Keys | Screen | +| --- | --- | +| REC | the GRID RECORDING icon on; REC again, off | +| DOWN held, REC | the GRID RECORDING icon on, as REC alone | +| DOWN held, T2 | T2 selected, as T2 alone | + +A first run left stock's SET DATE/TIME prompt open, so DOWN edited the date; it is not counted. The screenshots and the probe script stayed outside the repository. + +**2 December 2026, CUE after FX.** Same `ot_emu` and MAIN OS, with `--dsp --sequencer --internal-clock`, white noise on inputs A and B, 3 seconds per render. T1 THRU on A+B, trigs on steps 1, 5, 9 and 13, FX2 empty, CUE on with T1's cue level 127. Two renders, FX1 NONE and FX1 LO-FI with every FX1 knob at 127. Core 0's output words compared over the second half of each render: + +| Render | MAIN (words 2, 3) | CUE (words 0, 1) against MAIN | +| --- | --- | --- | +| FX1 NONE | flat noise, 16379 sample levels | r = 1.0000 per side (left one sample late) | +| FX1 LO-FI | 94 % of its energy below a quarter of Nyquist, 3 sample levels | r = 1.0000 per side (left one sample late) | + +So the CUE bus is the track after its FX. Not checked: Studio mode, MASTER TRACK, a cue level below 127, a unit. The probe script stayed outside the repository. + +**2 December 2026, SRC3 = the track.** Same `ot_emu`, MAIN OS and noise, 120 BPM, pattern 16 steps at 1X. T1 THRU on A+B with PLAY on step 1. T1's recorder: INAB and INCD `-`, SRC3 = T1 (raw 1), RLEN 8, LOOP off, a recorder trig for SRC3 only on step 1. T2 FLEX on recorder buffer 1, FX NONE, PLAY on step 11. Each track's post-FX output read from the read-back (octabam `tools/hw/sos_capture.py`, `readback_tracks`): + +| T1's FX1 | T1's output | T2 playing T1's take | +| --- | --- | --- | +| NONE | flat noise | T1's output 55,125 samples (10 steps) later, gain 0.72, residual 0.02 % | +| LO-FI, every knob 127 | 3 sample levels, 94 % of its energy below a quarter of Nyquist | the same: 94 % below a quarter of Nyquist, residual 0.01 % | + +So SRC3 = the track records it after its FX, the bounce a single track needs. The gain is T2's playback level, not measured further. Not checked: whether the take follows T1's LEVEL, FX2, a unit. The probe script stayed outside the repository. + +**2 December 2026, a track's pattern record.** Same `ot_emu` and MAIN OS. Known values written into bank 1, pattern A01, T3 of an empty project: trigs on steps 1, 5, 9 and 13, a trigless lock trig on step 3, a recorder trig A B on step 5 and SRC3 on step 9, track length 32, three locks (step 1 FX1 B = `0x55`, step 3 PLAYBACK C = `0x21`, step 13 FX2 F = `0x7f`). Loaded with `--dsp --sequencer`, then the bank's RAM and its battery-backed copy dumped (`--mem-dump`). (Without `--sequencer` the emulator stopped before the project load, and that run is not counted.) + +| Field | Address checked | RAM `0x400e3414` | Battery copy `0x10017382` | +| --- | --- | --- | --- | +| masks 0, 2, 4, 6 | `+0x00`, `+0x10`, `+0x20`, `+0x30` | as written | as written | +| length, scale | `+0x50`, `+0x51` | 32, 1X | 32, 1X | +| the three locks | `+0x59 + (s−1)·32 + slot` | as written | as written | +| the whole record | 0x919 bytes of the file's TRAC data | identical | identical | + +No other audio track carried a trig. The probe script and dumps stayed outside the repository. + +## The 0.1.0 prototype + +**2 December 2026.** `bounce.c` compiled with the pinned ColdFire flags and the shared object guard (`generate.py`), and `npm run module:dev -- bounce --build-only` built the package: 4,100 bytes of code and data, 11,072 bytes of zeroed buffers, 5 hook entries, no stock-code sites. `npm run module:doctor -- --draft bounce`: the experimental lines are green. It has not run in the emulator or on a unit: no behaviour below is claimed for it. + +Read and not yet checked by a run, each needed by the prototype: stock's track write `0x40029754(src, pattern, track)` takes a pattern index and writes the battery copy; Part paste `0x40029a4c` applies a changed FX id and recorder setup to the engine; the recorder mailbox `0x40005178(track, 0xc010, 1)` starts a SRC3 take at QREC's next PLEN boundary; the pattern's scale mode byte is `pattern + 0x8e55`. + +## On the unit + +**2 December 2026, prototype 0.1.0 on the developer's MKII.** Release base `ddb56b72…` with 11 kept modules (FM Synth, Sidechain Comp, Recorder Loop, Output Matrix, Quant Live Rec, Bar LED, Grain, ungemach, Resonator, syntiz, USB Audio), OS 1.40C. A RAM trial with `npm run module:dev -- bounce --seconds 900`, never kept; the developer pressed the keys in their own project after a SAVE, its CPU already at 90 % and over in the hours before (the base's `hot` and `shed` incidents). Phases from the trial's readout (`api->value`), the rest as the developer reported it: + +| Step | Seen | +| --- | --- | +| DOWN+REC | the BOUNCE window opens; FUNC+PART shows the BOUNCE row | +| Trig keys 1-8 | the merge toggles in the window; the trig key lamps keep showing the pattern (no lamp code yet) | +| YES with the sequencer stopped | the window went to STOPPED - NO BOUNCE within a second: the recorder started at once instead of waiting for the pattern start, and Bounce cancelled because the transport was stopped | +| YES while playing | armed, recorded about 4 s, BOUNCED: the FX1/FX2 bytes were cleared and the Flex slot pointed at the recorder buffer, but the track stayed Grain (a Modwerk machine signs the track in the Part, and Bounce left the signature), so Grain played the take; the old trigs stayed: stock's track write `0x40029754`, called as `(src, pattern, track)`, left the record unchanged | +| UNDO BOUNCE | an unpleasant sound, then no playback | +| 60 s later | the unit restarted (the trial's tick count reset; the base's log has a new boot with no crash record, after one late frame entry); the kept set came back | + +Fixed in 0.1.1, not yet run: the pattern record is written directly (working and battery-backed copies, as Pattern Sample Locks does), a Modwerk machine track is refused (MODWERK MACHINE: SET FLEX), the machine transition runs only when the machine byte changes, and YES while stopped waits for PLAY. Open: whether the restart was a power cycle or caused by UNDO. 0.4.0 in the emulator: UNDO after a bounce, a merge and RESET TRACK, and UNDO with nothing to undo, ran without a restart (below); still to run on the unit, several times each. + +**2 December 2026, prototype 0.1.1 on the same MKII**, same base and kept set, a RAM trial never kept, in the developer's own project after a SAVE. Readout phases and the developer's report: + +| Step | Seen | +| --- | --- | +| T2 active, trig keys 3 and 4 merged, YES while stopped | PRESS PLAY; PLAY armed it; the take ran about one second (readout); BOUNCED | +| The result | the three tracks bounced together into T2, which played the take as FLEX ("it worked fine"); the pass was one track's pattern length, not the longest of the three | +| T1 on Grain, YES | MODWERK MACHINE: SET FLEX, nothing changed | +| UNDO BOUNCE | not tried in this run | + +The trial's verdict at 900 s was FAIL: the base's frame guard had skipped 16,749 renders on T1, the Grain track, during the trial, so `module:dev` rolled it back. Bounce has no render or frame hook; the skips are T1's machine over the frame on this project (the reason the developer wants to bounce it). Not checked: whether they were there before the trial. + +## The 0.2.0 prototype + +**2 December 2026.** Built (`generate.py`), `npm run module:doctor -- --draft bounce` experimental lines green. Not yet run. New, from the developer's report on 0.1.1: + +- the merge length where the tracks' passes meet, else the longest; +- Grain and synth tracks bounced as they sound, then PICK FLEX in the chooser; +- the bounced track's AMP set to stock's values, its LFO depths to 0 and its FLEX page and setup to stock's, so the take plays as recorded; +- RESET TRACK (FUNC+PART > BOUNCE), with a confirmation, to a fresh project's STATIC track. Its values are those of a fresh project created by OS 1.40C, the same for every track: read from the fresh project in octabam's tree, not from the OS image. + +To run on the unit: a merge of tracks with different per-track lengths; a Grain track bounced, then FLEX picked; AMP and LFO after a bounce; RESET TRACK on a FLEX track and on a Grain track (refused); UNDO after each. + +**2 December 2026, 0.2.0 on the same MKII**, same base and kept set, RAM trials never kept, in the developer's own project after a SAVE. The developer reported that everything listed above worked (merge, Grain bounce with PICK FLEX, AMP and LFO, RESET TRACK, UNDO), except: + +- T3 and T4, both STATIC, had been merged into T2's bounce (so cued for the take, then muted), then unmuted and reset with RESET TRACK. With a new sample loaded they made no sound. Two diagnostic builds (not committed) read their state while the pattern played: STATIC, FX1 FILTER and FX2 DELAY at a fresh project's values, stock AMP, trigs present, not muted, not cued, not soloed, track level 0x72, and the voice started on each trig. Sample preview was silent too, and so was T3 as FLEX with a sample in its Flex slot. They stayed silent after a SAVE and a power cycle (the developer's), and played again after the project was reloaded, which also undid the session. Cause found in the emulator, below: RESET TRACK's table of fresh values had one zero too many in the second page group, so the bytes after the LFO waves landed one field off. Fixed in 0.2.1. +- After that power cycle, T1 and T2 (the bounced tracks) were silent too: the takes were only in the recorder buffers, which a power cycle empties (no WAV save yet). +- The first 0.2.0 trial was stopped early for the diagnostic build. The diagnostic trials ended clean; the base logged no skipped renders after T1's Grain was bounced. + +Changed since: RESET TRACK and the Grain path take a Modwerk machine signature with any version 1-63 (syntiz signs models 1-15; 0.2.0 took 1-9). Not the cause here: T3 and T4 were STATIC before the merge. + +## The 0.2.1 prototype + +**2 December 2026, the silent tracks, emulator.** `ot_emu` (`--interactive --dsp --frame --mount`, MKII panel) on the development twin of the developer's base `4813a3e5…`, Bounce as a RAM trial over the emulated USB link. Fixture: a fresh project, eight tracks on their own generated sounds (octabam `make_test_audio`), trigs on steps 1, 5, 9 and 13, FX off. Levels are each track's RMS in the emulator's per-track output over about 0.5 s of emulated playing, so they compare tracks in one run, nothing more. Not hardware evidence. + +| Build | Steps | T3 | T4 | Others | +| --- | --- | --- | --- | --- | +| none (stock) | play | 94 | 115 | play | +| 0.2.0 | RESET TRACK on T3 (no merge), four trigs on T3, play | **0** | 117 | play | +| 0.2.1 | the same | 90 | 115 | play | +| 0.2.1 | T2 bounced with T3 and T4 merged (BOUNCED; T3 and T4 muted) | 0 (muted) | 0 (muted) | play | +| 0.2.1 | then T3 and T4 unmuted | 91 | 117 | play | +| 0.2.1 | then RESET TRACK on T3 and T4, four trigs each, play | 91 | 113 | play | + +- **Cause, measured.** After 0.2.0's RESET TRACK, T3's Part bytes at `+0x2f2 + 30t` (LFO PMTR and WAVE, then the other setup pages) matched the untouched T2 and T4 up to byte 13, and from byte 14 on were theirs shifted one byte later: `FRESH` had seven zeros where a fresh project has six. Which field silences the voice was not isolated. The merge alone leaves T3 and T4 playing; RESET TRACK alone silences the track. So the developer's case was RESET TRACK. A Part reload rewrote the bytes, which is why reloading the project brought the sound back. +- **Fix.** `FRESH` corrected; after RESET TRACK in 0.2.1, T3's and T4's Part bytes equal T2's in that group. `verify.py` now compares `FRESH`, range by range, with all eight tracks of a fresh project's Part 1 (octabam's `out/fresh/image/NOPROJ`, on the developer's computer; slot bytes excluded); it fails on 0.2.0's table at byte 14 and passes on 0.2.1's. +- **Not tested** in this run: sample preview on a reset track, a reset FLEX track with a sample in its Flex slot, SAVE and power cycle after a reset, UNDO of a reset, and 0.2.1 on a unit. +- **Driving note.** FUNC+PART reopens on the row last used, so a scripted run must read the screen before pressing YES: one run here pressed UNDO instead of RESET TRACK and is not counted. + +## The 0.3.0 prototype + +**3 December 2026, emulator only.** Same `ot_emu` setup as 0.2.1 (above), now with `--card-rw` so the card image keeps what the firmware writes; the card was read back with octabam's `emu_card.extract_image`. The fixture adds pattern A02 in PER TRACK mode (T1 16 steps, T2 12 steps, 1X). Not hardware evidence. + +| What | Steps | Seen | +| --- | --- | --- | +| WAV save | T1 bounced alone on A01 | BOUNCED, SAVED AS / `B1-261203-0036`; on the card `AUDIO/B1-261203-0036.wav` (RIFF, 2 channels, 44,100 Hz, 16 bit, 88,200 frames = one 16-step pass at 120 BPM, peak 8,320) and its 832-byte `.ot`; T1's sample name on the main page became the file's; T1 then played at its level before the bounce (251 against 246) | +| Name taken | T1 bounced again in the same minute | `B1-261203-0036-2.wav`; the first file left as it was | +| Cue level 0 | T2's cue level set to 0 (MIDI CC 47, channel 2), T2 merged into T1, YES | T2 CUE LEVEL IS 0, nothing armed; cue level put back to 108 | +| MASTER TRACK | CONTROL > AUDIO > TRACK 8 MASTER (`0x80000034` = 1); BOUNCE on T8, YES; then BOUNCE on T1 with T8 merged, YES | T8 IS THE MASTER TRACK both times, nothing armed | +| PER TRACK length | A02, BOUNCE on T2; then T1 merged | PASS 12 STEPS; PASS 48 STEPS (where 16 and 12 meet) | +| PER TRACK start | A02, T2 left with one trig on step 1, bounced three times at different moments | each take 66,150 frames (12 steps), the hit at frame 0 and nowhere else: the take starts on the track's own step 1, not on the master pattern's (a chance match would be 1 in 27) | +| UNDO | UNDO after the third T2 bounce | UNDONE; T2's Flex slot stayed the recorder buffer, as the bounce before it left it | + +The emulator's clock stood at 00:36 throughout, so every name has that minute. Not tested: a save onto a full card (stock shows its own error and never calls back; Bounce gives up after a while and the take stays in the buffer), SAVE SAMPLES TO = PROJECT, a project save and reload after a bounce, a power cycle, studio cue mode, MAIN TO CUE, and everything on a unit. + +**3 December 2026, 0.3.0 on the developer's MKII**, a RAM trial never kept. The developer reported that it "worked totally fine", and that they tried everything listed for 0.3.0 but a full card: bouncing one track and merged tracks, the WAV save, RESET TRACK and UNDO. The base and the exact steps are not recorded: this is their report, not a test record. + +## The 0.4.0 prototype + +**3 December 2026, emulator only.** It is the same `ot_emu` setup as 0.3.0, and the package was built from this commit's `bounce.c` (`module:dev --build-only`). The LED bitmaps were read with `mem:0x460ba98c:36`: the steady bytes, the bytes last sent to the panel at `+0x11`, and the timed bytes at `+0x22`. This is not hardware evidence. + +| What | Steps | Seen | +| --- | --- | --- | +| Lamps, stopped | T1 active, DOWN+REC; then trig key 3 | steady and sent row 0: `00` before, `01` (key 1 red) once open, `21` (key 1 red, key 3 green) after trig key 3; the screen showed T1 and T3 inverted | +| Lamps, playing | PLAY, then DOWN+REC, trig key 3; eight readings 0.25 s apart; YES (armed), four more | `21` in 11 of 12 readings; one, just after YES, showed stock's running light (`0c`) in both the steady and the sent byte: stock drew a step before Bounce's next tick. On a unit that is at most one UI tick (1/60 s); not yet seen by eye | +| Lamps back | NO while armed (BOUNCE CANCELLED); PLAY while open closes BOUNCE | stock's running light again on the next readings (`c0`, `03`, `0c`); `00` once stopped | +| Full bounce | T1 alone, playing | phases WAIT, ARMED, RECORDING, SAVING, then BOUNCED, SAVED AS `B1-261203-1848`; afterwards stock's running light on the lamps | +| UNDO after a bounce | FUNC+PART > BOUNCE > UNDO | UNDONE; T1 sounding again (stem level 215) | +| UNDO with nothing to undo | the same again | NOTHING TO UNDO | +| UNDO after a merge | T1 with T3 merged, bounced; then UNDO | after the bounce T3 at 0 (muted); after UNDO T3 at 82, T1 at 215, as before | +| UNDO after RESET TRACK | T2: RESET TRACK, YES; then UNDO, then UNDO again | RESET T2 asked first, TRACK RESET, T2 at 0 (no trigs); UNDONE, T2 at 161 as before; then NOTHING TO UNDO | +| No restart | the whole run | the trial's tick count rose steadily (1,469 to 4,543), the slot stayed running | + +The stem levels vary by run: three readings in a row, with nothing changed, gave 212, 298 and 212 for T1, every track rising together. Compare a track against the others in the same reading, not across readings. + +Changed after this run, built but not run: every save that fails (stock's error, no answer within 30 s, which a full card gives, no free name, the pool not ready) now shows NOT SAVED: TAKE IN BUFFER / SAVE IT IN AUDIO EDITOR until a key, instead of a short message or closing silently after 100 s. The developer's suggestion, 3 December 2026. + +Changed after this run, built but not run: the colours. At the developer's request (3 December 2026) every key that can be tapped lights yellow (the trig keys have no white) and the tracks in the take green, the active one included; key 8 stays dark while MASTER TRACK is on. (Later the destination went back to red, as the README describes; the developer saw that version, package `cc70165e`.) + +Not tested in 0.4.0: the lamps on a unit (MKII or MKI), by eye; another module lighting trig keys 1-8 at the same time; everything still open from 0.3.0. + +### Bounces in the project's BOUNCES folder + +**3 December 2026, emulator only**, after the unit run below, so that run's package (`22e9087c`) saved to SAVE SAMPLES TO's folder. At the developer's request, the WAV now always goes to `/BOUNCES/`. Same `ot_emu` setup, package built from this change. SAVE SAMPLES TO was AUD POOL (`0x800000a4` = 0), the case the change must override. Not hardware evidence. + +| What | Steps | Seen | +| --- | --- | --- | +| First attempt | the WAV path forced for the write only | the WAV and `.ot` landed in `BOUNCE/BOUNCES/`, but BOUNCE said NOT SAVED: stock's assign step builds the slot's path from SAVE SAMPLES TO again, after the write, and looked in the pool. Fixed: Bounce now runs that step itself, with the setting forced for that call too | +| Folder made | T1 bounced, no `BOUNCES` folder yet | BOUNCED, SAVED AS `B1-261203-2012`; on the card `BOUNCE/BOUNCES/B1-261203-2012.wav` (352,844 bytes) and its `.ot` | +| Folder there | T2 bounced | BOUNCED, SAVED AS `B2-261203-2012`, beside the first | +| Setting kept | `0x800000a4` read before and after | 0 both times | +| Project save | PROJECT > SAVE, YES | `project.work` and `project.strd`: `PATH=BOUNCES/B1-261203-2012.wav` and `PATH=BOUNCES/B2-261203-2012.wav` | +| Reload | PROJECT > RELOAD, YES | the track showed `B2-…-2012` again once loaded | + +**3 December 2026, on the unit, as reported by the developer.** The developer's MKII, OS 1.40C, base `ddb56b72`, a RAM trial of package `cc70165ee9ed5364a3034a276af2ddbc6a1b1b9920fffc3ff733c8a56b4f6a98` through `npm run module:dev -- bounce`, USB disk mode off, never kept. The developer reported that everything worked, that the WAVs were saved into the project's `BOUNCES` folder, and that the trig key lamps were as designed. The trial's readout showed no refusals over about 270 s. The agent did not see the card or the unit itself. + +Not tested: a project that was never saved (`/AUDIO/BOUNCES/`), USB disk mode during a save (stock's folder call is a stub then, so it should read NOT SAVED), a project save and power cycle after a bounce on this package, and the test procedure's unit steps on this package (its CPU reading is below). + +### The PICK FLEX popup, and PROJECT > SAVE TO NEW + +**3 December 2026, emulator only** (`ot_emu`, the twin, MKII), package `1dcee07b1f0faaaba282132bf362ca4fca137b91928c8f30609842c3b339a565` (`1dcee07b`). Not hardware evidence. + +| What | Steps | Seen | +| --- | --- | --- | +| A bounce with this build | T1, DOWN+REC, YES, PLAY | BOUNCED, SAVED AS `B1-261203-2156`, in `BOUNCE/BOUNCES/` | +| SAVE TO NEW | stopped, PROJECT > SAVE TO NEW, a new name, YES | SYNCING PROJECT, SAVING AS NEW, THE NEW PROJECT IS NOW ACTIVE. The new project folder has its own `BOUNCES/` holding `B1-261203-2156.wav` (byte for byte the same as the original) and its `.ot`, and its `project.work` names `PATH=BOUNCES/B1-261203-2156.wav` | +| FUNC+SRC | T2, FUNC+SRC | SRC SETUP opens on the MACHINE list (STATIC, FLEX, THRU, NEIGHBOR, PICKUP), where the player picks FLEX | + +**The popup on the unit, as reported by the developer:** package `1dcee07b` in a RAM trial on their MKII, release base `ddb56b72`, a Grain or synth track bounced. The trial's readout went RECORDING, then the popup (phase 9) for about 48 s, then the strip (phase 6), then the saved message (phase 4), and then closed, with no refusals: the popup appeared, a key closed it, FLEX was picked, and the take was saved. The developer found the popup too big and detailed, so it now has two lines: TAKE RECORDED, then CHANGE T*n* TO FLEX. The two-line version was then seen on the unit with package `196de6d7` ([below](#the-040-test-procedure-on-the-release-candidate)). Reloading a project made with SAVE TO NEW: not tested. + +## The 0.4.0 test procedure on the unit + +**3 December 2026, the developer's MKII.** OS 1.40C. The development twin `4813a3e5` was RAM-booted with the developer's OK, never flashed; a power cycle returns the unit to release base `ddb56b72`. Source revision `9f17972c1`, clean tree. Package `bounce.mwrm`, SHA-256 `22e9087cf901cbd5368e17e1dcfc71e5c8d686faaed96e833741ba199478c00d` (`22e9087c`). The developer's own project was loaded. Bank A's Part 1 had unsaved changes and was left alone. The run used bank B, pattern B01, Part 1, whose working copy equalled its saved one (preflight: ready). Nothing was kept and the project was never saved. + +`npm run test:procedure -- bounce` stopped at its preflight on bank A: a changed Part, a pattern with trigs on 8 tracks, and no MIDI bridge. Its steps were then run one by one on bank B, with the commands from `--plan`: + +| Step | Result | +| --- | --- | +| 1 Software checks | `module:doctor -- --draft bounce`: passed (experimental lines green) | +| 2 Beside every other module | judged by step 1's compatibility line (a draft) | +| 3 Name the build | `module:dev -- bounce --build-only`: SHA-256 `22e9087c…` | +| 4 DSP cost model | `cycle-scan.mjs check`: passed | +| 5 Emulator rehearsal | not run by the procedure; the 0.4.0 emulator run is above | +| 6 Read the unit | status, Part state and inventory read; nothing installed | +| 7 Scripted unit pass | `device:test`: passed. Trial in RAM, rolled back; self-test passed; Part switches 12 of 12; inventory the same afterwards | +| 8 Soak | **not run**: the twin offers the Mac no USB MIDI port (only mass storage), so the soak's program changes cannot reach it | +| 9 Cost on the unit | `device:price`, 3 readings of 8 s a state, B01 playing: below | +| 10 Put back | inventory as before; Part 1 on B01: nothing to put back, working = saved | + +**CPU.** The share of the frame interrupt, and the CPU meter: + +| State | Frame interrupt | Longest frame | CPU meter | +| --- | --- | --- | --- | +| Before (no module), `device:price` | 28.9 % | 39.2 % | 41.6 % | +| Installed, BOUNCE closed (at rest), `device:price` | 28.8 % (adds −0.1, within the readings' spread) | 39.1 % | 41.5 % | +| Installed, B01 playing, 2 s windows just before each take (3 takes) | 29.3 % | 39.1–39.4 % | 41.8–41.9 % | +| While a take records: T4 alone, a window from the recorder's start to its end, 1.7 s (16 steps at 141 BPM), 3 takes | 35.2–35.4 % | 53.6–54.0 % | 51.0–51.5 % | + +The take adds about 6 points of the frame interrupt and 9.5 of the CPU meter while it records, and none were skipped. While recording, Bounce's own tick only reads the recorder's flag and the transport, so the rise is most likely stock's recorder writing the take. That is an inference: a stock recording of the same track, without Bounce, was not measured. + +**CPU on the release candidate, package `196de6d7`.** 3 December 2026, the developer's MKII. The development twin `4813a3e5` was RAM-booted, never flashed; a power cycle returns to release base 0.8.5 (`ddb56b72`). Package SHA-256 `196de6d7ea754be27946d6090b2f1346b00f6eb172d5e5e928fe2aa029571458`: the build with the BOUNCES folder and the two-line popup (source `64d32dc44`). Project SALVA 4, bank B, pattern B01, Part 1, at 141 BPM. On the twin's boot, the project showed stock's SOME ERRORS OCCURED, 'PARSE ERROR' prompt; NO let it load. That prompt comes from bank 16's file, which was damaged on 28 November, before this module existed. + +| State | Frame interrupt | Longest frame | CPU meter | +| --- | --- | --- | --- | +| Before (no module), `device:price --write`, 3 × 8 s | 23.7 % | 32.0 % | 36.1 % | +| Installed, BOUNCE closed (at rest), same | 23.7 % (+0) | 32.1 % | 36.2 % (+0.1) | +| Installed, B01 playing, 2 s just before each take (3 takes) | 25.2–25.3 % | 34.4–34.7 % | 37.8–38.0 % | +| While a take records: T4 alone, from the recorder's start to its end (about 4,510 frames), 3 takes | 31.1–31.2 % | 49.4–49.6 % | 47.6–47.9 % | + +`device:price --write` wrote the price (0 % of a frame) into the manifest and its readings into `evidence/cpu-price.json`. While recording, the take adds about 6 points of the frame interrupt and 10 of the CPU meter, as on `22e9087c`, and no frame was skipped. Each take was saved (`B4-261203-…`); after each, UNDO put bank B's Part 1 back byte for byte equal to its saved copy. The trial was rolled back. The base's CPU refusal count, already 297 from the price runs, rose to 477 while B01 played in the trial. Bounce has no render; what the base refused was not read. + +**Edge cases on the unit.** All on T4 of B01, the pattern playing; the trial readout's tick count rose throughout, and `health` showed no crash and no stall: + +| Case | Seen | +| --- | --- | +| A bounce, then UNDO (4 times) | each take saved as a WAV named `B4-261203-…` (the first `B4-261203-1915`), a free name each time; after each UNDO bank B's Part 1 equalled its saved copy byte for byte. Before UNDO the working Part differed exactly in T4's FX1, FX2, machine (FLEX) and Flex slot (recorder buffer 4) | +| A merge (T4 with T3), then UNDO | BOUNCED, SAVED AS `B4-261203-1922-2`; T3 was already muted in this project, so the mutes stayed `0x7c00`; after UNDO the Part equalled its saved copy and the mutes were unchanged | +| RESET TRACK on T4, then UNDO | RESET T4 asked first, YES: TRACK RESET, T4 STATIC; after UNDO the Part equalled its saved copy | +| A restart after UNDO (0.1.0's open question) | none in 6 UNDOs, over about 9 minutes of trial | + +The takes' WAV files stay on the developer's card (UNDO never deletes them). + +**Not run on the unit:** +- the soak; +- a project save and reload, and a power cycle, after a bounce; +- a WAV save onto a full card; +- the lamps by eye; +- the agent's step 11 screenshots of every screen; +- the submitter's stage 12. + +Once during the run, stock's Part Edit window was open on PART's actions, SAVE ALL highlighted. No script had sent FUNC+PART at that point, and it was closed without YES. The saved Part was checked afterwards and was unchanged. + +**3 December 2026, the developer at the unit**, after this run. The developer's report, not a test record: +- **Lamps.** The 0.4.0 build showed tappable keys yellow and the tracks in the take green. On their request the active track is now red, merged tracks green and the other tappable tracks yellow (the keys have only red and green, so no white). The red build is built but not yet seen. +- **Power cycle.** After a bounce, a project save and a power cycle, the take was still there ("power cycle works"). + +## The 0.4.0 test procedure on the release candidate + +**3 December 2026, the developer's MKII.** OS 1.40C. The development twin `4813a3e5` was RAM-booted again after a power cycle, never flashed. Release base 0.8.5 (`ddb56b72`) is flashed. Source `72af1cd79`. Package SHA-256 `196de6d7ea754be27946d6090b2f1346b00f6eb172d5e5e928fe2aa029571458`, the same package the CPU reading above priced. Project SALVA 4 (its bank 16's parse error prompt answered NO, as above), bank B, pattern B01, Part 1, working = saved. Nothing was kept and the project was never saved. + +`npm run test:procedure -- bounce` stopped at its preflight again: no MIDI bridge, since the twin offers the Mac no USB MIDI port. Its steps were run one by one with the commands from `--plan`: + +| Step | Result | +| --- | --- | +| 1 Software checks | `module:doctor -- --draft bounce`: experimental lines green; cross-compatibility installs beside every active module and the base | +| 2 Beside every other module | judged by step 1's compatibility line (a draft) | +| 3 Name the build | `module:dev -- bounce --build-only`: SHA-256 `196de6d7…` | +| 4 DSP cost model | `cycle-scan.mjs check`: passed | +| 5 Emulator rehearsal | not run by the procedure; this build's emulator runs are above | +| 6 Read the unit | status, Part state (Part 1 on B01, working = saved) and inventory (empty) read | +| 7 Scripted unit pass | `device:test`: passed. Trial in RAM, rolled back; self-test passed; Part switches 12 of 12; inventory unchanged | +| 8 Soak | **not run**: no USB MIDI port on the twin | +| 9 Cost on the unit | `device:price --write`: the CPU section above (0 % of a frame at rest; `--curve` is for machines and effects) | +| 10 Put back | inventory empty; Part 1 on B01: nothing to put back, working = saved | + +**Edge cases by hand**, on T4 of B01, in one trial, rolled back: + +| Case | Seen | +| --- | --- | +| Three bounces of T4, each then UNDO (the CPU readings) | each saved as `B4-261203-…`; after each UNDO bank B's Part 1 equalled its saved copy byte for byte | +| The windows | BOUNCE T4 with PASS 16 STEPS, TRIG 1-8: MERGE, YES: REC NO: CLOSE; T3 tapped and shown inverted beside T4; PRESS PLAY; WAITS FOR PATTERN START | +| A merge (T4 with T3), twice | RECORDING, then BOUNCED and saved; T3 muted afterwards (`0x80000008` = `0x400`); T4 FLEX on the take | +| UNDO after the merge | UNDONE; mutes back to 0; the Part equalled its saved copy | +| RESET TRACK on T4, then UNDO | RESET T4: STOCK STATIC TRACK, NO TRIGS, NO LOCKS, YES: RESET NO: BACK; YES: TRACK RESET; UNDO: UNDONE, the Part equalled its saved copy | + +**An unexplained popup.** After the first merge, stock's PART menu (RENAME, RELOAD, SAVE, SAVE ALL, with SAVE ALL highlighted) was open over the main screen. It was found at the next screenshot, about two minutes after the take. No script had sent PART or FUNC+PART in that trial, and in the earlier 0.4.0 run the same window turned up once. It was closed with NO, and the saved Part was unchanged. It did not come back in the second merge (screenshots every 1.5 s for 21 s), after the UNDO that restored the mutes, or in the three plain bounces. Cause not found: Bounce's mute redraw call ran in the UNDO without it, and a key pressed at the unit was not ruled out. The developer never saw it in their own runs and takes it for an artefact of the agent's scripted session on the development twin; it stays recorded here as seen only there. + +**The developer's own test of package `196de6d7`, as reported** (3 December 2026, the same MKII, in a RAM trial, never kept): +- the two-line popup, TAKE RECORDED / CHANGE T*n* TO FLEX, read right; +- a project save, reload and power cycle, and playing the bounced tracks, worked as they did on the earlier 0.4.0 builds (reported as "tested ... too", without details per step). + +**Not run:** +- the soak; +- a WAV save onto a full card; +- a project never saved; +- the submitter's stage 12. + +## The release run: test:procedure on package 196de6d7 + +**3 December 2026, the developer's MKII**, OS 1.40C. Development twin `7d1223b1` of base 0.8.5, built from the developer's own 1.40C with `--usb-midi` added (the earlier twin `4813a3e5` offered no USB MIDI port, which the soak needs), RAM-booted, never flashed. Release base 0.8.5 (`ddb56b72`) stays flashed. Source `02cd1555` (the draft, before the listing commit; the listed folder builds the same package). Package SHA-256 `196de6d7ea754be27946d6090b2f1346b00f6eb172d5e5e928fe2aa029571458`. Bank B, pattern B01, Part 1. `npm run test:procedure -- bounce`, 394 s: + +| Step | Result | +| --- | --- | +| 1 Software checks | passed (`module:doctor -- --draft bounce`) | +| 2 Beside every other module | not run on the unit; `modules:compat` installs it beside every active module and the base | +| 3 Name the build | passed: `196de6d7` | +| 4 DSP cost model | passed | +| 5 Emulator rehearsal | passed (twin `7d1223b1` in `ot_emu`, not hardware evidence) | +| 6 Read the unit | passed: Part 1 on B01, working = saved; the procedure saved that Part once (unchanged) so that its RELOAD works at the end | +| 7 Scripted unit pass | passed (`device:test`, 12 Part switches) | +| 8 Soak | passed: 2,400 operations in 122 s (19.7 a second), health replies median 12 ms, most 48; Part 1 reloaded afterwards, working = saved | +| 9 Cost on the unit | passed: frame interrupt 28.4 % before and 28.4 % installed and unused (0 points), CPU meter 41.0 % and 40.7 %, B01 playing | +| 10 Put back | passed: inventory empty, Part 1 working = saved | + +Steps 11 and 12 (by hand, and the developer's stage) are the runs on the same package recorded above: the edge cases on twin `4813a3e5` and the developer's report. + +**A test-tool fix found on the way.** The first run of this procedure failed at the soak's put-back: the device tool's RELOAD sent FUNC+PART, UP x3, DOWN, YES, made for stock's one-column PART menu. With Bounce installed the base opens its two-column Part Edit window, which remembers its cursor (it was on BOUNCE > UNDO), so those keys landed on BOUNCE's actions: the readout showed RESET TRACK's confirm (phase 7), then NO cancelled it and nothing was reset. The tool now presses LEFT, UP x3 and RIGHT first, which reaches PART's actions in the two-column window and changes nothing in stock's menu (both seen on the unit, screenshots, 3 December 2026). Commit `02cd1555`. + +## The release run: test:procedure on package ad2b4cfe + +**4 December 2026, the developer's MKII**, OS 1.40C. Development twin `7d1223b1` of base 0.8.5 (built from the developer's own 1.40C with USB MIDI, RAM-booted, never flashed); release base 0.8.5 stays flashed. Source `819162bc`. Package SHA-256 `ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea`. Bank B, pattern B01, Part 1. `npm run test:procedure -- bounce`, 411 s: + +| Step | Result | +| --- | --- | +| 1 Software checks | passed (`module:doctor -- bounce`) | +| 2 Beside every other module | passed | +| 3 Name the build | passed: `ad2b4cfe` | +| 4 DSP cost model | passed | +| 5 Emulator rehearsal | passed (twin `7d1223b1` in `ot_emu`, not hardware evidence) | +| 6 Read the unit | passed: Part 1 on B01, working = saved | +| 7 Scripted unit pass | passed (`device:test`) | +| 8 Soak | passed: 2,400 operations in 120 s (20 a second), no crash, stall, freeze or skipped track; Part 1 reloaded, working = saved | +| 9 Cost on the unit | passed: frame interrupt 28.6 % before and 28.6 % installed and unused (0 points), CPU meter 41.1 % and 40.9 % | +| 10 Put back | passed: nothing to put back, Part 1 working = saved | + +Step 11 (by hand) is the review-fix table below, on the same package. + +**Step 12, the developer's own test of package `ad2b4cfe`, as reported** (4 December 2026, the same MKII, a 30-minute RAM trial, never kept). The developer was asked to check a plain and a merged bounce by ear, a cancel followed by UNDO of the earlier bounce, a mute changed while a take was armed, a project save, reload and power cycle with the bounced tracks, and a Modwerk machine track through the PICK FLEX popup, and reported "all tested", without details per step. The trial ran on the flashed release base 0.8.5 (`ddb56b72`), not the development twin. Its readout (phase, merged tracks, transport, recorder, UNDO bit) shows a T1 take whose track was a Modwerk machine: the PICK FLEX popup and strip (phases 9 and 6), then the bounce finished and UNDO ready; a merged take of T2 with T3 and T4, finished and saved, UNDO ready; and an UNDO about two minutes later. + +## The review fixes, package ad2b4cfe (unit) + +A code review of 196de6d7 found four faults: arming a take dropped the last UNDO even when the take was then cancelled; a cancel after a pattern change on the same Part left the recorder setup as Bounce had set it; a cancel or a take's end put back every mute as it was when the take was armed, undoing mutes the player changed meanwhile; and WAITS FOR PATTERN START was long for the window. Package `ad2b4cfe` takes UNDO's copy at the take's end, keeps only the track's 12 recorder bytes while armed, puts them back while the same bank and Part are loaded (any pattern), puts back only the cue bits a merged take set, and reads WAIT. + +**4 December 2026, the developer's MKII**, OS 1.40C, development twin `7d1223b1` (RAM-booted), package `ad2b4cfe` in a RAM trial, rolled back. Bank B, Part 1, T4; T1, T2, T6 and T7 muted (`0x6300`). Readings from the trial's readout (phase, UNDO bit), `mem` reads of the mutes and of Part 1's working and saved copies, and screenshots: + +| Case | Seen | +| --- | --- | +| A bounce of T4 (stopped, YES, PLAY) | the take in 4.8 s, T4 FLEX on `B4-261204-0104`, UNDO ready, T4's recorder bytes back (`010140000901000000ffff00`), mutes unchanged | +| Arm again stopped, NO | BOUNCE CANCELLED, UNDO still ready, recorder bytes back | +| Arm while playing, NO | the armed window read WAIT; cancelled, UNDO still ready | +| Merge T3, arm, mute T5 (FUNC+T5), NO | cue bits set while armed (`0xc6300`), T5 muted (`0xc7300`); after NO `0x7300`: T5 stays muted, the cue bits gone | +| Arm on B01 (recorder bytes `00000f0004...`), PATTERN+TRIG2 (B02, Part 1 too), NO | recorder bytes back to `010140000901000000ffff00`, the screen on B02 | +| UNDO of the first bounce, after those cancels | UNDONE, T4 STATIC on its sample again, Part 1 working = saved, mutes `0x6300` | +| Merge T3, play, mute T5 near the take's end | mutes after the take `0x7700`: T3 muted by the bounce, T5 kept, no cue bits; UNDO then `0x7300` (T3 back, T5 kept), Part 1 working = saved | + +Not run by the agent on this package: a Modwerk machine track (the take's end now snapshots before the PICK FLEX popup; with the popup abandoned, UNDO is not ready). The developer's report covers it, as reported. + +## Key-press cost, package ad2b4cfe (emulator) + +**4 December 2026, `ot_emu`**, the same setup as below (octabam `f7d72906`, `--dsp --frame`, MKII panel, twin `4813a3e5`, the BOUNCE card), package `ad2b4cfe` in a trial. Not hardware evidence. + +| Press | Executed instructions | +| --- | --- | +| DOWN+REC (opens BOUNCE) | 427 | +| Trig key 2 (merge T2) | 253 | +| YES (arms the merge, stopped) | 67,320 | +| The take's end, in the UI tick while playing (UNDO's snapshot, Flex conversion, mutes, the save started) | 2,447,620 | +| UNDO of that bounce | 138,506 | +| RESET TRACK's YES | 247,832 | +| UNDO of the reset | 145,079 | +| A UI tick otherwise | about 6,000 to 10,000 | + +**Stress run:** as below, with A01 playing: 20 RESET TRACK and UNDO pairs, 10 on Part 1 and 10 on Part 2 after STOP, PLAY and a Part change. The readout counted 20 resets and 20 undos, the UI tick count rose throughout (to 7,182), the slot stayed running. `npm run perf:audit -- check evidence/performance.json`: worst event 2,447,620 of 26,600,000 (9 %), 40 presses while playing, no hang. + +## Key-press cost, package 196de6d7 (emulator) + +**3 December 2026, `ot_emu`** (octabam `f7d72906`, `--dsp --frame`, MKII panel) on the development twin `4813a3e5` of base 0.8.5, the developer's MAIN OS 1.40C, an emulated card with the BOUNCE project. Package `196de6d7` in a trial (`device.mjs try`), the same package the unit ran. Instructions counted with `watch`/`hits` between the base's key call (`0x40061dc8`) and its return, and its UI tick call (`0x40061e94`) and its return; each count includes the stock code and interrupts that ran inside the call. Not hardware evidence. + +| Press | Executed instructions | +| --- | --- | +| DOWN+REC (opens BOUNCE) | 10,486 | +| Trig key 2 (merge T2) | 253 | +| YES (arms the merge, stopped) | 161,103 | +| The take's end, in the UI tick while playing (Flex conversion, mutes, the save started) | 2,394,862 | +| UNDO of that bounce | 145,880 | +| RESET TRACK's YES | 247,170 | +| UNDO of the reset | 159,433 | +| A UI tick otherwise | about 6,000 | + +**Stress run:** with B01 playing, ten RESET TRACK and UNDO pairs on T1 in Part 1; STOP, PLAY, Part 2 (PART held, RIGHT); ten more pairs. The trial readout counted 20 resets and 20 undos, the UI tick count rose throughout (2,914 to 5,184), the slot stayed running. `npm run perf:audit -- check sdk/drafts/bounce/evidence/performance.json`: + +| Check | Result | +| --- | --- | +| record | key-press coldfire record for bounce@0.4.0-experimental | +| cycles | worst event 2,394,862 of 26,600,000 cycles (9 %) | +| stock benchmark | none: a key-press module adds nothing to the frame interrupt | +| stress | 40 presses while playing, no hang | + +After the take, the emulator showed stock's SET DATE/TIME window over the main screen (closed with NO); the bounce had finished and saved. It was not seen on the unit, whose clock is set. + +## Stock flows + +Not tested. To compare with and without the module: REC alone (grid recording), TRACK + REC1/2/3 sampling, recorder trigs and RLEN, CUE routing and Studio mode, Part Edit's stock rows, Part Reload and Save, project save and reload, stock track mute. diff --git a/sdk/octatrack/modules/bounce/bounce.c b/sdk/octatrack/modules/bounce/bounce.c new file mode 100644 index 0000000000..ff13b90528 --- /dev/null +++ b/sdk/octatrack/modules/bounce/bounce.c @@ -0,0 +1,817 @@ +/* SPDX-License-Identifier: MIT + * Copyright (c) 2026 seniorspiz + * + * Bounce In Place, OS 1.40C: record tracks for one pattern pass into the active track's + * recorder buffer, then make that track a Flex machine playing the take. + * 0.4.0: passed the test procedure on one MKII, and its developer's own test (TESTING.md). + * + * DOWN+REC (or FUNC+PART > BOUNCE > BOUNCE TRACK) opens BOUNCE. Trig keys 1-8 + * add or remove tracks to merge; YES arms; NO closes or cancels. + * Arm: the recorder takes the track itself (SRC3 = the track) or, when tracks + * are merged, CUE with exactly those tracks cued; RLEN is one pass in master + * 16ths (merged tracks: where their lengths meet, else the longest) and QREC + * is PLEN, so stock starts the take on the next pattern start and ends it by + * itself. Done: the Part gets FLEX on the track's own buffer with stock's FLEX, + * AMP and no-LFO settings, FX1/FX2 none and its recorder setup back; the + * pattern record gets one trig on step 1 and no locks; merged tracks are muted. + * Then stock's SAVE THIS RECORDING writes the take as BOUNCES/B-YYMMDD-HHMM.wav + * in the project folder + * and assigns the buffer to it, as SAVE ALL RECORDINGS does. + * A Modwerk machine track (Grain, a synth) is bounced as it sounds; then the + * player picks FLEX in the chooser, so the machine leaves through the base, + * and Bounce finishes. RESET TRACK makes a track a stock STATIC track with a + * fresh project's settings, no trigs and no locks. UNDO puts the track's Part + * bytes, its pattern record and the mutes back from Bounce's own copy. + * + * Every write goes through stock's own routines where one exists (Part paste, + * track write, the recorder mailbox), so the battery-backed copies follow. + * Addresses: octabam docs/firmware (PARTS.md, STEP_LOCKS.md, RECORDER.md, + * MIDI.md) and modules/free-loop/adapter.c; the text call and the lock index + * as Pattern Sample Locks uses them. TESTING.md says which are measured. */ +#include +#include "modwerk_module.h" +#include "modwerk_events.h" + +#define U8(a) (*(volatile uint8_t *)(uintptr_t)(a)) +#define U32(a) (*(volatile uint32_t *)(uintptr_t)(a)) + +/* ---- state the UI shows (MIDI.md, PSL's native.c, free-loop's adapter.c) ---- */ +#define BANK_PTR 0x46c82456u /* long: the current bank's RAM */ +#define BANK0 0x400e21e0u +#define BANK_STRIDE 0x9b340u +#define CUR_PART 0x100b14cfu /* the current Part, 0..3 */ +#define CUR_PATTERN 0x100b14d0u /* the current pattern, 0..15 */ +#define CUR_TRACK 0x80000000u /* the current audio track, 0..7 */ +#define MIDI_MODE 0x80000012u /* nonzero: MIDI tracks are shown */ +#define TRANSPORT 0x800065b8u /* long: 1 playing */ +#define ROWS 0x46100b18u /* the key matrix: row (code >> 3), bit (code & 7) */ +#define MUTES 0x80000008u /* long: bit 8+t muted, 16+t cued */ +#define MUTES_CS1 0x100b14d4u /* its battery-backed copy */ +#define VOICE 0x800049d8u /* + 0xa8 t: byte 1 nonzero while t's recorder runs */ +#define LIMIT 0x46c7fe24u /* long [t]: the last take's length, written at its stop */ +#define REDRAW 0x46c7c72cu +#define LOCK_INDEX 0x46c7d48cu /* + step: bit t, the track has a lock on that step */ + +/* ---- records (PARTS.md, STEP_LOCKS.md, ot_bank.py) ---- */ +#define PAT_BYTES 0x8ed8u +#define TRK_BYTES 0x91au +#define PART_AT 0x8ed80u +#define PART_BYTES 0x18b2u +#define PAT_LEN 0x8e53u /* pattern length, scale, scale mode (0 normal) */ +#define PAT_SCALE 0x8e54u +#define PAT_MODE 0x8e55u +#define TRK_LEN 0x50u +#define TRK_SCALE 0x51u +#define TRK_LOCKS 0x59u +#define P_FX1 0x00u /* + t */ +#define P_FX2 0x08u +#define P_MACHINE 0x22u /* + t: 0 STATIC 1 FLEX 2 THRU 3 NEIGHBOR 4 PICKUP */ +#define P_SRC 0x2au /* + 30 t: SRC pages, 6 bytes a machine (STATIC FLEX THRU NEIGHBOR PICKUP) */ +#define P_PAGES 0x11au /* + 24 t: LFO SPD1-3 DEP1-3, AMP ATK HOLD REL VOL BAL XVOL, FX1, FX2 */ +#define P_SETUP 0x1dau /* + 30 t: the machines' SETUP pages */ +#define P_SLOTS 0x2cau /* + 5 t: the slot bytes, FLEX at +1 */ +#define P_PAGES2 0x2f2u /* + 30 t: LFO PMTR1-3 WAVE1-3, the other setup pages */ +#define FLEX_DEFAULTS 0x400d320cu /* stock's 12 FLEX bytes (page, then setup), as the base reads them */ +#define BANK_INDEX 0x100b14ceu /* the current bank, for stock's parameter load */ +#define RELOAD_PARAMS 0x40001f18u /* (bank, Part, track): the track's live parameters from its Part */ +#define LOADING 0x80000015u /* nonzero: not now (Grain's guard on the same call) */ +#define P_REC 0x602u /* + 12 t: INAB INCD RLEN TRIG SRC3 LOOP FIN FOUT AB QREC QPL CD */ +#define REC_INAB 0 +#define REC_INCD 1 +#define REC_RLEN 2 +#define REC_SRC3 4 +#define REC_QREC 9 +#define SRC3_CUE 10u +#define QREC_PLEN 0u +#define STATIC 0u +#define FLEX 1u + +/* ---- stock routines ---- */ +#define REC_POST 0x40005178u /* (track, word, quantised): the REC keys' mailbox */ +#define PART_PASTE 0x40029a4cu /* (src, part): working Part and CS1, unsaved bit, applied */ +#define CS1_PATTERNS 0x1001614eu /* the current bank's patterns, battery-backed (STEP_LOCKS.md) */ +#define BANK_EDITED 0x9b332u /* bank + this: the next bank write takes it */ +#define PROJ_EDITED 0x100f8598u +#define P_SIG 60u /* + 30 t: a Modwerk machine's two letters and version (modwerk_events.h) */ +#define MACHINE_SET 0x400972fcu /* (part, track, old machine): the transition Part Reload runs */ +#define EDITED 0x40027e00u +#define TRACK_PREP 0x4009da20u /* (track): prepare the track's steps again */ +#define MUTE_EVENT 0x400053d8u /* (0x1a, 0, 0, 0, 0, 0): the screen after a mute */ +#define TEXT 0x40012bd8u +#define FONT 0x400ba876u +#define SURFACE 0x400bf10au + +/* ---- the take's WAV: stock's SAVE THIS RECORDING, save and assign to self (octabam + * docs/firmware/SAMPLE_SAVE.md; the same chain as stock's SAVE ALL RECORDINGS, + * 0x4003108c, as octabam's buffer-saver drives it, measured there on a MKII) ---- */ +#define SAVE_KIND 0x460be9e8u /* long: the object's kind, 1 FLEX */ +#define SAVE_OBJ 0x460be9ecu /* long: the object, recorder buffer n = 128 + n */ +#define SAVE_NAME 0x460be9f0u /* the file name, no extension */ +#define SAVE_MODE 0x460bcfc8u /* long: 0 save only; 2 save, then assign the buffer to the file */ +#define SAVE_ASSIGN 0x40024148u /* (): assign SAVE_OBJ to SAVE_NAME's file, then SAVE_DONE_B (mode 2 runs it after the .ot) */ +#define SAVE_DONE_A 0x46c8d194u /* done callbacks: A after the WAV (mode 0) */ +#define SAVE_DONE_B 0x46c8d198u /* B after the assignment (modes 1, 2), (result): < 0 failed */ +#define SAVE_WRITE 0x40024168u /* (name): the naming keyboard's confirm past its name and overwrite + * checks (SAVE_GO 0x40024288 calls it with SAVE_NAME): builds + * "%s/%s.wav" from the folder SAVE_TO picks and the name, then + * queues the write. The name may hold a '/', which SAVE_GO refuses. */ +#define POOL_READY 0x46105408u /* nonzero once the sample pool is up (the WAV writer's guard) */ +#define SLOT_STATE 0x46c922c4u /* + 44 id: the slot's state, +16 its length in frames */ +#define CLOCK_NAME 0x400819fcu /* (): "YYMMDD-HHMM", stock's recording name */ +#define SPRINTF 0x40013a08u +#define SAVE_TO 0x800000a4u /* long: SAVE SAMPLES TO, nonzero = the project's folder */ +#define PROJ_DIR_OK 0x40024eecu /* (): nonzero when the project has a folder of its own */ +#define PROJ_DIR 0x40025230u /* (0, 0): the project's folder */ +#define SET_DIR 0x100f8480u /* the set's folder */ +#define FILE_EXISTS 0x46c823fau /* long: the file-exists test, (path); answers for a folder too */ +#define FS_MKDIR 0x46c8240au /* long: create one folder, (path): 0 made, < 0 failed (STEM_REC.md 6) */ +#define MASTER_TRACK 0x80000034u /* nonzero: T8 is the master track (STORAGE.md) */ +#define CUE_LEVEL 0x80000c51u /* + 2t: the track's cue level (MIDI.md, CC 47) */ + +/* ---- the trig key lamps (octabam docs/firmware/PANEL.md section 8, KEYMAP.md "LED colours"): + * trig key n is LED id 2(n-1) red, 2(n-1)+1 green, eight ids a bitmap byte. The panel shows + * STEADY ^ TIMED; set_led's countdowns own TIMED, stock's drawers STEADY. ---- */ +#define LED_LOCK 0x460ba9c0u /* the LED semaphore set_led takes */ +#define LED_STEADY 0x460ba98cu +#define LED_TIMED 0x460ba9aeu +#define LED_FLUSH 0x400136a8u /* (): sends the rows that changed; with LED_LOCK held */ +#define LOCK_TAKE 0x400009f4u +#define LOCK_GIVE 0x40000ab4u + +#define K_DOWN 0x20 +#define K_REC 0x29 +#define K_YES 0x31 +#define K_NO 0x32 +#define TAKE_WORD 0xc010u /* start, SRC3 (free-loop's take word) */ +#define STOP_WORD 0x80u + +enum { CLOSED, SELECT, ARMED, RECORDING, MESSAGE, WAIT_PLAY, PICK_FLEX, CONFIRM_RESET, SAVING, PICK_INFO }; +#define PICKING (phase == PICK_FLEX || phase == PICK_INFO) /* waits for FLEX: the popup, then the strip */ + +/* A track's own bytes in its Part, in this order: what Bounce and RESET TRACK + * change and UNDO puts back (PARTS.md; ot_project.py, ot_spec.py). */ +static const struct { uint16_t at; uint8_t stride, n; } TRACK_BYTES[] = { + {P_FX1, 1, 1}, {P_FX2, 1, 1}, {P_MACHINE, 1, 1}, {P_SRC, 30, 30}, {P_PAGES, 24, 24}, + {P_SETUP, 30, 30}, {P_SLOTS, 5, 5}, {P_PAGES2, 30, 30}, {P_REC, 12, 12}, +}; +#define RANGES (sizeof TRACK_BYTES / sizeof *TRACK_BYTES) +/* A fresh project's values for one track, in that order (every track the same + * but its slots, set in reset_track): STATIC, FX1 FILTER, FX2 DELAY. */ +static const uint8_t FRESH[134] = { + 0x04, 0x08, 0x00, + 0x40, 0x00, 0x00, 0x7f, 0x00, 0x4f, 0x40, 0x00, 0x00, 0x7f, 0x00, 0x4f, 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x01, 0x7f, 0x40, 0x01, + 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x40, 0x40, 0x7f, 0x00, 0x7f, 0x00, 0x40, 0x00, 0x40, + 0x2f, 0x00, 0x7f, 0x00, 0x7f, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, + 0x00, 0x01, 0x7f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x40, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, +}; +#define AMP_AT 6u /* in P_PAGES: ATK HOLD REL VOL BAL XVOL */ +#define DEP_AT 3u /* in P_PAGES: DEP1-3 */ +static const uint8_t AMP_CLIP[6] = {0x00, 0x7f, 0x7f, 0x40, 0x40, 0x7f}; /* stock's AMP: the clip as recorded */ + +struct ctx { + uint32_t bank; + uint8_t pattern, part, track, merged; + uint32_t mutes; +}; + +static unsigned phase, consumed_lo, consumed_hi, shown_ticks; +static const char *message, *message2; /* a second line, or 0 */ +static struct ctx arm; /* the bounce in progress */ +static struct ctx last; /* the last finished bounce, for UNDO */ +static unsigned undo_ready; +static uint8_t record_copy[TRK_BYTES]; /* the track's pattern record as it was (UNDO) */ +static uint8_t record_new[TRK_BYTES]; +static uint8_t part_copy[PART_BYTES]; /* the Part as it was before the last finished bounce (UNDO) */ +static uint8_t rec_copy[12]; /* the armed track's recorder setup, put back after the take */ +static uint8_t part_buf[PART_BYTES]; +static char note[32]; /* a message built at run time */ +static volatile int saved_result, saved_in, wav_result, wav_in; +static uint32_t wav_in_project, assigning; +static uint32_t saved_ticks, prev_done_a, prev_done_b, prev_mode; +static char wav_name[24], wav_base[24], wav_dir[136], wav_path[160]; + +static void call6(uint32_t fn, uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e, uint32_t f) +{ ((void (*)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t))(uintptr_t)fn)(a, b, c, d, e, f); } +static void call3(uint32_t fn, uint32_t a, uint32_t b, uint32_t c) +{ ((void (*)(uint32_t, uint32_t, uint32_t))(uintptr_t)fn)(a, b, c); } +static void call2(uint32_t fn, uint32_t a, uint32_t b) +{ ((void (*)(uint32_t, uint32_t))(uintptr_t)fn)(a, b); } +static void call1(uint32_t fn, uint32_t a) { ((void (*)(uint32_t))(uintptr_t)fn)(a); } +static void call0(uint32_t fn) { ((void (*)(void))(uintptr_t)fn)(); } + +static void copy(uint8_t *to, const volatile uint8_t *from, unsigned n) { while (n--) *to++ = *from++; } +/* Struct copies by hand: there is no memcpy, and gcc calls it for a struct assignment. */ +static void copy_ctx(struct ctx *to, const struct ctx *from) { copy((uint8_t *)to, (const uint8_t *)from, sizeof *to); } +static void redraw(void) { U32(REDRAW) = 1; } +static unsigned held(unsigned code) { return (U8(ROWS + (code >> 3)) >> (code & 7u)) & 1u; } +static unsigned recording(unsigned t) { return U8(VOICE + 0xa8u * t + 1u) != 0; } +static unsigned bank_ok(uint32_t b) +{ return b >= BANK0 && b <= BANK0 + 15u * BANK_STRIDE && (b - BANK0) % BANK_STRIDE == 0; } + +static uint32_t pattern_at(const struct ctx *c) { return c->bank + c->pattern * PAT_BYTES; } +static uint32_t record_at(const struct ctx *c) { return pattern_at(c) + c->track * TRK_BYTES; } +static uint32_t part_at(const struct ctx *c) { return c->bank + PART_AT + c->part * PART_BYTES; } + +/* The context the UI shows now; 0 when it is not an audio track view. */ +static int current(struct ctx *c) +{ + uint32_t b = U32(BANK_PTR); + unsigned p = U8(CUR_PATTERN), part = U8(CUR_PART), t = U8(CUR_TRACK); + if (!bank_ok(b) || p >= 16u || part >= 4u || t >= 8u || U32(MIDI_MODE)) return 0; + c->bank = b; c->pattern = (uint8_t)p; c->part = (uint8_t)part; c->track = (uint8_t)t; + return 1; +} +static int same_place(const struct ctx *a, const struct ctx *b) +{ return a->bank == b->bank && a->pattern == b->pattern && a->part == b->part; } + +static unsigned per_track(const struct ctx *c) { return U8(pattern_at(c) + PAT_MODE) != 0; } +/* One pass of track t in ticks (a master 16th is 6), or 0. PER TRACK mode: the + * track's own length and scale (rlen-plen's cave reads the same pair). */ +static unsigned track_ticks(const struct ctx *c, unsigned t) +{ + static const uint8_t ticks[7] = {3, 4, 6, 8, 12, 24, 48}; /* 2X ... 1/8X */ + uint32_t pat = pattern_at(c), rec = pat + t * TRK_BYTES; + unsigned len = per_track(c) ? U8(rec + TRK_LEN) : U8(pat + PAT_LEN); + unsigned scale = per_track(c) ? U8(rec + TRK_SCALE) : U8(pat + PAT_SCALE); + return scale > 6u || !len ? 0 : len * ticks[scale]; +} +static unsigned gcd(unsigned a, unsigned b) { while (b) { unsigned r = a % b; a = b; b = r; } return a; } +/* The take, in master 16ths, 1 to 64 (RLEN's range), or 0: where the chosen + * tracks' passes meet, a whole number of 16ths. Past 64, the longest pass, + * rounded up to a 16th, and *longest says so. */ +static unsigned pass_steps(const struct ctx *c, unsigned *longest) +{ + unsigned meet = 6u, most = 0, over = 0; + *longest = 0; + for (unsigned t = 0; t < 8u; ++t) { + if (!(c->merged >> t & 1u)) continue; + unsigned x = track_ticks(c, t); + if (!x) return 0; + if (x > most) most = x; + if (!over) { meet = meet / gcd(meet, x) * x; over = meet > 64u * 6u; } + } + if (!over) return meet / 6u; + *longest = 1; + most = (most + 5u) / 6u; + return most <= 64u ? most : 0; +} + +/* Track t's own bytes into the Part image `to`: from a Part image (whole) or from FRESH's order. */ +static void put_track(uint8_t *to, const uint8_t *from, unsigned t, unsigned whole) +{ + unsigned k = 0; + for (unsigned r = 0; r < RANGES; ++r) { + unsigned at = TRACK_BYTES[r].at + TRACK_BYTES[r].stride * t; + for (unsigned i = 0; i < TRACK_BYTES[r].n; ++i, ++k) to[at + i] = whole ? from[at + i] : from[k]; + } +} +/* Paste the Part image, then bring the track's machine and live parameters in + * line with it: the transition Part Reload runs when the type changed, else + * stock's parameter load (relive() in the base's machine_registry.c). */ +static void paste(const struct ctx *c, unsigned t, unsigned old) +{ + call2(PART_PASTE, (uint32_t)(uintptr_t)part_buf, c->part); + unsigned now = part_buf[P_MACHINE + t]; + if (old != now) call3(MACHINE_SET, c->part, t, old); + else if ((U8(CUR_PART) & 3u) == c->part && !U8(LOADING)) call3(RELOAD_PARAMS, U8(BANK_INDEX), c->part, t); +} + +/* The mute and cue long and its battery-backed copy, as stock's mute stores it. */ +static void set_mutes(uint32_t value) +{ + uint16_t sr; + __asm__ volatile("move.w %%sr,%0\n\tmove.w #0x2700,%%sr" : "=d"(sr) :: "memory"); + U32(MUTES) = value; U32(MUTES_CS1) = value; + __asm__ volatile("move.w %0,%%sr" :: "d"(sr) : "memory"); + call6(MUTE_EVENT, 0x1a, 0, 0, 0, 0, 0); +} + +/* The lock index of the current pattern, for one track, from its record. */ +static void lock_index(const struct ctx *c) +{ + uint32_t rec = record_at(c); + for (unsigned step = 0; step < 64u; ++step) { + unsigned locked = 0; + for (unsigned slot = 0; slot < 31u && !locked; ++slot) + locked = U8(rec + TRK_LOCKS + 32u * step + slot) != 0xffu; + uint8_t bit = (uint8_t)(1u << c->track), v = U8(LOCK_INDEX + step); + U8(LOCK_INDEX + step) = locked ? (uint8_t)(v | bit) : (uint8_t)(v & ~bit); + } +} + +/* Bytes into the working record and its battery-backed copy, interrupts held + * for one span at a time so the sequencer reads a span wholly old or new. */ +static void write_span(uint32_t work, uint32_t cs1, const uint8_t *src, unsigned n) +{ + uint16_t sr; + __asm__ volatile("move.w %%sr,%0\n\tmove.w #0x2700,%%sr" : "=d"(sr) :: "memory"); + for (unsigned i = 0; i < n; ++i) { U8(work + i) = src[i]; U8(cs1 + i) = src[i]; } + __asm__ volatile("move.w %0,%%sr" :: "d"(sr) : "memory"); +} +/* The whole record: stock's track write (0x40029754) left it unchanged on the + * unit (2 December 2026), so Bounce writes it as Pattern Sample Locks does. */ +static void write_record(const struct ctx *c, const uint8_t *src) +{ + uint32_t work = record_at(c), cs1 = CS1_PATTERNS + c->pattern * PAT_BYTES + c->track * TRK_BYTES; + write_span(work, cs1, src, TRK_LOCKS); + for (unsigned step = 0; step < 64u; ++step) + write_span(work + TRK_LOCKS + 32u * step, cs1 + TRK_LOCKS + 32u * step, src + TRK_LOCKS + 32u * step, 32u); + write_span(work + TRK_LOCKS + 64u * 32u, cs1 + TRK_LOCKS + 64u * 32u, src + TRK_LOCKS + 64u * 32u, + TRK_BYTES - TRK_LOCKS - 64u * 32u); + lock_index(c); + U32(c->bank + BANK_EDITED) = 1; U32(PROJ_EDITED) = 1; + call0(EDITED); + call1(TRACK_PREP, c->track); +} + +/* A Modwerk machine (Grain, a synth ...) signs the track in the Part. Only the + * base switches a track off one (its leave clears the machine's own bytes), so + * the player picks FLEX or STATIC in the chooser and Bounce waits for it. */ +static unsigned modwerk_machine(uint32_t part, unsigned t) +{ + uint32_t s = part + P_SIG + 30u * t; + unsigned a = U8(s), b = U8(s + 1), v = U8(s + 2); + return a >= 'A' && a <= 'Z' && ((b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9')) && v >= 1u && v <= 63u + && U8(part + P_MACHINE + t) == FLEX; /* syntiz signs models 1-15 */ +} + +static void number(char *at, unsigned v); +static void append(char *at, const char *s); +static unsigned sticky; /* the message stays until a key */ +static void show(const char *text) { message2 = 0; sticky = 0; message = text; phase = MESSAGE; shown_ticks = 0; redraw(); } +/* The take is in the recorder buffer and the track plays it, but no WAV was written (a full + * card, most likely): it stays until a key, so the player saves it in the Audio Editor. */ +static void not_saved(void) { show("NOT SAVED: TAKE IN BUFFER"); message2 = "SAVE IT IN AUDIO EDITOR"; sticky = 1; } +static void close_view(void) { phase = CLOSED; message = 0; redraw(); } + +/* ---- arm, cancel, finish, undo ---- */ +static void open_select(void) +{ + struct ctx c; + if (phase == ARMED || phase == RECORDING || phase == WAIT_PLAY || phase == SAVING) return; + if (PICKING) phase = CLOSED; /* the take stays in the recorder buffer, nothing else changed */ + if (!current(&c)) { show("AUDIO TRACKS ONLY"); return; } + copy_ctx(&arm, &c); arm.merged = (uint8_t)(1u << c.track); + phase = SELECT; message = 0; redraw(); +} + +static void start(void) +{ + struct ctx now; + if (!current(&now) || !same_place(&now, &arm) || now.track != arm.track) { show("TRACK CHANGED"); return; } + unsigned t = arm.track, longest, steps = pass_steps(&arm, &longest); + unsigned merge = arm.merged != (uint8_t)(1u << t); + if (!steps) { show("PASS OVER 64 STEPS"); return; } + if (U8(MASTER_TRACK) && (arm.merged & 0x80u)) { show("T8 IS THE MASTER TRACK"); return; } + for (unsigned m = 0; merge && m < 8u; ++m) + if ((arm.merged >> m & 1u) && !U8(CUE_LEVEL + 2u * m)) { /* the take is the CUE bus */ + note[0] = 0; append(note, "T"); number(note + 1, m + 1u); append(note, " CUE LEVEL IS 0"); + show(note); return; + } + if (recording(t)) { show("RECORDER BUSY"); return; } + uint32_t part = part_at(&arm); + arm.mutes = U32(MUTES); /* the cue bits, put back after the take; UNDO's copy waits for the take */ + copy(rec_copy, (const volatile uint8_t *)(uintptr_t)(part + P_REC + 12u * t), 12u); + + copy(part_buf, (const volatile uint8_t *)(uintptr_t)part, PART_BYTES); + uint8_t *r = part_buf + P_REC + 12u * t; + r[REC_INAB] = 0; r[REC_INCD] = 0; r[REC_RLEN] = (uint8_t)(steps - 1u); + r[REC_SRC3] = (uint8_t)(merge ? SRC3_CUE : t + 1u); r[REC_QREC] = QREC_PLEN; + call2(PART_PASTE, (uint32_t)(uintptr_t)part_buf, arm.part); + if (merge) set_mutes((arm.mutes & ~0x00ff0000u) | (uint32_t)arm.merged << 16); + U32(LIMIT + 4u * t) = 0; + if (U32(TRANSPORT)) { call3(REC_POST, t, TAKE_WORD, 1); phase = ARMED; } + else phase = WAIT_PLAY; /* stopped: stock started the take at once (unit, 2 December 2026) */ + redraw(); +} + +/* The armed track's recorder setup back in its Part, while that bank and Part are + * loaded (any pattern: the setup lives in the Part). */ +static void restore_rec(void) +{ + unsigned t = arm.track; + if (U32(BANK_PTR) != arm.bank || (U8(CUR_PART) & 3u) != arm.part) return; + copy(part_buf, (const volatile uint8_t *)(uintptr_t)part_at(&arm), PART_BYTES); + for (unsigned i = 0; i < 12u; ++i) part_buf[P_REC + 12u * t + i] = rec_copy[i]; + call2(PART_PASTE, (uint32_t)(uintptr_t)part_buf, arm.part); +} + +/* Only the cue bits a merged take set go back: mutes the player changed meanwhile stay. */ +static void restore_cues(void) +{ + if (arm.merged == (uint8_t)(1u << arm.track)) return; + uint32_t mutes = (U32(MUTES) & ~0x00ff0000u) | (arm.mutes & 0x00ff0000u); + if (U32(MUTES) != mutes) set_mutes(mutes); +} + +/* Put back the recorder setup and the cue bits without any bounce. UNDO keeps the last bounce. */ +static void cancel(const char *why) +{ + unsigned t = arm.track; + if (recording(t)) call3(REC_POST, t, STOP_WORD, 0); + restore_rec(); + restore_cues(); + show(why); +} + +/* The take is in: UNDO's copy is the Part, record and mutes as they are now, before the clip. */ +static void snapshot(void) +{ + copy(part_copy, (const volatile uint8_t *)(uintptr_t)part_at(&arm), PART_BYTES); + copy(record_copy, (const volatile uint8_t *)(uintptr_t)record_at(&arm), TRK_BYTES); + copy_ctx(&last, &arm); last.mutes = U32(MUTES); + undo_ready = 0; /* ready again once the clip is applied */ +} + +/* The Part and the record of a FLEX track playing the take, from the Part as + * it is now (a machine track: after the player picked FLEX). */ +static void apply_clip(void) +{ + unsigned t = arm.track, longest; + uint32_t part = part_at(&arm); + unsigned old = U8(part + P_MACHINE + t), steps = pass_steps(&arm, &longest); + copy(part_buf, (const volatile uint8_t *)(uintptr_t)part, PART_BYTES); + for (unsigned i = 0; i < 12u; ++i) part_buf[P_REC + 12u * t + i] = rec_copy[i]; + part_buf[P_MACHINE + t] = FLEX; part_buf[P_FX1 + t] = 0; part_buf[P_FX2 + t] = 0; + part_buf[P_SLOTS + 5u * t + FLEX] = (uint8_t)(0x80u + t); + for (unsigned k = 0; k < 12u; ++k) /* stock's FLEX page and setup */ + part_buf[(k < 6u ? P_SRC : P_SETUP) + 30u * t + 6u + k % 6u] = U8(FLEX_DEFAULTS + k); + uint8_t *pages = part_buf + P_PAGES + 24u * t; + for (unsigned k = 0; k < 3u; ++k) pages[DEP_AT + k] = 0; /* no LFO moves the clip */ + for (unsigned k = 0; k < 6u; ++k) pages[AMP_AT + k] = AMP_CLIP[k]; + paste(&arm, t, old); + + for (unsigned i = 0; i < TRK_BYTES; ++i) record_new[i] = record_copy[i]; + for (unsigned i = 0; i < 64u; ++i) record_new[i] = 0; /* the eight step masks */ + record_new[7] = 1; /* mask 0, step 1 */ + for (unsigned i = 0; i < 64u * 32u; ++i) record_new[TRK_LOCKS + i] = 0xffu; + if (per_track(&arm) && steps) { record_new[TRK_LEN] = (uint8_t)steps; record_new[TRK_SCALE] = 2; } /* 1X: one pass */ + write_record(&arm, record_new); + + uint32_t mutes = U32(MUTES) | ((uint32_t)(arm.merged & (uint8_t)~(1u << t)) << 8); + if (U32(MUTES) != mutes) set_mutes(mutes); + undo_ready = 1; +} + +/* The WAV. Stock names it B-YYMMDD-HHMM (-2 .. -99 while that file + * exists in /BOUNCES: nothing is overwritten) and writes it and its .ot + * there, whatever SAVE SAMPLES TO says. wav_saved() comes after the WAV; the tick + * then assigns the buffer to it, and stock calls saved(). A project SAVE then keeps + * the path, and a reload fills the buffer again. */ +typedef int (*printf_fn)(char *, const char *, ...); +static void saved(int result) { saved_result = result; saved_in = 1; } +static void wav_saved(int result) { wav_result = result; wav_in = 1; } +static void save_done_restore(void) +{ + if (U32(SAVE_DONE_B) == (uint32_t)(uintptr_t)saved) { U32(SAVE_DONE_B) = prev_done_b; U32(SAVE_DONE_A) = prev_done_a; } + if (U32(SAVE_MODE) == 0u) U32(SAVE_MODE) = prev_mode; +} +/* SAVE SAMPLES TO picks the folder both when stock builds the WAV's path and + * when it writes the slot's path ("%s.wav" in the project, "../AUDIO/%s.wav" in + * the pool), so it is set for those two calls only, and put back at once. */ +static void with_folder(uint32_t fn, uint32_t arg) +{ + uint32_t save_to = U32(SAVE_TO); + U32(SAVE_TO) = wav_in_project; + call1(fn, arg); + U32(SAVE_TO) = save_to; +} +static void save_take(void) +{ + unsigned t = arm.track; + if (!U32(POOL_READY) || (int32_t)U32(SLOT_STATE + 44u * (128u + t) + 16u) <= 0) { not_saved(); return; } + printf_fn pf = (printf_fn)(uintptr_t)SPRINTF; + pf(wav_base, "B%d-%s", (int)(t + 1u), ((const char *(*)(void))(uintptr_t)CLOCK_NAME)()); + int (*exists)(const char *) = (int (*)(const char *))(uintptr_t)U32(FILE_EXISTS); + int (*mkdir)(const char *) = (int (*)(const char *))(uintptr_t)U32(FS_MKDIR); + /* Always /BOUNCES, whatever SAVE SAMPLES TO says; a project without a + * folder of its own (never saved) gets /AUDIO/BOUNCES. */ + unsigned in_project = ((int (*)(void))(uintptr_t)PROJ_DIR_OK)() != 0; + wav_in_project = in_project; + if (in_project) pf(wav_dir, "%s/BOUNCES", ((const char *(*)(int, int))(uintptr_t)PROJ_DIR)(0, 0)); + else pf(wav_dir, "%s/AUDIO/BOUNCES", (const char *)(uintptr_t)SET_DIR); + if (!exists || !mkdir || (!exists(wav_dir) && mkdir(wav_dir) < 0)) { not_saved(); return; } + for (int k = 1; k <= 99; ++k) { + if (k == 1) pf(wav_name, "%s", wav_base); else pf(wav_name, "%s-%d", wav_base, k); + pf(wav_path, "%s/%s.wav", wav_dir, wav_name); + if (!exists(wav_path)) break; + if (k == 99) { not_saved(); return; } + } + pf((char *)(uintptr_t)SAVE_NAME, "BOUNCES/%s", wav_name); + U32(SAVE_KIND) = 1; U32(SAVE_OBJ) = 128u + t; + prev_mode = U32(SAVE_MODE); prev_done_a = U32(SAVE_DONE_A); prev_done_b = U32(SAVE_DONE_B); + U32(SAVE_MODE) = 0; U32(SAVE_DONE_A) = (uint32_t)(uintptr_t)wav_saved; U32(SAVE_DONE_B) = (uint32_t)(uintptr_t)saved; + saved_in = 0; wav_in = 0; assigning = 0; saved_ticks = 0; phase = SAVING; redraw(); + with_folder(SAVE_WRITE, SAVE_NAME); +} +/* Once a tick while SAVING: stock's answer, or none (a failed write shows + * stock's own error and never calls back). */ +static void saving_tick(void) +{ + if (saved_in) { + save_done_restore(); + if (saved_result < 0) not_saved(); + else { show("BOUNCED, SAVED AS"); message2 = wav_name; } + } else if (wav_in && !assigning) { /* the WAV is written: assign the buffer to it */ + assigning = 1; + if (wav_result < 0) { save_done_restore(); not_saved(); } + else with_folder(SAVE_ASSIGN, 0); + } else if (++saved_ticks > 1800u) { save_done_restore(); not_saved(); } /* 30 s: a full card, stock's own error shown */ +} + +static void finish(void) +{ + struct ctx now; + unsigned t = arm.track; + if (!current(&now) || !same_place(&now, &arm)) { cancel("PATTERN CHANGED"); return; } + if (!U32(LIMIT + 4u * t)) { cancel("TAKE INCOMPLETE"); return; } + restore_rec(); + restore_cues(); + snapshot(); + if (modwerk_machine(part_at(&arm), t)) { /* the take is in; the machine plays on until the player picks FLEX */ + phase = PICK_INFO; message = 0; redraw(); /* a popup says what to do, until a key */ + return; + } + apply_clip(); + save_take(); +} + +/* After a machine track's take: once the player has picked FLEX for it, finish. */ +static void pick_tick(void) +{ + struct ctx now; + uint32_t part = part_at(&arm); + if (!current(&now) || !same_place(&now, &arm)) { show("TAKE LEFT IN BUFFER"); return; } + unsigned type = U8(part + P_MACHINE + arm.track); + if (type != FLEX) { show("TAKE LEFT IN BUFFER"); return; } /* the player picked another machine */ + if (!modwerk_machine(part, arm.track)) { apply_clip(); save_take(); } +} + +/* RESET TRACK: a fresh project's STATIC track, its slots its own, no trigs or locks. */ +static void reset_track(void) +{ + struct ctx c; + if (!current(&c) || c.track != arm.track || !same_place(&c, &arm)) { show("TRACK CHANGED"); return; } + unsigned t = c.track; + uint32_t part = part_at(&c); + if (modwerk_machine(part, t)) { show("PICK STATIC FIRST"); return; } + if (recording(t)) { show("RECORDER BUSY"); return; } + c.merged = (uint8_t)(1u << t); c.mutes = U32(MUTES); + copy(part_copy, (const volatile uint8_t *)(uintptr_t)part, PART_BYTES); + copy(record_copy, (const volatile uint8_t *)(uintptr_t)record_at(&c), TRK_BYTES); + unsigned old = part_copy[P_MACHINE + t]; + copy(part_buf, part_copy, PART_BYTES); + put_track(part_buf, FRESH, t, 0); + uint8_t *slots = part_buf + P_SLOTS + 5u * t; + slots[0] = slots[1] = (uint8_t)t; slots[4] = (uint8_t)(0x80u + t); + paste(&c, t, old); + + for (unsigned i = 0; i < TRK_BYTES; ++i) record_new[i] = 0; + for (unsigned i = 0x40u; i < 0x48u; ++i) record_new[i] = 0xaau; /* a fresh pattern's mask 8 */ + record_new[TRK_LEN] = record_copy[TRK_LEN]; record_new[TRK_SCALE] = record_copy[TRK_SCALE]; + record_new[0x53] = 0xffu; + for (unsigned i = 0; i < 64u * 32u; ++i) record_new[TRK_LOCKS + i] = 0xffu; + record_new[TRK_BYTES - 1u] = record_copy[TRK_BYTES - 1u]; /* not this track's (the next record) */ + write_record(&c, record_new); + copy_ctx(&last, &c); undo_ready = 1; + show("TRACK RESET"); +} + +static void open_reset(void) +{ + struct ctx c; + if (phase == ARMED || phase == RECORDING || phase == WAIT_PLAY || phase == SAVING) return; + if (PICKING) phase = CLOSED; + if (!current(&c)) { show("AUDIO TRACKS ONLY"); return; } + copy_ctx(&arm, &c); arm.merged = (uint8_t)(1u << c.track); + phase = CONFIRM_RESET; message = 0; redraw(); +} + +static void undo(void) +{ + struct ctx now; + if (phase == ARMED || phase == RECORDING || phase == WAIT_PLAY || phase == SAVING) return; + if (PICKING) { show("TAKE LEFT IN BUFFER"); return; } + if (!undo_ready) { show("NOTHING TO UNDO"); return; } + if (!current(&now) || !same_place(&now, &last)) { show("UNDO: OPEN ITS PATTERN"); return; } + unsigned t = last.track; + uint32_t part = part_at(&last); + unsigned old = U8(part + P_MACHINE + t); + copy(part_buf, (const volatile uint8_t *)(uintptr_t)part, PART_BYTES); + put_track(part_buf, part_copy, t, 1); /* a Modwerk machine's signature too: the base takes it as a paste */ + paste(&last, t, old); + write_record(&last, record_copy); + uint32_t bits = (uint32_t)last.merged << 8; + uint32_t mutes = (U32(MUTES) & ~bits) | (last.mutes & bits); + if (U32(MUTES) != mutes) set_mutes(mutes); + undo_ready = 0; + show("UNDONE"); +} + +/* ---- the trig key lamps: while BOUNCE is open or armed, keys 1-8 show the merge (tappable + * yellow, the active track red, merged tracks green, T8 dark while MASTER TRACK is on). Stock's steady bytes are kept as stock last drew + * them and put back when the window closes; stock's own drawing comes back on its next pass. + * Nothing runs while the lamps are stock's. ---- */ +static uint8_t lamps_on, lamp_stock[2], lamp_mine[2]; + +static void lamps(void) +{ + unsigned want = phase == SELECT || phase == WAIT_PLAY || phase == ARMED || phase == RECORDING; + if (!want && !lamps_on) return; + unsigned changed = 0; + call1(LOCK_TAKE, LED_LOCK); + for (unsigned r = 0; r < 2u; ++r) { + uint8_t now = U8(LED_STEADY + r), v = 0; + if (!lamps_on || now != lamp_mine[r]) lamp_stock[r] = now; /* stock drew since */ + if (want) { + for (unsigned k = 0; k < 4u; ++k) { + unsigned t = r * 4u + k; + if (t == arm.track) v |= (uint8_t)(1u << (2u * k)); /* the destination: red */ + else if (arm.merged & (1u << t)) v |= (uint8_t)(2u << (2u * k)); /* merged: green */ + else if (t != 7u || !U8(MASTER_TRACK)) v |= (uint8_t)(3u << (2u * k)); /* tappable: yellow */ + } + v ^= U8(LED_TIMED + r); /* a stock flash on these keys must not invert them */ + } else v = lamp_stock[r]; + if (v != now) { U8(LED_STEADY + r) = v; changed = 1; } + lamp_mine[r] = v; + } + if (changed) call0(LED_FLUSH); + call1(LOCK_GIVE, LED_LOCK); + lamps_on = (uint8_t)want; +} + +/* ---- hooks ---- */ +void module_tick(struct modwerk_runtime_api *api) +{ + if (phase == WAIT_PLAY) { + if (U32(TRANSPORT)) { call3(REC_POST, arm.track, TAKE_WORD, 1); phase = ARMED; redraw(); } + } else if (phase == ARMED) { + if (recording(arm.track)) { phase = RECORDING; redraw(); } + } else if (phase == RECORDING) { + if (!U32(TRANSPORT)) cancel("STOPPED - NO BOUNCE"); + else if (!recording(arm.track)) finish(); + } else if (PICKING) pick_tick(); + else if (phase == SAVING) saving_tick(); + else if (phase == MESSAGE && !sticky && ++shown_ticks > 90u) close_view(); + lamps(); + /* The readout: phase, merged tracks, transport, the track's recorder, UNDO ready. */ + api->value = (uint32_t)phase << 24 | (uint32_t)arm.merged << 16 | (U32(TRANSPORT) ? 0x200u : 0) + | (recording(arm.track) ? 0x100u : 0) | undo_ready; +} + +int module_key(int code, int pressed) +{ + if (code < 0 || code >= 64) return 0; + unsigned *consumed = code < 32 ? &consumed_lo : &consumed_hi; + unsigned bit = 1u << ((unsigned)code & 31u); + if (!pressed) { + if (!(*consumed & bit)) return 0; + *consumed &= ~bit; return 1; + } + if (*consumed & bit) return 1; + if (phase == SAVING) return 0; /* stock's save owns the screen */ + if (phase == PICK_INFO) { /* any key closes the popup; the strip stays until FLEX */ + phase = PICK_FLEX; redraw(); + if (code != K_YES && code != K_NO) return 0; /* FUNC, SRC ... go on to stock */ + } else if (phase == CLOSED || phase == PICK_FLEX) { /* PICK FLEX leaves every key to the chooser */ + if (code != K_REC || !held(K_DOWN)) return 0; + open_select(); + } else if (phase == CONFIRM_RESET) { + if (code == K_YES) reset_track(); + else if (code == K_NO) close_view(); + else return 0; + } else if (phase == SELECT) { + if (code < 8) { + if ((unsigned)code != arm.track) arm.merged ^= (uint8_t)(1u << code); + redraw(); + } else if (code == K_YES) start(); + else if (code == K_NO) close_view(); + else { close_view(); return 0; } + } else if (phase == ARMED || phase == RECORDING || phase == WAIT_PLAY) { + if (code != K_NO) return 0; + cancel("BOUNCE CANCELLED"); + } else { + close_view(); + if (code != K_YES && code != K_NO) return 0; + } + *consumed |= bit; + return 1; +} + +int module_enc(int encoder, int delta) +{ + (void)encoder; (void)delta; + return phase == SELECT || phase == CONFIRM_RESET; /* no stock edit under the open window */ +} + +/* ---- drawing: frame[x * 8 + 7 - y / 8], bit y % 8 (hello.c) ---- */ +static void dot(unsigned char *f, unsigned x, unsigned y, unsigned on) +{ + unsigned char *b = &f[x * 8u + 7u - y / 8u], m = (unsigned char)(1u << (y % 8u)); + *b = on ? (unsigned char)(*b | m) : (unsigned char)(*b & ~m); +} +static void fill(unsigned char *f, unsigned x, unsigned y, unsigned w, unsigned h, unsigned on) +{ for (unsigned a = x; a < x + w; ++a) for (unsigned b = y; b < y + h; ++b) dot(f, a, b, on); } +static void invert(unsigned char *f, unsigned x, unsigned y, unsigned w, unsigned h) +{ + for (unsigned a = x; a < x + w; ++a) for (unsigned b = y; b < y + h; ++b) + f[a * 8u + 7u - b / 8u] ^= (unsigned char)(1u << (b % 8u)); +} +static void frame_box(unsigned char *f, unsigned x, unsigned y, unsigned w, unsigned h) +{ + fill(f, x, y, w, 1, 1); fill(f, x, y + h - 1u, w, 1, 1); + fill(f, x, y, 1, h, 1); fill(f, x + w - 1u, y, 1, h, 1); +} +static void text(unsigned char *f, unsigned x, unsigned top, const char *s) +{ + uint32_t surface[7]; + for (unsigned i = 0; i < 7u; ++i) surface[i] = U32(SURFACE + 4u * i); + surface[3] = (uint32_t)(uintptr_t)f; + ((void (*)(uint32_t, void *, int, int, int, const char *))(uintptr_t)TEXT) + (FONT, surface, (int)x, 59 - (int)top, -1, s); +} +static void number(char *at, unsigned v) +{ + if (v >= 10u) *at++ = (char)('0' + v / 10u); + *at++ = (char)('0' + v % 10u); *at = 0; +} +static void append(char *at, const char *s) +{ + while (*at) ++at; + while ((*at++ = *s++)) ; +} + +void module_draw(unsigned char *frame) +{ + if (phase == CLOSED || phase == SAVING || !frame) return; + if (phase == PICK_FLEX) { /* a strip, so the chooser stays readable */ + char line[24]; + line[0] = 0; append(line, "BOUNCED: T"); line[10] = (char)('1' + arm.track); line[11] = 0; + append(line, " PICK FLEX"); + fill(frame, 0, 56, 128, 8, 0); + text(frame, 2, 57, line); + invert(frame, 0, 56, 128, 8); + return; + } + if (phase == PICK_INFO) { /* a small popup: what to do next, until a key */ + char line[20]; + line[0] = 0; append(line, "CHANGE T"); line[8] = (char)('1' + arm.track); line[9] = 0; + append(line, " TO FLEX"); + fill(frame, 16, 18, 96, 26, 0); + frame_box(frame, 16, 18, 96, 26); + text(frame, 20, 21, "TAKE RECORDED"); + invert(frame, 17, 20, 94, 7); + text(frame, 20, 32, line); + return; + } + fill(frame, 6, 10, 116, 44, 0); + frame_box(frame, 6, 10, 116, 44); + char title[12]; + title[0] = 0; append(title, "BOUNCE T"); + title[8] = (char)('1' + arm.track); title[9] = 0; + if (phase == CONFIRM_RESET) { title[0] = 0; append(title, "RESET T"); title[7] = (char)('1' + arm.track); title[8] = 0; } + text(frame, 10, 13, phase == MESSAGE ? "BOUNCE" : title); + invert(frame, 7, 12, 114, 7); + if (phase == MESSAGE) { + text(frame, 10, 27, message ? message : ""); + if (message2) text(frame, 10, 35, message2); + return; + } + if (phase == CONFIRM_RESET) { + text(frame, 10, 24, "STOCK STATIC TRACK"); + text(frame, 10, 31, "NO TRIGS, NO LOCKS"); + text(frame, 10, 45, "YES: RESET NO: BACK"); + return; + } + for (unsigned t = 0; t < 8u; ++t) { + char label[3]; + label[0] = 'T'; label[1] = (char)('1' + t); label[2] = 0; + unsigned x = 10u + 14u * t; + text(frame, x, 22, label); + if (arm.merged & (1u << t)) invert(frame, x - 1u, 21, 12, 7); + } + if (phase == SELECT) { + char line[24]; + line[0] = 0; append(line, "PASS "); + unsigned longest, steps = pass_steps(&arm, &longest); + if (steps) { number(line + 5, steps); append(line, longest ? " (LONGEST)" : " STEPS"); } + else append(line, "OVER 64 STEPS"); + text(frame, 10, 31, line); + text(frame, 10, 38, "TRIG 1-8: MERGE"); + text(frame, 10, 45, "YES: REC NO: CLOSE"); + } else { + text(frame, 10, 31, phase == WAIT_PLAY ? "PRESS PLAY" : phase == ARMED ? "WAIT" : "RECORDING ONE PASS"); + text(frame, 10, 45, "NO: CANCEL"); + } +} + +/* ---- FUNC+PART: the base's Part Edit window (ot_part_menu) ---- */ +static const char *const bounce_actions[3] = {"BOUNCE TRACK", "RESET TRACK", "UNDO"}; +static void bounce_choose(unsigned action) { if (action == 2u) undo(); else if (action) open_reset(); else open_select(); } +struct modwerk_part_menu bounce_part_menu = {MODWERK_PART_MENU_ABI, "BOUNCE", 3u, bounce_actions, bounce_choose, 0}; diff --git a/sdk/octatrack/modules/bounce/evidence/cpu-price.json b/sdk/octatrack/modules/bounce/evidence/cpu-price.json new file mode 100644 index 0000000000..c0ab12b4f0 --- /dev/null +++ b/sdk/octatrack/modules/bounce/evidence/cpu-price.json @@ -0,0 +1,68 @@ +{ + "module": "bounce", + "version": "0.4.0-experimental", + "base": "development twin 7d1223b1 of base 0.8.5, built from the developer's own 1.40C with USB MIDI, RAM-booted, never flashed", + "scene": "the bank, pattern and Part the unit was on, transport stopped (test:procedure)", + "inputs": { + "transport": "playing" + }, + "seconds": 8, + "readings": 3, + "measuredAt": "2026-12-04T00:42:23.184Z", + "result": { + "id": "bounce", + "version": "0.4.0-experimental", + "packageSha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea", + "before": { + "frame": 28.6, + "frameMax": 39, + "frames": 67342, + "skipped": 0, + "cpu": 41.1, + "dsp1to4": 40.5, + "dsp5to8": 47, + "dsp1to4Peak": 41.6, + "dsp5to8Peak": 48.1, + "readings": 3, + "spread": { + "frame": 0, + "cpu": 0.2, + "dsp1to4": 0, + "dsp5to8": 0, + "frameMax": 0.3, + "dsp1to4Peak": 0.1, + "dsp5to8Peak": 0.9 + } + }, + "atRest": { + "frame": 28.6, + "frameMax": 38.9, + "frames": 67338, + "skipped": 0, + "cpu": 40.9, + "dsp1to4": 40.5, + "dsp5to8": 47, + "dsp1to4Peak": 41.6, + "dsp5to8Peak": 48, + "readings": 3, + "spread": { + "frame": 0, + "cpu": 0.1, + "dsp1to4": 0, + "dsp5to8": 0, + "frameMax": 0.3, + "dsp1to4Peak": 0.1, + "dsp5to8Peak": 0.8 + } + }, + "atRestAdds": { + "frame": 0, + "cpu": -0.2, + "dsp1to4": 0, + "dsp5to8": 0, + "dsp1to4Peak": 0, + "dsp5to8Peak": -0.1 + }, + "rolledBack": true + } +} diff --git a/sdk/octatrack/modules/bounce/evidence/performance.json b/sdk/octatrack/modules/bounce/evidence/performance.json new file mode 100644 index 0000000000..35222a6067 --- /dev/null +++ b/sdk/octatrack/modules/bounce/evidence/performance.json @@ -0,0 +1,21 @@ +{ + "schema": 1, + "module": "bounce", + "version": "0.4.0-experimental", + "sourceSha256": "d76a262ef326504c4920439e996880888c5afbae9082e4be9aa2aeb444649b84", + "kind": "coldfire", + "trigger": "key", + "cycles": { + "unit": "cycles/event", + "static": null, + "measured": 2447620, + "budget": 26600000, + "method": "Executed instructions between the base's call sites and their returns, read with ot_emu's watch/hits (octabam f7d72906, --dsp --frame, MKII panel) on the development twin 4813a3e5 of base 0.8.5, package ad2b4cfe (the release candidate, with UNDO's copy taken at the take's end), 4 December 2026. Key presses (core_key 0x40061dc8 to 0x40061dce): RESET TRACK's YES 247,832 (the dearest press: it snapshots the Part bytes and the 2,330-byte pattern record and writes a fresh track), UNDO of a bounce 138,506 and of a reset 145,079, YES arming a merge 67,320, DOWN+REC 427, a merge tap 253. The take's end is not a key press but one bounded edit in the UI tick (core_tick 0x40061e94 to 0x40061e9a): the dearest tick of a two-track bounce while playing, UNDO's copy, the Flex conversion and the start of stock's save, 2,447,620; a tick otherwise about 6,000 to 10,000. Every count includes the stock code and interrupts that ran inside the call. Instructions, not cycles: at a few cycles each, still several times under the budget." + }, + "stress": { + "events": 40, + "playing": true, + "hangs": 0, + "method": "ot_emu, the same build and package ad2b4cfe, 4 December 2026: with A01 playing, ten times RESET TRACK (FUNC+PART > BOUNCE > RESET TRACK, YES, YES) and UNDO (FUNC+PART > BOUNCE > UNDO, YES) on T1 in Part 1; then STOP, PLAY and a Part change to Part 2 (PART held, RIGHT); then ten more pairs on Part 2. The trial's readout showed 20 resets and 20 undos (its undo bit rising and falling), the transport on throughout but for the STOP, the UI tick count rising steadily (to 7,182), the slot running. After the run the screen read UNDONE and T1 was FLEX again, as before it." + } +} diff --git a/sdk/octatrack/modules/bounce/generate.py b/sdk/octatrack/modules/bounce/generate.py new file mode 100644 index 0000000000..ec697cb050 --- /dev/null +++ b/sdk/octatrack/modules/bounce/generate.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Generate unit.s from bounce.c with the shared ColdFire guard (as Track Solo's generate.py). + + python3 generate.py # write unit.s + python3 generate.py --check # fail when unit.s is stale +""" +from pathlib import Path +import subprocess +import sys +import tempfile + +HERE = Path(__file__).resolve().parent +SDK = next((parent for parent in HERE.parents if (parent / 'sdk/runtime/m68k_codegen.py').is_file()), None) +if SDK is None: + raise RuntimeError('Could not locate the repository SDK runtime tools') +sys.path.insert(0, str(SDK / 'sdk/runtime')) +import m68k_codegen # noqa: E402 + +INCLUDES = ['-I', str(SDK / 'sdk/runtime/loader'), '-I', str(SDK / 'sdk/machines/octatrack/include')] +FLAGS = ['-mcpu=54455', '-msoft-float', '-Os', '-std=c99', '-ffreestanding', + '-fno-builtin', '-fno-common', '-fno-jump-tables', '-fno-zero-initialized-in-bss', + '-fno-asynchronous-unwind-tables', '-fno-unwind-tables', '-fno-ident', + '-fomit-frame-pointer', '-Wall', '-Wextra', '-Werror', *INCLUDES, *m68k_codegen.FLAGS] + +with tempfile.TemporaryDirectory() as tmp: + asm, obj = Path(tmp) / 'unit.s', Path(tmp) / 'unit.o' + subprocess.run(['m68k-elf-gcc', *FLAGS, '-S', 'bounce.c', '-o', str(asm)], check=True, cwd=HERE) # a relative name: no local path in unit.s + # One initialized .text extent, as other ColdFire modules: no .bss to clear. + result = '| Generated by generate.py from bounce.c; edit the C source.\n' + result += asm.read_text().replace('\t.data', '\t.text') + asm.write_text(result) + subprocess.run(['m68k-elf-as', '-mcpu=54455', str(asm), '-o', str(obj)], check=True) + m68k_codegen.check([obj]) + m68k_codegen.check_mcf54455([obj]) + undefined = subprocess.run(['m68k-elf-nm', '-u', str(obj)], check=True, capture_output=True, text=True).stdout.strip() + if undefined: + raise SystemExit(f'unresolved symbols (no C library here):\n{undefined}') + dest = HERE / 'unit.s' + if '--check' in sys.argv: + if not dest.exists() or dest.read_text() != result: + raise SystemExit('unit.s is stale; run generate.py') + print('unit.s matches guarded ColdFire compilation') + else: + dest.write_text(result) + print('Generated unit.s') diff --git a/sdk/octatrack/modules/bounce/manifest.py b/sdk/octatrack/modules/bounce/manifest.py new file mode 100644 index 0000000000..18ab4647bb --- /dev/null +++ b/sdk/octatrack/modules/bounce/manifest.py @@ -0,0 +1,30 @@ +"""Bounce In Place -- bounce tracks in place into the active track's Flex recording. + +DOWN+REC (or FUNC+PART > BOUNCE) opens BOUNCE; trig keys 1-8 pick tracks to +merge, YES records one pattern pass with the track's own recorder (SRC3 = the +track) or, merged, with CUE. Stock ends the take; Bounce then makes the track +FLEX on its recorder buffer with one trig on step 1, FX off, merged tracks +muted, and stock saves the take as a WAV assigned to the buffer. UNDO restores the Part bytes, the pattern record and the mutes. +While BOUNCE is open or armed, trig keys 1-8 show the merge in stock's steady LED bytes. + +No stock site is patched: the module reads the base's key, tick, draw and +encoder events and adds a row to the Part Edit window (runtime.json). It +calls stock's recorder mailbox (0x40005178), Part paste (0x40029a4c), track +write (0x40029754) and machine transition (0x400972fc). Read from octabam's +firmware notes and partly measured in the emulator (TESTING.md); the module +0.3.0 ran on one MKII in a RAM trial (TESTING.md). bounce.c is the source; generate.py writes +unit.s. +""" + +from remix.schema import Category, Proof, Gate, Kind, Linked, Module + +MODULE = Module( + name="bounce", + key="BOUNCE", + kind=Kind.CF_PATCH, + doc="Bounce In Place: record tracks for one pattern into the active track and make it a Flex machine playing the take.", + category=Category.TRACK, author="seniorspiz", author_url="https://github.com/seniorspiz", + proof=Proof.UNTESTED, proof_note="Prototype: 0.3.0 ran on one MKII in a RAM trial (developer's report); 0.4.0 (trig key lamps) in the emulator only.", + linked=(Linked("bounce", "modules/bounce/unit.s", cpu="5475", dram=True),), + gates=(Gate("modules/bounce/verify.py", remix_arg=False),), +) diff --git a/sdk/octatrack/modules/bounce/media/capture.json b/sdk/octatrack/modules/bounce/media/capture.json new file mode 100644 index 0000000000..2d120a9cdc --- /dev/null +++ b/sdk/octatrack/modules/bounce/media/capture.json @@ -0,0 +1,121 @@ +{ + "schemaVersion": 1, + "captured": "2026-12-03", + "moduleId": "bounce", + "moduleVersion": "0.4.0-experimental", + "packageSha256": "196de6d7ea754be27946d6090b2f1346b00f6eb172d5e5e928fe2aa029571458", + "sourceRevision": "64d32dc44", + "firmware": "1.40C", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "emulatorSha256": "c91e905aafb9133041110890ed2d42d4fe4e2af2de462dd14b1937d9a42c7c61", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6.", + "palette": { + "on": [ + 240, + 240, + 240 + ], + "off": [ + 24, + 24, + 24 + ] + }, + "keyMs": 150, + "model": "MKII", + "capturedBy": "seniorspiz", + "stockOs": { + "release": "1.40C", + "updateSha256": "34695b606eb00e1b4dded5fd0c4b66f3a460522a632e47d7416dbd220599e1ad" + }, + "captureMethod": "A private ot_emu session (--interactive --usb-host): node scripts/device.mjs try on the emulated bench, keys through scripts/device-send.py, each screen read with its png: step (the LCD the panel link carries, 2x, white 255) and rescaled to 6x in the 24/240 palette without changing a pixel.", + "plan": [ + { + "press": [ + "STOP" + ] + }, + { + "press": [ + "T1" + ] + }, + { + "hold": [ + "DOWN" + ] + }, + { + "press": [ + "REC" + ] + }, + { + "release": [ + "DOWN" + ] + }, + { + "press": [ + "TRIG2" + ] + }, + { + "capture": "ot-select.png" + }, + { + "press": [ + "YES" + ] + }, + { + "press": [ + "PLAY" + ] + }, + { + "wait": 13000 + }, + { + "capture": "ot-recording.png" + }, + { + "wait": 15000 + }, + { + "capture": "ot-bounced.png" + }, + { + "wait": 10000 + }, + { + "hold": [ + "FUNC" + ] + }, + { + "press": [ + "PART" + ] + }, + { + "release": [ + "FUNC" + ] + }, + { + "capture": "ot-undo.png" + }, + { + "press": [ + "YES" + ] + } + ], + "screenshots": { + "ot-select.png": "3502dac2afedcc9e8d6691376d867744f365e55c460a70adc8a8d8eb15751f15", + "ot-recording.png": "97a9afc1ca526b3edd719cd2711539c9c781bb684e1a9f103b055cbc64e7d84f", + "ot-bounced.png": "9f82ad21bcfe988c219cd3cb0e71f8a38ffcba9a00a6d7bc65d96a84770b0b49", + "ot-undo.png": "a2031c1516bb9074301c5879342466ec0293370f7eb6cb6fff9a11d7a69ac60c" + } +} diff --git a/sdk/octatrack/modules/bounce/media/ot-bounced.png b/sdk/octatrack/modules/bounce/media/ot-bounced.png new file mode 100644 index 0000000000..9fa9bb2b00 Binary files /dev/null and b/sdk/octatrack/modules/bounce/media/ot-bounced.png differ diff --git a/sdk/octatrack/modules/bounce/media/ot-recording.png b/sdk/octatrack/modules/bounce/media/ot-recording.png new file mode 100644 index 0000000000..67db3165aa Binary files /dev/null and b/sdk/octatrack/modules/bounce/media/ot-recording.png differ diff --git a/sdk/octatrack/modules/bounce/media/ot-select.png b/sdk/octatrack/modules/bounce/media/ot-select.png new file mode 100644 index 0000000000..5ffca4a24a Binary files /dev/null and b/sdk/octatrack/modules/bounce/media/ot-select.png differ diff --git a/sdk/octatrack/modules/bounce/media/ot-undo.png b/sdk/octatrack/modules/bounce/media/ot-undo.png new file mode 100644 index 0000000000..907ad0af96 Binary files /dev/null and b/sdk/octatrack/modules/bounce/media/ot-undo.png differ diff --git a/sdk/octatrack/modules/bounce/octamod.module.json b/sdk/octatrack/modules/bounce/octamod.module.json new file mode 100644 index 0000000000..c9d241a908 --- /dev/null +++ b/sdk/octatrack/modules/bounce/octamod.module.json @@ -0,0 +1,291 @@ +{ + "schemaVersion": 2, + "id": "bounce", + "key": "BOUNCE", + "name": "Bounce In Place", + "version": "0.4.0-experimental", + "category": "system", + "author": { + "github": "seniorspiz", + "credits": [ + "seniorspiz" + ] + }, + "nativeManifest": "manifest.py", + "presentation": { + "label": "Bounce tracks in place", + "family": "Recording", + "summary": "Bounce one or more audio tracks into the active track as a Flex recording, one pattern long, saved as a WAV, without setting up the recorder by hand.", + "overview": "Bounce In Place records the active track, and any other tracks you pick, for exactly one pattern length (in per-track mode the track's own length; merged tracks until their lengths meet), with their effects. When the take ends, the active track becomes a Flex machine playing it, with its FX off, stock AMP and one trig on step 1, and the take is saved as a WAV (B-YYMMDD-HHMM) in the project's BOUNCES folder, with the track's buffer assigned to it, so it reloads once you save the project. The other merged tracks are muted with stock's mute. RESET TRACK makes a track a fresh STATIC track. UNDO brings back the last bounce or reset until the next power cycle or project change. It uses no effect slot.", + "highlights": [ + "Hold DOWN and press REC, or FUNC+PART > BOUNCE, to open BOUNCE for the active track.", + "Press trig keys 1-8 to merge more tracks into the active track's take; the active track lights red, merged tracks green, the others you can tap yellow.", + "Records on the instrument's own tempo and length, starting on the next step 1.", + "The take is saved in the project's BOUNCES folder, the track becomes a Flex machine playing it, and FUNC+PART > BOUNCE > UNDO brings the track back." + ], + "usage": [ + "Select the track to bounce into, then hold DOWN and press REC (or FUNC+PART > BOUNCE > BOUNCE).", + "Press trig keys 1-8 to merge those tracks in; press YES to arm. The take starts on the next step 1.", + "When BOUNCE reads BOUNCED, SAVED AS, the track plays the recording. FUNC+PART > BOUNCE > UNDO goes back." + ] + }, + "controls": [], + "compatibility": { + "firmware": "1.40C", + "location": "Audio tracks", + "conflicts": [], + "uiClaims": [ + "key:DOWN+REC", + "key:TRIG@BOUNCE" + ], + "limitations": [ + "Experimental: 0.4.0 (package ad2b4cfe) passed the test procedure on one MKII (a development twin in RAM), soak included, and by hand: bounce, cancel, UNDO. Its developer's own test of the same package (bounces, cancel and UNDO, a project save, reload and power cycle) worked, as reported.", + "The WAV is saved at once, but the track only keeps pointing to it after you save the project (as stock's own SAVE THIS RECORDING).", + "A full card: BOUNCE says NOT SAVED and the take stays in the recorder buffer; save it from the Audio Editor.", + "A pass longer than 64 master steps (4 bars at 1X) is refused.", + "Refuses T8 while MASTER TRACK is on, and a merged track whose cue level is 0.", + "A Grain or synth track: after the take, pick FLEX for it in the machine chooser yourself; a popup says so.", + "Bounces only while the sequencer plays; UNDO lasts until the next power cycle or project change.", + "While a take records, the frame interrupt carries about 6 points more; at rest nothing.", + "Not yet tested: a full card, Studio cue mode, MAIN TO CUE, an MKI." + ], + "effectId": null + }, + "resources": { + "recorded": "2026-12-04", + "storage": { + "label": "ColdFire code", + "display": "26080 bytes", + "value": null, + "unit": "see display", + "method": "static", + "conditions": "The USB package ad2b4cfe: 8,284 bytes of ColdFire code and data and 17,796 bytes of bss (the Part and pattern snapshots for UNDO, 2,330 bytes of pattern record among them). No DSP memory.", + "source": "TESTING.md" + }, + "processing": { + "label": "ColdFire worst event", + "display": "2447620 cycles/event", + "value": null, + "unit": "see display", + "method": "emulator", + "conditions": "The dearest event in ot_emu (evidence/performance.json): the take's end, one bounded edit in the UI tick, 2,447,620 executed instructions against a 26,600,000-cycle responsiveness deadline; the dearest key press, RESET TRACK's YES, 247,832. Nothing runs in the frame interrupt.", + "source": "evidence/performance.json" + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-12-04", + "conditions": "the bank, pattern and Part the unit was on, transport stopped (test:procedure); base development twin 7d1223b1 of base 0.8.5, built from the developer's own 1.40C with USB MIDI, RAM-booted, never flashed; 3 readings of 8 s a state. Frame interrupt 28.6 % before, 28.6 % installed and used nowhere; CPU meter 41.1 % before, 40.9 % at rest.", + "source": "evidence/cpu-price.json" + }, + "impact": { + "conditions": "One instance, the only kind there is. On the developer's MKII (development twin 7d1223b1 of base 0.8.5), the frame interrupt with the module installed and unused, the pattern playing (test:procedure step 9); while a take records, the T4 readings on twin 4813a3e5 (TESTING.md).", + "cpu": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "Installed and unused, the frame interrupt stayed at 28.4 % (0 points). While a take records, about 6 more points, because stock's recorder runs; nothing at rest.", + "source": "evidence/cpu-price.json" + }, + "dsp": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "No DSP code: the package carries no DSP words and uses no effect slot.", + "source": "evidence/performance.json" + }, + "memory": { + "level": "moderate", + "basis": "source-estimate", + "rationale": "26,080 bytes of ColdFire RAM for the one instance, most of it the UNDO snapshot (tests.qualification.memory).", + "source": "TESTING.md" + } + } + }, + "tests": { + "report": "TESTING.md", + "summary": "npm run test:procedure on the developer's MKII (4 December 2026, development twin 7d1223b1 of base 0.8.5): steps 1-10 passed on package ad2b4cfe, including a 120 s soak of 2,400 operations and a CPU price of 0 points at rest. By hand on the same package: bounce, merge, cancel (UNDO, the recorder setup and the player's mutes kept) and UNDO, restoring the Part byte for byte; on 196de6d7 also RESET TRACK. The developer's own test of the same package (bounces, cancel and UNDO, mutes, a project save, reload and power cycle, a machine track) worked, as reported. perf:audit: worst event 2,447,620 instructions in ot_emu.", + "hardwareStatus": "reported", + "evidenceRevision": "819162bc660cfb480605b47c3c035b17c7a9de62", + "gates": [ + "Worst-case cycles under parameter modulation and maximum load", + "Exact memory region and maximum-instance totals", + "Owner-reviewed real-hardware evidence with actual coverage and limitations" + ], + "qualification": { + "moduleVersion": "0.4.0-experimental", + "sourceSha256": "e4790b5943d99a17d46362e813395e1364f8d414dcd64678981a095c8001ca34", + "cycles": [ + { + "processor": "coldfire", + "worstCase": 2447620, + "maxConfiguration": 2447620, + "maxInstances": 1, + "budget": 26600000, + "unit": "cycles/event", + "method": "emulator", + "conditions": { + "parameterExtremes": "The dearest event: the end of a two-track take while playing (Flex conversion, UNDO's snapshot, mutes, stock's save started), 2,447,620 executed instructions in the UI tick; the dearest key press, RESET TRACK's YES, 247,832 (it snapshots the Part bytes and the 2,330-byte pattern record and writes a fresh track); UNDO 138,506-145,079; YES arming a merge 67,320. Read with ot_emu's watch/hits between the base's core_key (0x40061dc8-0x40061dce) and core_tick (0x40061e94-0x40061e9a) calls and their returns (octabam f7d72906, --dsp --frame, MKII panel, twin 4813a3e5 of base 0.8.5, package ad2b4cfe, 4 December 2026); each count includes stock code and interrupts inside the call. Instructions, not cycles.", + "parameterModulation": "Not applicable: the module has no parameters, LFO destinations or MIDI CCs; it acts on key presses and once per UI tick only while a take is armed.", + "modeSwitching": "In ot_emu, STOP, PLAY and a Part change (Part 1 to Part 2) between the stress run's two halves of ten RESET TRACK and UNDO pairs; on the unit, 12 Part switches in device:test with the package installed (test:procedure step 7).", + "maxLoad": "One instance (a ColdFire key and tick handler). The dearest edit touches one track's Part and pattern record and the merged tracks' mutes, at most eight tracks; the stress run kept the pattern playing throughout.", + "inputConditions": "Not applicable to the cost: no audio passes through the module's code. The take itself is stock's recorder, at most 64 master steps." + }, + "report": "evidence/performance.json" + } + ], + "memory": { + "regions": [ + { + "name": "ColdFire code and data of the USB package", + "space": "cpu-ram", + "words": 8284, + "wordBits": 8, + "bytes": 8284, + "scope": "shared" + }, + { + "name": "ColdFire bss of the USB package", + "space": "cpu-ram", + "words": 17796, + "wordBits": 8, + "bytes": 17796, + "scope": "shared" + } + ], + "perInstanceBytes": 0, + "sharedBytes": 26080, + "maxInstances": 1, + "totalBytes": 26080, + "conditions": "From the header of the USB package ad2b4cfe (ABI 8): code and data 8,284 bytes, bss 17,796 (the UNDO snapshot of one track's Part bytes, its 2,330-byte pattern record and the mutes). No DSP memory and no stock blocks reused; the stack is the UI task's own; the WAV is written by stock's own save jobs.", + "report": "TESTING.md" + }, + "imageSha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea", + "hardware": { + "kind": "functional", + "status": "reported", + "model": "MKII", + "testedOn": "2026-12-04", + "tester": "seniorspiz", + "sourceRevision": "819162bc660cfb480605b47c3c035b17c7a9de62", + "imageSha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea", + "summary": "On the developer's Octatrack MKII (OS 1.40C), 4 December 2026, npm run test:procedure ran on package ad2b4cfe built from 819162bc on development twin 7d1223b1 of base 0.8.5 (RAM-booted, never flashed): software checks, beside every other module, cost model, emulator rehearsal, unit read, scripted pass, a 120 s soak of 2,400 operations, the CPU price (0 points of the frame interrupt at rest) and put back passed. By hand on the same package: a bounce, a cancelled take that kept UNDO, a cancel after a pattern change that put the recorder setup back, mutes changed during a take kept, and UNDO restoring the Part byte for byte. The developer then tested the same package (bounces by ear, cancel and UNDO, mutes, a project save, reload and power cycle, a machine track through PICK FLEX) and reported all of it working, without details per step; that trial ran on the flashed release base 0.8.5 (ddb56b72), and its readout shows a machine track through PICK FLEX, a merged take of three tracks and an UNDO.", + "limitations": [ + "The developer's own test of ad2b4cfe is as reported (\"all tested\"), without a record of each step; a Modwerk machine track through PICK FLEX was not run by the agent on this package.", + "Not tested: a WAV save onto a full card, Studio cue mode, MAIN TO CUE, and an MKI.", + "Not tested: another module with Part Edit rows (Kits, Pattern Sample Locks) installed at the same time.", + "No audio was recorded for evidence: how a take sounds is the developer's report." + ], + "report": "TESTING.md" + }, + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "Select the track to bounce into with its TRACK key, here T1.", + "Hold DOWN and press REC: BOUNCE opens with T1 inverted and its trig key red.", + "Press trig key 2 to merge T2 into the take, then YES to arm it; press PLAY if the sequencer is stopped.", + "After one pattern pass BOUNCE reads BOUNCED, SAVED AS with the WAV's name: T1 plays the take as a Flex machine and T2 is muted. Save the project to keep the link.", + "To go back, FUNC+PART > BOUNCE > UNDO." + ] + }, + "screenshots": [ + "media/ot-select.png", + "media/ot-recording.png", + "media/ot-bounced.png", + "media/ot-undo.png" + ], + "screenshotStyle": "black-and-white" + } + } + }, + "license": { + "spdx": "MIT", + "file": "LICENSE", + "declaration": "Original code by seniorspiz under MIT. No Elektron firmware, extracted routines or tables." + }, + "media": [ + { + "path": "media/ot-select.png", + "captureType": "emulator", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "caption": "Select the track to bounce into (here T1), hold DOWN and press REC: BOUNCE opens. Press trig key 2 to merge T2 into the take, then YES to arm it. The pass is one pattern long, here 16 steps.", + "alt": "The BOUNCE T1 window with T1 and T2 inverted in a row of track names T1 to T8, and the lines PASS 16 STEPS, TRIG 1-8: MERGE, YES: REC NO: CLOSE.", + "otUi": { + "page": "BOUNCE", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-recording.png", + "captureType": "emulator", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "caption": "Once armed, the take starts on the next pattern start while the sequencer plays and runs for one pass. NO cancels it and changes nothing.", + "alt": "The BOUNCE T1 window with T1 and T2 inverted and the lines RECORDING ONE PASS and NO: CANCEL.", + "otUi": { + "page": "BOUNCE", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-bounced.png", + "captureType": "emulator", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "caption": "After one pass the take is saved as a WAV in the project's BOUNCES folder, and T1 becomes a Flex machine playing it; the merged T2 is muted. Save the project to keep the track's link to the file.", + "alt": "The BOUNCE window reading BOUNCED, SAVED AS B1-261203-2328 over the main screen, with SRC FLEX on the bottom line.", + "otUi": { + "page": "BOUNCE", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-undo.png", + "captureType": "emulator", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "caption": "FUNC+PART opens Part Edit, where the BOUNCE row holds BOUNCE TRACK, RESET TRACK and UNDO. UNDO gives the last bounced or reset track back its machine, settings, trigs and the merged tracks' mutes.", + "alt": "The PART EDIT window with PART and BOUNCE in the left column, BOUNCE selected, and BOUNCE TRACK, RESET TRACK and UNDO on the right, UNDO highlighted.", + "otUi": { + "page": "PART EDIT", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + } + ], + "access": { + "location": "Hold DOWN and press REC, or FUNC+PART (Part Edit) > BOUNCE.", + "steps": [ + "Select the destination track with its TRACK key.", + "Hold DOWN, then press REC: BOUNCE opens with the active track inverted; the active track's trig key lights red, the others you can tap yellow.", + "Press trig keys 1-8 to add or remove tracks, then YES to arm; NO closes without changes." + ], + "screenshots": [ + "media/ot-select.png", + "media/ot-recording.png", + "media/ot-bounced.png", + "media/ot-undo.png" + ] + } +} diff --git a/sdk/octatrack/modules/bounce/presentation/thumbnail.svg b/sdk/octatrack/modules/bounce/presentation/thumbnail.svg new file mode 100644 index 0000000000..ca558a524c --- /dev/null +++ b/sdk/octatrack/modules/bounce/presentation/thumbnail.svg @@ -0,0 +1,19 @@ + +Bounce — tracks recorded in place into one Flex take +A conceptual diagram: the trigs of three tracks on the left run together into one recording on the right, one pattern pass long, which the active track then plays as a Flex machine from a WAV saved on the card. It illustrates the idea, not a measured screen. + + + +T1T2T3 + + + + +ONE PASSFLEX + WAVMERGED TRACKS + diff --git a/sdk/octatrack/modules/bounce/runtime.json b/sdk/octatrack/modules/bounce/runtime.json new file mode 100644 index 0000000000..fd445f682a --- /dev/null +++ b/sdk/octatrack/modules/bounce/runtime.json @@ -0,0 +1,10 @@ +{ + "schema": 1, + "subscribe": [ + {"event": "module_tick", "fn": "module_tick"}, + {"event": "module_draw", "fn": "module_draw"}, + {"event": "module_key", "fn": "module_key"}, + {"event": "module_enc", "fn": "module_enc"} + ], + "contribute": [{"to": "ot_part_menu", "data": "bounce_part_menu", "order": 70}] +} diff --git a/sdk/octatrack/modules/bounce/unit.s b/sdk/octatrack/modules/bounce/unit.s new file mode 100644 index 0000000000..a1c42d8c94 --- /dev/null +++ b/sdk/octatrack/modules/bounce/unit.s @@ -0,0 +1,2790 @@ +| Generated by generate.py from bounce.c; edit the C source. +#NO_APP + .file "bounce.c" + .text + .align 2 + .type copy, @function +copy: + move.l %a2,-(%sp) + move.l 8(%sp),%a0 + clr.l %d0 + move.l 12(%sp),%a1 +.L2: + cmp.l 16(%sp),%d0 + jne .L3 + move.l (%sp)+,%a2 + rts +.L3: + lea (%a1,%d0.l),%a2 + move.b (%a2),(%a0,%d0.l) + addq.l #1,%d0 + jra .L2 + .size copy, .-copy + .align 2 + .type current, @function +current: + lea (-16,%sp),%sp + movem.l #60,(%sp) + move.l 1187521622,%d3 + move.l 20(%sp),%a0 + move.b 269161680,%d2 + move.b 269161679,%d0 + move.b -2147483648,%d1 + move.w %d0,%a1 + move.l %d3,%d0 + add.l #-1074668000,%d0 + cmp.l #9535680,%d0 + jls .L5 +.L7: + clr.l %d0 +.L4: + movem.l (%sp),#60 + lea (16,%sp),%sp + rts +.L5: + move.l #635712,%d5 + remu.l %d5,%d4:%d0 + tst.l %d4 + jne .L7 + mvz.b %d2,%d0 + lsr.l #4,%d0 + jne .L7 + move.w %a1,%d5 + mvz.b %d5,%d0 + lsr.l #2,%d0 + jne .L7 + mvz.b %d1,%d0 + lsr.l #3,%d0 + jne .L7 + tst.l -2147483630 + jne .L7 + move.b %d2,4(%a0) + move.b %d5,5(%a0) + move.b %d1,6(%a0) + move.l %d3,(%a0) + moveq #1,%d0 + jra .L4 + .size current, .-current + .align 2 + .type same_place, @function +same_place: + move.l 8(%sp),%a0 + move.l 4(%sp),%a1 + move.l (%a0),%d0 + cmp.l (%a1),%d0 + jeq .L9 +.L11: + clr.l %d0 +.L8: + rts +.L9: + mvz.b 4(%a1),%d1 + mvz.b 4(%a0),%d0 + cmp.l %d1,%d0 + jne .L11 + move.b 5(%a1),%d0 + move.b 5(%a0),%d1 + eor.l %d1,%d0 + tst.b %d0 + seq %d0 + mvs.b %d0,%d0 + neg.l %d0 + jra .L8 + .size same_place, .-same_place + .align 2 + .type write_span, @function +write_span: + move.l %a3,-(%sp) + move.l %a2,-(%sp) + move.l 20(%sp),%a1 +#APP +| 313 "bounce.c" 1 + move.w %sr,%d0 + move.w #0x2700,%sr +| 0 "" 2 +#NO_APP + sub.l %a0,%a0 +.L13: + lea (%a1,%a0.l),%a3 + move.l 12(%sp),%a2 + move.b (%a3),(%a2,%a0.l) + move.l 16(%sp),%a2 + move.b (%a3),(%a2,%a0.l) + addq.l #1,%a0 + cmp.l 24(%sp),%a0 + jne .L13 +#APP +| 315 "bounce.c" 1 + move.w %d0,%sr +| 0 "" 2 +#NO_APP + move.l (%sp)+,%a2 + move.l (%sp)+,%a3 + rts + .size write_span, .-write_span + .align 2 + .type modwerk_machine, @function +modwerk_machine: + move.l %d2,-(%sp) + move.w 14(%sp),%d0 + move.l 8(%sp),%a1 + mulu.w #30,%d0 + add.l %d0,%a1 + move.b 60(%a1),%d0 + move.w %d0,%a0 + move.b 61(%a1),%d0 + move.b 62(%a1),%d1 + move.w %a0,%d2 + mvz.b %d2,%d2 + move.l %d2,%a0 + moveq #25,%d2 + lea (-65,%a0),%a0 + cmp.l %a0,%d2 + jcc .L16 +.L19: + clr.l %d0 +.L17: + move.l (%sp)+,%d2 + rts +.L16: + mvz.b %d0,%d0 + moveq #25,%d2 + move.l %d0,%a0 + lea (-65,%a0),%a0 + cmp.l %a0,%d2 + jcc .L18 + add.l #-48,%d0 + moveq #9,%d2 + cmp.l %d0,%d2 + jcs .L19 +.L18: + subq.l #1,%d1 + mvz.b %d1,%d1 + moveq #62,%d0 + cmp.l %d1,%d0 + jcs .L19 + move.l 8(%sp),%a0 + moveq #1,%d2 + move.l 12(%sp),%d1 + move.b 34(%a0,%d1.l),%d0 + eor.l %d2,%d0 + tst.b %d0 + seq %d0 + mvs.b %d0,%d0 + neg.l %d0 + jra .L17 + .size modwerk_machine, .-modwerk_machine + .align 2 + .type show, @function +show: + lea (4,%sp),%a0 + moveq #4,%d0 + move.l %d0,phase + moveq #1,%d0 + clr.l message2 + clr.l sticky + move.l (%a0),message + clr.l shown_ticks + move.l %d0,1187497772 + rts + .size show, .-show + .section .rodata.str1.1,"aMS",@progbits,1 +.LC0: + .string "NOT SAVED: TAKE IN BUFFER" +.LC1: + .string "SAVE IT IN AUDIO EDITOR" + .text + .align 2 + .type not_saved, @function +not_saved: + pea .LC0 + jsr show + addq.l #4,%sp + move.l #.LC1,%d0 + move.l %d0,message2 + moveq #1,%d0 + move.l %d0,sticky + rts + .size not_saved, .-not_saved + .align 2 + .type close_view, @function +close_view: + clr.l phase + moveq #1,%d0 + clr.l message + move.l %d0,1187497772 + rts + .size close_view, .-close_view + .section .rodata.str1.1 +.LC2: + .string "AUDIO TRACKS ONLY" + .text + .align 2 + .type open_select, @function +open_select: + move.l phase,%d1 + moveq #9,%d0 + lea (-12,%sp),%sp + move.l %a6,-(%sp) + cmp.l %d1,%d0 + jcs .L24 + moveq #1,%d0 + lsl.l %d1,%d0 + move.l %d0,%d1 + and.l #300,%d1 + tst.l %d1 + jne .L23 + and.l #576,%d0 + tst.l %d0 + jeq .L24 + clr.l phase +.L24: + lea (4,%sp),%a6 + move.l %a6,-(%sp) + jsr current + addq.l #4,%sp + tst.l %d0 + jne .L26 + pea .LC2 + jsr show + addq.l #4,%sp +.L23: + move.l (%sp)+,%a6 + lea (12,%sp),%sp + rts +.L26: + pea 12.w + move.l %a6,-(%sp) + pea arm + jsr copy + clr.l message + mvz.b 22(%sp),%d1 + moveq #1,%d0 + lea (12,%sp),%sp + lsl.l %d1,%d0 + move.b %d0,arm+7 + moveq #1,%d0 + move.l %d0,phase + move.l %d0,1187497772 + jra .L23 + .size open_select, .-open_select + .align 2 + .type saved, @function +saved: + lea (4,%sp),%a0 + moveq #1,%d0 + move.l (%a0),saved_result + move.l %d0,saved_in + rts + .size saved, .-saved + .align 2 + .type wav_saved, @function +wav_saved: + lea (4,%sp),%a0 + moveq #1,%d0 + move.l (%a0),wav_result + move.l %d0,wav_in + rts + .size wav_saved, .-wav_saved + .align 2 + .type fill, @function +fill: + lea (-24,%sp),%sp + movem.l #124,(%sp) + move.l 36(%sp),%d4 + moveq #1,%d5 + move.l 32(%sp),%d1 + move.l %d1,%d3 + add.l 40(%sp),%d3 + add.l 44(%sp),%d4 +.L33: + cmp.l %d3,%d1 + jcc .L32 + move.l %d1,%d0 + lsl.l #3,%d0 + addq.l #7,%d0 + move.l %d0,20(%sp) + move.l 36(%sp),%d0 + jra .L38 +.L36: + move.l %d0,%d2 + lsr.l #3,%d2 + move.l 20(%sp),%a1 + sub.l %d2,%a1 + moveq #7,%d2 + and.l %d0,%d2 + add.l 28(%sp),%a1 + move.l %d2,%a0 + move.l %d5,%d2 + move.l %a0,%d6 + lsl.l %d6,%d2 + move.b (%a1),%d6 + move.w %d6,%a0 + tst.l 48(%sp) + jeq .L34 + move.l %a0,%d6 + or.l %d6,%d2 +.L35: + move.b %d2,(%a1) + addq.l #1,%d0 +.L38: + cmp.l %d4,%d0 + jcs .L36 + addq.l #1,%d1 + jra .L33 +.L34: + not.l %d2 + move.l %a0,%d6 + and.l %d6,%d2 + jra .L35 +.L32: + movem.l (%sp),#124 + lea (24,%sp),%sp + rts + .size fill, .-fill + .align 2 + .type invert, @function +invert: + lea (-20,%sp),%sp + movem.l #124,(%sp) + move.l 32(%sp),%d4 + moveq #1,%d5 + move.l 28(%sp),%a0 + move.l %a0,%d3 + add.l 36(%sp),%d3 + add.l 40(%sp),%d4 +.L40: + mvz.w %a0,%d1 + move.l 32(%sp),%d0 + lsl.l #3,%d1 + addq.l #7,%d1 +.L41: + moveq #7,%d6 + and.l %d0,%d6 + move.l %d0,%d2 + lsr.l #3,%d2 + move.l %d1,%a1 + addq.l #1,%d0 + sub.l %d2,%a1 + add.l 24(%sp),%a1 + move.l %d5,%d2 + lsl.l %d6,%d2 + move.b (%a1),%d6 + eor.l %d6,%d2 + move.b %d2,(%a1) + cmp.l %d0,%d4 + jhi .L41 + addq.l #1,%a0 + cmp.l %a0,%d3 + jhi .L40 + movem.l (%sp),#124 + lea (20,%sp),%sp + rts + .size invert, .-invert + .align 2 + .type frame_box, @function +frame_box: + lea (-16,%sp),%sp + movem.l #7172,(%sp) + move.l 20(%sp),%d2 + move.l 24(%sp),%a3 + move.l 28(%sp),%a4 + pea 1.w + pea 1.w + move.l 40(%sp),-(%sp) + move.l %a4,-(%sp) + move.l %a3,-(%sp) + move.l %d2,-(%sp) + lea fill,%a2 + jsr (%a2) + pea 1.w + pea 1.w + move.l 64(%sp),-(%sp) + move.l 72(%sp),%d0 + pea -1(%a4,%d0.l) + move.l %a3,-(%sp) + move.l %d2,-(%sp) + jsr (%a2) + lea (48,%sp),%sp + pea 1.w + move.l 40(%sp),-(%sp) + pea 1.w + move.l %a4,-(%sp) + move.l %a3,-(%sp) + move.l %d2,-(%sp) + jsr (%a2) + pea 1.w + move.l 64(%sp),-(%sp) + pea 1.w + move.l %a4,-(%sp) + move.l 72(%sp),%d0 + pea -1(%a3,%d0.l) + move.l %d2,-(%sp) + jsr (%a2) + movem.l 48(%sp),#7172 + lea (64,%sp),%sp + rts + .size frame_box, .-frame_box + .align 2 + .type text, @function +text: + lea (-28,%sp),%sp + move.l %sp,%a1 + move.l #1074524426,%a0 + move.l %sp,%d0 +.L46: + move.l (%a0)+,(%a1)+ + cmp.l #1074524454,%a0 + jne .L46 + move.l 32(%sp),12(%sp) + move.l 44(%sp),-(%sp) + pea -1.w + moveq #59,%d1 + sub.l 48(%sp),%d1 + move.l %d1,-(%sp) + move.l 48(%sp),-(%sp) + move.l %d0,-(%sp) + move.l #1074505846,-(%sp) + jsr 1073818584 + lea (52,%sp),%sp + rts + .size text, .-text + .align 2 + .type append, @function +append: + move.l 4(%sp),%a0 +.L49: + move.b (%a0),%d0 + move.l %a0,%a1 + addq.l #1,%a0 + tst.b %d0 + jne .L49 + clr.l %d0 +.L50: + move.l 8(%sp),%a0 + move.b (%a0,%d0.l),%d1 + move.b %d1,(%a1,%d0.l) + addq.l #1,%d0 + tst.b %d1 + jne .L50 + rts + .size append, .-append + .align 2 + .type save_done_restore, @function +save_done_restore: + move.l #1187565976,%a0 + move.l #saved,%d0 + cmp.l (%a0),%d0 + jne .L54 + move.l prev_done_b,(%a0) + lea prev_done_a,%a0 + move.l (%a0),1187565972 +.L54: + move.l #1175179208,%a0 + tst.l (%a0) + jne .L53 + move.l prev_mode,(%a0) +.L53: + rts + .size save_done_restore, .-save_done_restore + .align 2 + .type put_track.constprop.0, @function +put_track.constprop.0: + lea (-20,%sp),%sp + clr.l %d1 + movem.l #3100,(%sp) + lea TRACK_BYTES,%a1 + clr.l %d2 +.L61: + mvz.b 2(%a1),%d0 + mvz.w (%a1),%d3 + move.l 24(%sp),%a3 + sub.l %a0,%a0 + move.l 24(%sp),%a2 + add.l %d2,%a2 + mulu.w 30(%sp),%d0 + add.l %d3,%d0 + mvz.b 3(%a1),%d3 + add.l %d0,%a3 + add.l #part_buf,%d0 +.L57: + cmp.l %a0,%d3 + jhi .L60 + add.l %d3,%d2 + addq.l #1,%d1 + addq.l #4,%a1 + moveq #9,%d0 + cmp.l %d1,%d0 + jne .L61 + movem.l (%sp),#3100 + lea (20,%sp),%sp + rts +.L60: + tst.l 32(%sp) + jeq .L58 + move.b (%a3,%a0.l),%d4 +.L59: + move.b %d4,(%a0,%d0.l) + addq.l #1,%a0 + jra .L57 +.L58: + move.b (%a2,%a0.l),%d4 + jra .L59 + .size put_track.constprop.0, .-put_track.constprop.0 + .align 2 + .type copy.constprop.0, @function +copy.constprop.0: + move.l %a2,-(%sp) + move.l 8(%sp),%a1 + clr.l %d0 + lea part_buf,%a0 +.L64: + lea (%a1,%d0.l),%a2 + move.b (%a2),(%a0,%d0.l) + addq.l #1,%d0 + cmp.l #6322,%d0 + jne .L64 + move.l (%sp)+,%a2 + rts + .size copy.constprop.0, .-copy.constprop.0 + .align 2 + .type set_mutes, @function +set_mutes: + move.l 4(%sp),%d0 +#APP +| 289 "bounce.c" 1 + move.w %sr,%d1 + move.w #0x2700,%sr +| 0 "" 2 +#NO_APP + move.l %d0,-2147483640 + move.l %d0,269161684 +#APP +| 291 "bounce.c" 1 + move.w %d1,%sr +| 0 "" 2 +#NO_APP + clr.l -(%sp) + clr.l -(%sp) + clr.l -(%sp) + clr.l -(%sp) + clr.l -(%sp) + pea 26.w + jsr 1073763288 + lea (24,%sp),%sp + rts + .size set_mutes, .-set_mutes + .align 2 + .type restore_cues, @function +restore_cues: + mvz.b arm+6,%d1 + moveq #1,%d0 + lsl.l %d1,%d0 + mvz.b arm+7,%d1 + mvz.b %d0,%d0 + cmp.l %d1,%d0 + jeq .L67 + move.l #-2147483640,%a0 + move.l arm+8,%d0 + move.l (%a0),%d1 + and.l #16711680,%d0 + and.l #-16711681,%d1 + or.l %d1,%d0 + cmp.l (%a0),%d0 + jeq .L67 + move.l %d0,-(%sp) + jsr set_mutes + addq.l #4,%sp +.L67: + rts + .size restore_cues, .-restore_cues + .align 2 + .type restore_rec, @function +restore_rec: + move.l 1187521622,%d1 + lea (-16,%sp),%sp + movem.l #1036,(%sp) + cmp.l arm.l,%d1 + jne .L69 + move.b 269161679,%d0 + move.w %d0,%a0 + move.b arm+5,%d0 + move.l %a0,%d3 + mvz.b %d0,%d2 + move.l %d2,%a1 + moveq #3,%d2 + and.l %d2,%d3 + cmp.l %a1,%d3 + jne .L69 + ext.w %d0 + move.b arm+6,%d3 + add.l #585088,%d1 + move.l %d1,%a0 + mulu.w #6322,%d0 + pea (%a0,%d0.l) + jsr (copy.constprop.0) + mvz.b %d3,%d0 + addq.l #4,%sp + lea rec_copy,%a1 + mulu.w #12,%d0 + move.l %d0,%a0 + clr.l %d0 + add.l #part_buf+1538,%a0 +.L71: + lea (%a1,%d0.l),%a2 + moveq #12,%d1 + move.b (%a2),(%a0,%d0.l) + addq.l #1,%d0 + cmp.l %d0,%d1 + jne .L71 + mvz.b arm+5,%d0 + move.l %d0,-(%sp) + pea part_buf + jsr 1073912396 + addq.l #8,%sp +.L69: + movem.l (%sp),#1036 + lea (16,%sp),%sp + rts + .size restore_rec, .-restore_rec + .align 2 + .type pass_steps.constprop.0, @function +pass_steps.constprop.0: + lea (-40,%sp),%sp + moveq #6,%d1 + movem.l #15612,(%sp) + move.l 44(%sp),%a0 + move.l #36437,%a2 + move.l #36435,%a3 + clr.l %d2 + move.l #36436,%a4 + sub.l %a1,%a1 + clr.l %d5 + clr.l (%a0) + mvz.b arm+4,%d0 + mvz.b arm+7,%d4 + mulu.w #36568,%d0 + move.l %d0,%a0 + add.l arm,%a0 + add.l %a0,%a2 + add.l %a0,%a3 + add.l %a0,%a4 + lea (81,%a0),%a0 +.L83: + btst %d5,%d4 + jeq .L74 + tst.b (%a2) + jeq .L75 + move.b -1(%a0),%d6 +.L76: + tst.b (%a2) + jeq .L77 + move.b (%a0),%d3 +.L78: + mvz.b %d3,%d3 + moveq #6,%d0 + cmp.l %d3,%d0 + jcs .L79 + mvz.b %d6,%d0 + tst.b %d6 + jeq .L73 + move.l #ticks.0,%d6 + move.l %d6,%a5 + mvz.b (%a5,%d3.l),%d3 + mulu.w %d3,%d0 + tst.l %d0 + jeq .L73 + cmp.l %a1,%d0 + jls .L81 + move.l %d0,%a1 +.L81: + tst.l %d2 + jne .L74 + move.l %d0,%d3 + move.l %d1,%d2 +.L82: + remu.l %d3,%d7:%d2 + move.l %d3,%d6 + move.l %d6,%d2 + move.l %d7,%d3 + tst.l %d7 + jne .L82 + divu.l %d6,%d1 + muls.l %d0,%d1 + cmp.l #384,%d1 + shi %d2 + mvs.b %d2,%d2 + neg.l %d2 +.L74: + addq.l #1,%d5 + lea (2330,%a0),%a0 + moveq #8,%d0 + cmp.l %d5,%d0 + jne .L83 + tst.l %d2 + jne .L84 + move.l %d1,%d0 + moveq #6,%d2 + divu.l %d2,%d0 +.L73: + movem.l (%sp),#15612 + lea (40,%sp),%sp + rts +.L75: + move.b (%a3),%d6 + jra .L76 +.L77: + move.b (%a4),%d3 + jra .L78 +.L84: + move.l 44(%sp),%a0 + moveq #1,%d0 + move.l %d0,(%a0) + move.l %a1,%d0 + addq.l #5,%d0 + cmp.l #389,%d0 + jls .L85 +.L79: + clr.l %d0 + jra .L73 +.L85: + moveq #6,%d2 + divu.l %d2,%d0 + jra .L73 + .size pass_steps.constprop.0, .-pass_steps.constprop.0 + .align 2 + .type write_record, @function +write_record: + lea (-40,%sp),%sp + movem.l #31756,(%sp) + move.l 44(%sp),%a2 + sub.l %a3,%a3 + move.l 48(%sp),%a6 + lea write_span,%a4 + mvz.b 4(%a2),%d2 + mvz.b 6(%a2),%d0 + mulu.w #36568,%d2 + mulu.w #2330,%d0 + add.l %d0,%d2 + move.l %d2,%a5 + move.l %d2,%d0 + add.l (%a2),%a5 + pea 89.w + move.l %a6,-(%sp) + add.l #268525902,%d0 + move.l %d0,-(%sp) + move.l %a5,-(%sp) + jsr (%a4) + lea (16,%sp),%sp + move.l %a5,%d3 + add.l #89,%d3 + lea (89,%a6),%a0 + move.l %d2,%a1 + add.l #268525991,%a1 + move.l %a0,36(%sp) +.L98: + pea 32.w + move.l 40(%sp),%a0 + pea (%a0,%a3.l) + pea (%a3,%a1.l) + pea (%a3,%d3.l) + move.l %a1,48(%sp) + jsr (%a4) + lea (16,%sp),%sp + lea (32,%a3),%a3 + move.l 32(%sp),%a1 + cmp.l #2048,%a3 + jne .L98 + pea 193.w + move.l #1187501196,%a3 + pea 2137(%a6) + add.l #268528039,%d2 + move.l %d2,-(%sp) + pea 2137(%a5) + jsr (%a4) + mvz.b 4(%a2),%d0 + move.w #1,%a4 + lea (16,%sp),%sp + mvz.b 6(%a2),%d1 + mulu.w #36568,%d0 + mulu.w #2330,%d1 + move.l %d0,%a0 + add.l %d1,%a0 + add.l (%a2),%a0 + lea (89,%a0),%a0 +.L99: + sub.l %a1,%a1 +.L102: + move.b (%a0,%a1.l),%d0 + addq.l #1,%a1 + moveq #31,%d1 + cmp.l %a1,%d1 + jne .L100 + not.l %d0 + tst.b %d0 + sne %d0 + mvs.b %d0,%d0 + neg.l %d0 +.L101: + mvz.b 6(%a2),%d1 + move.l %a4,%d2 + lsl.l %d1,%d2 + move.b (%a3),%d1 + tst.l %d0 + jeq .L103 + or.l %d2,%d1 +.L104: + move.b %d1,(%a3)+ + lea (32,%a0),%a0 + cmp.l #1187501260,%a3 + jne .L99 + move.l (%a2),%a0 + moveq #1,%d0 + add.l #635698,%a0 + move.l %d0,(%a0) + moveq #1,%d0 + move.l %d0,269452696 + jsr 1073905152 + mvz.b 6(%a2),%d0 + movem.l (%sp),#31756 + move.l %d0,44(%sp) + lea (40,%sp),%sp + jmp 1074387488 +.L100: + mvz.b %d0,%d0 + cmp.l #255,%d0 + jeq .L102 + moveq #1,%d0 + jra .L101 +.L103: + not.l %d2 + and.l %d2,%d1 + jra .L104 + .size write_record, .-write_record + .section .rodata.str1.1 +.LC3: + .string "B%d-%s" +.LC4: + .string "%s/BOUNCES" +.LC5: + .string "%s/AUDIO/BOUNCES" +.LC6: + .string "%s/%s.wav" +.LC7: + .string "%s-%d" +.LC8: + .string "%s" +.LC9: + .string "BOUNCES/%s" + .text + .align 2 + .type save_take, @function +save_take: + lea (-16,%sp),%sp + movem.l #3084,(%sp) + tst.l 1175475208 + jeq .L110 + mvz.b arm+6,%d3 + move.w %d3,%d0 + mulu.w #44,%d0 + move.l %d0,%a0 + add.l #1187592404,%a0 + tst.l (%a0) + jgt .L111 +.L110: + movem.l (%sp),#3084 + lea (16,%sp),%sp + jra not_saved +.L111: + jsr 1074272764 + move.l #1073822216,%a2 + move.l %d3,%a0 + move.l %d0,-(%sp) + pea 1(%a0) + pea .LC3 + pea wav_base + jsr (%a2) + move.l 1187521530,%a3 + move.l 1187521546,%d2 + jsr 1073893100 + lea (16,%sp),%sp + tst.l %d0 + sne %d1 + mvs.b %d1,%d1 + neg.l %d1 + move.l %d1,wav_in_project + tst.l %d0 + jeq .L112 + clr.l -(%sp) + clr.l -(%sp) + jsr 1073893936 + move.l %d0,-(%sp) + pea .LC4 + pea wav_dir + jsr (%a2) + lea (20,%sp),%sp +.L113: + tst.l %a3 + jeq .L110 + tst.l %d2 + jeq .L110 + pea wav_dir + jsr (%a3) + addq.l #4,%sp + tst.l %d0 + jne .L114 + pea wav_dir + move.l %d2,%a0 + jsr (%a0) + addq.l #4,%sp + tst.l %d0 + jlt .L110 +.L114: + pea wav_base + moveq #1,%d2 + pea .LC8 + pea wav_name + jsr 1073822216 + lea (12,%sp),%sp +.L116: + pea wav_name + move.l #1073822216,%a2 + pea wav_dir + pea .LC6 + pea wav_path + jsr (%a2) + pea wav_path + jsr (%a3) + lea (20,%sp),%sp + tst.l %d0 + jeq .L115 + moveq #99,%d0 + cmp.l %d2,%d0 + jeq .L110 + addq.l #1,%d2 + move.l %d2,-(%sp) + pea wav_base + pea .LC7 + pea wav_name + jsr (%a2) + lea (16,%sp),%sp + jra .L116 +.L112: + move.l #269452416,-(%sp) + pea .LC5 + pea wav_dir + jsr (%a2) + lea (12,%sp),%sp + jra .L113 +.L115: + pea wav_name + pea .LC9 + move.l #1175185904,-(%sp) + jsr (%a2) + add.l #128,%d3 + move.l #-2147483484,%a2 + moveq #1,%d0 + move.l %d0,1175185896 + move.l #1175179208,%a0 + move.l %d3,1175185900 + move.l #wav_saved,%d0 + move.l (%a0),prev_mode + move.l #1187565972,%a0 + move.l (%a0),prev_done_a + move.l #1187565976,%a0 + move.l (%a0),prev_done_b + clr.l 1175179208 + move.l %d0,1187565972 + moveq #8,%d0 + lea saved,%a0 + move.l %a0,1187565976 + clr.l saved_in + clr.l wav_in + clr.l assigning + clr.l saved_ticks + move.l %d0,phase + moveq #1,%d0 + move.l %d0,1187497772 + move.l (%a2),%d3 + move.l wav_in_project,(%a2) + move.l #1175185904,-(%sp) + jsr 1073889640 + move.l %d3,(%a2) + movem.l 16(%sp),#3084 + lea (32,%sp),%sp + rts + .size save_take, .-save_take + .align 2 + .type paste, @function +paste: + lea (-16,%sp),%sp + movem.l #1052,(%sp) + move.l 20(%sp),%a2 + move.l 24(%sp),%d2 + move.l 28(%sp),%d3 + mvz.b 5(%a2),%d0 + move.l %d0,-(%sp) + pea part_buf + jsr 1073912396 + addq.l #8,%sp + lea part_buf,%a0 + mvz.b 34(%a0,%d2.l),%d0 + cmp.l %d0,%d3 + jeq .L130 + move.l %d3,28(%sp) + move.l %d2,24(%sp) + mvz.b 5(%a2),%d0 + movem.l (%sp),#1052 + move.l %d0,20(%sp) + lea (16,%sp),%sp + jmp 1074361084 +.L130: + move.b 269161679,%d0 + move.b 5(%a2),%d1 + moveq #3,%d4 + and.l %d4,%d0 + mvz.b %d1,%d3 + cmp.l %d3,%d0 + jne .L129 + tst.b -2147483627.l + jne .L129 + move.b 269161678,%d0 + move.l %d2,28(%sp) + movem.l (%sp),#1052 + mvs.b %d1,%d1 + move.l %d1,24(%sp) + mvz.b %d0,%d0 + move.l %d0,20(%sp) + lea (16,%sp),%sp + jmp 1073749784 +.L129: + movem.l (%sp),#1052 + lea (16,%sp),%sp + rts + .size paste, .-paste + .align 2 + .type apply_clip, @function +apply_clip: + link.w %fp,#-44 + mvz.b arm+5,%d0 + movem.l #7292,(%sp) + move.b arm+6,%d4 + lea arm,%a2 + mulu.w #6322,%d0 + move.l (%a2),%a3 + add.l #585088,%a3 + add.l %d0,%a3 + mvz.b %d4,%d2 + move.l %d2,%a4 + lea (34,%a4),%a4 + mvz.b (%a3,%a4.l),%d3 + pea -4(%fp) + jsr (pass_steps.constprop.0) + move.l %a3,-(%sp) + move.l %d0,-12(%fp) + jsr (copy.constprop.0) + move.w %d2,%d0 + addq.l #8,%sp + lea rec_copy,%a1 + mulu.w #12,%d0 + move.l %d0,%a0 + clr.l %d0 + add.l #part_buf+1538,%a0 +.L133: + lea (%a1,%d0.l),%a3 + moveq #12,%d1 + move.b (%a3),(%a0,%d0.l) + addq.l #1,%d0 + cmp.l %d0,%d1 + jne .L133 + move.w %d2,%d0 + moveq #1,%d5 + lea part_buf,%a1 + add.l #-128,%d4 + clr.b %d6 + clr.l %d1 + mulu.w #5,%d0 + move.b %d5,(%a1,%a4.l) + move.w #474,%a4 + move.b %d6,(%a1,%d2.l) + move.b %d6,8(%a1,%d2.l) + lea (%a1,%d0.l),%a0 + move.w %d2,%d0 + move.b %d4,715(%a0) + mulu.w #30,%d0 + addq.l #6,%d0 +.L135: + move.l %d1,%a3 + moveq #5,%d4 + add.l #1074606604,%a3 + cmp.l %d1,%d4 + jcs .L141 + move.w #42,%a0 +.L134: + move.l %d1,%d5 + moveq #6,%d6 + remu.l %d6,%d4:%d5 + add.l %a1,%a0 + add.l %d0,%a0 + addq.l #1,%d1 + move.b (%a3),(%a0,%d4.l) + moveq #12,%d4 + cmp.l %d1,%d4 + jne .L135 + move.w %d2,%d1 + moveq #127,%d6 + move.l #2139045952,%d5 + mulu.w #24,%d1 + move.l %d1,%a0 + add.l #part_buf+282,%a0 + move.b %d6,11(%a0) + clr.l 3(%a0) + move.l %d5,7(%a0) + move.l %d3,-(%sp) + move.l %d2,-(%sp) + pea arm + jsr paste + lea (12,%sp),%sp + clr.l %d1 + lea record_new,%a0 + lea record_copy,%a1 +.L136: + lea (%a1,%d1.l),%a3 + move.b (%a3),(%a0,%d1.l) + addq.l #1,%d1 + cmp.l #2330,%d1 + jne .L136 + clr.l %d0 +.L137: + clr.b %d1 + moveq #64,%d4 + move.b %d1,(%a0,%d0.l) + addq.l #1,%d0 + cmp.l %d0,%d4 + jne .L137 + moveq #1,%d5 + clr.l %d0 + lea record_new+89,%a0 + move.b %d5,record_new+7 +.L138: + st %d6 + addq.l #1,%d0 + move.b %d6,-1(%a0,%d0.l) + cmp.l #2048,%d0 + jne .L138 + mvz.b arm+4,%d0 + move.l (%a2),%a0 + add.l #36437,%a0 + mulu.w #36568,%d0 + tst.b (%a0,%d0.l) + jeq .L139 + tst.l -12(%fp) + jeq .L139 + moveq #2,%d0 + lea (-9,%fp),%a0 + move.b (%a0),record_new+80 + move.b %d0,record_new+81 +.L139: + pea record_new + pea arm + jsr write_record + move.b arm+7,%d1 + addq.l #8,%sp + moveq #1,%d0 + lsl.l %d2,%d0 + move.l #-2147483640,%a0 + not.l %d0 + and.l %d1,%d0 + mvz.b %d0,%d0 + lsl.l #8,%d0 + or.l (%a0),%d0 + cmp.l (%a0),%d0 + jeq .L140 + move.l %d0,-(%sp) + jsr set_mutes + addq.l #4,%sp +.L140: + movem.l -44(%fp),#7292 + moveq #1,%d1 + move.l %d1,undo_ready + unlk %fp + rts +.L141: + move.l %a4,%a0 + jra .L134 + .size apply_clip, .-apply_clip + .section .rodata.str1.1 +.LC10: + .string "TAKE LEFT IN BUFFER" +.LC11: + .string "NOTHING TO UNDO" +.LC12: + .string "UNDO: OPEN ITS PATTERN" +.LC13: + .string "UNDONE" + .text + .align 2 + .type bounce_choose, @function +bounce_choose: + lea (-28,%sp),%sp + moveq #2,%d1 + move.l 32(%sp),%d0 + movem.l #17412,(%sp) + cmp.l %d0,%d1 + jne .L154 + move.l phase,%d1 + moveq #9,%d0 + cmp.l %d1,%d0 + jcs .L155 + moveq #1,%d0 + lsl.l %d1,%d0 + move.l %d0,%d1 + and.l #300,%d1 + tst.l %d1 + jne .L153 + and.l #576,%d0 + tst.l %d0 + jeq .L155 + move.l #.LC10,%d1 + move.l %d1,32(%sp) +.L176: + movem.l (%sp),#17412 + lea (28,%sp),%sp + jra show +.L155: + tst.l undo_ready + jne .L157 + move.l #.LC11,%d0 + move.l %d0,32(%sp) + jra .L176 +.L157: + move.l %sp,%d2 + add.l #16,%d2 + move.l %d2,-(%sp) + jsr current + addq.l #4,%sp + lea show,%a2 + tst.l %d0 + jeq .L158 + pea last + move.l %d2,-(%sp) + jsr same_place + addq.l #8,%sp + tst.l %d0 + jne .L159 +.L158: + pea .LC12 +.L177: + jsr (%a2) +.L175: + addq.l #4,%sp +.L153: + movem.l (%sp),#17412 + lea (28,%sp),%sp + rts +.L159: + mvz.b last+5,%d0 + mvz.b last+6,%d2 + lea last,%a6 + move.l (%a6),%a0 + add.l #585088,%a0 + mulu.w #6322,%d0 + add.l %d0,%a0 + move.b 34(%a0,%d2.l),%d1 + move.b %d1,15(%sp) + move.l %a0,-(%sp) + jsr (copy.constprop.0) + pea 1.w + move.l %d2,-(%sp) + pea part_copy + jsr (put_track.constprop.0) + mvz.b 31(%sp),%d0 + move.l %d0,-(%sp) + move.l %d2,-(%sp) + move.l %a6,-(%sp) + jsr paste + pea record_copy + move.l %a6,-(%sp) + jsr write_record + mvz.b last+7,%d0 + lea (36,%sp),%sp + move.l #-2147483640,%a0 + move.l (%a0),%d1 + move.l last+8,%d2 + lsl.l #8,%d0 + eor.l %d1,%d2 + and.l %d2,%d0 + eor.l %d1,%d0 + cmp.l (%a0),%d0 + jeq .L160 + move.l %d0,-(%sp) + jsr set_mutes + addq.l #4,%sp +.L160: + clr.l undo_ready + pea .LC13 + jra .L177 +.L154: + tst.l %d0 + jeq .L162 + move.l phase,%d1 + moveq #9,%d0 + cmp.l %d1,%d0 + jcs .L163 + moveq #1,%d0 + lsl.l %d1,%d0 + move.l %d0,%d1 + and.l #300,%d1 + tst.l %d1 + jne .L153 + and.l #576,%d0 + tst.l %d0 + jeq .L163 + clr.l phase +.L163: + move.l %sp,%d2 + add.l #16,%d2 + move.l %d2,-(%sp) + jsr current + addq.l #4,%sp + tst.l %d0 + jne .L165 + pea .LC2 + jsr show + jra .L175 +.L165: + pea 12.w + move.l %d2,-(%sp) + pea arm + jsr copy + clr.l message + mvz.b 34(%sp),%d1 + moveq #1,%d0 + lea (12,%sp),%sp + lsl.l %d1,%d0 + moveq #7,%d1 + move.l %d1,phase + move.b %d0,arm+7 + moveq #1,%d0 + move.l %d0,1187497772 + jra .L153 +.L162: + movem.l (%sp),#17412 + lea (28,%sp),%sp + jra open_select + .size bounce_choose, .-bounce_choose + .align 2 + .type cancel, @function +cancel: + mvz.b arm+6,%d1 + subq.l #4,%sp + move.l 8(%sp),(%sp) + move.w %d1,%d0 + mulu.w #168,%d0 + move.l %d0,%a0 + add.l #-2147464743,%a0 + tst.b (%a0) + jeq .L179 + clr.l -(%sp) + pea 128.w + move.l %d1,-(%sp) + jsr 1073762680 + lea (12,%sp),%sp +.L179: + jsr restore_rec + jsr restore_cues + move.l (%sp),8(%sp) + addq.l #4,%sp + jra show + .size cancel, .-cancel + .section .rodata.str1.1 +.LC14: + .string "STOPPED - NO BOUNCE" +.LC15: + .string "PATTERN CHANGED" +.LC16: + .string "TAKE INCOMPLETE" +.LC17: + .string "BOUNCED, SAVED AS" + .text + .align 2 + .globl module_tick + .type module_tick, @function +module_tick: + move.l phase,%d0 + moveq #5,%d1 + lea (-64,%sp),%sp + movem.l #23804,(%sp) + cmp.l %d0,%d1 + jne .L184 + tst.l -2147457608 + jeq .L185 + mvz.b arm+6,%d0 + pea 1.w + moveq #2,%d2 + move.l #49168,-(%sp) + moveq #1,%d6 + move.l %d0,-(%sp) + jsr 1073762680 + move.l %d2,phase + move.l %d6,1187497772 + lea (12,%sp),%sp +.L185: + move.w #1,%a6 + moveq #1,%d4 +.L208: + move.l #1175169472,-(%sp) + jsr 1073744372 + clr.l %d3 + lea lamp_stock,%a3 + lea lamp_mine,%a2 + lea lamps_on,%a0 + clr.l %d0 + move.b (%a0),51(%sp) + addq.l #4,%sp +.L220: + move.l %d0,%a4 + add.l #1175169420,%a4 + move.b (%a4),%d2 + tst.b 47(%sp) + jeq .L210 + mvz.b (%a2,%d0.l),%d5 + mvz.b %d2,%d1 + cmp.l %d1,%d5 + jeq .L211 +.L210: + move.b %d2,(%a3,%d0.l) +.L211: + tst.l %d4 + jeq .L212 + mvz.b arm+6,%d1 + move.l %d0,%d6 + sub.l %a0,%a0 + lsl.l #2,%d6 + mvz.b arm+7,%d5 + move.l %d1,48(%sp) + clr.b %d1 + move.l %d6,%a1 +.L217: + cmp.l 48(%sp),%a1 + jne .L213 + moveq #1,%d7 +.L251: + move.l %a0,%d6 + lsl.l %d6,%d7 + or.l %d7,%d1 + jra .L214 +.L184: + moveq #2,%d7 + cmp.l %d0,%d7 + jne .L186 + mvz.b arm+6,%d0 + mulu.w #168,%d0 + move.l %d0,%a0 + add.l #-2147464743,%a0 + tst.b (%a0) + jeq .L185 + moveq #3,%d0 + moveq #1,%d1 + move.l %d0,phase + move.l %d1,1187497772 + jra .L185 +.L186: + moveq #3,%d2 + cmp.l %d0,%d2 + jne .L187 + tst.l -2147457608 + jne .L188 + pea .LC14 +.L252: + jsr cancel +.L248: + addq.l #4,%sp + jra .L189 +.L188: + mvz.b arm+6,%d3 + lea arm,%a3 + move.w %d3,%d0 + mulu.w #168,%d0 + move.l %d0,%a0 + add.l #-2147464743,%a0 + tst.b (%a0) + jne .L185 + move.l %sp,%d2 + add.l #52,%d2 + move.l %d2,-(%sp) + jsr current + addq.l #4,%sp + tst.l %d0 + jeq .L190 + move.l %a3,-(%sp) + move.l %d2,-(%sp) + jsr same_place + addq.l #8,%sp + tst.l %d0 + jne .L191 +.L190: + pea .LC15 + jra .L252 +.L191: + move.l %d3,%d0 + add.l #296877961,%d0 + lsl.l #2,%d0 + move.l %d0,%a0 + tst.l (%a0) + jne .L193 + pea .LC16 + jra .L252 +.L193: + jsr restore_rec + jsr restore_cues + mvz.b arm+5,%d0 + move.l (%a3),%a4 + move.l %a4,%d2 + add.l #585088,%d2 + pea 6322.w + mulu.w #6322,%d0 + lea copy,%a2 + add.l %d0,%d2 + move.l %d2,-(%sp) + pea part_copy + jsr (%a2) + mvz.b arm+4,%d0 + pea 2330.w + mvz.b arm+6,%d1 + mulu.w #36568,%d0 + mulu.w #2330,%d1 + move.l %d0,%a0 + add.l %d1,%a0 + pea (%a0,%a4.l) + pea record_copy + jsr (%a2) + pea 12.w + move.l %a3,-(%sp) + pea last + jsr (%a2) + lea (32,%sp),%sp + move.l #-2147483640,%a0 + move.l (%a0),last+8 + move.l %d3,(%sp) + move.l %d2,-(%sp) + clr.l undo_ready + jsr modwerk_machine + addq.l #8,%sp + tst.l %d0 + jeq .L249 + moveq #9,%d0 + moveq #1,%d1 + move.l %d0,phase + clr.l message + move.l %d1,1187497772 +.L189: + move.l phase,%d0 + moveq #3,%d2 + cmp.l %d0,%d2 + jcs .L207 + tst.l %d0 + jeq .L206 + jra .L185 +.L187: + moveq #6,%d2 + cmp.l %d0,%d2 + jeq .L195 + moveq #9,%d6 + cmp.l %d0,%d6 + jne .L196 +.L195: + lea arm,%a2 + move.l %sp,%d4 + add.l #52,%d4 + move.l (%a2),%d2 + move.l %d4,-(%sp) + move.b arm+5,%d3 + jsr current + addq.l #4,%sp + tst.l %d0 + jeq .L197 + move.l %a2,-(%sp) + move.l %d4,-(%sp) + jsr same_place + addq.l #8,%sp + tst.l %d0 + jne .L198 +.L197: + pea .LC10 + jsr show + jra .L248 +.L198: + mvz.b %d3,%d3 + mvz.b arm+6,%d0 + move.l %d2,%a0 + add.l #585088,%a0 + mulu.w #6322,%d3 + add.l %d3,%a0 + mvz.b 34(%a0,%d0.l),%d1 + subq.l #1,%d1 + tst.l %d1 + jne .L197 + move.l %d0,-(%sp) + move.l %a0,-(%sp) + jsr modwerk_machine + addq.l #8,%sp + tst.l %d0 + jne .L189 +.L249: + jsr apply_clip + jsr save_take + jra .L189 +.L196: + moveq #8,%d1 + cmp.l %d0,%d1 + jne .L200 + tst.l saved_in + jeq .L201 + jsr save_done_restore + tst.l saved_result + jge .L202 +.L250: + jsr not_saved + jra .L189 +.L202: + pea .LC17 + move.l #wav_name,%d2 + jsr show + move.l %d2,message2 + jra .L248 +.L201: + tst.l wav_in + jeq .L203 + tst.l assigning + jne .L203 + moveq #1,%d6 + move.l %d6,assigning + tst.l wav_result + jge .L204 +.L205: + jsr save_done_restore + jra .L250 +.L204: + move.l #-2147483484,%a2 + move.l (%a2),%d2 + move.l wav_in_project,(%a2) + clr.l -(%sp) + jsr 1073889608 + move.l %d2,(%a2) + jra .L248 +.L203: + move.l saved_ticks,%d0 + addq.l #1,%d0 + move.l %d0,saved_ticks + cmp.l #1800,%d0 + jhi .L205 +.L206: + tst.b lamps_on.l + jeq .L209 + clr.l %d4 + sub.l %a6,%a6 + jra .L208 +.L200: + subq.l #4,%d0 + tst.l %d0 + jne .L189 + tst.l sticky + jne .L206 + move.l shown_ticks,%d0 + addq.l #1,%d0 + move.l %d0,shown_ticks + moveq #90,%d1 + cmp.l %d0,%d1 + jcc .L206 + jsr close_view + jra .L189 +.L207: + subq.l #5,%d0 + tst.l %d0 + jne .L206 + jra .L185 +.L222: + moveq #1,%d0 + jra .L220 +.L213: + move.l %a1,%d7 + btst %d7,%d5 + jeq .L215 + moveq #2,%d6 + move.l %a0,%d7 + lsl.l %d7,%d6 + or.l %d6,%d1 +.L214: + addq.l #1,%a1 + addq.l #2,%a0 + moveq #8,%d7 + cmp.l %a0,%d7 + jne .L217 + move.l %d0,%a0 + add.l #1175169454,%a0 + move.b (%a0),%d5 + eor.l %d5,%d1 +.L218: + mvz.b %d2,%d2 + mvz.b %d1,%d5 + cmp.l %d2,%d5 + jeq .L219 + move.b %d1,(%a4) + moveq #1,%d3 +.L219: + move.b %d1,(%a2,%d0.l) + subq.l #1,%d0 + tst.l %d0 + jne .L222 + tst.l %d3 + jeq .L221 + jsr 1073821352 +.L221: + move.w %a6,%d2 + move.l #1175169472,-(%sp) + jsr 1073744564 + addq.l #4,%sp + move.b %d2,lamps_on +.L209: + mvz.b arm+6,%d0 + moveq #24,%d6 + moveq #9,%d7 + move.l -2147457608,%d1 + mvz.b arm+7,%d2 + mulu.w #168,%d0 + tst.l %d1 + sne %d1 + swap %d2 + clr.w %d2 + move.l %d0,%a0 + add.l #-2147464743,%a0 + move.l phase,%d0 + lsl.l %d6,%d0 + mvs.b %d1,%d1 + neg.l %d1 + lsl.l %d7,%d1 + or.l undo_ready,%d0 + or.l %d2,%d0 + movem.l (%sp),#23804 + or.l %d1,%d0 + tst.b (%a0) + sne %d1 + move.l 68(%sp),%a0 + mvs.b %d1,%d1 + neg.l %d1 + lsl.l #8,%d1 + or.l %d1,%d0 + move.l %d0,(%a0) + lea (64,%sp),%sp + rts +.L215: + moveq #7,%d6 + cmp.l %a1,%d6 + jne .L216 + tst.b -2147483596.l + jne .L214 +.L216: + moveq #3,%d7 + jra .L251 +.L212: + move.b (%a3,%d0.l),%d1 + jra .L218 + .size module_tick, .-module_tick + .section .rodata.str1.1 +.LC18: + .string "TRACK CHANGED" +.LC19: + .string "PICK STATIC FIRST" +.LC20: + .string "RECORDER BUSY" +.LC21: + .string "TRACK RESET" +.LC22: + .string "PASS OVER 64 STEPS" +.LC23: + .string "T8 IS THE MASTER TRACK" +.LC24: + .string "T" +.LC25: + .string " CUE LEVEL IS 0" +.LC26: + .string "BOUNCE CANCELLED" + .text + .align 2 + .globl module_key + .type module_key, @function +module_key: + link.w %fp,#-52 + moveq #63,%d1 + movem.l #3324,(%sp) + move.l 8(%fp),%d4 + move.l 12(%fp),%d0 + cmp.l %d4,%d1 + jcs .L254 + moveq #31,%d2 + cmp.l %d4,%d2 + jlt .L255 + move.l consumed_lo,%d1 + lea consumed_lo,%a2 +.L256: + moveq #31,%d2 + moveq #1,%d3 + and.l %d4,%d2 + lsl.l %d2,%d3 + move.l %d1,%d2 + and.l %d3,%d2 + tst.l %d0 + jne .L257 + tst.l %d2 + jeq .L258 + not.l %d3 + and.l %d1,%d3 + move.l %d3,(%a2) +.L259: + moveq #1,%d0 + jra .L258 +.L255: + move.l consumed_hi,%d1 + lea consumed_hi,%a2 + jra .L256 +.L257: + tst.l %d2 + jne .L259 + move.l phase,%d0 + moveq #8,%d1 + cmp.l %d0,%d1 + jeq .L254 + moveq #9,%d1 + cmp.l %d0,%d1 + jne .L260 + moveq #6,%d2 + moveq #1,%d0 + move.l %d2,phase + move.l %d0,1187497772 + add.l #-49,%d4 + move.l %d4,-20(%fp) +.L328: + cmp.l %d4,%d0 + jcc .L261 + jra .L254 +.L260: + tst.l %d0 + jeq .L262 + moveq #6,%d1 + cmp.l %d0,%d1 + jne .L263 +.L262: + moveq #41,%d2 + cmp.l %d4,%d2 + jne .L254 + move.b 1175456540,%d0 + btst #0,%d0 + jeq .L254 + jsr open_select +.L261: + or.l %d3,(%a2) + jra .L259 +.L263: + moveq #7,%d1 + cmp.l %d0,%d1 + jne .L264 + moveq #49,%d2 + cmp.l %d4,%d2 + jne .L265 + move.l %fp,%d6 + add.l #-12,%d6 + move.l %d6,-(%sp) + jsr current + addq.l #4,%sp + tst.l %d0 + jeq .L277 + move.b -6(%fp),%d5 + mvz.b arm+6,%d0 + mvz.b %d5,%d2 + cmp.l %d2,%d0 + jne .L277 + pea arm + move.l %d6,-(%sp) + jsr same_place + addq.l #8,%sp + tst.l %d0 + jne .L267 +.L277: + pea .LC18 + jra .L329 +.L267: + mvz.b -7(%fp),%d0 + move.l -12(%fp),%a0 + move.l %a0,%d7 + add.l #585088,%d7 + move.l %d2,-(%sp) + mulu.w #6322,%d0 + move.l %a0,-20(%fp) + add.l %d0,%d7 + move.l %d7,-(%sp) + jsr modwerk_machine + addq.l #8,%sp + move.l %d0,%d4 + tst.l %d0 + jeq .L269 + pea .LC19 +.L329: + jsr show +.L331: + addq.l #4,%sp + jra .L261 +.L269: + move.w %d2,%d0 + mulu.w #168,%d0 + move.l %d0,%a0 + add.l #-2147464743,%a0 + tst.b (%a0) + jeq .L270 +.L330: + pea .LC20 + jra .L329 +.L270: + moveq #1,%d0 + lsl.l %d2,%d0 + move.l #-2147483640,%a0 + lea copy,%a3 + move.b %d0,-5(%fp) + move.l (%a0),-4(%fp) + pea 6322.w + move.l %d7,-(%sp) + pea part_copy + jsr (%a3) + pea 2330.w + move.w %d2,%d1 + mvz.b -8(%fp),%d0 + mulu.w #36568,%d0 + mulu.w #2330,%d1 + move.l %d0,%a0 + add.l %d1,%a0 + move.l -20(%fp),%d1 + pea (%a0,%d1.l) + pea record_copy + jsr (%a3) + lea part_copy,%a0 + mvz.b 34(%a0,%d2.l),%d7 + move.l %a0,-(%sp) + jsr (copy.constprop.0) + clr.l -(%sp) + move.l %d2,-(%sp) + pea FRESH + jsr (put_track.constprop.0) + lea (36,%sp),%sp + move.w %d2,%d0 + mulu.w #5,%d0 + move.l %d0,%a0 + add.l #part_buf+714,%a0 + move.b %d5,1(%a0) + move.b %d5,(%a0) + add.l #-128,%d5 + move.b %d5,4(%a0) + move.l %d7,(%sp) + move.l %d2,-(%sp) + move.l %d6,-(%sp) + jsr paste + lea (12,%sp),%sp + lea record_new,%a0 + clr.l %d0 + move.l %a0,%d1 +.L271: + clr.b %d2 + move.b %d2,(%a0,%d0.l) + addq.l #1,%d0 + cmp.l #2330,%d0 + jne .L271 + st %d0 + move.l #-1431655766,%a0 + move.l %a0,record_new+64 + move.l %a0,record_new+68 + lea record_copy+80,%a0 + move.w (%a0),record_new+80 + lea record_new+89,%a0 + move.b %d0,record_new+83 +.L272: + st %d2 + addq.l #1,%d4 + move.b %d2,-1(%a0,%d4.l) + cmp.l #2048,%d4 + jne .L272 + lea record_copy+2329,%a0 + move.b (%a0),record_new+2329 + move.l %d1,-(%sp) + move.l %d6,-(%sp) + jsr write_record + pea 12.w + move.l %d6,-(%sp) + pea last + jsr (%a3) + pea .LC21 + moveq #1,%d0 + move.l %d0,undo_ready + jsr show + lea (24,%sp),%sp + jra .L261 +.L265: + moveq #50,%d1 + cmp.l %d4,%d1 + jne .L254 +.L291: + jsr close_view + jra .L261 +.L264: + moveq #1,%d1 + cmp.l %d0,%d1 + jne .L273 + moveq #7,%d0 + cmp.l %d4,%d0 + jlt .L274 + mvz.b arm+6,%d0 + cmp.l %d4,%d0 + jeq .L275 + moveq #1,%d0 + move.b arm+7,%d1 + lsl.l %d4,%d0 + eor.l %d1,%d0 + move.b %d0,arm+7 +.L275: + moveq #1,%d1 + move.l %d1,1187497772 + jra .L261 +.L274: + moveq #49,%d0 + cmp.l %d4,%d0 + jne .L276 + move.l %fp,%d4 + add.l #-12,%d4 + move.l %d4,-(%sp) + jsr current + addq.l #4,%sp + tst.l %d0 + jeq .L277 + pea arm + move.l %d4,-(%sp) + jsr same_place + addq.l #8,%sp + tst.l %d0 + jeq .L277 + move.b arm+6,%d6 + mvz.b -6(%fp),%d0 + mvz.b %d6,%d7 + cmp.l %d0,%d7 + jne .L277 + pea -16(%fp) + jsr (pass_steps.constprop.0) + addq.l #4,%sp + move.l %d0,%a3 + tst.l %d0 + jne .L280 + pea .LC22 + jra .L329 +.L280: + move.b arm+7,%d5 + tst.b -2147483596.l + jne .L281 +.L284: + moveq #1,%d4 + lsl.l %d7,%d4 + mvz.b %d5,%d5 + mvz.b %d4,%d4 + cmp.l %d5,%d4 + jne .L286 +.L283: + move.w %d7,%d0 + mulu.w #168,%d0 + move.l %d0,%a0 + add.l #-2147464743,%a0 + tst.b (%a0) + jne .L330 + move.w %d7,%d1 + mvz.b arm+5,%d0 + move.l #-2147483640,%a0 + move.l (%a0),arm+8 + move.l arm,%d2 + add.l #585088,%d2 + mulu.w #6322,%d0 + pea 12.w + mulu.w #12,%d1 + add.l %d0,%d2 + move.l %d1,%a0 + lea (1538,%a0),%a0 + pea (%a0,%d2.l) + move.l %a0,-20(%fp) + pea rec_copy + jsr copy + move.l %d2,-(%sp) + jsr (copy.constprop.0) + lea (16,%sp),%sp + move.l -20(%fp),%a0 + add.l #part_buf,%a0 + move.l %a0,-20(%fp) + move.l %a3,%d0 + subq.l #1,%d0 + clr.w (%a0) + move.b %d0,2(%a0) + cmp.l %d5,%d4 + jne .L294 + addq.l #1,%d6 +.L288: + clr.b %d0 + move.l -20(%fp),%a0 + move.b %d6,4(%a0) + move.b %d0,9(%a0) + mvz.b arm+5,%d0 + move.l %d0,-(%sp) + pea part_buf + jsr 1073912396 + addq.l #8,%sp + cmp.l %d5,%d4 + jeq .L289 + mvz.b arm+7,%d0 + move.l arm+8,%d1 + swap %d0 + clr.w %d0 + and.l #-16711681,%d1 + or.l %d0,%d1 + move.l %d1,-(%sp) + jsr set_mutes + addq.l #4,%sp +.L289: + move.l %d7,%d0 + add.l #296877961,%d0 + lsl.l #2,%d0 + move.l %d0,%a0 + clr.l (%a0) + tst.l -2147457608 + jeq .L295 + pea 1.w + move.l #49168,-(%sp) + move.l %d7,-(%sp) + jsr 1073762680 + lea (12,%sp),%sp + moveq #2,%d0 +.L290: + move.l %d0,phase + moveq #1,%d0 + move.l %d0,1187497772 + jra .L261 +.L281: + tst.b %d5 + jge .L284 + pea .LC23 + jra .L329 +.L285: + move.l %d1,%d2 + moveq #8,%d0 + cmp.l %d1,%d0 + jeq .L283 +.L286: + move.l %d2,%d1 + addq.l #1,%d1 + btst %d2,%d5 + jeq .L285 + mvz.w %d2,%d0 + add.l %d0,%d0 + move.l %d0,%a0 + add.l #-2147480495,%a0 + tst.b (%a0) + jne .L285 + clr.b %d1 + pea .LC24 + move.l #note,%d4 + move.l %d4,-(%sp) + lea append,%a3 + add.l #49,%d2 + move.b %d1,note + jsr (%a3) + move.b %d2,note+1 + clr.b %d2 + pea .LC25 + move.l %d4,-(%sp) + move.b %d2,note+2 + jsr (%a3) + move.l %d4,-(%sp) + jsr show + lea (20,%sp),%sp + jra .L261 +.L294: + moveq #10,%d6 + jra .L288 +.L295: + moveq #5,%d0 + jra .L290 +.L276: + moveq #50,%d1 + cmp.l %d4,%d1 + jeq .L291 + jsr close_view +.L254: + clr.l %d0 +.L258: + movem.l -52(%fp),#3324 + unlk %fp + rts +.L273: + move.l %d0,%d1 + subq.l #2,%d1 + lsr.l #1,%d1 + jeq .L292 + subq.l #5,%d0 + tst.l %d0 + jne .L293 +.L292: + moveq #50,%d2 + cmp.l %d4,%d2 + jne .L254 + pea .LC26 + jsr cancel + jra .L331 +.L293: + jsr close_view + add.l #-49,%d4 + move.l %d4,-20(%fp) + moveq #1,%d0 + jra .L328 + .size module_key, .-module_key + .align 2 + .globl module_enc + .type module_enc, @function +module_enc: + move.l phase,%d1 + move.l %d2,-(%sp) + moveq #7,%d2 + cmp.l %d1,%d2 + seq %d0 + moveq #1,%d2 + cmp.l %d1,%d2 + seq %d1 + move.l (%sp)+,%d2 + neg.l %d0 + neg.l %d1 + or.l %d1,%d0 + mvz.b %d0,%d0 + rts + .size module_enc, .-module_enc + .section .rodata.str1.1 +.LC27: + .string "BOUNCE" +.LC28: + .string "" +.LC29: + .string " (LONGEST)" +.LC30: + .string " STEPS" +.LC31: + .string "RECORDING ONE PASS" +.LC32: + .string "PRESS PLAY" +.LC33: + .string "WAIT" +.LC34: + .string "BOUNCED: T" +.LC35: + .string " PICK FLEX" +.LC36: + .string "CHANGE T" +.LC37: + .string " TO FLEX" +.LC38: + .string "TAKE RECORDED" +.LC39: + .string "BOUNCE T" +.LC40: + .string "RESET T" +.LC41: + .string "STOCK STATIC TRACK" +.LC42: + .string "NO TRIGS, NO LOCKS" +.LC43: + .string "YES: RESET NO: BACK" +.LC44: + .string "PASS " +.LC45: + .string "OVER 64 STEPS" +.LC46: + .string "TRIG 1-8: MERGE" +.LC47: + .string "YES: REC NO: CLOSE" +.LC48: + .string "NO: CANCEL" + .text + .align 2 + .globl module_draw + .type module_draw, @function +module_draw: + link.w %fp,#-68 + moveq #-9,%d0 + movem.l #15388,(%sp) + move.l phase,%d3 + and.l %d3,%d0 + tst.l %d0 + jeq .L333 + tst.l 8(%fp) + jeq .L333 + lea append,%a3 + moveq #6,%d0 + lea fill,%a4 + lea text,%a2 + lea invert,%a5 + cmp.l %d3,%d0 + jne .L335 + clr.b %d1 + pea .LC34 + move.l %fp,%d2 + add.l #-24,%d2 + move.l %d2,-(%sp) + clr.b %d3 + move.b %d1,-24(%fp) + jsr (%a3) + move.b arm+6,%d0 + move.b %d3,-13(%fp) + pea .LC35 + move.l %d2,-(%sp) + add.l #49,%d0 + move.b %d0,-14(%fp) + jsr (%a3) + clr.l -(%sp) + pea 8.w + pea 128.w + pea 56.w + clr.l -(%sp) + move.l 8(%fp),-(%sp) + jsr (%a4) + lea (36,%sp),%sp + move.l %d2,(%sp) + pea 57.w + pea 2.w + move.l 8(%fp),-(%sp) + jsr (%a2) + pea 8.w + pea 128.w + pea 56.w + clr.l -(%sp) + move.l 8(%fp),-(%sp) + jsr (%a5) +.L370: + lea (36,%sp),%sp +.L333: + movem.l -68(%fp),#15388 + unlk %fp + rts +.L335: + move.l #frame_box,%d4 + moveq #9,%d0 + cmp.l %d3,%d0 + jne .L336 + clr.b %d1 + pea .LC36 + move.l %fp,%d2 + add.l #-24,%d2 + move.l %d2,-(%sp) + clr.b %d3 + move.b %d1,-24(%fp) + jsr (%a3) + move.b arm+6,%d0 + move.b %d3,-15(%fp) + pea .LC37 + move.l %d2,-(%sp) + add.l #49,%d0 + move.b %d0,-16(%fp) + jsr (%a3) + clr.l -(%sp) + pea 26.w + pea 96.w + pea 18.w + pea 16.w + move.l 8(%fp),-(%sp) + jsr (%a4) + lea (40,%sp),%sp + pea 26.w + pea 96.w + pea 18.w + pea 16.w + move.l %d4,%a0 + move.l 8(%fp),-(%sp) + jsr (%a0) + pea .LC38 + pea 21.w + pea 20.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (36,%sp),%sp + pea 7.w + pea 94.w + pea 20.w + pea 17.w + move.l 8(%fp),-(%sp) + jsr (%a5) + move.l %d2,-(%sp) + pea 32.w + pea 20.w + move.l 8(%fp),-(%sp) + jsr (%a2) + jra .L370 +.L336: + clr.l -(%sp) + pea 44.w + pea 116.w + pea 10.w + pea 6.w + move.l %fp,%d2 + add.l #-36,%d2 + move.l 8(%fp),-(%sp) + jsr (%a4) + pea 44.w + pea 116.w + pea 10.w + pea 6.w + move.l %d4,%a0 + moveq #7,%d4 + move.l 8(%fp),-(%sp) + jsr (%a0) + clr.b %d0 + lea (40,%sp),%sp + move.l #.LC39,(%sp) + move.l %d2,-(%sp) + move.b %d0,-36(%fp) + jsr (%a3) + move.b arm+6,%d0 + clr.b %d1 + addq.l #8,%sp + add.l #49,%d0 + move.b %d0,-28(%fp) + move.b %d1,-27(%fp) + cmp.l %d3,%d4 + jne .L337 + pea .LC40 + move.l %d2,-(%sp) + move.b %d1,-36(%fp) + jsr (%a3) + addq.l #8,%sp + move.b arm+6,%d0 + add.l #49,%d0 + move.b %d0,-29(%fp) + clr.b %d0 + move.b %d0,-28(%fp) +.L338: + move.l %d2,-(%sp) + moveq #4,%d3 + pea 13.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + pea 7.w + pea 114.w + pea 12.w + pea 7.w + move.l 8(%fp),-(%sp) + jsr (%a5) + lea (36,%sp),%sp + move.l phase,%d0 + cmp.l %d0,%d3 + jne .L339 + move.l message,%d0 + tst.l %d0 + jne .L340 + move.l #.LC28,%d0 +.L340: + move.l %d0,-(%sp) + pea 27.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (16,%sp),%sp + move.l message2,%d0 + tst.l %d0 + jeq .L333 + move.l %d0,-(%sp) + pea 35.w +.L371: + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (16,%sp),%sp + jra .L333 +.L337: + subq.l #4,%d3 + tst.l %d3 + jne .L338 + move.l #.LC27,%d2 + jra .L338 +.L339: + subq.l #7,%d0 + tst.l %d0 + jne .L350 + pea .LC41 + pea 24.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + pea .LC42 + pea 31.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (28,%sp),%sp + move.l #.LC43,(%sp) +.L369: + pea 45.w + jra .L371 +.L350: + move.w #10,%a4 + move.l %fp,%d2 + clr.l %d3 + add.l #-24,%d2 +.L341: + moveq #84,%d0 + clr.b %d1 + move.l %d2,-(%sp) + pea 22.w + move.l %a4,-(%sp) + move.l 8(%fp),-(%sp) + move.b %d0,-24(%fp) + move.l %d3,%d0 + add.l #49,%d0 + move.b %d0,-23(%fp) + move.b %d1,-22(%fp) + jsr (%a2) + mvz.b arm+7,%d0 + lea (16,%sp),%sp + btst %d3,%d0 + jeq .L342 + pea 7.w + pea 12.w + pea 21.w + pea -1(%a4) + move.l 8(%fp),-(%sp) + jsr (%a5) + lea (20,%sp),%sp +.L342: + addq.l #1,%d3 + lea (14,%a4),%a4 + moveq #8,%d4 + cmp.l %d3,%d4 + jne .L341 + move.l phase,%d0 + moveq #1,%d1 + cmp.l %d0,%d1 + jne .L343 + clr.b %d3 + pea .LC44 + move.l %d2,-(%sp) + move.b %d3,-24(%fp) + jsr (%a3) + pea -40(%fp) + jsr (pass_steps.constprop.0) + lea (12,%sp),%sp + tst.l %d0 + jeq .L344 + moveq #9,%d4 + cmp.l %d0,%d4 + jcc .L351 + move.l %d0,%d1 + moveq #10,%d4 + divu.l %d4,%d1 + lea (-18,%fp),%a0 + add.l #48,%d1 + move.b %d1,-19(%fp) +.L345: + moveq #10,%d3 + remu.l %d3,%d1:%d0 + clr.b %d4 + add.l #48,%d1 + move.b %d1,(%a0) + move.b %d4,1(%a0) + tst.l -40(%fp) + jeq .L352 + move.l #.LC29,%d0 +.L346: + move.l %d0,-(%sp) +.L368: + move.l %d2,-(%sp) + jsr (%a3) + addq.l #4,%sp + move.l %d2,(%sp) + pea 31.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + pea .LC46 + pea 38.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (28,%sp),%sp + move.l #.LC47,(%sp) + jra .L369 +.L351: + lea (-19,%fp),%a0 + jra .L345 +.L352: + move.l #.LC30,%d0 + jra .L346 +.L344: + pea .LC45 + jra .L368 +.L343: + moveq #5,%d1 + cmp.l %d0,%d1 + jeq .L353 + subq.l #2,%d0 + tst.l %d0 + jne .L354 + move.l #.LC33,%d0 +.L348: + move.l %d0,-(%sp) + pea 31.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + pea .LC48 + pea 45.w + pea 10.w + move.l 8(%fp),-(%sp) + jsr (%a2) + lea (32,%sp),%sp + jra .L333 +.L353: + move.l #.LC32,%d0 + jra .L348 +.L354: + move.l #.LC31,%d0 + jra .L348 + .size module_draw, .-module_draw + .section .rodata + .type ticks.0, @object + .size ticks.0, 7 +ticks.0: + .base64 "AwQGCAwYMA==" + .globl bounce_part_menu + .text + .align 2 + .type bounce_part_menu, @object + .size bounce_part_menu, 24 +bounce_part_menu: + .long 1 + .long .LC27 + .long 3 + .long bounce_actions + .long bounce_choose + .long 0 + .section .rodata.str1.1 +.LC49: + .string "BOUNCE TRACK" +.LC50: + .string "RESET TRACK" +.LC51: + .string "UNDO" + .section .rodata + .align 2 + .type bounce_actions, @object + .size bounce_actions, 12 +bounce_actions: + .long .LC49 + .long .LC50 + .long .LC51 + .local lamp_mine + .comm lamp_mine,2,1 + .local lamp_stock + .comm lamp_stock,2,1 + .local lamps_on + .comm lamps_on,1,1 + .local sticky + .comm sticky,4,2 + .local wav_path + .comm wav_path,160,1 + .local wav_dir + .comm wav_dir,136,1 + .local wav_base + .comm wav_base,24,1 + .local wav_name + .comm wav_name,24,1 + .local prev_mode + .comm prev_mode,4,2 + .local prev_done_b + .comm prev_done_b,4,2 + .local prev_done_a + .comm prev_done_a,4,2 + .local saved_ticks + .comm saved_ticks,4,2 + .local assigning + .comm assigning,4,2 + .local wav_in_project + .comm wav_in_project,4,2 + .local wav_in + .comm wav_in,4,2 + .local wav_result + .comm wav_result,4,2 + .local saved_in + .comm saved_in,4,2 + .local saved_result + .comm saved_result,4,2 + .local note + .comm note,32,1 + .local part_buf + .comm part_buf,6322,1 + .local rec_copy + .comm rec_copy,12,1 + .local part_copy + .comm part_copy,6322,1 + .local record_new + .comm record_new,2330,1 + .local record_copy + .comm record_copy,2330,1 + .local undo_ready + .comm undo_ready,4,2 + .local last + .comm last,12,2 + .local arm + .comm arm,12,2 + .local message2 + .comm message2,4,2 + .local message + .comm message,4,2 + .local shown_ticks + .comm shown_ticks,4,2 + .local consumed_hi + .comm consumed_hi,4,2 + .local consumed_lo + .comm consumed_lo,4,2 + .local phase + .comm phase,4,2 + .type FRESH, @object + .size FRESH, 134 +FRESH: + .base64 "BAgAQAAAfwBPQAAAfwBPAEAAAEAAAAAAAAAAQAIBf0ABICAgAAAAAH9/QEB/AH8AQABALwB/AH8AAQAAAAFAAQAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAABAQAAAAAAAAEAAwAAAX8BAAAAAAAAAAABAUAACQEAAAD//wA=" + .align 2 + .type TRACK_BYTES, @object + .size TRACK_BYTES, 36 +TRACK_BYTES: + .word 0 + .byte 1 + .byte 1 + .word 8 + .byte 1 + .byte 1 + .word 34 + .byte 1 + .byte 1 + .word 42 + .byte 30 + .byte 30 + .word 282 + .byte 24 + .byte 24 + .word 474 + .byte 30 + .byte 30 + .word 714 + .byte 5 + .byte 5 + .word 754 + .byte 30 + .byte 30 + .word 1538 + .byte 12 + .byte 12 diff --git a/sdk/octatrack/modules/bounce/verify.py b/sdk/octatrack/modules/bounce/verify.py new file mode 100644 index 0000000000..47d02fdf6d --- /dev/null +++ b/sdk/octatrack/modules/bounce/verify.py @@ -0,0 +1,54 @@ +"""Bounce's gate: RESET TRACK's table is a fresh project's track, byte for byte. + +bounce.c's FRESH holds one track's Part bytes in TRACK_BYTES' order. A byte out +of place shifts every field after it: 0.2.0's table had one extra zero in the +second page group, and a reset track stayed silent, preview included, until a +Part reload (emulator, 2 December 2026). This compares FRESH, and the ranges' +sizes, with every track of a fresh project's bank 1 Part 1, read from +octabam's own fresh image (out/fresh/image/NOPROJ, made by octabam's build from +the developer's OS; nothing of it is in this repository). The slot bytes differ +per track and are set by reset_track, so they are left out. + +Run: python3 verify.py [OCTABAM_DIR] (default: $OCTABAM, then +~/.cache/modwerk-upstream/octabam, then sdk/octabam) +""" +import os, pathlib, re, sys + +HERE = pathlib.Path(__file__).resolve().parent +SRC = (HERE / "bounce.c").read_text() +RANGES = [(int(a, 0) if a.startswith("0x") else None, a, int(s), int(n)) + for a, s, n in re.findall(r"\{(P_\w+|0x[0-9a-f]+), (\d+), (\d+)\}", SRC.split("TRACK_BYTES[] = {", 1)[1].split("};", 1)[0])] +DEFINES = {m[0]: int(m[1], 16) for m in re.findall(r"#define (P_\w+)\s+(0x[0-9a-f]+)u", SRC)} +body = SRC.split("static const uint8_t FRESH[", 1)[1] +size = int(body.split("]", 1)[0]) +FRESH = [int(v, 16) for v in re.findall(r"0x([0-9a-f]{2})", body.split("{", 1)[1].split("};", 1)[0])] + +fails = [] +total = sum(n for *_, n in RANGES) +if len(FRESH) != size or size != total: + fails.append(f"FRESH has {len(FRESH)} bytes, is declared {size}, TRACK_BYTES covers {total}") + +candidates = [sys.argv[1]] if len(sys.argv) > 1 else [os.environ.get("OCTABAM", ""), + str(pathlib.Path.home() / ".cache/modwerk-upstream/octabam"), str(HERE.parents[1] / "octabam")] +bank = next((pathlib.Path(c) / "out/fresh/image/NOPROJ/bank01.work" for c in candidates + if c and (pathlib.Path(c) / "out/fresh/image/NOPROJ/bank01.work").is_file()), None) +if bank is None: + sys.exit("[FAIL] no fresh project: build octabam's fresh image (out/fresh/image/NOPROJ) or pass OCTABAM_DIR") +data = bank.read_bytes() +PART = 0x8eed6 + 9 # ot_project.PART_BASE, then the 9-byte record header: RAM offsets from here + +for t in range(8): + k = 0 + for _, name, stride, n in RANGES: + at = DEFINES[name] + stride * t + want = data[PART + at:PART + at + n] + have = bytes(FRESH[k:k + n]) + if name != "P_SLOTS" and have != want: + first = next(i for i in range(n) if have[i] != want[i]) + fails.append(f"T{t + 1} {name}: byte {first} is {have[first]:#04x}, a fresh project has {want[first]:#04x}" + f"\n fresh {want.hex(' ')}\n FRESH {have.hex(' ')}") + k += n + +if fails: + sys.exit("[FAIL] " + "\n[FAIL] ".join(dict.fromkeys(fails))) +print(f"[PASS] FRESH ({size} bytes) matches all 8 tracks of {bank.parent.name}'s Part 1 outside the slot bytes") diff --git a/src/catalog/module-documents.json b/src/catalog/module-documents.json index da0cfcdf1e..51ec524735 100644 --- a/src/catalog/module-documents.json +++ b/src/catalog/module-documents.json @@ -18693,6 +18693,297 @@ "declaration": "Original authored source by Nathaniel Pavel (@npp1993). Stock code is referenced by address only. No firmware, extracted stock routine or table, image, card or memory dump is included." }, "media": [] + }, + { + "schemaVersion": 2, + "id": "bounce", + "key": "BOUNCE", + "name": "Bounce In Place", + "version": "0.4.0-experimental", + "category": "system", + "access": { + "location": "Hold DOWN and press REC, or FUNC+PART (Part Edit) > BOUNCE.", + "steps": [ + "Select the destination track with its TRACK key.", + "Hold DOWN, then press REC: BOUNCE opens with the active track inverted; the active track's trig key lights red, the others you can tap yellow.", + "Press trig keys 1-8 to add or remove tracks, then YES to arm; NO closes without changes." + ], + "screenshots": [ + "media/ot-select.png", + "media/ot-recording.png", + "media/ot-bounced.png", + "media/ot-undo.png" + ] + }, + "author": { + "github": "seniorspiz", + "credits": [ + "seniorspiz" + ] + }, + "nativeManifest": "manifest.py", + "presentation": { + "label": "Bounce tracks in place", + "family": "Recording", + "summary": "Bounce one or more audio tracks into the active track as a Flex recording, one pattern long, saved as a WAV, without setting up the recorder by hand.", + "overview": "Bounce In Place records the active track, and any other tracks you pick, for exactly one pattern length (in per-track mode the track's own length; merged tracks until their lengths meet), with their effects. When the take ends, the active track becomes a Flex machine playing it, with its FX off, stock AMP and one trig on step 1, and the take is saved as a WAV (B-YYMMDD-HHMM) in the project's BOUNCES folder, with the track's buffer assigned to it, so it reloads once you save the project. The other merged tracks are muted with stock's mute. RESET TRACK makes a track a fresh STATIC track. UNDO brings back the last bounce or reset until the next power cycle or project change. It uses no effect slot.", + "highlights": [ + "Hold DOWN and press REC, or FUNC+PART > BOUNCE, to open BOUNCE for the active track.", + "Press trig keys 1-8 to merge more tracks into the active track's take; the active track lights red, merged tracks green, the others you can tap yellow.", + "Records on the instrument's own tempo and length, starting on the next step 1.", + "The take is saved in the project's BOUNCES folder, the track becomes a Flex machine playing it, and FUNC+PART > BOUNCE > UNDO brings the track back." + ], + "usage": [ + "Select the track to bounce into, then hold DOWN and press REC (or FUNC+PART > BOUNCE > BOUNCE).", + "Press trig keys 1-8 to merge those tracks in; press YES to arm. The take starts on the next step 1.", + "When BOUNCE reads BOUNCED, SAVED AS, the track plays the recording. FUNC+PART > BOUNCE > UNDO goes back." + ] + }, + "controls": [], + "compatibility": { + "firmware": "1.40C", + "effectId": null, + "location": "Audio tracks", + "conflicts": [], + "uiClaims": [ + "key:DOWN+REC", + "key:TRIG@BOUNCE" + ], + "limitations": [ + "Experimental: 0.4.0 (package ad2b4cfe) passed the test procedure on one MKII (a development twin in RAM), soak included, and by hand: bounce, cancel, UNDO. Its developer's own test of the same package (bounces, cancel and UNDO, a project save, reload and power cycle) worked, as reported.", + "The WAV is saved at once, but the track only keeps pointing to it after you save the project (as stock's own SAVE THIS RECORDING).", + "A full card: BOUNCE says NOT SAVED and the take stays in the recorder buffer; save it from the Audio Editor.", + "A pass longer than 64 master steps (4 bars at 1X) is refused.", + "Refuses T8 while MASTER TRACK is on, and a merged track whose cue level is 0.", + "A Grain or synth track: after the take, pick FLEX for it in the machine chooser yourself; a popup says so.", + "Bounces only while the sequencer plays; UNDO lasts until the next power cycle or project change.", + "While a take records, the frame interrupt carries about 6 points more; at rest nothing.", + "Not yet tested: a full card, Studio cue mode, MAIN TO CUE, an MKI." + ] + }, + "resources": { + "recorded": "2026-12-04", + "storage": { + "label": "ColdFire code", + "display": "26080 bytes", + "value": null, + "unit": "see display", + "method": "static", + "conditions": "The USB package ad2b4cfe: 8,284 bytes of ColdFire code and data and 17,796 bytes of bss (the Part and pattern snapshots for UNDO, 2,330 bytes of pattern record among them). No DSP memory.", + "source": "TESTING.md" + }, + "processing": { + "label": "ColdFire worst event", + "display": "2447620 cycles/event", + "value": null, + "unit": "see display", + "method": "emulator", + "conditions": "The dearest event in ot_emu (evidence/performance.json): the take's end, one bounded edit in the UI tick, 2,447,620 executed instructions against a 26,600,000-cycle responsiveness deadline; the dearest key press, RESET TRACK's YES, 247,832. Nothing runs in the frame interrupt.", + "source": "evidence/performance.json" + }, + "impact": { + "conditions": "One instance, the only kind there is. On the developer's MKII (development twin 7d1223b1 of base 0.8.5), the frame interrupt with the module installed and unused, the pattern playing (test:procedure step 9); while a take records, the T4 readings on twin 4813a3e5 (TESTING.md).", + "cpu": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "Installed and unused, the frame interrupt stayed at 28.4 % (0 points). While a take records, about 6 more points, because stock's recorder runs; nothing at rest.", + "source": "evidence/cpu-price.json" + }, + "dsp": { + "level": "minimal", + "basis": "measured-comparison", + "rationale": "No DSP code: the package carries no DSP words and uses no effect slot.", + "source": "evidence/performance.json" + }, + "memory": { + "level": "moderate", + "basis": "source-estimate", + "rationale": "26,080 bytes of ColdFire RAM for the one instance, most of it the UNDO snapshot (tests.qualification.memory).", + "source": "TESTING.md" + } + }, + "cpuPrice": { + "value": 0, + "unit": "percent-of-frame", + "measure": "frame-interrupt", + "tool": "npm run device:price -- --write", + "date": "2026-12-04", + "conditions": "the bank, pattern and Part the unit was on, transport stopped (test:procedure); base development twin 7d1223b1 of base 0.8.5, built from the developer's own 1.40C with USB MIDI, RAM-booted, never flashed; 3 readings of 8 s a state. Frame interrupt 28.6 % before, 28.6 % installed and used nowhere; CPU meter 41.1 % before, 40.9 % at rest.", + "source": "evidence/cpu-price.json" + } + }, + "tests": { + "report": "TESTING.md", + "summary": "npm run test:procedure on the developer's MKII (4 December 2026, development twin 7d1223b1 of base 0.8.5): steps 1-10 passed on package ad2b4cfe, including a 120 s soak of 2,400 operations and a CPU price of 0 points at rest. By hand on the same package: bounce, merge, cancel (UNDO, the recorder setup and the player's mutes kept) and UNDO, restoring the Part byte for byte; on 196de6d7 also RESET TRACK. The developer's own test of the same package (bounces, cancel and UNDO, mutes, a project save, reload and power cycle, a machine track) worked, as reported. perf:audit: worst event 2,447,620 instructions in ot_emu.", + "hardwareStatus": "reported", + "evidenceRevision": "819162bc660cfb480605b47c3c035b17c7a9de62", + "gates": [ + "Worst-case cycles under parameter modulation and maximum load", + "Exact memory region and maximum-instance totals", + "Owner-reviewed real-hardware evidence with actual coverage and limitations" + ], + "qualification": { + "documentation": { + "tutorial": { + "title": "Quick tutorial", + "steps": [ + "Select the track to bounce into with its TRACK key, here T1.", + "Hold DOWN and press REC: BOUNCE opens with T1 inverted and its trig key red.", + "Press trig key 2 to merge T2 into the take, then YES to arm it; press PLAY if the sequencer is stopped.", + "After one pattern pass BOUNCE reads BOUNCED, SAVED AS with the WAV's name: T1 plays the take as a Flex machine and T2 is muted. Save the project to keep the link.", + "To go back, FUNC+PART > BOUNCE > UNDO." + ] + }, + "screenshots": [ + "media/ot-select.png", + "media/ot-recording.png", + "media/ot-bounced.png", + "media/ot-undo.png" + ], + "screenshotStyle": "black-and-white" + }, + "moduleVersion": "0.4.0-experimental", + "sourceSha256": "e4790b5943d99a17d46362e813395e1364f8d414dcd64678981a095c8001ca34", + "imageSha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea", + "cycles": [ + { + "processor": "coldfire", + "worstCase": 2447620, + "maxConfiguration": 2447620, + "maxInstances": 1, + "budget": 26600000, + "unit": "cycles/event", + "method": "emulator", + "conditions": { + "parameterExtremes": "The dearest event: the end of a two-track take while playing (Flex conversion, UNDO's snapshot, mutes, stock's save started), 2,447,620 executed instructions in the UI tick; the dearest key press, RESET TRACK's YES, 247,832 (it snapshots the Part bytes and the 2,330-byte pattern record and writes a fresh track); UNDO 138,506-145,079; YES arming a merge 67,320. Read with ot_emu's watch/hits between the base's core_key (0x40061dc8-0x40061dce) and core_tick (0x40061e94-0x40061e9a) calls and their returns (octabam f7d72906, --dsp --frame, MKII panel, twin 4813a3e5 of base 0.8.5, package ad2b4cfe, 4 December 2026); each count includes stock code and interrupts inside the call. Instructions, not cycles.", + "parameterModulation": "Not applicable: the module has no parameters, LFO destinations or MIDI CCs; it acts on key presses and once per UI tick only while a take is armed.", + "modeSwitching": "In ot_emu, STOP, PLAY and a Part change (Part 1 to Part 2) between the stress run's two halves of ten RESET TRACK and UNDO pairs; on the unit, 12 Part switches in device:test with the package installed (test:procedure step 7).", + "maxLoad": "One instance (a ColdFire key and tick handler). The dearest edit touches one track's Part and pattern record and the merged tracks' mutes, at most eight tracks; the stress run kept the pattern playing throughout.", + "inputConditions": "Not applicable to the cost: no audio passes through the module's code. The take itself is stock's recorder, at most 64 master steps." + }, + "report": "evidence/performance.json" + } + ], + "memory": { + "regions": [ + { + "name": "ColdFire code and data of the USB package", + "space": "cpu-ram", + "words": 8284, + "wordBits": 8, + "bytes": 8284, + "scope": "shared" + }, + { + "name": "ColdFire bss of the USB package", + "space": "cpu-ram", + "words": 17796, + "wordBits": 8, + "bytes": 17796, + "scope": "shared" + } + ], + "perInstanceBytes": 0, + "sharedBytes": 26080, + "maxInstances": 1, + "totalBytes": 26080, + "conditions": "From the header of the USB package ad2b4cfe (ABI 8): code and data 8,284 bytes, bss 17,796 (the UNDO snapshot of one track's Part bytes, its 2,330-byte pattern record and the mutes). No DSP memory and no stock blocks reused; the stack is the UI task's own; the WAV is written by stock's own save jobs.", + "report": "TESTING.md" + }, + "hardware": { + "kind": "functional", + "status": "reported", + "model": "MKII", + "testedOn": "2026-12-04", + "tester": "seniorspiz", + "sourceRevision": "819162bc660cfb480605b47c3c035b17c7a9de62", + "imageSha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea", + "summary": "On the developer's Octatrack MKII (OS 1.40C), 4 December 2026, npm run test:procedure ran on package ad2b4cfe built from 819162bc on development twin 7d1223b1 of base 0.8.5 (RAM-booted, never flashed): software checks, beside every other module, cost model, emulator rehearsal, unit read, scripted pass, a 120 s soak of 2,400 operations, the CPU price (0 points of the frame interrupt at rest) and put back passed. By hand on the same package: a bounce, a cancelled take that kept UNDO, a cancel after a pattern change that put the recorder setup back, mutes changed during a take kept, and UNDO restoring the Part byte for byte. The developer then tested the same package (bounces by ear, cancel and UNDO, mutes, a project save, reload and power cycle, a machine track through PICK FLEX) and reported all of it working, without details per step; that trial ran on the flashed release base 0.8.5 (ddb56b72), and its readout shows a machine track through PICK FLEX, a merged take of three tracks and an UNDO.", + "limitations": [ + "The developer's own test of ad2b4cfe is as reported (\"all tested\"), without a record of each step; a Modwerk machine track through PICK FLEX was not run by the agent on this package.", + "Not tested: a WAV save onto a full card, Studio cue mode, MAIN TO CUE, and an MKI.", + "Not tested: another module with Part Edit rows (Kits, Pattern Sample Locks) installed at the same time.", + "No audio was recorded for evidence: how a take sounds is the developer's report." + ], + "report": "TESTING.md" + } + } + }, + "license": { + "spdx": "MIT", + "file": "LICENSE", + "declaration": "Original code by seniorspiz under MIT. No Elektron firmware, extracted routines or tables." + }, + "media": [ + { + "path": "media/ot-select.png", + "captureType": "emulator", + "caption": "Select the track to bounce into (here T1), hold DOWN and press REC: BOUNCE opens. Press trig key 2 to merge T2 into the take, then YES to arm it. The pass is one pattern long, here 16 steps.", + "alt": "The BOUNCE T1 window with T1 and T2 inverted in a row of track names T1 to T8, and the lines PASS 16 STEPS, TRIG 1-8: MERGE, YES: REC NO: CLOSE.", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "BOUNCE", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-recording.png", + "captureType": "emulator", + "caption": "Once armed, the take starts on the next pattern start while the sequencer plays and runs for one pass. NO cancels it and changes nothing.", + "alt": "The BOUNCE T1 window with T1 and T2 inverted and the lines RECORDING ONE PASS and NO: CANCEL.", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "BOUNCE", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-bounced.png", + "captureType": "emulator", + "caption": "After one pass the take is saved as a WAV in the project's BOUNCES folder, and T1 becomes a Flex machine playing it; the merged T2 is muted. Save the project to keep the track's link to the file.", + "alt": "The BOUNCE window reading BOUNCED, SAVED AS B1-261203-2328 over the main screen, with SRC FLEX on the bottom line.", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "BOUNCE", + "shows": "controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + }, + { + "path": "media/ot-undo.png", + "captureType": "emulator", + "caption": "FUNC+PART opens Part Edit, where the BOUNCE row holds BOUNCE TRACK, RESET TRACK and UNDO. UNDO gives the last bounced or reset track back its machine, settings, trigs and the merged tracks' mutes.", + "alt": "The PART EDIT window with PART and BOUNCE in the left column, BOUNCE selected, and BOUNCE TRACK, RESET TRACK and UNDO on the right, UNDO highlighted.", + "credit": "seniorspiz (headless capture)", + "license": "LicenseRef-OT-UI-Documentation", + "source": "original", + "otUi": { + "page": "PART EDIT", + "shows": "location-and-controls", + "firmware": "1.40C", + "moduleVersion": "0.4.0-experimental", + "imageSha256": "1d7a00b139d4eef4d8e99aff0f788435c4486187ac851fab775e375329d7c54b", + "setup": "Headless ot_emu (octabam f7d72906, the adapted emulator), MKII panel, --dsp --frame; the development twin 4813a3e5 of Modwerk base 0.8.5 built from the developer's own 1.40C, with package 196de6d7 in a trial over the emulated USB; an emulated card with a test project (BOUNCE), Part 2, pattern A01; the LCD as the panel link carries it (module_draw included), 128x64 at integer scale 6." + } + } + ] } ] } diff --git a/src/community/module-changelogs/bounce.json b/src/community/module-changelogs/bounce.json new file mode 100644 index 0000000000..71ddd97a8c --- /dev/null +++ b/src/community/module-changelogs/bounce.json @@ -0,0 +1,13 @@ +[ + { + "version": "0.4.0-experimental", + "date": "2026-12-03", + "changes": [ + "Hold DOWN and press REC (or FUNC+PART > BOUNCE) to record the active track for one pattern length, with its FX, without setting up the recorder.", + "Trig keys 1-8 merge other tracks into the take; the keys light red for the track you bounce into, green for merged tracks, yellow for the rest.", + "The track becomes a Flex machine playing the take, saved as a WAV in the project's BOUNCES folder; save the project to keep the link.", + "FUNC+PART > BOUNCE > RESET TRACK makes a track a fresh STATIC track, and UNDO brings back the last bounced or reset track.", + "Known issue: a pass longer than 4 bars at 1X is refused, and a Grain or synth track needs FLEX picked by hand after the take." + ] + } +] diff --git a/src/engine/assets/module-build.json b/src/engine/assets/module-build.json index 748c440632..d10e05ecd9 100644 --- a/src/engine/assets/module-build.json +++ b/src/engine/assets/module-build.json @@ -1,10 +1,10 @@ { "schemaVersion": 1, "kind": "source-packages", - "sourceCommit": "aeab9f2c62f7eb212cba35a9762bbd780f85b98c", + "sourceCommit": "33ba4c6faff81bfe7fe90426ddaa0f168cbc3332", "nativeRevision": "b8deefc88b2c3e5f3c6158e364eb741df1924e1d", - "sourceTreeSha256": "1d04cebce91c1b3602fc31b38a7eac7ce7ed1aad073e379ccc2f1e7442d6c595", - "compilerSha256": "f7df23786c873b87f5d6f4c781f3cefe798a1ae0d1be46a873e31d0731b7da45", + "sourceTreeSha256": "66e9d69f32f72510f0f7b4aa9329562527f30a8f397634ec5c5f79c4dc66c55b", + "compilerSha256": "300a345e5a1cef4a1e241c3160c1aba0cec57c7b4b492d14e5b88ae90d34e949", "moduleVersions": { "miniverb": "0.2.3-experimental", "tapeecho": "0.1.9-experimental", @@ -50,7 +50,8 @@ "songbook": "0.1.0-experimental", "arr-rows": "0.2.0-experimental", "smart-reload": "0.1.0-experimental", - "defrost": "0.1.0-experimental" + "defrost": "0.1.0-experimental", + "bounce": "0.4.0-experimental" }, "files": { "dsp-packages.json": { @@ -86,8 +87,8 @@ "sha256": "6f4823e51ae30e79f387f2e83dc684c74c7547be223f2e4246c7d51096aa6df5" }, "requested-packages.json": { - "bytes": 1479316, - "sha256": "eabbb13105d5f6f4d97488d229c2f5d5ed60bc75056106dccfc1cbff99567023" + "bytes": 1508419, + "sha256": "dbfd1c800b9a8fb817ead0a5af382d0058b5d4c884cd57becc0793793315e6d7" }, "utility-packages.json": { "bytes": 11735, diff --git a/src/engine/assets/octatrack-module-packages.json b/src/engine/assets/octatrack-module-packages.json index b0fb60d6c3..52a4b25002 100644 --- a/src/engine/assets/octatrack-module-packages.json +++ b/src/engine/assets/octatrack-module-packages.json @@ -1013,6 +1013,21 @@ "module": "a7af7e7b", "bytes": 1020, "sha256": "c44725aabe4c9a9752e864d2a625b7479e83147277ff83513875dffa2127b0a7" + }, + { + "id": "bounce", + "octabam": true, + "version": "0.4.0-experimental", + "path": "octatrack-modules/bounce/0.4.0-experimental.mwrm", + "abi": 8, + "features": 128, + "sites": 0, + "copies": 0, + "fills": 0, + "name": "Bounce In Place", + "module": "4d6723e5", + "bytes": 9632, + "sha256": "ad2b4cfeab5688dea5c003cb56ebb07be92454035b051df2b608fc07c81188ea" } ], "usbAudio": { diff --git a/src/engine/assets/requested-packages.json b/src/engine/assets/requested-packages.json index 3f4ef2ea85..0dcd8d9725 100644 --- a/src/engine/assets/requested-packages.json +++ b/src/engine/assets/requested-packages.json @@ -1567,6 +1567,29 @@ "placement": "linked", "poolBaseLiterals": 0, "variants": [] + }, + { + "label": "bounce", + "moduleId": "bounce", + "version": "0.4.0-experimental", + "key": "BOUNCE", + "author": "seniorspiz", + "nativeAuthor": "seniorspiz", + "cpu": "54455", + "dram": true, + "caveAddress": null, + "source": "modules/bounce/unit.s", + "sources": { + "modules/bounce/unit.s": "c77fa99d0d4e05bc77b1cf628f7d41e842f84e9762e1823105558d0f06b4bc7d", + "modules/bounce/manifest.py": "27e8a39dcedcb52242e3ffcecc5a4cd2e5a07e2863e01f43507a31b4d85753a9" + }, + "bytes": 14052, + "code": "7f454c46010201000000000000000000000100040000000100000000000000000000352c000000260034000000000028000b000a2f0a206f00084280226f000cb0af00106604245f4e7545f1080011920800528060ea4feffff048d7003c263946c82456206f00141439100b14d01039100b14cf123980000000324020030680bff1de200c80009180c0630c42804cd7003c4fef00104e752a3c0009b3404c4500044a8466e67182e88866e03a097185e48866d87181e68866d24ab98000001266ca1142000411450005114100062083700160ba206f0008226f00042010b091670442804e7573a9000471a80004b08166f01029000512280005b3804a0057c07100448060de2f0b2f0a226f001440c046fc270091c847f18800246f000c15938800246f0010159388005288b1ef001866e446c0245f265f4e752f02302f000e226f0008c0fc001ed3c01029003c30401029003d1229003e340875822042741941e8ffbfb48864064280241f4e7571807419204041e8ffbfb488640c0680ffffffd07409b48065e053817381703eb08165d6206f00087401222f000c10301822b5804a0057c07100448060be41ef0004700423c000000000700142b90000000042b90000000023d00000000042b90000000023c046c7c72c4e754879000000004ebaffca588f203c0000000023c000000000700123c0000000004e7542b900000000700142b90000000023c046c7c72c4e7522390000000070094feffff42f0eb08165207001e3a8220002810000012c4a81662c0280000002404a80670642b9000000004def00042f0e4ebafe0a588f4a8066144879000000004ebaff50588f2c5f4fef000c4e754878000c2f0e4879000000004ebafdbe42b90000000073af001670014fef000ce3a813c000000000700123c00000000023c046c7c72c60c041ef0004700123d00000000023c0000000004e7541ef0004700123d00000000023c0000000004e754fefffe848d7007c282f00247a01222f00202601d6af0028d8af002cb283644c2001e7885e802f400014202f0024602c2400e68a226f001493c27407c480d3ef001c204224052c08edaa1c1130464aaf003067102c08848612825280b08465d0528160b846822c08c48660ec4cd7007c4fef00184e754fefffec48d7007c282f00207a01206f001c2608d6af0024d8af002873c8202f0020e7895e817c07cc802400e68a2241528093c2d3ef00182405edaa1c11bd821282b88062e05288b68862d04cd7007c4fef00144e754feffff048d71c04242f0014266f0018286f001c48780001487800012f2f00282f0c2f0b2f0245faff0c4e9248780001487800012f2f0040202f0048487408ff2f0b2f024e924fef0030487800012f2f0028487800012f0c2f0b2f024e92487800012f2f0040487800012f0c202f0048487308ff2f024e924cef1c0400304fef00404e754fefffe4224f207c400bf10a200f22d8b1fc400bf12666f62f6f0020000c2f2f002c4878ffff723b92af00302f012f2f00302f002f3c400ba8764eb940012bd84fef00344e75206f00041010224852884a0066f64280206f0008123008001381080052804a0166ee4e75207c46c8d198203c00000000b090661220b90000000041f90000000023d046c8d194207c460bcfc84a90660620b9000000004e754fefffec428148d70c1c43f900000000428271a9000277d1266f001891c8246f0018d5c2c0ef001ed08377a90003d7c0068000000000b6886216d483528158897009b08166cc4cd70c1c4fef00144e754aaf0020670c1833880011840800528860d41832880060f22f0a226f0008428041f90000000045f108001192080052800c80000018b266ee245f4e75202f000440c146fc270023c08000000823c0100b14d446c142a742a742a742a742a74878001a4eb9400053d84fef00184e7573b9000000007001e3a873b9000000007180b0816728207c800000082039000000002210028000ff00000281ff00ffff8081b09067082f004ebaff94588f4e75223946c824564feffff048d7040cb2b90000000066761039100b14cf30401039000000002608758022427403c682b689665a488016390000000006810008ed802041c0fc18b2487008004ebaff1e7183588f43f900000000c0fc000c20404280d1fc0000000045f10800720c119208005280b28066f071b9000000002f004879000000004eb940029a4c508f4cd7040c4fef00104e754fefffd8720648d73cfc206f002c247c00008e55267c00008e534282287c00008e5493c94285429071b90000000079b900000000c0fc8ed82040d1f900000000d5c8d7c8d9c841e800510b0467604a12677e1c28ffff4a12677a161077837006b0836500008871864a06675a2c3c000000002a4677b53800c0c34a806748b089630222404a826626260024014c4320072c03240626074a8766f24c4610014c0018000c810000018052c275024482528541e8091a7008b08566904a82661a200174064c4200004cd73cfc4fef00284e751c13608216146084206f002c7001208020095a800c80000001856304428060d674064c42000060ce4fefffd848d77c0c246f002c97cb2c6f003049faf9b075aa000471aa0006c4fc8ed8c0fc091ad4802a422002dbd2487800592f0e06801001614e2f002f0d4e944fef0010260d06830000005941ee00592242d3fc100161a72f48002448780020206f00284870b80048739800487338002f4900304e944fef001047eb0020226f0020b7fc0000080066d2487800c1267c46c7d48c486e08590682100169a72f02486d08594e9471aa0004387c00014fef001073aa0006c0fc8ed8c2fc091a2040d1c1d1d241e8005993c9103098005289721fb289665846804a0056c07100448073aa0006240ce3aa12134a80674e828216c141e80020b7fc46c7d4cc66ca20527001d1fc0009b3322080700123c0100f85984eb940027e0071aa00064cd77c0c2f40002c4fef00284ef94009da2071800c80000000ff6792700160a44682c28260ae4feffff048d70c0c4ab946105408671877b9000000003003c0fc002c2040d1fc46c938d44a906e0c4cd70c0c4fef00106000f9244eb9400819fc247c40013a0820432f00486800014879000000004879000000004e92267946c823fa243946c8240a4eb940024eec4fef00104a8056c17301448123c1000000004a80670000bc42a742a74eb9400252302f004879000000004879000000004e924fef00144a8b67864a8267824879000000004e93588f4a80661248790000000020424e90588f4a806d00ff6448790000000074014879000000004879000000004eb940013a084fef000c487900000000247c40013a084879000000004879000000004879000000004e924879000000004e934fef00144a8067427063b0826700ff0e52822f024879000000004879000000004879000000004e924fef001060aa2f3c100f84804879000000004879000000004e924fef000c6000ff4a4879000000004879000000002f3c460be9f04e92068300000080247c800000a4700123c0460be9e8207c460bcfc823c3460be9ec203c0000000023d000000000207c46c8d19423d000000000207c46c8d19823d00000000042b9460bcfc823c046c8d194700841faf85e23c846c8d19842b90000000042b90000000042b90000000042b90000000023c000000000700123c046c7c72c261224b9000000002f3c460be9f04eb94002416824834cef0c0c00104fef00204e754feffff048d7041c246f0014242f0018262f001c71aa00052f004879000000004eb940029a4c508f41f90000000071b02822b680671e2f43001c2f42001871aa00054cd7041c2f4000144fef00104ef9400972fc1039100b14cf122a00057803c0847781b083662c4a398000001566241039100b14ce2f42001c4cd7041c73012f41001871802f4000144fef00104ef940001f184cd7041c4fef00104e754e56ffd471b90000000048d71c7c18390000000045f900000000c0fc18b22652d7fc0008ed80d7c07584284249ec002277b3c800486efffc4ebafae02f0b2d40fff44ebaf9aa3002508f43f900000000c0fc000c20404280d1fc0000000047f10800720c119308005280b28066f030027a0143f9000000000684ffffff8042064281c0fc00051385c800387c01da138628001386280841f108003002114402cbc0fc001e5c8026417805d7fc400d320cb8816500011c307c002a2a017c064c465004d1c9d1c0528111934800780cb88166d432027c7f2a3c7f7f4040c2fc00182041d1fc000000001146000b42a80003214500072f032f024879000000004ebafe624fef000c428141f90000000043f90000000047f118001193180052810c810000091a66ee428042017840118108005280b88066f27a01428041f90000000013c50000000050c65280118608ff0c800000080066f071b9000000002052d1fc00008e55c0fc8ed84a30080067184aaefff46712700241eefff713d00000000013c0000000004879000000004879000000004ebafa7e123900000000508f7001e5a8207c800000084680c0817180e1888090b09067082f004ebaf858588f4cee1c7cffd4720123c1000000004e5e4e75204c6000fee64fefffe47202202f002048d74404b280660001242239000000007009b08165307001e3a8220002810000012c4a8166680280000002404a806716223c000000002f4100204cd744044fef001c6000f4584ab900000000660c203c000000002f40002060e0240f0682000000102f024ebaf2e0588f45faf4304a8067124879000000002f024ebaf348508f4a8066144879000000004e92588f4cd744044fef001c4e7571b90000000075b9000000004df9000000002056d1fc0008ed80c0fc18b2d1c0123028221f41000f2f084ebaf74a487800012f024879000000004ebaf6d271af001f2f002f022f0e4ebafca04879000000002f0e4ebaf94471b9000000004fef0024207c800000082210243900000000e188b382c082b380b09067082f004ebaf71a588f42b9000000004879000000006000ff604a806700008e2239000000007009b08165227001e3a8220002810000012c4a816600ff400280000002404a80670642b900000000240f0682000000102f024ebaf1da588f4a80660e4879000000004ebaf3206000ff0c4878000c2f024879000000004ebaf19442b90000000073af002270014fef000ce3a8720723c10000000013c000000000700123c046c7c72c6000fed24cd744044fef001c6000f33a73b900000000598f2eaf00083001c0fc00a82040d1fc800049d94a10671242a7487800802f014eb9400051784fef000c4ebaf6a84ebaf6642f570008588f6000f29220390000000072054fefffc048d75cfcb280660000b64ab9800065b8672c71b9000000004878000174022f3c0000c0107c012f004eb94000517823c20000000023c646c7c72c4fef000c3c7c000178012f3c460ba9c04eb9400009f4428347f90000000045f90000000041f90000000042801f500033588f2840d9fc460ba98c14144a2f002f670a7bb208007382ba816704178208004a84670003da73b9000000002c0091c8e58e7bb9000000002f41003042012246b3ef0030660002e67e012c08edaf8287600002ea7e02be80662c71b900000000c0fc00a82040d1fc800049d94a106700ff647003720123c00000000023c146c7c72c6000ff507403b480660001364ab9800065b866104879000000004ebafeaa588f6000010677b90000000047f9000000003003c0fc00a82040d1fc800049d94a106600ff10240f0682000000342f024ebaeff2588f4a80670e2f0b2f024ebaf062508f4a80660848790000000060ac2003068011b1ff89e58820404a90660848790000000060944ebaf5184ebaf4d471b9000000002853240c06820008ed80487818b2c0fc18b245faef78d4802f024879000000004e9271b9000000004878091a73b900000000c0fc8ed8c2fc091a2040d1c14870c8004879000000004e924878000c2f0b4879000000004e924fef0020207c8000000823d0000000002e832f0242b9000000004ebaf01e508f4a80670000aa7009720123c00000000042b90000000023c146c7c72c2039000000007403b480650001664a80670001226000fe147406b48067067c09bc80667a45f900000000280f06840000003424122f041639000000004ebaeedc588f4a80670e2f0a2f044ebaef4c508f4a80660e4879000000004ebaf0146000fe96778371b9000000002042d1fc0008ed80c6fc18b2d1c373b0082253814a8166d22f002f084ebaef76508f4a806600ff704ebaf9604ebaf6b06000ff647208b280660000a24ab900000000672e4ebaf2964ab9000000006c084ebaefe26000ff40487900000000243c000000004ebaefa023c2000000006000fe1c4ab900000000673a4ab90000000066327c0123c6000000004ab9000000006c064ebaf24860b8247c800000a4241224b90000000042a74eb94002414824826000fdda203900000000528023c0000000000c800000070862c84a3900000000670000a442849dce6000fcec59804a806600feb44ab90000000066de203900000000528023c000000000725ab28064ca4ebaef546000fe905b804a8066bc6000fcb070016000fcd82e090f05670000b67c022e08efae8286528954887e08be886600fcfa2040d1fc460ba9ae1a10bb8175827b81ba826704188176011581080053804a8066bc4a8367064eb9400136a8340e2f3c460ba9c04eb940000ab4588f13c20000000071b9000000007c187e092239800065b875b900000000c0fc00a84a8156c1484242422040d1fc800049d9203900000000eda873014481efa980b90000000080824cd75cfc80814a1056c1206f004473014481e189808120804fef00404e757c07bc89660a4a39800000346600ff467e036000fc4e123308006000ff504e56ffcc723f48d70cfc282e0008202e000cb284650004d4741fb4846d2e22390000000045f900000000741f7601c484e5ab2401c4834a8066204a82670004ae4683c68124837001600004a222390000000045f90000000060d04a8266e82039000000007208b280670004807209b28066227406700123c20000000023c046c7c72c0684ffffffcf2d44ffecb0846428600004584a8067067206b280661e7429b48466000446103946100b1c08000000670004384ebaedc48792608a7207b280660001d67431b484660001be2c0e0686fffffff42f064ebaebe6588f4a8067221a2efffa71b9000000007585b08266124879000000002f064ebaec42508f4a806608487900000000603071aefff9206efff42e0806870008ed802f02c0fc18b22d48ffecde802f074ebaec78508f28004a8067104879000000004ebaecd8588f6000ff763002c0fc00a82040d1fc800049d94a10670848790000000060dc7001e5a8207c8000000847faeb321d40fffb2d50fffc487818b22f074879000000004e934878091a320271aefff8c0fc8ed8c2fc091a2040d1c1222effec487018004879000000004e9341f9000000007fb028222f084ebaefd042a72f024879000000004ebaef5a4fef00243002c0fc00052040d1fc000000001145000110850685ffffff80114500042e872f022f064ebaf50a4fef000c41f9000000004280220842021182080052800c800000091a66f050c0207caaaaaaaa23c80000000023c80000000041f90000000033d00000000041f90000000013c00000000050c25284118248ff0c840000080066f041f90000000013d0000000002f012f064ebaf14c4878000c2f064879000000004e93487900000000700123c0000000004ebaeb964fef00186000fe327232b2846600025c4ebaebd26000fe227201b280660002587007b0846d2871b900000000b08467127001123900000000e9a8b38013c000000000720123c146c7c72c6000fdec7031b0846600020a280e0684fffffff42f044ebae9dc588f4a806700fe184879000000002f044ebaea46508f4a806700fe041c390000000071aefffa7f86be806600fdf2486efff04ebaef9a588f26404a80660a4879000000006000fe101a39000000004a39800000346600011e7801efac7b857984b8856600012a3007c0fc00a82040d1fc800049d94a106600fdfa320771b900000000207c8000000823d00000000024390000000006820008ed80c0fc18b24878000cc2fc000cd480204141e80602487028002d48ffec4879000000004ebae8fa2f024ebaedde4fef0010206effecd1fc000000002d48ffec200b5380425011400002b8856600010852864200206effec114600041140000971b9000000002f004879000000004eb940029a4c508fb885672071b900000000223900000000484042400281ff00ffff82802f014ebaed98588f2007068011b1ff89e588204042904ab9800065b8670000ac487800012f3c0000c0102f074eb9400051784fef000c700223c000000000700123c046c7c72c6000fc624a056c00fee04879000000006000fcd424017008b0816700feda22025281050567ee71c2d0802040d1fc80000c514a1066de4201487900000000283c000000002f0447faec2a06820000003113c1000000004e9313c20000000042024879000000002f0413c2000000004e932f044ebae94c4fef00146000fbe87c0a6000fef870056000ff6a7232b2846700fdac4ebae97c42804cee0cfcffcc4e5e4e7522005581e28967065b804a8066147432b48466e04879000000004ebaf6306000fc284ebae94a0684ffffffcf2d44ffec70016000fb622239000000002f027407b48157c07401b48157c1241f44804481808171804e754e56ffbc70f748d73c1c263900000000c0834a806700009c4aae00086700009447faeb58700649fae9bc45faeb084bfaea2ab083660000864201487900000000240e0682ffffffe82f0242031d41ffe84e931039000000001d43fff34879000000002f020680000000311d40fff24e9342a748780008487800804878003842a72f2e00084e944fef00242e8248780039487800022f2e00084e9248780008487800804878003842a72f2e00084e954fef00244cee3c1cffbc4e5e4e75283c000000007009b083660000b04201487900000000240e0682ffffffe82f0242031d41ffe84e931039000000001d43fff14879000000002f020680000000311d40fff04e9342a74878001a4878006048780012487800102f2e00084e944fef00284878001a48780060487800124878001020442f2e00084e9048790000000048780015487800142f2e00084e924fef0024487800074878005e48780014487800112f2e00084e952f0248780020487800142f2e00084e926000ff3842a74878002c487800744878000a48780006240e0682ffffffdc2f2e00084e944878002c487800744878000a48780006204478072f2e00084e9042004fef00282ebc000000002f021d40ffdc4e931039000000004201508f0680000000311d40ffe41d41ffe5b883660000a64879000000002f021d41ffdc4e93508f1039000000000680000000311d40ffe342001d40ffe42f0276044878000d4878000a2f2e00084e9248780007487800724878000c487800072f2e00084e954fef0024203900000000b680665a2039000000004a806606203c000000002f004878001b4878000a2f2e00084e924fef00102039000000004a806700fe442f00487800234878000a2f2e00084e924fef00106000fe2c59834a836600ff7c243c000000006000ff725f804a806638487900000000487800184878000a2f2e00084e924879000000004878001f4878000a2f2e00084e924fef001c2ebc000000004878002d609e387c000a240e42830682ffffffe8705442012f02487800162f0c2f2e00081d40ffe820030680000000311d40ffe91d41ffea4e9271b9000000004fef00100700671a487800074878000c48780015486cffff2f2e00084e954fef0014528349ec000e7808b88366a62039000000007201b280660000b042034879000000002f021d43ffe84e93486effd84ebaea024fef000c4a80670000867809b88064702200780a4c44100141eeffee0681000000301d41ffed760a4c43000142040681000000301081114400014aaeffd86746203c000000002f002f024e93588f2e824878001f4878000a2f2e00084e92487900000000487800264878000a2f2e00084e924fef001c2ebc000000006000feee41eeffed60a0203c0000000060b848790000000060b27205b280673855804a80663a203c000000002f004878001f4878000a2f2e00084e924879000000004878002d4878000a2f2e00084e924fef00206000fc7a203c0000000060cc203c0000000060c400000001000000000000000300000000000000000000000000004e4f542053415645443a2054414b4520494e20425546464552005341564520495420494e20415544494f20454449544f5200415544494f20545241434b53204f4e4c59004225642d25730025732f424f554e4345530025732f415544494f2f424f554e4345530025732f25732e7761760025732d256400257300424f554e4345532f25730054414b45204c45465420494e20425546464552004e4f5448494e4720544f20554e444f00554e444f3a204f50454e20495453205041545445524e00554e444f4e450053544f50504544202d204e4f20424f554e4345005041545445524e204348414e4745440054414b4520494e434f4d504c45544500424f554e4345442c20534156454420415300545241434b204348414e474544005049434b20535441544943204649525354005245434f52444552204255535900545241434b2052455345540050415353204f56455220363420535445505300543820495320544845204d415354455220545241434b00540020435545204c4556454c204953203000424f554e43452043414e43454c4c454400424f554e4345000020284c4f4e474553542900205354455053005245434f5244494e47204f4e45205041535300505245535320504c4159005741495400424f554e4345443a205400205049434b20464c4558004348414e474520540020544f20464c45580054414b45205245434f5244454400424f554e4345205400524553455420540053544f434b2053544154494320545241434b004e4f2054524947532c204e4f204c4f434b53005945533a205245534554204e4f3a204241434b005041535320004f564552203634205354455053005452494720312d383a204d45524745005945533a2052454320204e4f3a20434c4f5345004e4f3a2043414e43454c00424f554e434520545241434b00524553455420545241434b00554e444f0000030406080c1830000000000000000000000000000408004000007f004f4000007f004f0040000040000000000000004002017f4001202020000000007f7f40407f007f004000402f007f007f00010000000140010000000140000000000000000000000000000000000140000000000000000000000001010000000000000100030000017f010000000000000000010140000901000000ffff00000001010008010100220101002a1e1e011a181801da1e1e02ca050502f21e1e06020c0c0000000000000000000000000000000000000000000100000000000000000400fff1000000000000000000000000030000010000000000000000000000000300000300000000000000000000000003000004000001770000000000000022020000010000000a000000220000007e0200000100000012000000a000000032020000010000001d000000d200000034020000010000002800000106000000720200000100000038000001780000002e020000010000003d0000457e0000000401000004000000430000456a00000004010000040000004c000000060000000401000004000000530000456e00000004010000040000005b0000457200000004010000040000000000000000000000000300000500000067000001a6000000220200000100000071000001c800000016020000010000007c000001de0000008e02000001000000880000455e0000000c010000040000006b0000026c00000014020000010000008c00000186000000040100000400000099000001820000000401000004000000a2000002800000001402000001000000ac0000017e0000000401000004000000b70000017a0000000401000004000000be000002940000007602000001000000c30000030a0000005602000001000000ca000003600000008402000001000000d4000003e40000004602000001000000d90000042a0000002402000001000000e00000044e0000003402000001000000f2000001660000000401000004000000fe0000016a00000004010000040000010a000001620000000401000004000001140000048200000068020000010000012a0000009a000000240100000600000136000001aa000018b2010000040000013f000004ea0000002402000001000001500000050e00000032020000010000015a000005400000004002000001000001670000058000000096020000010000017300001a5c0000000c010000040000017c00000616000000f802000001000001930000000000000007010000060000019b0000070e0000014202000001000001a8000008500000020e02000001000001b2000001320000001801000004000001bb000001760000000401000004000001ca000000aa0000008801000004000001d20000014a0000001801000004000001db0000000a000000a001000004000001e4000001720000000401000004000001ee0000016e0000000401000004000001fa00000a5e0000009e020000010000020000000afc000001d6020000010000020b0000331a0000091a010000040000021600003c340000091a01000004000002220000454e00000004010000040000022d00000cd2000001d4020000010000023b000045520000000c010000040000024000001a68000018b2010000040000024a00000ea60000004202000001000002510000000200000002010000040000025c000000000000000201000004000002660000000400000001010000040000026f0000457a00000004010000040000027b000045760000000401000004000002870000001400000086010000060000028d0000018a00000020010000040000000000000000000000000300000600000292000000080000000c01000006000002a100000ee80000047c12000001000002ad000013640000052c12000001000002b8000018900000002012000001000002c3000018b00000044a12000001000002cf00001cfa000000181100000100626f756e63652e630063757272656e740073616d655f706c6163650077726974655f7370616e006d6f647765726b5f6d616368696e650073686f77007068617365006d6573736167653200737469636b79006d6573736167650073686f776e5f7469636b73006e6f745f736176656400636c6f73655f76696577006f70656e5f73656c6563740061726d0073617665645f726573756c740073617665645f696e007761765f7361766564007761765f726573756c74007761765f696e0066696c6c00696e76657274006672616d655f626f78007465787400617070656e6400736176655f646f6e655f726573746f726500707265765f646f6e655f6200707265765f646f6e655f6100707265765f6d6f6465007075745f747261636b2e636f6e737470726f702e3000545241434b5f425954455300706172745f62756600636f70792e636f6e737470726f702e30007365745f6d7574657300726573746f72655f6375657300726573746f72655f726563007265635f636f707900706173735f73746570732e636f6e737470726f702e30007469636b732e300077726974655f7265636f726400736176655f74616b65007761765f62617365007761765f696e5f70726f6a656374007761765f646972007761765f6e616d65007761765f706174680061737369676e696e670073617665645f7469636b73007061737465006170706c795f636c6970007265636f72645f6e6577007265636f72645f636f707900756e646f5f726561647900626f756e63655f63686f6f7365006c61737400706172745f636f70790063616e63656c006c616d705f73746f636b006c616d705f6d696e65006c616d70735f6f6e00636f6e73756d65645f6c6f00636f6e73756d65645f6869004652455348006e6f746500626f756e63655f616374696f6e73006d6f64756c655f7469636b006d6f64756c655f6b6579006d6f64756c655f656e63006d6f64756c655f6472617700626f756e63655f706172745f6d656e750000000180000004010000457e00000188000004010000456a0000018e000004010000000600000194000004010000456e0000019a0000040100004572000001b4000010010000001a000001ba000004010000456a000001c20000040100000006000001ca000004010000457e000001d2000004010000456e0000020c000004010000457e00000246000004010000456e00000258000004010000456500000260000004010000457e0000027400000401000001860000027a000004010000018200000288000004010000017e0000028e000004010000017a00000456000002010000026c000004b400000401000001aa00000590000004010000455e000005e200000401000007ac000006840000470100000000000008c60000040100000176000009dc0000020100000280000009e20000040100000162000009ee000004010000016a000009fa000004010000016600000a18000004010000018200000a1e000004010000017a00000a24000004010000017200000a2a000004010000016e00000a30000004010000457e00000b5600000401000007ac00000be000000401000002c400000c3e000004010000332100000c78000004010000336a00000c7e000004010000336b00000cc4000004010000454e00000d0e000010010000008500000d2c000010010000009900000dfa000004010000454e00000e38000004010000457e00000e70000004010000456e00000e84000004010000457e00000e8a000004010000456500000f24000004010000457e00000fd6000004010000457e000010d8000004010000455a000010e2000004010000454e000010f8000004010000457e000010fe000004010000456e000011d2000004010000014a000011dc000004010000456a000011f8000004010000017200001230000004010000016e0000123e0000040100000004000012680000040100004572000012e40000040100000004000013dc000004010000457e0000153800000401000004740000157e000004010000335a00001584000004010000335e00001590000004010000336a0000159c000004010000336d000015b80000040100003c33000015dc000004010000454e000016220000040100004565000016d200000401000045660000171800000401000001aa000017ac000004010000457e000017f8000004010000018a0000180a000004010000018a00001812000004010000018b00001822000004010000018c0000196e000002010000036000001a6a000010010000020700001afc000010010000019b00001b42000010010000019400001b7e000010010000023e00001c58000010010000019c00001c8e000010010000027600001c9e00001001000001a700001cba00001001000001cc00001cec00001001000001c100001cf400001001000001ae00001cfe000010010000019400001d06000047010000000800001d0a0000020100000cd2000001a80000100100000000000001e0000004010000457e0000022200001001000000320000023c000004010000455e00000460000004010000016600000466000004010000016a0000047c00000401000001620000048e000047010000009a000004f400000401000001aa0000054200000401000045640000054c00000401000045650000055e0000040100004566000005a00000040100004563000005b60000040100004564000005d40000040100001a5c000005f800000401000045630000060000000401000001aa00000640000004010000456200000646000004010000456500000652000004010000455e0000086200000401000045640000089a0000100100000044000008a00000040100000132000008de000010010000004b000008e400000401000000aa000008f800000401000000aa0000090600000401000000aa00000918000004010000013200000920000010010000007700000926000004010000014a00000936000004010000014a0000094200000401000000aa0000094800001001000000670000094e000004010000000a00000956000004010000000a0000097200000401000001320000097800001001000000710000097e000004010000014a0000099200001001000000560000099800000401000000aa000009a8000004010000014a000009ae000010010000007a00000a40000004010000017600000a7a00000401000001aa00000a8800000401000001aa00000b02000004010000456300000b0c000004010000456400000b12000004010000455e00000b480000040100001a5c00000b7000000401000001aa00000bf6000004010000455e00000c06000004010000331a00000c0c0000040100003c3400000c38000004010000337300000c54000004010000456200000c84000004010000331a00000c8a000004010000455e00000c94000004010000456500000ce8000004010000457e00000d24000004010000454e00000d50000004010000455200000d6200001001000000a900000d76000004010000455700000d7c000004010000455800000d82000004010000455200000daa0000040100001a6800000dc20000040100003c3400000dce000004010000455900000de0000004010000455a00000e0000001001000000c000000e10000004010000457e00000e52000010010000003200000e66000004010000455e00000ea8000004010000456400000eea000004010000457e00000f08000004010000456400000f48000004010000000200000f4e000004010000000000000f54000004010000000400000f86000004010000456400000f92000004010000456500000fba000004010000456400000ff600001001000000c70000100600000401000045640000100c000004010000455e0000104800001001000000db0000106000001001000000eb000010700000040100004563000010900000040100001a68000010980000040100004562000010a20000040100004564000010b80000040100003c34000010c600000401000045520000110a000004010000457e0000112e000004010000455e0000114000000401000045630000115e00001001000000850000116e0000040100004564000011b00000040100000182000011bc0000040100000186000011cc00001001000000fb000011e6000004010000017a000011ee0000040100000172000011fe000004010000017e00001214000004010000017600001228000004010000016e000012580000040100000006000012600000040100004572000012ea0000040100004564000012fa000004010000456500001314000004010000457e00001322000004010000454e00001384000004010000457a0000138a000004010000457a000013b20000040100004576000013b80000040100004576000013c4000004010000457e0000144a000004010000456400001456000004010000455e00001468000010010000010d0000149a000010010000011b000014bc000010010000012d000014e00000040100001a68000015060000040100003c340000150e0000040100001a680000152200004701000000140000155c000004010000331a0000158a0000040100003c84000015960000040100003373000015b2000004010000454d000015cc0000040100004552000015d4000010010000013b0000160c000004010000456400001618000004010000456500001652000004010000455e000016660000040100004564000016880000100100000147000016920000040100004565000016c60000040100004563000016d8000004010000455e000017000000040100001a5c0000174200000401000045630000174a00000401000001aa0000175c0000040100004565000017620000040100004566000017c4000010010000015a000017f200001001000001710000181a000010010000017300001870000010010000018300001892000004010000457e000018bc000004010000457e000018ec00001001000001d10000190400000401000045640000190e00001001000001dc0000197e00001001000001e7000019960000040100004564000019a000001001000001f0000019e800001001000001f900001a78000004010000456400001a96000010010000021000001aa6000004010000456400001ae8000004010000457e00001af2000004010000456e00001b16000004010000456a00001b52000010010000021800001b66000010010000022b00001bbe000004010000456500001bf2000004010000457e00001c02000010010000025200001c76000010010000026600001ca6000010010000025800001cd0000010010000028a0000000800001001000002950000000c00001001000002a20000001000001001000002ae002e73796d746162002e737472746162002e7368737472746162002e72656c612e74657874002e64617461002e627373002e726f646174612e737472312e31002e72656c612e726f646174610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000100000006000000000000003400001d12000000000000000000000004000000000000001b0000000400000040000000000000287c00000c3c0000000800000001000000040000000c0000002600000001000000030000000000001d4800000000000000000000000000000004000000000000002c00000008000000030000000000001d4800004582000000000000000000000004000000000000003100000001000000320000000000001d48000002b3000000000000000000000001000000010000004500000001000000020000000000001ffc000000be0000000000000000000000020000000000000040000000040000004000000000000034b8000000240000000800000006000000040000000c00000001000000020000000000000000000020bc000004e000000009000000490000000400000010000000090000000300000000000000000000259c000002e00000000000000000000000010000000000000011000000030000000000000000000034dc0000004d00000000000000000000000100000000", + "sha256": "3589ca991d5d7fd56385076e0c7409ded6eb63e373db35967ee9110d2afd5f7d", + "stockCopies": [], + "placement": "linked", + "poolBaseLiterals": 0, + "variants": [] } ], "groups": [ @@ -6089,6 +6112,17 @@ "refs": [], "pokes": [], "tables": [] + }, + { + "moduleId": "bounce", + "key": "BOUNCE", + "author": "seniorspiz", + "nativeAuthor": "seniorspiz", + "activeWith": null, + "detours": [], + "refs": [], + "pokes": [], + "tables": [] } ], "composition": {