Skiff 1.2: more sounds, a list by type, and new ways to shape them

143 factory sounds (100 before), at least 8 for every engine, each a BASS,
LEAD, PAD, KEYS, PLUCK, DRUM or FX sound: SAVE > PRESETS' LIST steps through
one type across every engine. Presets for all of DRUM's kits and eight new
DRUM-X kits. FX > DRIVE (four DIST types and a TONE), ENV 2 in the MOD
matrix, DRUM's lane TUNE and DECAY; a HALL reverb, the chorus as FLANGER or
PHASER with FEEDBACK, and GATE, DUB, FLANGE and VINYL on the FX layer. SLICE
has a new BREAK and a second loop, FUNK, made with the YuE2 music model.
HOME opened from the sequencer's first page no longer draws that page's
hints under its own (#3). Projects saved with 1.2 open on 1.1 without the
new settings.
This commit is contained in:
illuminus5 committed 2026-10-15 21:49:38 -05:00
1 parent 102d0c1403
commit 5bbd35da7a
95 files changed
+2666 -579

No files matched your search

+6 -5
View File
@@ -43,12 +43,13 @@ On Linux x86-64 the toolchain runs natively and Docker is not needed.
`JIELI_TOOLCHAIN` and `AC79_SDK` override the default locations
(`~/.jieli/toolchain`, `~/fw-AC79_AIoT_SDK`).
`./build.sh --release 1.0` makes a release build: the package identity becomes `FM-1_710`
(Skiff's 7XY; Felucca's are 9XY) and the version string `v1.0`; the package is `build/skiff-1.0.fwsc`, and
`build/release-1.0/` holds what a release ships: the package, the app
(`skiff-1.1-app.bin`), `SHA256SUMS`, the sample attribution, `LICENSE`, `LICENSING.md` and
`./build.sh --release 1.2` makes a release build: the package identity becomes `FM-1_712`
(Skiff's 7XY; Felucca's are 9XY) and the version string `v1.2`; the package is `build/skiff-1.2.fwsc`, and
`build/release-1.2/` holds what a release ships: the package, the app
(`skiff-1.2-app.bin`), `SHA256SUMS`, the samples' attributions (`ATTRIBUTION.txt` for the CC0 sets,
`ATTRIBUTION-BREAKS.txt` for SLICE's BREAK and FUNK), `LICENSE`, `LICENSING.md` and
`LICENSES/` (the package contains Apache-2.0 SDK files, so the licence texts travel with it).
`web/make_site.py build/skiff-1.0.fwsc 1.0 OUT` makes the GitHub Pages site from it: the browser installer, the
`web/make_site.py build/skiff-1.2.fwsc 1.2 OUT` makes the GitHub Pages site from it: the browser installer, the
editor and the package with its licences.
Build options (environment, `0` or `1`; defaults in `firmware/src/felucca.c`, `core.h` and `icons.c`):
+24 -8
View File
@@ -262,7 +262,18 @@ Add a combo here before adding it to the code. Every SHIFT combo has to appear o
- CRYPT: CRYPT CHOIR, MONK CHANT, CATHEDRAL, HARPSICHORD, BONE FLUTE, WAR HORN, GRAVE BELL, DARK STRINGS, WAR DRUMS, CAVE WIND.
- NEON: NIGHT BASS, NEON LEAD, SUNSET PAD, HERO BRASS, GLASS KEYS, TURBO SYNC, NEON ARP, DREAM CHOIR, NEON KIT, SYN TOM.
- QUARK: GEIGER, QUARK CLOUD, PHOTON, ISOTOPE, COLLIDER, QUANTA, NEUTRINO, PLASMA, HADRON KIT, DARK MATTER.
- **A preset's other values** (`core.h` `preset_t` `more`): besides its engine values, envelope, sends and voice mode, a factory preset may set up to four more of the sound's parameters: the LFO, GLIDE, ENV › PITCH. Twelve of the thirty do (vibrato, PWM, pitch drops, S&H bleeps). Like every other sound parameter, they go back to their defaults when a preset without them is loaded. The track's own settings are never among them (`editor_test` checks every preset).
- **A preset's other values** (`core.h` `preset_t` `more`): besides its engine values, envelope, sends and voice mode, a factory preset may set up to four more of the sound's parameters: the LFO, GLIDE, ENV › PITCH, (phase 9) DRIVE's TYPE and TONE. Twelve of the thirty do (vibrato, PWM, pitch drops, S&H bleeps). Like every other sound parameter, they go back to their defaults when a preset without them is loaded. The track's own settings are never among them (`editor_test` checks every preset).
**Sounds and their types** (phase 9, 2026-10-15):
- **143 factory sounds**, at least 8 an engine. A table only grows at its end: a preset's number is in projects, favourites, the power-on sounds and the goldens. Names have 12 letters at most, each once among all the engines (a type's list mixes them; phase 9 renamed the older ones that weren't: ANALOG's PLUCK BRASS WIND, FM6's BELL BRASS MARIMBA ORGAN PLUCK, PHASE's BRASS ORGAN STRING BELL and DRUM-X's DRUM KIT, now OWN KIT; `ui_test` checks it), and no drum machine's or synth's trademark. Each new sound passed the audition page (the user's KEEP / CHANGE and a note) and regress's HEALTH, at the loudness of the sounds of its kind there were before.
- **A type each** (`core.h` `preset_t.tag`, `TAG(PT_*)`): BASS LEAD PAD KEYS PLUCK DRUM FX. SAVE › PRESETS' KNOB 4 is **LIST**: ALL, FAV, then the types. A type lists every engine's sounds of it, in the PRESETS list's order (`ENGINE_ORDER`); KNOB 1 and the PRESETS knob step through it wherever they browse; KNOB 2 (ENG) still steps the engines. User sounds are on ALL and FAV only. A light track leaves PHYS and GRAIN out of every list, as of ALL. The footer names the LIST beside the engine; an empty one says NO SOUNDS (a type) or NO FAVORITES.
- **The LIST is the unit's** (not the track's, not the project's): the settings byte `favorites.factory[15][21]` (0 none, else the type), kept below 8 at boot. `favorites.filter` stays 0 or 1, because older firmware refuses a backup whose filter is above 1; the LIST is the type + 1, else the filter.
- **DRUM's kits:** presets for its five model kits (80 10 66 55 77) and variations of the standard one, never on the retired KIT values 1..3 (a preset's values load as they are).
- **DRUM-X's kits** (`eng_drumx.c` `DX_KITS[]`, the factory kit first; `DRUMX_PKIT[]`, a kit + 1 per preset): such a preset loads its kit as the project's one kit, with the sound, as one undo (`UNDO_KIT`: SAVE held brings the kit back). Presets 0 and 1 keep the kit, because every engine switch loads preset 0, which would otherwise wipe the project's kit. `track_sig` hashes the kit, so an edit of it between two loads is an undo of its own.
- **SAMPLE's variations** (`tools/gen_samples.py` `SET_VARIANTS`, `MORE` too) follow PERC's slot; the placeholder there is a PIANO alias, hidden from browsing.
- **SLICE's loops** (phase 9, `assets/breaks/`): BREAK (one bar at 120 BPM, its 16ths on the grid) and FUNK (SOURCE 5, after PIANO: two beats at 86.33 BPM), cut from drum takes made with the YuE2 music model (`ATTRIBUTION.txt` there), mono at 22.05 kHz like every sample. Their AUTO slices are what the firmware's own detector finds (`gen_samples.py` `slc_onsets` runs `slc_scan`'s integer steps; `slice_test` checks them to the sample). FUNK BREAK plays FUNK's sixteenths. Flash: FUNK costs 15.3 KB.
**The FX layer's map** (phase 9): fourteen effects, seven a row, an octave each (F3 .. E4 over F4 .. E5), in 30 px cells; the REPEATs' rate written 8, 16, 32 (the "1/" doesn't fit beside the key's letter). The four new ones, in the white keys after OCT DN (`perform.c`): GATE (the mix chopped on the sixteenths, open their first half; DEPTH how deep), DUB (the dry mix into the delay, its feedback up to 0.94 and its return at MIX's default while held; the echoes ring out after), FLANGE and VINYL (buffer effects: a jet sweep 0.3 .. 6 ms, a bar each way, fed back; a 0.555 Hz wow of ±0.4 %, a 4.5 kHz low-pass and crackle). Their icons, Fukiai's: a pulse, echoes trailing off, a comb, a record.
## LEDs
@@ -336,13 +347,14 @@ The colours differ in lightness as well as hue, and always appear with the track
- **MENU > SYSTEM > RESET SETTINGS** (U4, A3): its dialog on the page under the MENU, then every MENU setting as a new unit has it (Skiff's palette, BPM LOCK ON, CLOCK INT, MIDI IN CH1-6, TUNE 0, HINTS ON ..); the calibration, the favourites and the music stay.
- **One word for one thing** (U4, the review's L1–L3; `params.c` TP / GP, the engines' rows, the cards' own words): spelled out where the card has room (Barlow Condensed fits 8 letters), the vocabulary of the review's appendix: LEVEL, ATTACK DECAY SUSTAIN RELEASE, CUTOFF PITCH SHAPE (ENV and LFO DEST), PHASE, OCTAVE, SWING, CHANCE, ORDER, SCALE, QUANTIZE, TRANSP, LENGTH, DIST CHORUS DELAY REVERB, VOICE GLIDE GL MODE PRIORITY DETUNE, SLICER PATTERN, CHORD VOICING, CLOCK FEEDBACK COLOR ROUTE ENGINE; on the engines DETUNE, NOISE, CUTOFF, DRIVE, KEYTRK, CRUSH, SWEEP, VIBRATO, VOWEL, BREATH, RANDOM, PITCH (every semitone pitch: SAMPLE's and the drums' TUNE, VOICE's SHIFT, TRIO's PITCH2 PITCH3), SOURCE, DENSITY, SPREAD, STRUCT, BRIGHT, ACCENT, EXCITE, DRIFT, ALGO, MOD LVL, RATIO, MOD ENV, VEL MOD, PATCH (FM6's SLOT), MORPH, COLOR (DRUM-X's TONE, its sheet's COLR); the cards VELOCITY, CHANCE, RATCHET, SOURCE DEST AMOUNT (MOD). One name, one meaning (L2): DEST for a destination (DST was distortion too), RVRS for reverse (REV is reverb: SLICE's, the play direction's), PLAYED for the arp's order as played. The lanes CL HAT and OP HAT in full, BD SD CH OH on the grid. AUTOMATION's PARAM card shows ENV or LFO on its label's line (ENV ATTACK). The web editor's library files keyed by the labels of before (LVL ATK ..) still load: `legacyKeys` takes them to today's by id.
- **Messages say the way out** (U4, the review's F3, L6): a refusal names what to do, on the header's second line where it needs one (`ui.c` `ui_way`): PATTERNS FULL, then SAVE > PATTERNS: CLEAR; AUTOMATION FULL, then AUTOMATION: DELETE ONE; BPM LOCKED, then GLO + SELECT: TEMPO; PLAY ONE LOOP FIRST, DISARM REC FOR A TAKE, NOTHING BEFORE TO JOIN, STOP TO ERASE / RENAME / SAVE as it is. Musicians' words for developers': CLOCK IS EXTERNAL, SLICES NOW MANUAL, PICK A USR SAMPLE FIRST, SAVED UNTIL POWER OFF (no flash), STORAGE ERROR, UPDATE MODE, KEYS RECORD LANES, HOLD [GLO]: SHORTCUTS, UNDONE: SEQUENCE / MIX / SCALE / REC, PATTERN 06 CLEARED, SOUND INITIALIZED. After a crash the session is not restored on purpose, and the boot says SESSION NOT RESTORED. MIDI IN into a track not selected marks its number on HOME for 0.4 s (was a header message every 4 s, covering the title). Values show up to 7 letters (SPRING, MELLOW; were cut at 5), the card falling to M, then S, where V is too wide. AUTOMATION names a lane as its kit plays it (CONGA). The REC layer says CLICK, COUNT-IN, CLICK LVL as MENU > AUDIO does; GLOBAL's swing is SWING+ (it adds to PATTERN's SWG).
- **Every page has a graph of its own** (U5, the review's V1; `ui_pgraph.c`, design/mock_u5.py): ENV DEST the ENV page's envelope scaled by each amount around a zero line; LFO DEST the LFO's wave a row a destination, as tall as its amount, a dot where it is now; DELAY the dry hit and an echo every TIME, the first MIX high, each next FEEDBACK lower (`fx.c`), over the bar's beats; REVERB the first reflections and the tail SIZE long, its top dimmed by DAMP, SPRING's coil; CHORUS the dry line and its drifting copy (one modulated delay); GLOBAL a bar's 16 steps, the off steps late by SWING+ over where they would be, the long:short share; VOICE what the mode does and the GLIDE between two notes; VOICE 2 the engine's voices, those sounding lit, the next one outlined (POLY, ROT), DETUNE's UNI spread; ANALOG's OSC the wave and its detuned second, FLT the low pass's curve, its peak at CUTOFF as high as RES; ARP and ARP 2 one graph, the arp's notes over 16 steps from the notes held (else C E G, said), GATE a tile's length, SWING, the steps CHANCE skips outlined. Of a page's curves the knob just turned (else the biggest amount) is the track's colour, the others MID, a zero one DIM. The other engines' EDIT pages keep their charts (FM6, WHEEL, SAMPLE) or the output's scope; FM6's OPERATOR and ALL OPS draw the note as the engine plays it (FM6 LAB, below).
- **Every page has a graph of its own** (U5, the review's V1; `ui_pgraph.c`, design/mock_u5.py): ENV DEST the ENV page's envelope scaled by each amount around a zero line; LFO DEST the LFO's wave a row a destination, as tall as its amount, a dot where it is now; DELAY the dry hit and an echo every TIME, the first MIX high, each next FEEDBACK lower (`fx.c`), over the bar's beats; REVERB the first reflections and the tail SIZE long, its top dimmed by DAMP, SPRING's coil; CHORUS the dry line and its drifting copy (one modulated delay), (phase 9) FEEDBACK its copy's copy fainter behind, FLANGER and PHASER their response across the spectrum (the comb, the two notches) drawn as FLT's curve; REVERB's HALL the tail twice ROOM's; FX › DRIVE (phase 9) the TYPE's transfer curve at the DIST, the straight line behind it, and one sine cycle through it as `fx.c` runs it (BITS' hold, TONE's low-pass in it); GLOBAL a bar's 16 steps, the off steps late by SWING+ over where they would be, the long:short share; VOICE what the mode does and the GLIDE between two notes; VOICE 2 the engine's voices, those sounding lit, the next one outlined (POLY, ROT), DETUNE's UNI spread; ANALOG's OSC the wave and its detuned second, FLT the low pass's curve, its peak at CUTOFF as high as RES; ARP and ARP 2 one graph, the arp's notes over 16 steps from the notes held (else C E G, said), GATE a tile's length, SWING, the steps CHANCE skips outlined. Of a page's curves the knob just turned (else the biggest amount) is the track's colour, the others MID, a zero one DIM. The other engines' EDIT pages keep their charts (FM6, WHEEL, SAMPLE) or the output's scope; FM6's OPERATOR and ALL OPS draw the note as the engine plays it (FM6 LAB, below).
- **The page families** (U3, the review's structure; `params.c` `PAGES`, `ui.c` `page_visible`):
- FX holds the track's effects (FX, SLICER, DUCK). The buses every track shares are GLO's, after MIXER: DELAY, REVERB (TYPE SIZE DAMP), CHORUS (RATE DEPTH, were CRT CDP), then GLOBAL (BPM, SWING). Its footer counts the five as one (MIXER 1/5).
- FX holds the track's effects (FX, (phase 9) DRIVE: DIST TYPE TONE, SLICER, DUCK). The buses every track shares are GLO's, after MIXER: DELAY, REVERB (TYPE SIZE DAMP; TYPE ROOM SPRING, phase 9 HALL), CHORUS (RATE DEPTH, were CRT CDP; phase 9 MODE FEEDBACK), then GLOBAL (BPM, SWING). Its footer counts the five as one (MIXER 1/5).
- (Phase 9) ENV's third page, ENV 2 (ATTACK DECAY SUSTAIN RELEASE, the ENV page's graph), is a second envelope for the MOD matrix only (source ENV2; `voice.c` `env2_tick`, ticked only while a slot uses it).
- SEQ goes by task: STEP, ROLL, CHANCE, PLAY, PATTERN, AUTOMATION, SONG last. On a drum track STEP is the grid and ROLL is not there.
- AUTOMATION is 1.1.5's AUTO LIST: the records, and a first row of its own (ROW ALL) with PLAY on KNOB 2 and CLEAR on KNOB 4. The AUTOMATION page of before, its counts and scope, is gone.
- EDIT > LANES (DRUM) is one page: KNOB 1 the lane (the grid's too), KNOB 2 its LEVEL, the eight as faders; a held step's KNOB 2 locks the lane's level. DRUM-X has its sheet's LEVEL instead.
- A page that changes nothing on the track's engine is not there: ENV, ENV DEST, VOICE, VOICE 2 and SCL on DRUM and DRUM-X (`engine_t.oneshot`), ENV and ENV DEST on FM6 (`ownenv`); VOICE 2 is ALLOC and DTUNE (PAN, MUTE: MIXER's). A card that does nothing there is dimmed: LFO DEST's PIT FLT SHP on the hits, DRUM's KICK on a model kit. A button with no page says so (NO ENV ON DRUM); a page a track no longer has goes to its family's first (or HOME) and says so too.
- EDIT > LANES (DRUM) is one page: KNOB 1 the lane (the grid's too), KNOB 2 its LEVEL, (phase 9) KNOB 3 its TUNE (±12 semitones, 0.0 as the kit has it), KNOB 4 its DECAY (a signed offset, 0 as the kit has it), the eight as faders; a held step's KNOB 2 3 4 lock that lane's. DRUM-X has its sheet's LEVEL instead (and tunes its sounds there).
- A page that changes nothing on the track's engine is not there: ENV, ENV DEST, ENV 2, VOICE, VOICE 2 and SCL on DRUM and DRUM-X (`engine_t.oneshot`), ENV, ENV DEST and ENV 2 on FM6 (`ownenv`); VOICE 2 is ALLOC and DTUNE (PAN, MUTE: MIXER's). A card that does nothing there is dimmed: LFO DEST's PIT FLT SHP on the hits, DRUM's KICK on a model kit. A button with no page says so (NO ENV ON DRUM); a page a track no longer has goes to its family's first (or HOME) and says so too.
- Every family reopens the page it was left on (SAVE and GLO too), and the MENU closes back onto the page it was opened over.
- SAVE › TOOLS is gone (CLEAR is the REC and SEQ TOOLS layers', INIT the EDIT layer's), and so is GLO › SYSTEM: CLOCK and MIDI IN are MENU › CONTROL's, TUNE MENU › AUDIO's, CPU (read only) MENU › SYSTEM's.
- CLOCK, MIDI IN and TUNE are the unit's (`ui.c` `unit_g_*`, settings bytes [15][18..20]): a project still stores them (for older firmware) but a load leaves them; the first boot with U3 takes the restored session's.
@@ -361,7 +373,7 @@ font and its own widgets (N1-N8); QUARK (`ux.quark`) Skiff's Barlow faces and it
- **The SEQ pages:** PATTERN's steps ASCII (# - .); the piano roll's notes swords (a gold crossguard where the note
starts, the blade as long as it lasts, its edge bright), its cursor and playhead gold; the step tiles plaques, their
border engraved (the edited one's gold); the pool's and SONG's tiles stone.
- **The graphs as ASCII art** (`cr_art`: a level a 6 px character column, joined by 2 px strokes, _ / \ _| as the curve moves): ENV with skulls on its three points over a ':' shade; LFO a snake along its path up to where the LFO is now; ENV DEST's amounts up or down, a skull on the bright one's peak; LFO DEST's rows snakes; DELAY # columns under skulls, the dry hit under a torch; REVERB's tail in shade characters # * + : ., its top blood (DAMP), SPRING's coil ~; CHORUS's copy a snake; GLOBAL # columns, ^ where an off step would be; VOICE's glide timed by a sword; VOICE 2's voices skulls, the next one in a gold double frame; OSC's wave with blood in its teeth; FLT's curve with a skull on its peak and a dagger at the cutoff; ARP's notes #, a skipped one a crossed skull. FX's sends and DRUM LANES' levels are the MIXER's torches; SLICER's steps # columns (a GATE step ':' as high as it stays open, STUT '='); WHEEL's drawbars # columns as far out as they are; DUCK the level as ASCII art over the shade, the source's hits ^ under it. The ':' shade is DIM (LINE vanished into the stone's specks).
- **The graphs as ASCII art** (`cr_art`: a level a 6 px character column, joined by 2 px strokes, _ / \ _| as the curve moves): ENV with skulls on its three points over a ':' shade; LFO a snake along its path up to where the LFO is now; ENV DEST's amounts up or down, a skull on the bright one's peak; LFO DEST's rows snakes; DELAY # columns under skulls, the dry hit under a torch; REVERB's tail in shade characters # * + : ., its top blood (DAMP), SPRING's coil ~; CHORUS's copy a snake; GLOBAL # columns, ^ where an off step would be; VOICE's glide timed by a sword; VOICE 2's voices skulls, the next one in a gold double frame; OSC's wave with blood in its teeth; FLT's curve with a skull on its peak and a dagger at the cutoff; ARP's notes #, a skipped one a crossed skull; (phase 9) DRIVE's curve a snake, its head at the end, the straight line faint behind it, its sine as OSC's wave, blood in its teeth; FLANGER's and PHASER's response as FLT's curve over its shade, a skull on the middle peak; CHORUS's FEEDBACK copy MID art behind the snake; HALL as ROOM's tail. FX's sends and DRUM LANES' levels are the MIXER's torches; SLICER's steps # columns (a GATE step ':' as high as it stays open, STUT '='); WHEEL's drawbars # columns as far out as they are; DUCK the level as ASCII art over the shade, the source's hits ^ under it. The ':' shade is DIM (LINE vanished into the stone's specks).
**The LFO's graphs** (every theme; LFO, LFO DEST; `ui_graph.c` `lfo_view_at`): the LFO over 2 s from its retrigger (a phrase's first note), as it runs: RATE's cycles in it, PHASE where it starts, FADE rising from nothing; a dot (CRYPT: the snake's head) where it is now, crossing the whole graph in the 2 s; past them the window scrolls, the last 2 s. (The hardware test: RATE and FADE did nothing to the old two fixed cycles.)
@@ -389,7 +401,9 @@ the grid, VHS snow, the high score table; `ui_neon.c`):
grid floor, the car.
- **The graphs:** every curve glows (`cv_line_t`: a ring out of it on the background only). ENV over the sun's bands, its
points sparkles; LFO a ridge of vector mountains, a white-hot trail into a sparkle where it is now; DELAY's echoes on the
grid toward a dim sun, ghosting wider; FLT and DUCK over the sun's bands; GLOBAL, FX's sends, LANES and WHEEL VU columns;
grid toward a dim sun, ghosting wider; FLT and DUCK over the sun's bands, and (phase 9) DRIVE's curve, FLANGER's and PHASER's
response and REVERB's tail (its reflections lit tubes, DAMP's share violet), sparkles at DRIVE's ends and at the
chorus copy's, a ghost behind it its FEEDBACK; GLOBAL, FX's sends, LANES and WHEEL VU columns;
SLICER, the piano roll's notes, the drum grid's hits and the step tiles lit tubes; the cursor a cyan laser.
- **The SEQ pages:** PATTERN's steps lit tubes, the cursor a laser under them; the roll's playhead a laser; a list's
selected row a sunset bar (AUTOMATION, the presets), AUTOMATION's values cyan on dotted leaders; the pool's tiles glass,
@@ -412,7 +426,9 @@ collisions, dark matter, the hazard sign, the polar scope; `ui_quark.c`, its cir
red brackets. The splash: an atom in a collision's tracks.
- **The graphs:** ENV a Monte Carlo fill under the curve, its points nuclei, DECAY's and RELEASE's half-lives written
on it; LFO the orbit and its projection (the electron's height drawn out as the wave, dashed to where it is now);
DELAY a decay chain; FLT and DUCK Monte Carlo fills; GLOBAL, FX's sends, LANES, WHEEL and SLICER calorimeter towers;
DELAY a decay chain; FLT and DUCK Monte Carlo fills, and (phase 9) DRIVE's curve (a nucleus on its top, the electron at
its sine's end), FLANGER's and PHASER's response and REVERB's tail (its reflections towers, DAMP's share sparse);
CHORUS's copy ends in the electron, its FEEDBACK copy dotted; GLOBAL, FX's sends, LANES, WHEEL and SLICER calorimeter towers;
the roll's notes bubble tracks from their vertex (its cursor in gold corners); the drum grid's hits and PATTERN's steps
bunches. The scope (HOME tapped on HOME): the sound as an event, the wave wrapped round the detector, the
calorimeter's towers outside it as loud as it is there, a collision at its heart.
+5 -2
View File
@@ -39,12 +39,15 @@ All by Hügelton Instruments (Leo Kuroshita), in this tree:
| Felucca: firmware, tools, web pages, tests | GPL-3.0-only | `LICENSE` |
| The PHASE engine's waveforms: a C port of the oscillator of CrispyZebra (<https://github.com/hugelton/CrispyZebra>) | GPL-3.0 | `firmware/src/eng_phase.c` |
| The DRUM voices and kit | GPL-3.0-only | `firmware/src/drum_voice.c`, `firmware/src/eng_drum.c` |
| The Hügelton Sample Pack: Felucca's drum sounds, made by `tools/gen_waves.py`, from which the SLICE engine's BREAK is built (not CC0) | GPL-3.0-only | `tools/gen_waves.py` |
| The Hügelton Sample Pack: Felucca's drum sounds, made by `tools/gen_waves.py` (not CC0; the SLICE engine's BREAK was built from them through Skiff 1.1, the SLICE test's loop still is) | GPL-3.0-only | `tools/gen_waves.py` |
| The Fukiai icon font (<https://github.com/hugelton/Fukiai>): the firmware's icons (rasterised at build time by `tools/gen_aa_icons.py`) and the web editor's | MIT | `web/fukiai.ttf`, `LICENSES/MIT-Fukiai.txt`, `web/FUKIAI-LICENSE.txt` |
Skiff's changes to Felucca, marked (Skiff) in the sources, and its pictures (`docs/skiff.png` from the firmware's
screen renders, `docs/controls.jpg` and `docs/keystrip.pdf` drawn by `tools/gen_panel_diagram.py`) are GPL-3.0-only
too.
too. So are SLICE's BREAK and FUNK (`assets/breaks/`, after Skiff 1.1): loops cut from drum takes made with the YuE2 music
model by Multimodal Art Projection (<https://github.com/multimodal-art-projection/YuE>), under its permission for
individual creators to publish and distribute what it makes; no YuE2 weights or code are in this tree (how they were
made: `assets/breaks/ATTRIBUTION.txt`).
## Third-party material
+123 -20
View File
@@ -16,9 +16,10 @@ synths and drums, patterns and songs, live performance, and a screen that shows
![Skiff on the FM-1's screen: HOME, a step page, PERFORM, the MIXER, DELAY and the SHIFT map](docs/skiff.png)
Skiff turns the FM-1 into a six-track groovebox: fourteen synth and drum engines, a 64-step sequencer with chords,
ratchets, trig conditions and parameter locks, a shared pool of patterns played through per-track lists and scenes,
and a performance layer for launching it all live. Every page draws what its knobs do, and holding HOME shows what
Skiff turns the FM-1 into a six-track groovebox: fourteen synth and drum engines with 143 factory sounds you can list
by type (only the basses, only the pads), a 64-step sequencer with chords, ratchets, trig conditions and parameter
locks, a shared pool of patterns played through per-track lists and scenes, and a performance layer for launching it
all live. Every page draws what its knobs do, and holding HOME shows what
every button, encoder and key does right there. FM6 sounds can be built from a bare sine on the unit itself, every
operator's envelope drawn as it plays and coloured by how bright the FM makes it. A browser editor reaches all of it
from a computer.
@@ -35,12 +36,12 @@ Custom firmware, at your own risk; the way back to the official firmware is belo
connect the FM-1 by USB and follow it. The same page takes the FM-1 back to the official V15 firmware, saving a
complete backup of your music first.
**With Python 3:** download `skiff-1.1.fwsc` from the [latest release](https://github.com/illuminus5/skiff/releases/latest)
**With Python 3:** download `skiff-1.2.fwsc` from the [latest release](https://github.com/illuminus5/skiff/releases/latest)
and, with this repository's `tools/` folder,
```
pip install mido python-rtmidi
python tools/fm1_install.py skiff-1.1.fwsc
python tools/fm1_install.py skiff-1.2.fwsc
```
It takes about two minutes and the FM-1 restarts on Skiff.
@@ -54,14 +55,14 @@ Edge, over USB MIDI).
| | |
| --- | --- |
| **Tracks** | 6, each with its own engine, sound, sequence and mix; 8 voices shared between them (T5 and T6 play every engine but PHYS and GRAIN) |
| **Engines** | 14: ANALOG, FM6, PHASE, LOFI, SAMPLE, VOICE, TRIO, WHEEL, GRAIN, PHYS, NOISE, SLICE, DRUM, DRUM-X; 100 factory sounds; every value of an FM6 patch (6 operators, 32 algorithms) editable on the unit |
| **Engines** | 14: ANALOG, FM6, PHASE, LOFI, SAMPLE, VOICE, TRIO, WHEEL, GRAIN, PHYS, NOISE, SLICE, DRUM, DRUM-X; 143 factory sounds, at least 8 an engine, each a BASS, LEAD, PAD, KEYS, PLUCK, DRUM or FX sound that SAVE › PRESETS lists by type; presets for all six of DRUM's kits and eight DRUM-X kits among them; every value of an FM6 patch (6 operators, 32 algorithms) editable on the unit |
| **Sequencer** | 64 steps a track; LENGTH 1–64; 1/1 to 1/32, triplets, 2 and 4 bars a step; chords of up to 4 notes, velocity, accent, slide, tie; per-step chance, ratchet ×1–4 or FLAM, 12 trig conditions (FILL, !FILL, 1:2 … 4:4), NUDGE (−32 to +31 64ths of a step); swing, gate; FWD, RVRS, PING or RAND |
| **Recording** | live with overdub, FEEL (keeps where you played), count-in and click; step recording; TAKE keeps the last loop you played, after the fact |
| **Automation** | knob moves and parameter locks (hold a step, turn a knob), 64 records, listed and edited on SEQ › AUTOMATION |
| **Patterns and songs** | a pool of 64 patterns shared by every project; each track a list of 16 entries (A–P), each a pattern played 1–16 times; SONG walks each track down its list |
| **Performance** | PERFORM: launch any track's entries and stage mutes on LOOP, BAR, BEAT or NOW; 16 scenes; throws (CUTOFF, REVERB, DELAY, DIST) that glide back; the FX layer: repeat, reverse, filter sweeps, tape stop, freeze, harmonizer, cuts |
| **Sound** | per track: an envelope, an LFO with depths per destination, a 4-slot modulation matrix, DIST, the SLICER (16 patterns), DUCK (sidechain); arpeggiator (14 modes), chord keys (9 chords, 5 voicings), 16 scales; MONO, LEGATO, UNISON, glide |
| **Effects** | chorus, delay and reverb (ROOM or SPRING) as sends |
| **Performance** | PERFORM: launch any track's entries and stage mutes on LOOP, BAR, BEAT or NOW; 16 scenes; throws (CUTOFF, REVERB, DELAY, DIST) that glide back; the FX layer: repeat, reverse, filter sweeps, tape stop, freeze, harmonizer, gate, dub echo, flanger, vinyl, cuts |
| **Sound** | per track: an envelope and a second one for modulation (ENV 2), an LFO with depths per destination, a 4-slot modulation matrix, DIST in four types (SOFT, HARD, FOLD, BITS) with a TONE, the SLICER (16 patterns), DUCK (sidechain); a drum kit's lanes tuned and their decay set one by one; arpeggiator (14 modes), chord keys (9 chords, 5 voicings), 16 scales; MONO, LEGATO, UNISON, glide |
| **Effects** | chorus (CHORUS, FLANGER or PHASER, with FEEDBACK), delay and reverb (ROOM, SPRING or HALL) as sends |
| **Memory** | 4 projects, 32 user sounds, 3 user sample slots; the music comes back at power-on (RESTORE LAST); 8 levels of undo |
| **Screen** | 240 × 240 colour; a graph on every page; HOME held shows every control's job; 6 themes; LARGE mode with tall cards |
| **MIDI and USB** | USB MIDI in and out, TRS MIDI in; clock from inside, USB or TRS; channels 1–6 play tracks 1–6; a stereo USB audio input to record the master on a computer |
@@ -70,6 +71,51 @@ Edge, over USB MIDI).
## A tour
### Find a sound by type
Every factory sound has a type: **BASS**, **LEAD**, **PAD**, **KEYS**, **PLUCK**, **DRUM** or **FX**. When a track needs
a bass, list the basses and step through them, across every engine, until one fits:
<table>
<tr>
<td width="40%"><img src="docs/img/presets_bass.png" alt="SAVE › PRESETS with LIST on BASS"><br><sub><b>LIST: BASS</b>: the basses of every engine, ENG saying whose each one is</sub></td>
<td>
1. **Pick the track** with ALGORITHM, say track 2.
2. **Tap SAVE** for SAVE › PRESETS (turn SELECT to it if another SAVE page opens) and turn **KNOB 4, LIST,** to
**BASS**. The list now holds only the basses: 18 of them, from eight engines.
3. **Turn PRESETS** (or KNOB 1): each bass plays on the track as you reach it. One from another engine switches the
track to that engine; its notes, its mix and its effects stay as they are.
4. **Stop on the one that fits.** Gone past the sound you had? **SAVE held** brings it back: a run of PRESETS turns
is one undo.
</td>
</tr>
</table>
The LIST stays where you leave it, through a power-off too, and it is the unit's, not the track's. While it is on a
type, the PRESETS knob steps through that type on HOME and the sound pages too, and the footer says BASS beside the
engine, so you can browse from whichever page you are on. For track 3's pad: ALGORITHM to track 3, LIST to PAD. Back on
**ALL**, PRESETS steps through all 143 again.
- **FAV** lists your favourites. On SAVE › PRESETS, turn **KNOB 3, FAV,** right to mark the sound playing, left to
unmark it. Your own sounds (SAVE › USER) are listed on ALL and FAV.
- **KNOB 2, ENG,** jumps to the next engine's first sound, whatever the LIST.
- Tracks 5 and 6 leave PHYS and GRAIN out of every list, since they don't play them: 17 basses there.
| Type | Sounds | From |
| --- | ---: | --- |
| BASS | 18 | ANALOG 6, FM6 4, LOFI 2, TRIO 2, PHASE, VOICE, WHEEL, PHYS |
| LEAD | 23 | ANALOG 6, LOFI 4, PHASE 3, SAMPLE 3, TRIO 3, VOICE 2, FM6, WHEEL |
| PAD | 22 | ANALOG 6, GRAIN 6, VOICE 4, PHYS 2, FM6, PHASE, SAMPLE, TRIO |
| KEYS | 23 | FM6 7, WHEEL 6, PHASE 3, PHYS 3, SAMPLE 2, ANALOG, TRIO |
| PLUCK | 11 | PHYS 3, LOFI 2, SAMPLE 2, ANALOG, FM6, PHASE, TRIO |
| DRUM | 31 | DRUM 10, DRUM-X 10, SLICE 8, PHYS 2, ANALOG |
| FX | 15 | NOISE 8, ANALOG 2, GRAIN 2, VOICE, TRIO, SLICE |
A DRUM-X kit preset loads its whole kit, the project's one kit for every DRUM-X track; SAVE held brings the kit back
too. Switching a track to DRUM-X keeps the kit the project has.
### Sequencer
<table>
@@ -98,6 +144,11 @@ Edge, over USB MIDI).
<td><img src="docs/img/global_swing.png" alt="GLOBAL"><br><sub><b>GLOBAL</b>: tempo and swing, the swung steps drawn</sub></td>
<td><img src="docs/img/fx_duck.png" alt="FX › DUCK"><br><sub><b>DUCK</b>: a track dips under another's hits, the pump drawn over a bar</sub></td>
</tr>
<tr>
<td><img src="docs/img/six_fx.png" alt="The FX layer"><br><sub><b>FX layer</b> (hold FX): 14 effects on the white keys, an octave a row; cuts on the black</sub></td>
<td><img src="docs/img/perform_held.png" alt="The FX layer, effects held"><br><sub>Effects held, a repeat waiting for its sixteenth</sub></td>
<td></td>
</tr>
</table>
### FM6 from scratch
@@ -140,6 +191,12 @@ the modulators make it bite).
<td><img src="docs/img/chord.png" alt="CHORD"><br><sub><b>CHORD</b>: the chord on the keys</sub></td>
<td><img src="docs/img/menu.png" alt="MENU"><br><sub><b>MENU</b>: four tabs of settings</sub></td>
</tr>
<tr>
<td><img src="docs/img/drive_fold.png" alt="FX › DRIVE"><br><sub><b>DRIVE</b>: the TYPE's curve, a sine through it</sub></td>
<td><img src="docs/img/env_2.png" alt="ENV › ENV 2"><br><sub><b>ENV 2</b>: a second envelope, for the MOD matrix</sub></td>
<td><img src="docs/img/lanes_tune.png" alt="EDIT › LANES"><br><sub><b>LANES</b>: a drum lane's level, tune and decay</sub></td>
<td><img src="docs/img/chorus_flanger.png" alt="CHORUS as a flanger"><br><sub><b>CHORUS</b>: FLANGER's comb</sub></td>
</tr>
</table>
### Themes
@@ -172,7 +229,10 @@ FM6 patches from `.syx` files and saves complete backups.
- **Six tracks**, each its own engine and sound; 8 voices shared between them. T5 and T6 play every engine but
PHYS and GRAIN. ALGORITHM selects the track on every page; HOME, PERFORM, SONG and the MIXER show all six
- **Fourteen engines** (below), DRUM-X among them, each with its own factory presets
- **Fourteen engines** (below), DRUM-X among them, each with at least 8 factory presets, 143 in all
- **Sounds by type:** every factory sound is a BASS, LEAD, PAD, KEYS, PLUCK, DRUM or FX sound; SAVE › PRESETS'
LIST (KNOB 4) shows one type across every engine, and the PRESETS knob then steps through it on every page
([Find a sound by type](#find-a-sound-by-type))
- **FM6 from scratch** (1.1): every value of an FM6 patch on the unit (EDIT › OPERATOR and ALL OPS), INIT a bare
sine, the sound saved as a user sound; the operators' envelopes drawn as they play, each carrier shaded by its
brightness, in every theme's own look
@@ -199,15 +259,18 @@ FM6 patches from `.syx` files and saves complete backups.
- **SEQ TOOLS** (hold SEQ): CLEAR, REVERSE, SHIFT < / >, RANDOM, COOK; on a drum track BEAT and each lane's
tools
- **DUCK** (FX › DUCK): a track dips under another track's hits, the sidechain pump
- **Effects:** DIST and the SLICER per track; chorus, delay and reverb (ROOM or SPRING) buses on GLO; the FX
layer (hold FX): repeat, reverse, filter sweeps, tape stop, freeze, harmonizer, and cuts on the black keys
- **Effects:** per track DIST, in four types on FX › DRIVE (SOFT, HARD, FOLD, BITS) with a TONE, and the SLICER;
the buses on GLO: chorus (CHORUS, FLANGER or PHASER, with FEEDBACK), delay and reverb (ROOM, SPRING or HALL); the
FX layer (hold FX): fourteen effects on the white keys and cuts on the black ([the keys](#the-fx-layers-keys))
- **Quick layers:** hold FX, GLO, SCL, EDIT, ARP or SEQ for its map on the keys and knobs; SHIFT + the button
keeps it open. The GLO layer: solos, mutes, FILL, tap tempo
- **DRUM-X** (from [JIANT FM](https://github.com/juanjiant-bit/JIANT)): a synthesized kit of 8 sounds, each
with an A and a B patch and MORPH between them, one kit per project, edited a sound at a time on EDIT › SOUND
with an A and a B patch and MORPH between them, one kit per project, edited a sound at a time on EDIT › SOUND;
eight kits come as presets, each loading its own (FACTORY, DEEP, CLICK, INDUSTRIAL, SOFT, GLITCH, TRIBAL, LASER)
- **Chord keys, arpeggiator, scales:** in-key chords with voicings; an arpeggiator with 14 modes, CHANCE,
SWING and HOLD; 16 scales with a white-key mode; MONO, LEGATO, UNISON and glide
- **Modulation matrix:** 4 slots a track, MIDI controllers as sources
- **Modulation matrix:** 4 slots a track; the sources the LFO, ENV and a second envelope of its own (ENV › ENV 2),
velocity, the key, a random value and MIDI controllers
- **Presets and projects:** factory presets, 32 user sounds and 4 projects, named on the device; the music
comes back at power-on (RESTORE LAST, an autosave of its own)
- **Screen and LEDs:** the BLOCKS look in Barlow Condensed with Fukiai icons; six themes; MENU › LARGE for tall
@@ -252,11 +315,34 @@ by the keys, with what each key is in Skiff.
F3 held clears the track's sequence, then CLICK, COUNT-IN, CLICK LEVEL, FEEL
- **EDIT** opens the EDIT pages everywhere; on STEP and ROLL with REC armed it clears the cursor step
- **SELECT** turns the pages of a family; **GLO + SELECT** sets the tempo (MENU › BPM LOCK, on by default)
- **PRESETS** changes the sound; on the step pages it moves the cursor, on lists it picks
- **PRESETS** changes the sound; on the step pages it moves the cursor, on lists it picks. With SAVE › PRESETS'
LIST on a type (BASS, PAD ..) it steps through that type only
- On action pages and in dialogs, **OCT+** does it and **OCT−** goes back
- Hold a step on SEQ › STEP and turn KNOB 1–4 to lock those parameters on that step
- Save a sound: stop, tap SAVE (USER), pick a slot with KNOB 1, OCT+, name it with the keys, OCT+
### The FX layer's keys
Hold **FX** and press a key: its effect plays while the key is held (SHIFT + FX keeps the layer open, and then a key
latches its effect). Effects of different kinds stack; of the ones that play back what was just heard (REPEAT,
REVERSE, TAPE STOP, FREEZE, OCT UP and DN, FLANGE, VINYL) the last one pressed plays, and letting it go returns to
the one held before.
| Key | Effect | Key | Effect |
| --- | --- | --- | --- |
| F3 | REPEAT 1/8 | F4 | FREEZE |
| G3 | REPEAT 1/16 | G4 | OCT UP: the mix an octave up beside itself |
| A3 | REPEAT 1/32 | A4 | OCT DN: an octave down |
| B3 | REVERSE | B4 | GATE: the mix chopped on the sixteenths |
| C4 | LPF: a low-pass closing over a bar | C5 | DUB: the mix into the delay, its feedback up; the echoes ring out after |
| D4 | HPF: a high-pass opening over a bar | D5 | FLANGE: a jet sweep, a bar each way |
| E4 | TAPE STOP | E5 | VINYL: a record's wow, a darker top, crackle |
REPEAT and REVERSE start on the next sixteenth. The black keys F#3, G#3, A#3, C#4, D#4 and F#4 cut tracks 1–6 while
held. KNOB 1–4 are the layer's macros: FILTER (left a low-pass, right a high-pass), CRUSH, THROW (the mix into the
delay and the reverb) and DEPTH, how much of the effect you hear (with OCT UP or DN, its shimmer instead; with GATE,
how deep it cuts).
## Engines
In the order the device lists them:
@@ -276,18 +362,21 @@ In the order the device lists them:
- **GRAIN**: granular textures from the built-in samples or a user slot
- **PHYS**: physical models: modal resonators, strings, struck membranes, sympathetic strings
- **NOISE**: noise from analog to digital: colours, crackle, shift-register and metallic tones
- **SLICE**: a drum break, a piano note (both built in) or your own sample cut into slices, one per key;
- **SLICE**: two drum breaks, a piano note (all built in) or your own sample cut into slices, one per key;
set the slices by hand on the SLICES page
- **DRUM**: an 8-lane kit of Felucca's own drum voices on the General MIDI key map. KIT picks the
standard kit or one of five virtual-analog (VA) kits in the manner of
classic analog drum machines (the numbers are a hint), every lane its own voice: **80** (deep sine kick with a long decay, noisy snare,
six-square hats), **10** (swept kick, white-noise snare, long-tailed claps, a cymbal), **66** (soft
round kick, bright snare, noise hats, a conga), **55** (dropping kick, high metal hats, a metal bell)
and **77** (swelling kick, multi-burst claps, claves, a cymbal). All of them are synthesized, no samples.
EDIT › LANES sets each lane's level (KNOB 1 the lane, KNOB 2 its level)
and **77** (swelling kick, multi-burst claps, claves, a cymbal). All of them are synthesized, no samples, and
each has presets (BOOM KIT, CRISP KIT, RHYTHM BOX, ELECTRO KIT, STUDIO KIT ..). EDIT › LANES sets each lane on its
own: KNOB 1 the lane, KNOB 2 its level, KNOB 3 its tune (±12 semitones), KNOB 4 its decay (0 as the kit has it)
- **DRUM-X**: a synthesized 8-sound kit from [JIANT FM](https://github.com/juanjiant-bit/JIANT), after the idea of
Sonic Charge's Microtonic: each sound an oscillator (SIN, FM, MTL, BEL) with a pitch envelope and filtered noise,
two patches A and B with MORPH between them; one kit a project, edited on EDIT › SOUND, a sound at a time
two patches A and B with MORPH between them; one kit a project, edited on EDIT › SOUND, a sound at a time. Its
presets FACTORY KIT, DEEP KIT, CLICK KIT, INDUSTRIAL, SOFT KIT, GLITCH KIT, TRIBAL KIT and LASER KIT each load a
kit of their own (SAVE held brings the one before back); OWN KIT and HADRON KIT keep the project's kit
**SLICER** (FX › SLICER, every track): a tempo-synced 16-step gate or stutter, with 16 patterns.
@@ -297,12 +386,25 @@ In the order the device lists them:
The DIGITAL engine of Felucca 0.9 became FM6: projects and presets with DIGITAL sounds load as FM6 sounds converted
from them. The SAMPLE engine's PERC kit was removed in Felucca 1.0.2: sounds and projects that used it load as the
DRUM engine's kit, on the same key map. FM6's patch bank (the B slots) was removed in 1.0.3: user presets keep their
own FM6 patch. SLICE gained a second built-in sound in 1.0.4, PIANO, next to BREAK. A missing sample (an empty user
own FM6 patch. SLICE gained a second built-in sound in 1.0.4, PIANO, next to BREAK; this version a new BREAK (one bar
at 120 BPM) and FUNK (SOURCE 5: two beats at 86 BPM), both made with the YuE2 music model. A missing sample (an empty user
slot) plays a plain sine at the note's pitch on SAMPLE, GRAIN and SLICE, and the screen says NO SAMPLE once. DRUM's
KIT variants HAND, CYM and H+CYM were retired in 1.0.5: sounds and projects that used them play the 66, 10 and 77
kits. Felucca's projects become Skiff's at the first start: each track's steps a pattern on its entry A.
</details>
<details>
<summary><b>Going back to Skiff 1.1</b></summary>
Projects, patterns and sounds saved with this version open on Skiff 1.1, without what 1.1 doesn't have: DIST's TYPE
and TONE (it plays SOFT), ENV 2's settings, the drum lanes' TUNE and DECAY, the chorus's MODE and FEEDBACK (it plays
CHORUS); a HALL reverb plays as SPRING. A MOD slot whose source is ENV2 becomes EXPR there, which with no MIDI
expression coming in is its whole amount all the time: set it OFF on 1.1. Saving there leaves the new settings out for
good. A pattern with automation on one of them keeps its steps and its other automation. A track on a sound added in
this version keeps playing it as it was saved, under the name of one of 1.1's sounds. SLICE's FUNK plays PIANO there,
and BREAK 1.1's own break.
</details>
## Menu
Hold **HOME** and let it go for the menu. It is in four tabs: **DISPLAY** (THEME to LEDS, SCREEN OFF, HINTS),
@@ -431,6 +533,7 @@ Skiff stands on Felucca. If it is useful to you, support Felucca's author:
[SIL OFL 1.1](LICENSES/OFL-BarlowCondensed.txt); [Inter Tight](https://github.com/rsms/inter-tight) by The Inter Project Authors (the control card), [SIL OFL 1.1](LICENSES/OFL-InterTight.txt);
the browser emulator's labels: [DotGothic16](https://github.com/fontworks-fonts/DotGothic16) by The DotGothic16 Project Authors, [SIL OFL 1.1](LICENSES/OFL-DotGothic16.txt)
- Samples: [Versilian Studios](https://versilian-studios.com/) [VSCO-2 Community Edition](https://github.com/sgossner/VSCO-2-CE) and [VCSL](https://github.com/sgossner/VCSL), CC0 1.0: the SAMPLE sets, also SLICE's PIANO ([attribution](assets/samples-cc0/ATTRIBUTION.txt))
- SLICE's BREAK and FUNK: made with [YuE2](https://github.com/multimodal-art-projection/YuE) by Multimodal Art Projection ([how](assets/breaks/ATTRIBUTION.txt))
- VOICE engine: after [klattsch](https://github.com/tgies/klattsch) by Tony Gies (MIT); formant data from Klatt (1980) and Hillenbrand et al. (1995)
- PHYS engine: models ported from [DaisySP](https://github.com/electro-smith/DaisySP) by Electrosmith and Emilie Gillet ([MIT](LICENSES/MIT-DaisySP.txt)) and from Emilie Gillet's [eurorack](https://github.com/pichenettes/eurorack) code ([MIT](LICENSES/MIT-Rings.txt))
- FM6 engine: msfa from [Dexed](https://github.com/asb2m10/dexed) by Google Inc. and Pascal Gauthier ([Apache-2.0](LICENSES/Apache-2.0-msfa.txt))
+26
View File
@@ -0,0 +1,26 @@
SLICE's built-in loops (Skiff phase 9, after Skiff 1.1)
break.wav BREAK (SLICE SOURCE 0): one bar at 120 BPM, 22050 Hz mono, 44100 samples
funk.wav FUNK (SLICE SOURCE 5): two beats at 86.33 BPM, 22050 Hz mono, 30650 samples
Both are cut from drum takes generated on 2026-10-15 with the YuE2 music model by Multimodal Art
Projection (m-a-p, https://github.com/multimodal-art-projection/YuE): YuE2-3B (Comfy-Org's
yue2_3b_int8_convrot.safetensors) in ComfyUI 0.37.4's native YuE2 nodes, ABC planning off,
12 s, temperature 1.0, top_p 0.95, top_k 100, repetition penalty 1.2; KSampler 32 steps, cfg 1,
dpm_2, sgm_uniform. The style text of both ended in "A drum break played on a live acoustic drum
kit: kick, snare, hi-hats, ghost notes. Drums only, no vocals, no bass, no guitar, no keys.
120 BPM, 4/4, dry vintage soul recording."
break.wav style "Breakbeat drum solo. ...", lyrics "[Drum Break] [instrument solo]
[instrument solo]", seed 1001: its second bar, 2.713 to 4.713 s (it plays at 120.00 BPM)
funk.wav style "Solo funk drum break. ...", lyrics "[Instrumental] [Drum Solo]", seed 1000:
4.473 to 5.863 s (it plays at 86.33 BPM: four eighths, before a sung phrase at 7.3 s)
Each cut: 48 kHz stereo to 22050 Hz (soxr), left and right mixed to mono, its start 8 ms before
the beat, its join cross-faded over 3 ms with what followed the loop's end, peak -0.5 dBFS.
tools/gen_samples.py encodes them (IMA ADPCM) and writes their slice tables.
YuE2's weights are CC BY-NC 4.0 with an additional permission (2026-09-16) for individual
creators to generate outputs and to publish, distribute, sell or license them; being made with
the weights does not by itself put an output under their NonCommercial term. No YuE2 weights or
code are in this tree. The loops are part of Skiff: GPL-3.0-only (LICENSING.md).
Binary file not shown.
Binary file not shown.
Regular → Executable
View File
File mode changed.
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

+10 -4
View File
@@ -7,7 +7,8 @@
*
* A pattern is BK_REC bytes:
* 0 the version (0: empty)
* 1 P_COUNT when it was saved (its motion's ids: project.c proj_motion_ids)
* 1 the parameter count its motion's ids are of (project.c proj_motion_ids): (Skiff phase 9) PROJ_NP,
* which firmware before reads, unless the motion names a parameter added since: then P_COUNT
* 2..6 LEN DIV SWING GATE DIR, each + 64 (the sound's own values, not an automated one)
* 7 its motion records (0..64), bit 7: the automation plays (motion.on)
* 8..583 the 64 steps, 9 bytes each (project.c step_put9)
@@ -197,10 +198,15 @@ static int bk_write(uint32_t c)
* automation on or not: 0 for a step no format can hold (none the UI makes) */
static int bk_pack_raw(uint8_t *r, uint32_t k, const step_t *st, const int16_t *tv, const motion_store_t *ms, int on)
{
uint32_t i, n = 0;
uint32_t i, n = 0, np = PROJ_NP;
/* ((Skiff phase 9) the motion's ids as a store of PROJ_NP has them, which firmware before reads; today's when it
* names a parameter added since) */
for (i = 0; i < ms->count && i < MOTION_MAX; i++)
if ((ms->event[i].place >> 6) == k && MOTION_ID(&ms->event[i]) >= PROJ_NP - 8u && MOTION_ID(&ms->event[i]) < P_E0)
np = P_COUNT;
memset(r, 0, BK_REC);
r[0] = BK_VER;
r[1] = P_COUNT;
r[1] = (uint8_t)np;
for (i = 0; i < 5u; i++)
r[2u + i] = (uint8_t)(tv[i] + 64);
for (i = 0; i < NSTEP; i++)
@@ -213,7 +219,7 @@ static int bk_pack_raw(uint8_t *r, uint32_t k, const step_t *st, const int16_t *
if ((e->place >> 6) != k)
continue;
m[0] = e->place & 63u;
m[1] = e->param;
m[1] = (uint8_t)(np == P_COUNT || MOTION_ID(e) < P_E0 ? e->param : e->param - PROJ_NX); /* (the lock bit kept) */
m[2] = (uint8_t)e->value;
m[3] = (uint8_t)((uint16_t)e->value >> 8);
n++;
+16 -4
View File
@@ -74,6 +74,10 @@ enum { /* per-track parameters */
P_LN0, P_LN1, P_LN2, P_LN3, P_LN4, P_LN5, P_LN6, P_LN7, /* DRUM lane levels (eng_drum.c, #97): KICK .. BELL */
P_DIR, /* (Skiff) play direction (seq.c seq_next): DIR_FWD REV PING RAND */
P_DKSRC, P_DKAMT, P_DKREL, /* (Skiff) ducking (duck.c): the track it ducks under, DEPTH, RELEASE */
P_DTYPE, P_DTONE, /* (Skiff phase 9) FX > DRIVE (fx.c track_dist): DIST's kind, its tone */
P_EG2_ATK, P_EG2_DEC, P_EG2_SUS, P_EG2_REL, /* (Skiff phase 9) ENV 2 (voice.c env2_tick): a MOD source */
P_LTUNE0, P_LTUNE1, P_LTUNE2, P_LTUNE3, P_LTUNE4, P_LTUNE5, P_LTUNE6, P_LTUNE7, /* (Skiff phase 9) the DRUM lanes' */
P_LDECAY0, P_LDECAY1, P_LDECAY2, P_LDECAY3, P_LDECAY4, P_LDECAY5, P_LDECAY6, P_LDECAY7, /* TUNE and DECAY */
P_E0, P_E1, P_E2, P_E3, P_E4, P_E5, P_E6, P_E7,
P_COUNT
};
@@ -87,12 +91,13 @@ enum { /* global parameters */
G_ENGSEL, G_ENGGO, /* no page: the editor switches the engine with a SET of G_ENGSEL; G_ENGGO is
* unused (ids are fixed by the formats and the protocol) */
G_CLRSEQ, G_INITSND,
G_RTYPE, /* REVERB TYPE: 0 ROOM, 1 SPRING (fx.c). Was G_DRCH, the GM drum part's MIDI
G_RTYPE, /* REVERB TYPE: 0 ROOM, 1 SPRING, (Skiff phase 9) 2 HALL (fx.c). Was G_DRCH, the GM drum part's MIDI
* channel (inert since 1.0, never read); projects of formats before FUN7 load it
* as ROOM (project.c proj_rtype_room) */
G_DRLVL, G_DRREV, /* inert (label "-", on no page): the GM drum part they set is gone; kept
* because the ids and G_COUNT are fixed by the formats and the protocol (only
* the import of an old project reads them: proj_drums_to_part) */
G_CMODE, G_CFDBK, /* (Skiff phase 9) GLO > CHORUS's MODE (0 CHORUS, 1 FLANGER, 2 PHASER) and FEEDBACK
* (fx.c cho_mode). Were G_DRLVL / G_DRREV, the GM drum part's level and reverb send
* (inert since 1.0): an import of a format before SKF3 reads them as those
* (project.c proj_drums_to_part), then sets them 0 (proj_import) */
G_COUNT
};
@@ -155,6 +160,7 @@ enum { V_POLY, V_MONO, V_LEGATO, V_UNISON }; /* P_VOICE */
typedef struct {
uint8_t note, vel, gate, active;
uint8_t stage; /* env: 0 off, 1 attack, 2 decay/sustain, 3 release */
uint8_t stage2; /* (Skiff phase 9) ENV 2's (voice.c env2_tick): the same, its release at the gate's end */
int32_t env; /* Q24 */
int32_t env_out; /* last control-rate amplitude, Q15 */
int32_t pitch16, pitch_cur; /* 1/16 semitone, with glide */
@@ -165,6 +171,7 @@ typedef struct {
uint32_t age;
uint8_t mvel; /* mod.c: the note-on velocity (before UNISON scaling) and RAND of the note */
int16_t mrnd;
int32_t env2; /* (Skiff phase 9) ENV 2, Q24: a MOD source only (mod.c MS_ENV2) */
} voice_t;
typedef struct { /* per-voice control-rate modulation, computed in voice.c */
@@ -188,9 +195,12 @@ typedef struct {
* arp is the track's too: a preset does not set it) */
struct { uint8_t id; int8_t v; } more[4]; /* (Skiff) up to four more of the sound's values, {P_* id, value}: the
* LFO, GLIDE, ENV -> PITCH (sound parameters only, never param_kept's: editor_test); id 0 ends */
uint8_t tag; /* (Skiff phase 9) its type, PT_*: PRESETS' LIST shows one (ui.c preset_in_list) */
} preset_t;
#define FX(d, c, dl, r) .fx = {(d) + 1, (c) + 1, (dl) + 1, (r) + 1}
#define MORE(...) .more = {__VA_ARGS__}
#define TAG(t) .tag = (t)
enum { PT_NONE, PT_BASS, PT_LEAD, PT_PAD, PT_KEYS, PT_PLUCK, PT_DRUM, PT_FX, PT_N }; /* (stored: the LIST setting) */
struct track;
typedef struct { /* an engine (engines.c ENGINES[]; the eng_*.c files) */
@@ -384,6 +394,7 @@ typedef struct track {
/* mix runtime */
int32_t peak;
int32_t dist_hp, dist_lp1, dist_lp2; /* DIST insert state (fx.c) */
int32_t dist_dc; /* (Skiff phase 9) the DC after HARD's and FOLD's clip (fx.c dist_hard) */
uint8_t tail; /* blocks to mix after the last voice (the DIST tail) */
int16_t armp, aholdp; /* P_AMODE / P_AHOLD as last seen by the ISR */
/* engine switch (voice.c engine_block): the old engine's voices fade out, then it switches */
@@ -396,6 +407,7 @@ typedef struct track {
uint8_t m_vel, m_key, m_vi; /* the latest note-on: velocity, note, voice index (per-block destinations) */
int16_t m_rnd; /* .. its RAND */
int32_t m_env; /* the amp envelope of voice m_vi, last block (Q15) */
int32_t m_env2; /* (Skiff phase 9) .. its ENV 2 (Q15; while a MOD slot uses it) */
} track_t;
typedef struct {
+25 -21
View File
@@ -79,28 +79,32 @@ static void analog_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
}
static const preset_t ANALOG_PRESETS[] = {
{"SAW LEAD", {0, 12, 64, 0, 90, 30, 10, 64}, {4, 70, 100, 50}, 20, 1, FX(0, 10, 45, 30)},
{"SOFT PAD", {0, 20, 64, 4, 60, 10, 0, 32}, {80, 90, 110, 95}, 10, 0, FX(0, 60, 20, 70)},
{"SQR BASS", {1, 0, 0, 0, 50, 70, 40, 64}, {0, 60, 40, 30}, 30, 1, FX(5, 0, 10, 10)},
{"PWM STR", {4, 8, 40, 0, 75, 20, 0, 48}, {60, 80, 110, 85}, 8, 0, FX(0, 50, 20, 60)},
{"ACID", {0, 0, 0, 0, 50, 100, 25, 64}, {0, 55, 20, 30}, 48, 1, FX(20, 0, 45, 15)},
{"SINE KEY", {3, 6, 50, 0, 127, 0, 0, 0}, {2, 80, 30, 70}, 0, 0, FX(0, 30, 25, 40)},
{"RAVE", {4, 30, 64, 0, 85, 20, 30, 64}, {20, 80, 110, 60}, 10, 1, FX(30, 40, 30, 30)},
{"SUB BASS", {3, 0, 0, 0, 40, 0, 20, 0}, {0, 60, 100, 20}, 0, 1, FX(0, 0, 0, 10)},
{"PLUCK", {0, 8, 50, 0, 30, 40, 0, 64}, {0, 88, 0, 60}, 55, 0, FX(0, 20, 50, 30)},
{"BRASS", {0, 10, 64, 0, 45, 20, 10, 64}, {35, 70, 90, 45}, 40, 0, FX(0, 20, 20, 40)},
{"WIND", {0, 0, 0, 90, 30, 90, 0, 0}, {60, 90, 60, 80}, 50, 0, FX(0, 30, 30, 70)},
{"STRINGS", {0, 25, 64, 0, 70, 10, 0, 32}, {70, 90, 115, 90}, 5, 0, FX(0, 60, 20, 70)},
{"SAW LEAD", {0, 12, 64, 0, 90, 30, 10, 64}, {4, 70, 100, 50}, 20, 1, FX(0, 10, 45, 30), TAG(PT_LEAD)},
{"SOFT PAD", {0, 20, 64, 4, 60, 10, 0, 32}, {80, 90, 110, 95}, 10, 0, FX(0, 60, 20, 70), TAG(PT_PAD)},
{"SQR BASS", {1, 0, 0, 0, 50, 70, 40, 64}, {0, 60, 40, 30}, 30, 1, FX(5, 0, 10, 10), TAG(PT_BASS)},
{"PWM STR", {4, 8, 40, 0, 75, 20, 0, 48}, {60, 80, 110, 85}, 8, 0, FX(0, 50, 20, 60), TAG(PT_PAD)},
{"ACID", {0, 0, 0, 0, 50, 100, 25, 64}, {0, 55, 20, 30}, 48, 1, FX(20, 0, 45, 15), TAG(PT_BASS)},
{"SINE KEY", {3, 6, 50, 0, 127, 0, 0, 0}, {2, 80, 30, 70}, 0, 0, FX(0, 30, 25, 40), TAG(PT_KEYS)},
{"RAVE", {4, 30, 64, 0, 85, 20, 30, 64}, {20, 80, 110, 60}, 10, 1, FX(30, 40, 30, 30), TAG(PT_LEAD)},
{"SUB BASS", {3, 0, 0, 0, 40, 0, 20, 0}, {0, 60, 100, 20}, 0, 1, FX(0, 0, 0, 10), TAG(PT_BASS)},
{"SYNTH PLUCK", {0, 8, 50, 0, 30, 40, 0, 64}, {0, 88, 0, 60}, 55, 0, FX(0, 20, 50, 30), TAG(PT_PLUCK)},
{"SYNTH BRASS", {0, 10, 64, 0, 45, 20, 10, 64}, {35, 70, 90, 45}, 40, 0, FX(0, 20, 20, 40), TAG(PT_LEAD)},
{"WIND SWEEP", {0, 0, 0, 90, 30, 90, 0, 0}, {60, 90, 60, 80}, 50, 0, FX(0, 30, 30, 70), TAG(PT_FX)},
{"STRINGS", {4, 6, 64, 0, 92, 8, 0, 48}, {48, 90, 118, 72}, 6, 0, FX(0, 95, 15, 55), MORE({P_LD_SHP, 20}, {P_LRATE, 72}, {P_LD_PIT, 1}, {P_LFADE, 80}), TAG(PT_PAD)}, /* ((Skiff phase 9) as SOFT PAD to the ear: a bright string
* machine now, its PWM moving, a late vibrato) */
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"BONE FLUTE", {2, 3, 30, 22, 84, 15, 0, 64}, {56, 80, 110, 64}, 6, 1, FX(0, 15, 30, 85), MORE({P_LRATE, 84}, {P_LFADE, 90}, {P_LD_PIT, 1})},
{"WAR HORN", {0, 5, 64, 4, 42, 12, 20, 64}, {72, 80, 110, 80}, 30, 1, FX(0, 10, 10, 90), MORE({P_LRATE, 80}, {P_LFADE, 96}, {P_LD_PIT, 1})},
{"DARK STRINGS", {0, 22, 64, 0, 56, 8, 0, 40}, {92, 90, 120, 100}, 6, 0, FX(0, 70, 10, 100), MORE({P_LRATE, 36}, {P_LD_FLT, 5})},
{"NIGHT BASS", {0, 7, 64, 0, 40, 35, 15, 64}, {0, 64, 50, 30}, 45, 1, FX(0, 5, 10, 8)},
{"NEON LEAD", {0, 14, 64, 0, 92, 25, 12, 64}, {6, 70, 110, 55}, 14, 1, FX(0, 25, 55, 40), MORE({P_LRATE, 86}, {P_LFADE, 92}, {P_LD_PIT, 2}, {P_GLIDE, 28})},
{"SUNSET PAD", {4, 9, 55, 0, 74, 15, 0, 48}, {78, 90, 115, 92}, 10, 0, FX(0, 85, 25, 70), MORE({P_LWAVE, 1}, {P_LRATE, 52}, {P_LD_SHP, 48})},
{"HERO BRASS", {0, 16, 64, 0, 50, 18, 8, 56}, {50, 75, 95, 55}, 44, 0, FX(0, 45, 20, 45)},
{"SYN TOM", {3, 0, 0, 6, 127, 0, 25, 0}, {0, 76, 0, 60}, 0, 0, FX(0, 0, 10, 45), MORE({P_ED_PIT, 63})},
{"QUANTA", {3, 0, 0, 0, 127, 0, 0, 0}, {0, 64, 127, 50}, 0, 1, FX(0, 0, 55, 35), MORE({P_LWAVE, 4}, {P_LRATE, 96}, {P_LD_PIT, 40})},
{"BONE FLUTE", {2, 3, 30, 22, 84, 15, 0, 64}, {56, 80, 110, 64}, 6, 1, FX(0, 15, 30, 85), MORE({P_LRATE, 84}, {P_LFADE, 90}, {P_LD_PIT, 1}), TAG(PT_LEAD)},
{"WAR HORN", {0, 5, 64, 4, 42, 12, 20, 64}, {72, 80, 110, 80}, 30, 1, FX(0, 10, 10, 90), MORE({P_LRATE, 80}, {P_LFADE, 96}, {P_LD_PIT, 1}), TAG(PT_LEAD)},
{"DARK STRINGS", {1, 4, 64, 6, 40, 34, 22, 40}, {100, 90, 120, 105}, 10, 0, FX(0, 30, 0, 110), MORE({P_LRATE, 30}, {P_LD_FLT, 8}, {P_LD_PIT, 1}, {P_LFADE, 110}), TAG(PT_PAD)}, /* ((phase 9) hollow and dark, a slow swell) */
{"NIGHT BASS", {0, 7, 64, 0, 40, 35, 15, 64}, {0, 64, 50, 30}, 45, 1, FX(0, 5, 10, 8), TAG(PT_BASS)},
{"NEON LEAD", {0, 14, 64, 0, 92, 25, 12, 64}, {6, 70, 110, 55}, 14, 1, FX(0, 25, 55, 40), MORE({P_LRATE, 86}, {P_LFADE, 92}, {P_LD_PIT, 2}, {P_GLIDE, 28}), TAG(PT_LEAD)},
{"SUNSET PAD", {4, 9, 55, 0, 74, 15, 0, 48}, {78, 90, 115, 92}, 10, 0, FX(0, 85, 25, 70), MORE({P_LWAVE, 1}, {P_LRATE, 52}, {P_LD_SHP, 48}), TAG(PT_PAD)},
{"HERO BRASS", {0, 16, 64, 0, 50, 18, 8, 56}, {50, 75, 95, 55}, 44, 0, FX(0, 45, 20, 45), TAG(PT_PAD)},
{"SYN TOM", {3, 0, 0, 6, 127, 0, 25, 0}, {0, 76, 0, 60}, 0, 0, FX(0, 0, 10, 45), MORE({P_ED_PIT, 63}), TAG(PT_DRUM)},
{"QUANTA", {3, 0, 0, 0, 127, 0, 0, 0}, {0, 64, 127, 50}, 0, 1, FX(0, 0, 55, 35), MORE({P_LWAVE, 4}, {P_LRATE, 96}, {P_LD_PIT, 40}), TAG(PT_FX)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"REESE", {0, 40, 64, 0, 52, 15, 30, 32}, {0, 64, 127, 30}, 10, 1, FX(10, 20, 5, 10), MORE({P_LRATE, 30}, {P_LD_FLT, 8}), TAG(PT_BASS)},
{"DRIVE BASS", {0, 14, 64, 0, 62, 20, 10, 64}, {0, 64, 64, 25}, 24, 1, FX(40, 0, 5, 5), MORE({P_DTYPE, 1}, {P_DTONE, -32}), TAG(PT_BASS)},
};
static const engine_t ENG_ANALOG = {
+16 -8
View File
@@ -256,8 +256,8 @@ static void drum_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
drum_lane_t *L = drum_lane_of(t, v);
dv_param_t k;
int32_t y[CTL], mb[CTL], acc = clamp(p[P_E5] * v->vel * 4, 0, 65536), drv = p[P_E7], g = 0, mk = 0; /* acc Q16 */
int32_t lv = clamp(p[P_LN0 + ((uint32_t)v->s[0] & (DV_NLANE - 1u))], 0, 127);
uint32_t i, r;
uint32_t ln = (uint32_t)v->s[0] & (DV_NLANE - 1u), i, r;
int32_t lv = clamp(p[P_LN0 + ln], 0, 127);
vmod_t ml; /* (only its amplitude ramp is read: voice_amp) */
if (!L)
return;
@@ -272,11 +272,11 @@ static void drum_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
n = CTL;
r = L->role;
dv_default(&k, r); /* the knobs move every lane from its design (64) */
k.decay = (uint8_t)clamp(k.decay + p[P_E3] - 64, 0, 127);
k.tone = (uint8_t)clamp(k.tone + p[P_E2] - 64, 0, 127);
k.decay = (uint8_t)clamp(k.decay + p[P_E3] - 64 + p[P_LDECAY0 + ln], 0, 127); /* ((Skiff phase 9) and the */
k.tone = (uint8_t)clamp(k.tone + p[P_E2] - 64, 0, 127); /* lane its own: LANES) */
k.extra = (uint8_t)clamp(k.extra + p[P_E4] - 64, 0, 127);
k.accent = (uint8_t)clamp(acc >> 9, 0, 127); /* (Q16 -> 0..127) */
k.tune = (int16_t)(L->st * 16 + (p[P_E1] - 64) * 3); /* +-12 semitones */
k.tune = (int16_t)(L->st * 16 + (p[P_E1] - 64) * 3 + (p[P_LTUNE0 + ln] - 64) * 3); /* +-12 semitones, each */
if (((const uint32_t *)&k)[0] != ((const uint32_t *)&L->key)[0] ||
((const uint32_t *)&k)[1] != ((const uint32_t *)&L->key)[1]) {
dv_setup(&L->c, &k); /* (a parameter moved) */
@@ -308,10 +308,18 @@ static int32_t drum_keys(const track_t *t, uint32_t k)
/* {KIT, TUNE, TONE, DECY, SNAP, ACC, KICK, DRV}; every kit suggests the BEAT pattern (GM notes) */
static const preset_t DRUM_PRESETS[] = {
{"DRUM KIT", DRUM_KIT_E, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20)}, /* (core.h: SAMPLE PERC's too) */
{"DRUM KIT", DRUM_KIT_E, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)}, /* (core.h: SAMPLE PERC's too) */
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"WAR DRUMS", {0, 40, 38, 108, 40, 110, 1, 24}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 75)},
{"NEON KIT", {4, 60, 80, 56, 90, 100, 0, 20}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 40)},
{"WAR DRUMS", {0, 40, 38, 108, 40, 110, 1, 24}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 75), TAG(PT_DRUM)},
{"NEON KIT", {4, 60, 80, 56, 90, 100, 0, 20}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 40), TAG(PT_DRUM)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"BOOM KIT", {4, 58, 60, 100, 50, 100, 0, 10}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 25), TAG(PT_DRUM)},
{"CRISP KIT", {5, 64, 76, 60, 80, 100, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)},
{"RHYTHM BOX", {6, 66, 64, 56, 64, 100, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)},
{"ELECTRO KIT", {7, 64, 70, 60, 70, 100, 0, 15}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)},
{"STUDIO KIT", {8, 64, 64, 64, 64, 100, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 25), TAG(PT_DRUM)},
{"TIGHT KIT", {0, 70, 80, 30, 100, 110, 0, 10}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 12), TAG(PT_DRUM)},
{"LOFI KIT", {0, 56, 30, 70, 40, 100, 1, 50}, {0, 100, 127, 100}, 0, 0, FX(20, 0, 0, 30), TAG(PT_DRUM)},
};
static const engine_t ENG_DRUM = {
+96 -2
View File
@@ -146,11 +146,105 @@ static void drumx_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
/* {MRPH, TUNE, TONE, DECY, NOIS, FM, FOLD, DRV} */
#define DRUMX_E {64, 64, 70, 64, 64, 0, 0, 0}
static const preset_t DRUMX_PRESETS[] = {
{"DRUM KIT", DRUMX_E, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20)}, /* (the footer: DRUM-X DRUM KIT) */
{"OWN KIT", DRUMX_E, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)}, /* (the footer: DRUM-X OWN KIT:
* it plays the project's own kit,
* as FM6's SLOT OWN its patch;
* DRUM KIT until phase 9, DRUM's
* name too) */
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"HADRON KIT", {100, 72, 90, 40, 80, 70, 60, 25}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 30, 25)},
{"HADRON KIT", {100, 72, 90, 40, 80, 70, 60, 25}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 30, 25), TAG(PT_DRUM)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"FACTORY KIT", {64, 64, 70, 64, 64, 0, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 20), TAG(PT_DRUM)},
{"DEEP KIT", {64, 60, 64, 62, 60, 0, 0, 10}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 30), TAG(PT_DRUM)},
{"CLICK KIT", {64, 64, 70, 64, 64, 0, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 20, 15), TAG(PT_DRUM)},
{"INDUSTRIAL", {64, 62, 70, 64, 70, 20, 30, 40}, {0, 100, 127, 100}, 0, 0, FX(10, 0, 10, 35), TAG(PT_DRUM)},
{"SOFT KIT", {64, 64, 56, 60, 56, 0, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 40), TAG(PT_DRUM)},
{"GLITCH KIT", {64, 64, 70, 60, 64, 30, 20, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 35, 20), TAG(PT_DRUM)},
{"TRIBAL KIT", {64, 64, 64, 64, 60, 0, 0, 0}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 0, 35), TAG(PT_DRUM)},
{"LASER KIT", {64, 64, 70, 64, 64, 10, 0, 10}, {0, 100, 127, 100}, 0, 0, FX(0, 0, 30, 25), TAG(PT_DRUM)},
};
/* (Skiff phase 9) the factory kits a preset loads as the project's kit (ui.c apply_preset_to), 8 lanes as dx_kit has
* them (drumx_voice.c): 0 the factory kit (DX_KIT_INIT, what INIT gives), then the kits of the presets FACTORY KIT on.
* DRUMX_PKIT[preset]: its kit + 1, 0 none: OWN KIT, the first, loads on every switch to DRUM-X (ui.c
* set_engine_of) and keeps the kit there is, as HADRON KIT (the kit's macros) */
static const dx_lane_t DX_KITS[][8] = {
DX_KIT_INIT,
{ /* DEEP */
{DX_MODE(DXW_SINE, DXF_LP, 1) | DXM_LONG << 5, {6, 60, 84, 2, 10}, {10, 80, 92, 4, 30}}, /* KICK */
{DX_MODE(DXW_SINE, DXF_BP, 0), {36, 20, 60, 90, 60}, {40, 28, 70, 100, 70}}, /* SNARE */
{DX_MODE(DXW_SINE, DXF_BP, 0), {56, 0, 52, 127, 70}, {52, 0, 64, 127, 64}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_HP, 0), {92, 0, 18, 100, 104}, {96, 0, 24, 110, 110}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_HP, 0), {92, 0, 70, 100, 100}, {96, 0, 84, 110, 106}}, /* HAT OP */
{DX_MODE(DXW_SINE, DXF_LP, 1) | DXM_LONG << 5, {22, 50, 80, 6, 20}, {28, 70, 92, 10, 40}}, /* TOM */
{DX_MODE(DXW_BELL, DXF_HP, 1), {58, 8, 16, 10, 40}, {62, 16, 22, 20, 50}}, /* RIM */
{DX_MODE(DXW_METAL, DXF_BP, 0), {64, 0, 80, 0, 36}, {70, 0, 92, 10, 48}}, /* BELL */
},
{ /* CLICK */
{DX_MODE(DXW_SINE, DXF_LP, 1), {16, 100, 60, 10, 40}, {20, 120, 68, 20, 70}}, /* KICK */
{DX_MODE(DXW_FM, DXF_HP, 0), {60, 10, 40, 70, 110}, {66, 0, 46, 90, 120}}, /* SNARE */
{DX_MODE(DXW_SINE, DXF_HP, 0), {70, 0, 30, 127, 100}, {66, 0, 40, 127, 96}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_HP, 0), {116, 0, 8, 60, 124}, {120, 0, 12, 80, 127}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_HP, 0), {116, 0, 40, 60, 120}, {120, 0, 50, 80, 124}}, /* HAT OP */
{DX_MODE(DXW_FM, DXF_LP, 1), {40, 60, 36, 0, 50}, {46, 80, 44, 0, 70}}, /* TOM */
{DX_MODE(DXW_BELL, DXF_HP, 1), {80, 20, 8, 0, 60}, {86, 30, 10, 10, 80}}, /* RIM */
{DX_MODE(DXW_FM, DXF_BP, 0), {88, 0, 30, 0, 80}, {92, 0, 40, 0, 90}}, /* BELL */
},
{ /* INDUSTRIAL */
{DX_MODE(DXW_FM, DXF_LP, 1) | DX_DRIVE, {10, 90, 70, 20, 70}, {14, 110, 80, 30, 100}}, /* KICK */
{DX_MODE(DXW_METAL, DXF_BP, 0) | DX_DRIVE, {44, 30, 50, 100, 80}, {50, 40, 60, 110, 90}}, /* SNARE */
{DX_MODE(DXW_METAL, DXF_BP, 0), {64, 0, 46, 120, 90}, {60, 0, 56, 124, 84}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_HP, 0) | DX_DRIVE, {104, 0, 20, 110, 116}, {110, 0, 28, 120, 122}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_HP, 0), {104, 0, 72, 110, 112}, {110, 0, 84, 120, 118}}, /* HAT OP */
{DX_MODE(DXW_METAL, DXF_LP, 1), {28, 50, 60, 20, 60}, {34, 70, 72, 30, 80}}, /* TOM */
{DX_MODE(DXW_BELL, DXF_BP, 1) | DX_DRIVE, {70, 20, 20, 30, 70}, {76, 30, 26, 40, 90}}, /* RIM */
{DX_MODE(DXW_BELL, DXF_BP, 0), {60, 10, 90, 10, 60}, {66, 20, 94, 20, 74}}, /* BELL */
},
{ /* SOFT */
{DX_MODE(DXW_SINE, DXF_LP, 1), {12, 40, 76, 0, 4}, {14, 54, 86, 2, 14}}, /* KICK */
{DX_MODE(DXW_SINE, DXF_LP, 0), {42, 10, 46, 60, 50}, {44, 16, 56, 70, 56}}, /* SNARE */
{DX_MODE(DXW_SINE, DXF_LP, 0), {60, 0, 40, 127, 60}, {58, 0, 50, 127, 56}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_BP, 0), {90, 0, 16, 100, 90}, {94, 0, 22, 110, 96}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_BP, 0), {90, 0, 60, 100, 86}, {94, 0, 70, 110, 92}}, /* HAT OP */
{DX_MODE(DXW_SINE, DXF_LP, 1), {32, 20, 60, 4, 10}, {36, 30, 70, 8, 20}}, /* TOM */
{DX_MODE(DXW_SINE, DXF_BP, 1), {66, 4, 12, 20, 40}, {70, 8, 16, 30, 50}}, /* RIM */
{DX_MODE(DXW_SINE, DXF_BP, 0), {78, 0, 60, 0, 20}, {80, 0, 72, 4, 30}}, /* BELL */
},
{ /* GLITCH */
{DX_MODE(DXW_FM, DXF_LP, 1) | DXM_NOISE << 5, {12, 80, 56, 10, 60}, {18, 110, 64, 20, 90}}, /* KICK */
{DX_MODE(DXW_FM, DXF_BP, 0) | DXM_NOISE << 5, {50, 60, 40, 90, 100}, {58, 80, 48, 100, 110}}, /* SNARE */
{DX_MODE(DXW_METAL, DXF_HP, 0), {76, 20, 30, 110, 110}, {70, 30, 40, 120, 104}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_HP, 0) | DXM_NOISE << 5, {110, 30, 10, 80, 120}, {118, 50, 14, 90, 126}}, /* HAT CL */
{DX_MODE(DXW_BELL, DXF_HP, 0), {108, 20, 44, 80, 116}, {114, 30, 52, 90, 122}}, /* HAT OP */
{DX_MODE(DXW_FM, DXF_LP, 0) | DXM_NOISE << 5, {36, 90, 40, 10, 80}, {44, 110, 48, 20, 100}}, /* TOM */
{DX_MODE(DXW_BELL, DXF_HP, 1) | DXM_NOISE << 5, {84, 40, 10, 30, 80}, {90, 60, 14, 40, 100}}, /* RIM */
{DX_MODE(DXW_FM, DXF_BP, 0) | DXM_SINE << 5, {72, 50, 50, 0, 90}, {80, 70, 60, 10, 100}}, /* BELL */
},
{ /* TRIBAL */
{DX_MODE(DXW_SINE, DXF_LP, 1) | DXM_LONG << 5, {14, 50, 80, 0, 20}, {18, 64, 90, 4, 30}}, /* KICK */
{DX_MODE(DXW_SINE, DXF_BP, 1), {46, 40, 50, 40, 50}, {50, 50, 58, 50, 60}}, /* SNARE */
{DX_MODE(DXW_SINE, DXF_BP, 0), {58, 0, 40, 127, 72}, {54, 0, 48, 127, 66}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_BP, 0), {96, 0, 14, 110, 100}, {100, 0, 18, 120, 106}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_BP, 0), {96, 0, 40, 110, 96}, {100, 0, 50, 120, 102}}, /* HAT OP */
{DX_MODE(DXW_SINE, DXF_LP, 1) | DXM_LONG << 5, {30, 60, 70, 4, 24}, {36, 80, 80, 8, 34}}, /* TOM */
{DX_MODE(DXW_BELL, DXF_BP, 1), {74, 10, 18, 4, 50}, {78, 16, 22, 10, 60}}, /* RIM */
{DX_MODE(DXW_BELL, DXF_BP, 0), {76, 0, 70, 0, 40}, {80, 0, 80, 4, 50}}, /* BELL */
},
{ /* LASER */
{DX_MODE(DXW_SINE, DXF_LP, 1), {10, 110, 70, 0, 30}, {14, 127, 80, 6, 50}}, /* KICK */
{DX_MODE(DXW_FM, DXF_BP, 0) | DXM_SINE << 5, {50, 70, 50, 80, 90}, {56, 90, 60, 90, 100}}, /* SNARE */
{DX_MODE(DXW_SINE, DXF_BP, 0), {62, 0, 44, 127, 86}, {58, 0, 54, 127, 80}}, /* CLAP */
{DX_MODE(DXW_METAL, DXF_HP, 0), {106, 0, 14, 90, 120}, {110, 0, 18, 100, 124}}, /* HAT CL */
{DX_MODE(DXW_METAL, DXF_HP, 0), {106, 0, 56, 90, 116}, {110, 0, 64, 100, 120}}, /* HAT OP */
{DX_MODE(DXW_SINE, DXF_LP, 1) | DXM_SINE << 5, {40, 100, 60, 0, 40}, {48, 120, 70, 0, 60}}, /* TOM */
{DX_MODE(DXW_FM, DXF_HP, 1) | DXM_SINE << 5, {90, 90, 20, 0, 80}, {96, 110, 26, 0, 100}}, /* RIM */
{DX_MODE(DXW_SINE, DXF_LP, 0) | DXM_SINE << 5, {70, 127, 50, 0, 40}, {80, 127, 60, 0, 60}}, /* BELL */
},
};
static const uint8_t DRUMX_PKIT[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8};
_Static_assert(sizeof DRUMX_PKIT == NELEM(DRUMX_PRESETS), "a kit (or none) per DRUM-X preset");
_Static_assert(sizeof DX_KITS[0] == sizeof dx_kit, "a factory kit is a kit");
static const engine_t ENG_DRUMX = {
.name = "DRUM-X",
.page_title = {"KIT", "HIT"},
+15 -12
View File
@@ -383,19 +383,22 @@ _Static_assert(NELEM(N_FM6_PATCH) == FM6_OWN + 2u, "a SLOT name per value");
/* {ALG, FB, MLVL, MRAT, MEG, VMOD, DTUN, SLOT}: the factory patch F1..F8 as it is, DTUN on the pad */
static const preset_t FM6_PRESETS[] = {
{"TINE EP", {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 127, 0}, 0, 0, FX(0, 45, 25, 35)},
{"BELL", {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 10, 30, 70)},
{"FM BASS", {0, 0, 0, 0, 0, 0, 0, 2}, {0, 0, 127, 0}, 0, 1, FX(0, 0, 10, 10)},
{"BRASS", {0, 0, 0, 0, 0, 0, 0, 3}, {0, 0, 127, 0}, 0, 0, FX(0, 25, 20, 40)},
{"PAD", {0, 0, 0, 0, 0, 0, 30, 4}, {0, 0, 127, 0}, 0, 0, FX(0, 60, 30, 70)},
{"MARIMBA", {0, 0, 0, 0, 0, 0, 0, 5}, {0, 0, 127, 0}, 0, 0, FX(0, 0, 25, 40)},
{"ORGAN", {0, 0, 0, 0, 0, 0, 0, 6}, {0, 0, 127, 0}, 0, 0, FX(10, 40, 0, 30)},
{"PLUCK", {0, 0, 0, 0, 0, 0, 0, 7}, {0, 0, 127, 0}, 0, 0, FX(0, 20, 35, 30)},
{"TINE EP", {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 127, 0}, 0, 0, FX(0, 45, 25, 35), TAG(PT_KEYS)},
{"GLASS BELL", {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 10, 30, 70), TAG(PT_KEYS)},
{"FM BASS", {0, 0, 0, 0, 0, 0, 0, 2}, {0, 0, 127, 0}, 0, 1, FX(0, 0, 10, 10), TAG(PT_BASS)},
{"FM BRASS", {0, 0, 0, 0, 0, 0, 0, 3}, {0, 0, 127, 0}, 0, 0, FX(0, 25, 20, 40), TAG(PT_LEAD)},
{"PAD", {0, 0, 0, 0, 0, 0, 30, 4}, {0, 0, 127, 0}, 0, 0, FX(0, 60, 30, 70), TAG(PT_PAD)},
{"FM MARIMBA", {0, 0, 0, 0, 0, 0, 0, 5}, {0, 0, 127, 0}, 0, 0, FX(0, 0, 25, 40), TAG(PT_KEYS)},
{"FM ORGAN", {0, 0, 0, 0, 0, 0, 0, 6}, {0, 0, 127, 0}, 0, 0, FX(10, 40, 0, 30), TAG(PT_KEYS)},
{"NYLON PICK", {0, 0, 0, 0, 0, 0, 0, 7}, {0, 0, 127, 0}, 0, 0, FX(0, 20, 35, 30), TAG(PT_PLUCK)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"GRAVE BELL", {0, 0, 6, 0, 20, 0, 30, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 10, 15, 100)},
{"GLASS KEYS", {0, 0, 8, 0, 0, 0, 24, 0}, {0, 0, 127, 0}, 0, 0, FX(0, 75, 30, 45)},
{"ISOTOPE", {0, 0, 14, 2, -10, 0, 50, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 20, 50, 70)},
{"DARK MATTER", {0, 4, 16, 0, 10, 0, 0, 2}, {0, 0, 127, 0}, 0, 1, FX(8, 0, 0, 10)},
{"GRAVE BELL", {0, 0, 6, 0, 20, 0, 30, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 10, 15, 100), TAG(PT_KEYS)},
{"GLASS KEYS", {0, 0, 8, 0, 0, 0, 24, 0}, {0, 0, 127, 0}, 0, 0, FX(0, 75, 30, 45), TAG(PT_KEYS)},
{"ISOTOPE", {0, 0, 14, 2, -10, 0, 50, 1}, {0, 0, 127, 0}, 0, 0, FX(0, 20, 50, 70), TAG(PT_KEYS)},
{"DARK MATTER", {0, 4, 16, 0, 10, 0, 0, 2}, {0, 0, 127, 0}, 0, 1, FX(8, 0, 0, 10), TAG(PT_BASS)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"PICK BASS", {0, 2, 12, 0, 16, 2, 0, 7}, {0, 0, 127, 0}, 0, 1, FX(0, 0, 5, 10), TAG(PT_BASS)},
{"GROWL BASS", {0, 5, 8, 0, 20, 0, 8, 3}, {0, 0, 127, 0}, 20, 1, FX(30, 0, 5, 5), MORE({P_LD_FLT, 36}, {P_LRATE, 80}, {P_DTYPE, 2}), TAG(PT_BASS)},
};
static const engine_t ENG_FM6 = {
+9 -7
View File
@@ -204,14 +204,16 @@ static void formant_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, con
static const preset_t FORMANT_PRESETS[] = {
/* VOWEL VOWL2 TALK SHIFT | BUZZ BREATH Q RAND */
{"CHOIR AAH", {0, 0, 0, 0, 40, 22, 60, 0}, {85, 90, 115, 95}, 0, 0, FX(0, 70, 15, 90)},
{"VOX LEAD", {32, 0, 0, 2, 90, 8, 72, 0}, {6, 70, 105, 55}, 0, 1, FX(0, 20, 45, 40)},
{"WOW BASS", {95, 0, 68, 0, 100, 0, 80, 0}, {0, 70, 70, 30}, 0, 1, FX(10, 0, 10, 10)},
{"WHISPER", {0, 95, 88, 3, 50, 120, 50, 0}, {50, 90, 110, 90}, 0, 0, FX(0, 40, 30, 70)},
{"CHOIR AAH", {0, 0, 0, 0, 40, 22, 60, 0}, {85, 90, 115, 95}, 0, 0, FX(0, 70, 15, 90), TAG(PT_PAD)},
{"VOX LEAD", {32, 0, 0, 2, 90, 8, 72, 0}, {6, 70, 105, 55}, 0, 1, FX(0, 20, 45, 40), TAG(PT_LEAD)},
{"WOW BASS", {95, 0, 68, 0, 100, 0, 80, 0}, {0, 70, 70, 30}, 0, 1, FX(10, 0, 10, 10), TAG(PT_BASS)},
{"WHISPER", {0, 95, 88, 3, 50, 120, 50, 0}, {50, 90, 110, 90}, 0, 0, FX(0, 40, 30, 70), TAG(PT_FX)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"CRYPT CHOIR", {112, 0, 0, -3, 34, 30, 64, 14}, {90, 90, 118, 100}, 0, 0, FX(0, 75, 10, 110), MORE({P_LRATE, 70}, {P_LD_PIT, 1})},
{"MONK CHANT", {95, 0, 96, -5, 80, 12, 80, 0}, {50, 80, 115, 85}, 0, 1, FX(0, 20, 10, 110), MORE({P_LRATE, 82}, {P_LFADE, 96}, {P_LD_PIT, 1})},
{"DREAM CHOIR", {0, 20, 0, 3, 55, 45, 55, 8}, {80, 90, 118, 95}, 0, 0, FX(0, 90, 30, 80)},
{"CRYPT CHOIR", {112, 0, 0, -3, 34, 30, 64, 14}, {90, 90, 118, 100}, 0, 0, FX(0, 75, 10, 110), MORE({P_LRATE, 70}, {P_LD_PIT, 1}), TAG(PT_PAD)},
{"MONK CHANT", {95, 0, 96, -5, 80, 12, 80, 0}, {50, 80, 115, 85}, 0, 1, FX(0, 20, 10, 110), MORE({P_LRATE, 82}, {P_LFADE, 96}, {P_LD_PIT, 1}), TAG(PT_PAD)},
{"DREAM CHOIR", {0, 20, 0, 3, 55, 45, 55, 8}, {80, 90, 118, 95}, 0, 0, FX(0, 90, 30, 80), TAG(PT_PAD)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"ROBOT TALK", {20, 100, 40, -12, 110, 4, 90, 30}, {0, 70, 100, 30}, 0, 1, FX(10, 0, 40, 30), TAG(PT_LEAD)},
};
static const engine_t ENG_FORMANT = {
+9 -5
View File
@@ -439,12 +439,16 @@ static void grain_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
static const preset_t GRAIN_PRESETS[] = {
/* name, {SRC, POS, SIZE, DENS, PTCH, SPRD, RAND, TONE}, {A D S R}, fenv, mono */
{"CLOUD PAD", {2, 50, 92, 88, 0, 40, 14, 100}, {70, 90, 120, 90}, 0, 0, FX(0, 40, 25, 85)},
{"GLITCH", {3, 64, 24, 112, 0, 100, 90, 127}, {0, 70, 100, 30}, 0, 0, FX(10, 0, 50, 25)},
{"FROZEN", {0, 40, 108, 72, 0, 0, 10, 92}, {50, 100, 127, 100}, 0, 0, FX(0, 30, 20, 95)},
{"SHIMMER", {0, 30, 70, 100, 12, 30, 24, 110}, {30, 90, 110, 90}, 0, 0, FX(0, 50, 40, 90)},
{"CLOUD PAD", {2, 50, 92, 88, 0, 40, 14, 100}, {70, 90, 120, 90}, 0, 0, FX(0, 40, 25, 85), TAG(PT_PAD)},
{"GLITCH", {3, 64, 24, 112, 0, 100, 90, 127}, {0, 70, 100, 30}, 0, 0, FX(10, 0, 50, 25), TAG(PT_FX)},
{"FROZEN", {0, 40, 108, 72, 0, 0, 10, 92}, {50, 100, 127, 100}, 0, 0, FX(0, 30, 20, 95), TAG(PT_PAD)},
{"SHIMMER", {0, 30, 70, 100, 12, 30, 24, 110}, {30, 90, 110, 90}, 0, 0, FX(0, 50, 40, 90), TAG(PT_PAD)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"QUARK CLOUD", {2, 70, 6, 124, 12, 120, 70, 115}, {50, 90, 120, 95}, 0, 0, FX(0, 30, 45, 85)},
{"QUARK CLOUD", {2, 70, 6, 124, 12, 120, 70, 115}, {50, 90, 120, 95}, 0, 0, FX(0, 30, 45, 85), TAG(PT_PAD)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"PIANO HAZE", {0, 20, 100, 80, 0, 50, 20, 90}, {70, 90, 120, 100}, 0, 0, FX(0, 50, 30, 90), TAG(PT_PAD)},
{"SAX DRONE", {3, 60, 120, 90, -12, 20, 10, 80}, {90, 90, 127, 100}, 0, 0, FX(0, 40, 20, 90), TAG(PT_PAD)},
{"SCATTER", {2, 64, 40, 70, 12, 50, 0, 110}, {0, 70, 100, 50}, 0, 0, FX(0, 20, 45, 60), TAG(PT_FX)},
};
static const engine_t ENG_GRAIN = {
+9 -6
View File
@@ -204,15 +204,18 @@ static void lofi_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
}
static const preset_t LOFI_PRESETS[] = {
{"PULSE LD", {0, 0, 32, 0, 0, 20, 0, 127}, {0, 60, 90, 30}, 0, 1, FX(0, 0, 40, 20)},
{"WAVE BASS", {1, 1, 0, 0, 0, 0, 0, 90}, {0, 50, 70, 20}, 0, 1, FX(0, 0, 10, 0)},
{"ARP 8BIT", {2, 0, 96, 0, 0, 0, 2, 110}, {0, 60, 80, 40}, 0, 0, FX(0, 0, 30, 20)},
{"PULSE LD", {0, 0, 32, 0, 0, 20, 0, 127}, {0, 60, 90, 30}, 0, 1, FX(0, 0, 40, 20), TAG(PT_LEAD)},
{"WAVE BASS", {1, 1, 0, 0, 0, 0, 0, 90}, {0, 50, 70, 20}, 0, 1, FX(0, 0, 10, 0), TAG(PT_BASS)},
{"ARP 8BIT", {2, 0, 96, 0, 0, 0, 2, 110}, {0, 60, 80, 40}, 0, 0, FX(0, 0, 30, 20), TAG(PT_LEAD)},
/* wave RAM VOXA (DUTY 92 / 8 = 11), a little vibrato */
{"WAVE LEAD", {0, 4, 92, 0, 0, 18, 0, 110}, {0, 70, 90, 30}, 0, 1, FX(0, 0, 40, 25)},
{"WAVE LEAD", {0, 4, 92, 0, 0, 18, 0, 110}, {0, 70, 90, 30}, 0, 1, FX(0, 0, 40, 25), TAG(PT_LEAD)},
/* STEP: 25 % pulse, DCY 34 = D7 (a 15-step decay over 0.5 s), REL ~54 ms of staircase after note-off */
{"STEP LEAD", {4, 0, 40, 34, 0, 16, 0, 127}, {0, 64, 127, 55}, 0, 1, FX(0, 0, 40, 20)},
{"STEP LEAD", {4, 0, 40, 34, 0, 16, 0, 127}, {0, 64, 127, 55}, 0, 1, FX(0, 0, 40, 20), TAG(PT_LEAD)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"PHOTON", {2, 1, 64, 0, 16, 0, 0, 120}, {0, 70, 0, 40}, 0, 0, FX(0, 0, 50, 35)},
{"PHOTON", {2, 1, 64, 0, 16, 0, 0, 120}, {0, 70, 0, 40}, 0, 0, FX(0, 0, 50, 35), TAG(PT_PLUCK)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"TRI BASS", {0, 1, 64, 0, 0, 0, 0, 100}, {0, 60, 90, 20}, 0, 1, FX(0, 0, 5, 5), TAG(PT_BASS)},
{"CHIP BELL", {2, 0, 20, 0, 30, 0, 0, 110}, {0, 70, 0, 50}, 0, 0, FX(0, 0, 40, 40), TAG(PT_PLUCK)},
};
static const engine_t ENG_LOFI = {
+10 -7
View File
@@ -240,16 +240,19 @@ static void noise_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
/* {MODE, COLR, FREQ, RES, TRK, DENS, DRFT, CRSH / CLK} */
static const preset_t NOISE_PRESETS[] = {
{"WIND", {NZ_ANLG, 64, 70, 100, 127, 0, 70, 0}, {90, 90, 110, 90}, 0, 0, FX(0, 30, 20, 80)},
{"RAIN", {NZ_DUST, 30, 88, 80, 64, 105, 40, 0}, {10, 90, 127, 70}, 0, 0, FX(0, 0, 20, 70)},
{"WIND", {NZ_ANLG, 64, 70, 100, 127, 0, 70, 0}, {90, 90, 110, 90}, 0, 0, FX(0, 30, 20, 80), TAG(PT_FX)},
{"RAIN", {NZ_DUST, 30, 88, 80, 64, 105, 40, 0}, {50, 90, 127, 70}, 0, 0, FX(0, 0, 20, 70), TAG(PT_FX)}, /* ((Skiff phase 9) its
* attack slower: it came in hard) */
/* a 7-bit register (127 steps) clocked 84 semitones (7 octaves) above the key: one period per key period,
* a pitched chip-style buzz */
{"ARCADE", {NZ_LFSR, 0, 127, 0, 127, 112, 0, 84}, {0, 80, 0, 50}, 0, 0, FX(0, 0, 10, 20)},
{"METAL", {NZ_META, 0, 100, 40, 100, 32, 0, 0}, {0, 75, 40, 60}, 10, 0, FX(0, 20, 30, 45)},
{"ARCADE", {NZ_LFSR, 0, 127, 0, 127, 112, 0, 84}, {0, 80, 0, 50}, 0, 0, FX(0, 0, 10, 20), TAG(PT_FX)},
{"METAL", {NZ_META, 0, 100, 40, 100, 32, 0, 0}, {0, 75, 40, 60}, 10, 0, FX(0, 20, 30, 45), TAG(PT_FX)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"CAVE WIND", {NZ_ANLG, 100, 70, 112, 127, 0, 100, 0}, {100, 90, 120, 100}, 0, 0, FX(0, 40, 10, 100)},
{"GEIGER", {NZ_DUST, 10, 100, 40, 64, 34, 0, 0}, {0, 90, 127, 40}, 0, 0, FX(0, 0, 5, 15)},
{"PLASMA", {NZ_META, 0, 90, 90, 100, 40, 80, 0}, {60, 90, 110, 90}, 0, 0, FX(0, 30, 30, 80), MORE({P_LRATE, 56}, {P_LD_FLT, 18})},
{"CAVE WIND", {NZ_ANLG, 100, 70, 112, 127, 0, 100, 0}, {100, 90, 120, 100}, 0, 0, FX(0, 40, 10, 100), TAG(PT_FX)},
{"GEIGER", {NZ_DUST, 10, 100, 40, 64, 34, 0, 0}, {0, 90, 127, 40}, 0, 0, FX(0, 0, 5, 15), TAG(PT_FX)},
{"PLASMA", {NZ_META, 0, 90, 90, 100, 40, 80, 0}, {60, 90, 110, 90}, 0, 0, FX(0, 30, 30, 80), MORE({P_LRATE, 56}, {P_LD_FLT, 18}), TAG(PT_FX)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"OCEAN", {NZ_ANLG, 50, 60, 20, 0, 0, 40, 0}, {100, 90, 120, 110}, 0, 0, FX(0, 30, 10, 90), MORE({P_LRATE, 20}, {P_LD_FLT, 40}, {P_LWAVE, 1}), TAG(PT_FX)},
};
static const engine_t ENG_NOISE = {
+10 -7
View File
@@ -172,14 +172,17 @@ static void phase_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
static const preset_t PHASE_PRESETS[] = {
/* name, {WAVE, WAVE2, DCW, ENV, DTN, LINE, SUB, -}, {A D S R}, fenv, mono */
{"BRASS", {0, 0, 30, 90, 0, 0, 0, 0}, {8, 70, 90, 40}, 0, 0, FX(0, 20, 20, 40)},
{"ORGAN", {3, 0, 40, 0, 0, 0, 0, 0}, {0, 127, 127, 30}, 0, 0, FX(0, 40, 0, 30)},
{"STRING", {0, 4, 50, 40, 12, 0, 0, 0}, {40, 90, 100, 70}, 0, 0, FX(0, 50, 20, 60)},
{"RESO", {5, 0, 60, 60, 0, 0, 0, 0}, {0, 70, 30, 60}, 0, 0, FX(0, 0, 40, 40)},
{"BELL", {6, 0, 80, 50, 0, 0, 0, 0}, {0, 95, 0, 90}, 0, 0, FX(0, 0, 30, 70)},
{"WIRE", {4, 7, 70, 40, 7, 0, 0, 0}, {10, 80, 80, 60}, 0, 0, FX(15, 30, 30, 40)},
{"PD BRASS", {0, 0, 30, 90, 0, 0, 0, 0}, {8, 70, 90, 40}, 0, 0, FX(0, 20, 20, 40), TAG(PT_LEAD)},
{"PD ORGAN", {3, 0, 40, 0, 0, 0, 0, 0}, {0, 127, 127, 30}, 0, 0, FX(0, 40, 0, 30), TAG(PT_KEYS)},
{"PD STRINGS", {0, 4, 50, 40, 12, 0, 0, 0}, {40, 90, 100, 70}, 0, 0, FX(0, 50, 20, 60), TAG(PT_PAD)},
{"RESO", {5, 0, 60, 60, 0, 0, 0, 0}, {0, 70, 30, 60}, 0, 0, FX(0, 0, 40, 40), TAG(PT_LEAD)},
{"PD BELL", {6, 0, 80, 50, 0, 0, 0, 0}, {0, 95, 0, 90}, 0, 0, FX(0, 0, 30, 70), TAG(PT_KEYS)},
{"WIRE", {4, 7, 70, 40, 7, 0, 0, 0}, {10, 80, 80, 60}, 0, 0, FX(15, 30, 30, 40), TAG(PT_LEAD)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"NEUTRINO", {3, 0, 20, 70, 0, 0, 0, 0}, {0, 80, 0, 75}, 0, 0, FX(0, 10, 75, 55)},
{"NEUTRINO", {3, 0, 20, 70, 0, 0, 0, 0}, {0, 80, 0, 75}, 0, 0, FX(0, 10, 75, 55), TAG(PT_PLUCK)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"PD BASS", {0, 0, 50, 80, 4, 0, 60, 0}, {0, 60, 60, 25}, 0, 1, FX(5, 0, 5, 10), TAG(PT_BASS)},
{"SOFT KEYS", {3, 0, 30, 60, 6, 0, 0, 0}, {0, 85, 30, 60}, 0, 0, FX(0, 40, 20, 40), TAG(PT_KEYS)},
};
static const engine_t ENG_PHASE = {
+12 -10
View File
@@ -214,19 +214,21 @@ static void phys_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
* 98 1 : 3.57 : 7.65, 116 1 : 4.0 : 9.0 (a tuned bar: 1 : 4 : 10) */
static const preset_t PHYS_PRESETS[] = {
/* name, {MODEL, STRC, BRIT, DAMP, POS, ACC, BOW, EXC}, {A D S R}, fenv, mono */
{"BELL TREE", {PM_MODAL, 70, 100, 106, 12, 100, 0, 6}, {0, 100, 127, 96}, 0, 0, FX(0, 20, 30, 60)},
{"MARIMBA", {PM_MODAL, 116, 38, 40, 24, 90, 0, 30}, {0, 90, 127, 52}, 0, 0, FX(0, 0, 15, 30)},
{"PLUCK", {PM_STRING, 56, 72, 84, 40, 96, 0, 0}, {0, 100, 127, 58}, 0, 0, FX(0, 10, 30, 30)},
{"BOWED METAL", {PM_MODAL, 98, 70, 112, 10, 80, 90, 0}, {60, 90, 127, 90}, 0, 0, FX(0, 40, 20, 70)},
{"KALIMBA", {PM_MODAL, 34, 16, 56, 100, 90, 0, 48}, {0, 100, 127, 60}, 0, 0, FX(0, 10, 20, 40)},
{"BELL TREE", {PM_MODAL, 70, 100, 106, 12, 100, 0, 6}, {0, 100, 127, 96}, 0, 0, FX(0, 20, 30, 60), TAG(PT_KEYS)},
{"MARIMBA", {PM_MODAL, 116, 38, 40, 24, 90, 0, 30}, {0, 90, 127, 52}, 0, 0, FX(0, 0, 15, 30), TAG(PT_KEYS)},
{"PLUCK", {PM_STRING, 56, 72, 84, 40, 96, 0, 0}, {0, 100, 127, 58}, 0, 0, FX(0, 10, 30, 30), TAG(PT_PLUCK)},
{"BOWED METAL", {PM_MODAL, 98, 70, 112, 10, 80, 90, 0}, {60, 90, 127, 90}, 0, 0, FX(0, 40, 20, 70), TAG(PT_PAD)},
{"KALIMBA", {PM_MODAL, 34, 16, 56, 100, 90, 0, 48}, {0, 100, 127, 60}, 0, 0, FX(0, 10, 20, 40), TAG(PT_PLUCK)},
/* MEMB: {MODEL, HARM, BRIT, DAMP, POS, ACC, BEND, EXC} */
{"HAND DRUM", {PM_MEMB, 112, 76, 56, 44, 100, 14, 24}, {0, 100, 127, 64}, 0, 0, FX(0, 0, 10, 30)},
{"TOMS", {PM_MEMB, 0, 52, 40, 30, 100, 40, 30}, {0, 100, 127, 70}, 0, 0, FX(0, 0, 0, 40)},
{"HAND DRUM", {PM_MEMB, 112, 76, 56, 44, 100, 14, 24}, {0, 100, 127, 64}, 0, 0, FX(0, 0, 10, 30), TAG(PT_DRUM)},
{"TOMS", {PM_MEMB, 0, 52, 40, 30, 100, 40, 30}, {0, 100, 127, 70}, 0, 0, FX(0, 0, 0, 40), TAG(PT_DRUM)},
/* SYMP: {MODEL, CHRD, BRIT, DAMP, SYMP, ACC, BUZZ, EXC} */
{"DRONE STRING", {PM_SYMP, 127, 80, 88, 64, 100, 92, 0}, {0, 100, 127, 90}, 0, 0, FX(0, 10, 20, 50)},
{"HARP", {PM_SYMP, 8, 62, 74, 60, 90, 0, 0}, {0, 100, 127, 80}, 0, 0, FX(0, 20, 20, 60)},
{"DRONE STRING", {PM_SYMP, 127, 80, 88, 64, 100, 92, 0}, {0, 100, 127, 90}, 0, 0, FX(0, 10, 20, 50), TAG(PT_PAD)},
{"HARP", {PM_SYMP, 8, 62, 74, 60, 90, 0, 0}, {0, 100, 127, 80}, 0, 0, FX(0, 20, 20, 60), TAG(PT_PLUCK)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"HARPSICHORD", {PM_STRING, 44, 112, 76, 10, 127, 0, 24}, {0, 100, 127, 50}, 0, 0, FX(0, 10, 10, 60)},
{"HARPSICHORD", {PM_STRING, 44, 112, 76, 10, 127, 0, 24}, {0, 100, 127, 50}, 0, 0, FX(0, 10, 10, 60), TAG(PT_KEYS)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"UPRIGHT", {PM_STRING, 60, 60, 90, 20, 127, 0, 60}, {0, 100, 127, 40}, 0, 1, FX(20, 0, 5, 20), TAG(PT_BASS)},
};
static const engine_t ENG_PHYS = {
+30 -15
View File
@@ -2,21 +2,22 @@
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* SLICE: a sample slicer, played from the keys and the sequencer. Felucca's own design.
*
* Material (SRC): the built-in BREAK (tools/gen_samples.py: one bar of 16ths at 120 BPM arranged
* from Felucca's generated drums, stored after the SAMPLE sets), a user slot USR1..3 (the same
* slots as SAMPLE's, eng_sample.c), whose zones are played one after the other as one recording
* (a zone that shares its data with an earlier one is skipped), or PIANO (SRC 4, since 1.0.4: one
* note, the SAMPLE engine's PIANO zone of middle C, played from its data in SMP_DATA: no copy).
* Material (SRC): the built-in BREAK (tools/gen_samples.py: one bar of 16ths at 120 BPM, stored after
* the SAMPLE sets; (Skiff phase 9) made with the YuE2 music model, assets/breaks/), a user slot USR1..3 (the
* same slots as SAMPLE's, eng_sample.c), whose zones are played one after the other as one recording
* (a zone that shares its data with an earlier one is skipped), PIANO (SRC 4, since 1.0.4: one
* note, the SAMPLE engine's PIANO zone of middle C, played from its data in SMP_DATA: no copy), or
* (Skiff phase 9) FUNK (SRC 5: two beats at 86.33 BPM, built in as BREAK is).
* A source with no material (an empty or invalid slot; PIANO in a build without the CC0 samples)
* plays a plain sine at the key's pitch (+ PTCH) instead, through DCAY, TONE and the ADSR (MODE ONE
* acts as GATE there: no slice end), and the UI says so (ui_input.c sample_notice).
*
* Slices (DIV): 4 / 8 / 16 / 32 equal ones, AUTO: one per onset, or MAN: set by hand on the EDIT family's SLICES
* page (ui_slice.c) for a user slot (BREAK and PIANO: MAN plays AUTO). IMA ADPCM can only be entered
* page (ui_slice.c) for a user slot (the built-in ones: MAN plays AUTO). IMA ADPCM can only be entered
* at a known decoder state, so each source keeps a table (slc_src_t): the states at the 128 grid
* points k * len / 128 (every equal slice starts on one, and they are the reverse checkpoints) and
* up to 32 AUTO starts with their states. BREAK's and PIANO's tables are written at build time (BREAK's
* hits are its AUTO slices; PIANO has one, the attack); a user slot's is computed by slc_scan when the slot becomes valid
* up to 32 AUTO starts with their states. The built-in sources' tables are written at build time (BREAK's
* and FUNK's AUTO slices are what slc_scan finds in them; PIANO has one, the attack); a user slot's is computed by slc_scan when the slot becomes valid
* (smp_user_scan: boot, upload end; main loop, never the audio ISR): two decoding passes; per hop
* of 32 samples the peak of the first difference (hats, snares, clicks stand out, a kick's tail
* does not) and the plain peak (low hits); an onset is a hop where either rises 1.75x over its
@@ -60,11 +61,14 @@ typedef struct {
static const slc_src_t SLC_BREAK = SLC_BREAK_INIT;
static const slc_src_t SLC_PIANO = SLC_PIANO_INIT;
static const slc_src_t SLC_FUNK = SLC_FUNK_INIT; /* (Skiff phase 9) */
static slc_src_t slc_usr[SMP_USER_SLOTS];
/* append-only: stored sounds keep their SRC numbers (1.0.4 added PIANO) */
static const char *const N_SLC_SRC[] = {"BREAK", "USR1", "USR2", "USR3", "PIANO"};
/* append-only: stored sounds keep their SRC numbers (1.0.4 added PIANO, Skiff phase 9 FUNK) */
static const char *const N_SLC_SRC[] = {"BREAK", "USR1", "USR2", "USR3", "PIANO", "FUNK"};
#define SLC_SRC_PIANO 4u
#define SLC_NSRC 5
#define SLC_SRC_FUNK 5u
#define SLC_NSRC 6
#define SLC_SRC_USR(src) ((src) - 1u < SMP_USER_SLOTS) /* (Skiff phase 9) USR1..3; the others are built in */
#define SLC_SINE 7u /* a voice's source when it has no material: the sine */
static const char *const N_SLC_DIV[] = {"4", "8", "16", "32", "AUTO", "MAN"};
static const char *const N_SLC_MODE[] = {"ONE", "GATE", "LOOP"};
@@ -87,15 +91,18 @@ static volatile uint8_t slc_man_cur[SMP_USER_SLOTS];
static void (*slc_man_load)(uint32_t k); /* slice_store.c: a slot was read (smp_user_scan): its stored slices */
static uint8_t slc_man_save; /* bit k: slot k's slices changed, to flash (slice_store.c) */
/* the SRC of a part's sound (0..4: a stored value out of range reads as the nearest) */
/* the SRC of a part's sound (0..5: a stored value out of range reads as the nearest) */
static uint32_t slc_src_of(const int16_t *p) { return (uint32_t)clamp(p[P_E0], 0, SLC_NSRC - 1); }
/* source 0 = BREAK, 1..3 = USR1..3, 4 = PIANO; 0 = no material (an empty or erased slot, no PIANO in the build) */
/* source 0 = BREAK, 1..3 = USR1..3, 4 = PIANO, 5 = FUNK; 0 = no material (an empty or erased slot, no PIANO in
* the build) */
static const slc_src_t *slc_get(uint32_t src)
{
if (!src)
return SLC_BREAK.len ? &SLC_BREAK : 0;
if (src == SLC_SRC_PIANO)
return SLC_PIANO.len ? &SLC_PIANO : 0;
if (src == SLC_SRC_FUNK)
return SLC_FUNK.len ? &SLC_FUNK : 0;
src--;
return src < SMP_USER_SLOTS && usr_nz[src] && slc_usr[src].len ? &slc_usr[src] : 0;
}
@@ -610,8 +617,16 @@ static void slice_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
/* two factory sounds, both on BREAK (always there) */
static const preset_t SLICE_PRESETS[] = {
{"CHOP", {0, 2, 0, 0, SLC_ONE, 0, 127, 127}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 12)},
{"STUTTER", {0, 1, 0, 0, SLC_GATE, 0, 90, 110}, {0, 127, 127, 12}, 0, 0, FX(10, 0, 20, 10)},
{"CHOP", {0, 2, 0, 0, SLC_ONE, 0, 127, 127}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 12), TAG(PT_DRUM)},
{"STUTTER", {0, 1, 0, 0, SLC_GATE, 0, 90, 110}, {0, 127, 127, 12}, 0, 0, FX(10, 0, 20, 10), TAG(PT_DRUM)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"LOW BREAK", {0, 2, 0, -7, 0, 0, 127, 100}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 10), TAG(PT_DRUM)},
{"BACK BREAK", {0, 2, 0, 0, 0, 1, 127, 127}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 10), TAG(PT_DRUM)},
{"BREAK HITS", {0, 4, 0, 0, 0, 0, 127, 127}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 10), TAG(PT_DRUM)},
{"SHORT CHOP", {0, 2, 0, 0, 0, 0, 80, 127}, {0, 127, 127, 20}, 0, 0, FX(0, 0, 0, 10), TAG(PT_DRUM)},
{"FAST BREAK", {0, 2, 0, 5, 0, 0, 110, 127}, {0, 127, 127, 25}, 0, 0, FX(35, 0, 10, 10), MORE({P_DTYPE, 1}), TAG(PT_DRUM)},
{"ROLL LOOP", {0, 3, 0, 0, 2, 0, 127, 127}, {0, 127, 127, 20}, 0, 0, FX(0, 0, 0, 10), TAG(PT_FX)},
{"FUNK BREAK", {5, 1, 0, 0, 0, 0, 127, 127}, {0, 127, 127, 30}, 0, 0, FX(0, 0, 0, 10), TAG(PT_DRUM)},
};
/* the lowest key is slice 0 (C4 + ROOT), no scale */
+10 -8
View File
@@ -345,15 +345,17 @@ static void trio_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
static const preset_t TRIO_PRESETS[] = {
/* name, {WAVE, INT2, INT3, DTN, MODE, CUT, RES, PW}, {A D S R}, fenv, mono */
{"FAT BASS", {0, 0, -12, 9, 0, 62, 45, 64}, {0, 62, 60, 25}, 40, 1, FX(10, 0, 10, 10)},
{"ARP LEAD", {2, 12, 0, 4, 0, 88, 25, 32}, {0, 60, 90, 30}, 8, 0, FX(0, 0, 35, 20)},
{"SYNC LEAD", {9, 9, 0, 0, 0, 82, 30, 64}, {2, 70, 100, 40}, 18, 1, FX(0, 10, 40, 25)},
{"RING BELL", {13, 0, 18, 6, 1, 96, 30, 64}, {0, 92, 0, 80}, 0, 0, FX(0, 20, 35, 55)},
{"CHIP CHOIR", {1, 0, 12, 7, 1, 62, 95, 40}, {70, 90, 110, 85}, 30, 0, FX(0, 50, 20, 65)},
{"FAT BASS", {0, 0, -12, 9, 0, 62, 45, 64}, {0, 62, 60, 25}, 40, 1, FX(10, 0, 10, 10), TAG(PT_BASS)},
{"ARP LEAD", {2, 12, 0, 4, 0, 88, 25, 32}, {0, 60, 90, 30}, 8, 0, FX(0, 0, 35, 20), TAG(PT_LEAD)},
{"SYNC LEAD", {9, 9, 0, 0, 0, 82, 30, 64}, {2, 70, 100, 40}, 18, 1, FX(0, 10, 40, 25), TAG(PT_LEAD)},
{"RING BELL", {13, 0, 18, 6, 1, 96, 30, 64}, {0, 92, 0, 80}, 0, 0, FX(0, 20, 35, 55), TAG(PT_KEYS)},
{"CHIP CHOIR", {1, 0, 12, 7, 1, 62, 95, 40}, {70, 90, 110, 85}, 30, 0, FX(0, 50, 20, 65), TAG(PT_PAD)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"TURBO SYNC", {9, 7, 0, 3, 0, 92, 28, 64}, {2, 72, 105, 45}, 20, 1, FX(6, 15, 55, 30), MORE({P_GLIDE, 24}, {P_LRATE, 86}, {P_LFADE, 90}, {P_LD_PIT, 1})},
{"NEON ARP", {1, 12, 0, 5, 0, 70, 35, 40}, {0, 66, 0, 45}, 36, 0, FX(0, 25, 70, 25)},
{"COLLIDER", {13, 0, 23, 9, 2, 60, 50, 64}, {0, 70, 0, 55}, 0, 0, FX(8, 10, 50, 50), MORE({P_ED_PIT, 36})},
{"TURBO SYNC", {9, 7, 0, 3, 0, 92, 28, 64}, {2, 72, 105, 45}, 20, 1, FX(6, 15, 55, 30), MORE({P_GLIDE, 24}, {P_LRATE, 86}, {P_LFADE, 90}, {P_LD_PIT, 1}), TAG(PT_LEAD)},
{"NEON ARP", {1, 12, 0, 5, 0, 70, 35, 40}, {0, 66, 0, 45}, 36, 0, FX(0, 25, 70, 25), TAG(PT_PLUCK)},
{"COLLIDER", {13, 0, 23, 9, 2, 60, 50, 64}, {0, 70, 0, 55}, 0, 0, FX(8, 10, 50, 50), MORE({P_ED_PIT, 36}), TAG(PT_FX)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"DIRTY BASS", {1, -12, 0, 8, 1, 62, 85, 30}, {0, 50, 50, 20}, 35, 1, FX(72, 0, 5, 5), MORE({P_DTYPE, 1}, {P_DTONE, -10}), TAG(PT_BASS)},
};
static const engine_t ENG_TRIO = {
+9 -6
View File
@@ -267,13 +267,16 @@ static void wheel_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
static const preset_t WHEEL_PRESETS[] = {
/* name, {REG, SUB, BODY, TOP, PERC, CLICK, DRIVE, ROTR}, {A D S R}, fenv, mono */
{"FULL ORGAN", {15, 0, 0, 0, 0, 30, 20, 1}, {0, 64, 127, 45}, 0, 0, FX(0, 0, 10, 35)},
{"JAZZ PERC", {4, 0, 0, 0, 2, 50, 8, 1}, {0, 64, 127, 40}, 0, 0, FX(0, 0, 0, 25)},
{"GOSPEL", {6, 0, 0, 0, 1, 60, 40, 2}, {0, 64, 127, 45}, 0, 0, FX(0, 0, 0, 40)},
{"SOFT FLUTE", {1, 0, -2, 0, 0, 10, 0, 1}, {0, 64, 127, 55}, 0, 0, FX(0, 20, 15, 55)},
{"ROCK DRIVE", {7, 0, 0, 0, 0, 70, 100, 2}, {0, 64, 127, 40}, 0, 0, FX(35, 0, 10, 25)},
{"FULL ORGAN", {15, 0, 0, 0, 0, 30, 20, 1}, {0, 64, 127, 45}, 0, 0, FX(0, 0, 10, 35), TAG(PT_KEYS)},
{"JAZZ PERC", {4, 0, 0, 0, 2, 50, 8, 1}, {0, 64, 127, 40}, 0, 0, FX(0, 0, 0, 25), TAG(PT_KEYS)},
{"GOSPEL", {6, 0, 0, 0, 1, 60, 40, 2}, {0, 64, 127, 45}, 0, 0, FX(0, 0, 0, 40), TAG(PT_KEYS)},
{"SOFT FLUTE", {1, 0, -2, 0, 0, 10, 0, 1}, {0, 64, 127, 55}, 0, 0, FX(0, 20, 15, 55), TAG(PT_KEYS)},
{"ROCK DRIVE", {7, 0, 0, 0, 0, 70, 100, 2}, {0, 64, 127, 40}, 0, 0, FX(35, 0, 10, 25), TAG(PT_KEYS)},
/* (Skiff) for the themes: CRYPT (dungeon synth), NEON (synthwave), QUARK (particles) */
{"CATHEDRAL", {12, 2, 0, 0, 0, 6, 0, 0}, {48, 64, 127, 72}, 0, 0, FX(0, 0, 0, 110)},
{"CATHEDRAL", {12, 2, 0, 0, 0, 6, 0, 0}, {48, 64, 127, 72}, 0, 0, FX(0, 0, 0, 110), TAG(PT_KEYS)},
/* (Skiff phase 9) more for every engine: basses, kits */
{"PEDAL BASS", {14, 4, 0, -4, 0, 20, 10, 0}, {0, 64, 127, 30}, 0, 1, FX(0, 0, 0, 15), TAG(PT_BASS)},
{"CLARINET", {9, 0, 2, -5, 0, 0, 14, 1}, {24, 64, 120, 45}, 0, 1, FX(0, 20, 15, 40), MORE({P_LD_PIT, 1}, {P_LRATE, 89}, {P_LFADE, 70}), TAG(PT_LEAD)},
};
static const engine_t ENG_WHEEL = {
+1 -1
View File
@@ -32,7 +32,7 @@
#define FELUCCA_ID "FM-1_700" /* package identity (build.py: the .fwsc marker string) */
#endif
#ifndef FELUCCA_VERSION
#define FELUCCA_VERSION "v1.1" /* Skiff's; shown in the menu, the console and the editor; build.py --release X.Y */
#define FELUCCA_VERSION "v1.2" /* Skiff's; shown in the menu, the console and the editor; build.py --release X.Y */
#endif
#if FELUCCA_OTA && !FELUCCA_FLASH
#error "FELUCCA_OTA needs FELUCCA_FLASH"
+8 -8
View File
@@ -65,14 +65,14 @@ static const char *const N_RATIO[] = {".5", "1", "2", "3", "4", "5", "6", "7", "
/* the factory presets (the stores' preset numbers of engine 1 index this table) */
static const preset_t DIGITAL_PRESETS[] = {
/* ALG R2 R3 R4 INDEX MODDEC FDBK - */
{"E.PIANO", {4, 1, 1, 14, 70, 55, 0, 0}, {0, 80, 40, 60}, 0, 0, FX(0, 50, 25, 35)},
{"BELL", {4, 8, 1, 4, 90, 70, 0, 0}, {0, 95, 0, 85}, 0, 0, FX(0, 0, 30, 70)},
{"BASS", {0, 1, 1, 1, 48, 40, 8, 0}, {0, 60, 70, 25}, 0, 1, FX(0, 0, 10, 10)},
{"BRASS", {0, 1, 1, 1, 70, 40, 20, 0}, {40, 70, 100, 40}, 20, 0, FX(0, 20, 20, 40)},
{"ORGAN", {7, 2, 3, 4, 0, 0, 0, 0}, {2, 60, 127, 20}, 0, 0, FX(10, 40, 0, 30)},
{"PAD", {5, 2, 1, 3, 40, 90, 10, 0}, {80, 90, 110, 95}, 0, 0, FX(0, 60, 30, 70)},
{"MARIMBA", {4, 4, 1, 1, 60, 30, 0, 0}, {0, 80, 0, 60}, 0, 0, FX(0, 0, 25, 40)},
{"FUNK KEY", {3, 1, 3, 5, 90, 25, 20, 0}, {0, 45, 30, 30}, 0, 0, FX(0, 20, 30, 20)},
{"E.PIANO", {4, 1, 1, 14, 70, 55, 0, 0}, {0, 80, 40, 60}, 0, 0, FX(0, 50, 25, 35), TAG(PT_KEYS)},
{"BELL", {4, 8, 1, 4, 90, 70, 0, 0}, {0, 95, 0, 85}, 0, 0, FX(0, 0, 30, 70), TAG(PT_KEYS)},
{"BASS", {0, 1, 1, 1, 48, 40, 8, 0}, {0, 60, 70, 25}, 0, 1, FX(0, 0, 10, 10), TAG(PT_BASS)},
{"BRASS", {0, 1, 1, 1, 70, 40, 20, 0}, {40, 70, 100, 40}, 20, 0, FX(0, 20, 20, 40), TAG(PT_LEAD)},
{"ORGAN", {7, 2, 3, 4, 0, 0, 0, 0}, {2, 60, 127, 20}, 0, 0, FX(10, 40, 0, 30), TAG(PT_KEYS)},
{"PAD", {5, 2, 1, 3, 40, 90, 10, 0}, {80, 90, 110, 95}, 0, 0, FX(0, 60, 30, 70), TAG(PT_PAD)},
{"MARIMBA", {4, 4, 1, 1, 60, 30, 0, 0}, {0, 80, 0, 60}, 0, 0, FX(0, 0, 25, 40), TAG(PT_KEYS)},
{"FUNK KEY", {3, 1, 3, 5, 90, 25, 20, 0}, {0, 45, 30, 30}, 0, 0, FX(0, 20, 30, 20), TAG(PT_KEYS)},
};
#define FM4_NPRESETS 8u
_Static_assert(NELEM(DIGITAL_PRESETS) == FM4_NPRESETS, "DIGITAL presets");
+169 -12
View File
@@ -19,11 +19,14 @@ static struct {
int32_t dly_lp;
uint16_t comb_i[4], ap_i[2];
int32_t comb_lp[4];
uint8_t rtype; /* the reverb model running (G_RTYPE: 0 ROOM, 1 SPRING) */
uint8_t rtype; /* the reverb model running (G_RTYPE: 0 ROOM, 1 SPRING, (Skiff phase 9) 2 HALL) */
uint16_t sp_w; /* SPRING: the loop's write index (SP_MASK) */
int32_t sp_lp, sp_hp, sp_he, sp_size; /* .. its loop low-pass, low cut (and its remainder), the loop
* length (Q8, glides) */
uint32_t sp_ph; /* .. the output tap's wobble */
int32_t hall_y; /* (Skiff phase 9) HALL: its last half-rate output (the line between) */
int32_t cho_y; /* (Skiff phase 9) the CHORUS bus: its last output (FEEDBACK), */
int32_t ph_s[4]; /* .. PHASER's allpasses */
} fx;
/* SPRING (G_RTYPE 1): one spring of a spring tank, mono like the other buses, in the ROOM's own buffers (no
@@ -43,18 +46,77 @@ static struct {
* |x - o| < 749000, far past any peak the chain reaches) */
_Static_assert(sizeof rev_comb / 2u >= SP_LEN && sizeof rev_u.sp / 4u >= 4u * (SP_N + 1u), "SPRING in ROOM's buffers");
/* (Skiff phase 9) FX > DRIVE: DIST's kind (P_DTYPE) at the same drive (P_DIST), and its TONE (P_DTONE, -64..63: the
* tone low-pass moved from where the drive puts it; 0 as before). SOFT: the soft clip below, as before. HARD: the
* drive into a flat clip at 3/4 of full scale (odd harmonics: a buzz). FOLD: the drive into a triangle wavefolder, a
* fold every 4 x 16384 (the louder, the more folds: bright, hollow). BITS: the drive as bits and rate taken away, up
* to 11 bits, each sample held 1 2 4 or 8 (a run starts every block: CTL is a multiple of 8; aliasing, grit), its
* low-pass closing less. Each after the low cut, before the two-pole tone and the make-up, as SOFT */
enum { DT_SOFT, DT_HARD, DT_FOLD, DT_BITS };
#define DIST_TONE(k, t) clamp((k) + (t)->p[P_DTONE] * 150, 2000, 32700) /* TONE's move of the low-pass (Q15) */
static __attribute__((noinline)) void dist_hard(track_t *t, int32_t *b, uint32_t n, int32_t g, int32_t k, int32_t mk)
{
for (uint32_t i = 0; i < n; i++) {
int32_t x = b[i], y;
t->dist_hp += (x - t->dist_hp + 64) >> 7;
x = clamp(x - t->dist_hp, -230000, 230000);
y = clamp(((x >> 2) * g) >> 10, -24576, 24576);
t->dist_dc += (y - t->dist_dc + 256) >> 9; /* (~14 Hz: a clip of an uneven wave has a mean, kept out of */
y -= t->dist_dc; /* the buses' feedback) */
t->dist_lp1 += mulq15(y - t->dist_lp1, k);
t->dist_lp2 += mulq15(t->dist_lp1 - t->dist_lp2, k);
b[i] = mulq15(t->dist_lp2, mk);
}
}
static __attribute__((noinline)) void dist_fold(track_t *t, int32_t *b, uint32_t n, int32_t g, int32_t k, int32_t mk)
{
for (uint32_t i = 0; i < n; i++) {
int32_t x = b[i], y, u;
t->dist_hp += (x - t->dist_hp + 64) >> 7;
x = clamp(x - t->dist_hp, -230000, 230000);
u = ((((x >> 2) * g) >> 10) + 16384) & 65535; /* (two's complement: the mask is the fold's period) */
y = (u < 32768 ? u - 16384 : 49152 - u) * 2; /* -32768 .. 32768, the wave itself inside */
t->dist_dc += (y - t->dist_dc + 256) >> 9; /* (as HARD's) */
y -= t->dist_dc;
t->dist_lp1 += mulq15(y - t->dist_lp1, k);
t->dist_lp2 += mulq15(t->dist_lp1 - t->dist_lp2, k);
b[i] = mulq15(t->dist_lp2, mk);
}
}
static __attribute__((noinline)) void dist_bits(track_t *t, int32_t *b, uint32_t n, int32_t d, int32_t k, int32_t mk)
{
uint32_t s = (uint32_t)d / 11u, hm = (1u << ((uint32_t)d >> 5)) - 1u; /* bits taken 0..11, held 1 2 4 8 */
int32_t h = 0, r = s ? 1 << (s - 1u) : 0;
for (uint32_t i = 0; i < n; i++) {
int32_t x = b[i];
t->dist_hp += (x - t->dist_hp + 64) >> 7;
x = clamp(x - t->dist_hp, -230000, 230000);
if (!(i & hm))
h = ((x + r) >> s) << s; /* (rounded: no offset) */
t->dist_lp1 += mulq15(h - t->dist_lp1, k);
t->dist_lp2 += mulq15(t->dist_lp1 - t->dist_lp2, k);
b[i] = mulq15(t->dist_lp2, mk);
}
}
/* DIST: low cut -> drive (1x..8x, exponential) -> asymmetric soft clip
* (a little bias = even harmonics) -> tone low-pass that closes with drive ->
* make-up gain (straight into tanh over the full band, it would sound like a
* broken digital fuzz). State per part (track_t dist_*). */
* broken digital fuzz). State per part (track_t dist_*). (Skiff phase 9) DRIVE's TYPE and TONE: above */
static void track_dist(track_t *t, int32_t *b, uint32_t n)
{
int32_t d = t->p[P_DIST], i, g, k, mk, bias = 2400, b0;
if (!d)
return; /* states kept: switching on does not click */
g = 4096 + d * d * 2; /* Q12: 1x .. ~9x, gentle at first */
k = 32000 - d * 95; /* tone: transparent at low drive .. ~3 kHz, Q15 */
k = DIST_TONE(32000 - d * 95, t); /* tone: transparent at low drive .. ~3 kHz, Q15 */
mk = 30000 - d * 120; /* make-up */
switch (t->p[P_DTYPE]) {
case DT_HARD: dist_hard(t, b, n, g, k, mk); return;
case DT_FOLD: dist_fold(t, b, n, g, k, mk); return;
case DT_BITS: dist_bits(t, b, n, d, DIST_TONE(32700 - d * 40, t), 32000 - d * 20); return;
default: break;
}
b0 = softclip(bias);
for (i = 0; i < (int32_t)n; i++) {
int32_t x = b[i], y;
@@ -223,6 +285,42 @@ static __attribute__((noinline)) void rev_room(const int32_t *rev_in, int32_t *o
}
}
/* (Skiff phase 9) HALL (G_RTYPE 2): ROOM's combs and allpasses at half the rate, in ROOM's own buffers: every other
* sample, the pair's mean in, and from the last output to this one a straight line out. Twice the lengths (combs of
* 50 .. 61 ms): a bigger, darker space (nothing above ~11 kHz), each SIZE a longer tail; about half ROOM's work */
static __attribute__((noinline)) void rev_hall(const int32_t *rev_in, int32_t *out, uint32_t n)
{
uint32_t i, k;
int32_t size = 25000 + song.g[G_RSIZE] * 50, damp = 32767 - song.g[G_RDAMP] * 200;
for (i = 0; i + 1u < n; i += 2u) {
int32_t a = 0;
int16_t *c = rev_comb;
int32_t in = mulq15((rev_in[i] + rev_in[i + 1u]) >> 1, 2580);
for (k = 0; k < 4u; k++) {
int32_t o = c[fx.comb_i[k]];
fx.comb_lp[k] = o + mulq15(fx.comb_lp[k] - o, 32767 - damp);
c[fx.comb_i[k]] = (int16_t)clamp(in + mulq15(fx.comb_lp[k], size), -32768, 32767);
if (++fx.comb_i[k] >= REV_COMB[k])
fx.comb_i[k] = 0;
a += o;
c += REV_COMB[k];
}
c = rev_ap;
for (k = 0; k < 2u; k++) {
int32_t o = c[fx.ap_i[k]];
int32_t v = a + (o >> 1);
c[fx.ap_i[k]] = (int16_t)clamp(v, -32768, 32767);
a = o - a;
if (++fx.ap_i[k] >= REV_AP[k])
fx.ap_i[k] = 0;
c += REV_AP[k];
}
out[i] += (fx.hall_y + a) >> 1;
out[i + 1u] += a;
fx.hall_y = a;
}
}
/* SPRING (see the top), added to out */
static __attribute__((noinline)) void rev_spring(const int32_t *rev_in, int32_t *out, uint32_t n)
{
@@ -278,6 +376,67 @@ static void rev_clear(void)
for (i = 0; i < 4u; i++)
fx.comb_lp[i] = 0;
fx.sp_lp = fx.sp_hp = fx.sp_he = 0;
fx.hall_y = 0;
}
static void rev_model(uint32_t m, const int32_t *rev_in, int32_t *out, uint32_t n) /* G_RTYPE m, added to out */
{
if (m == 1u)
rev_spring(rev_in, out, n);
else if (m == 2u)
rev_hall(rev_in, out, n);
else
rev_room(rev_in, out, n);
}
/* (Skiff phase 9) the CHORUS bus in its MODE (G_CMODE) with FEEDBACK (G_CFDBK, 0 .. 127: up to 0.93 of its output fed
* back in), wet into wet (its part: the delay's is added after). CHORUS: the modulated delay of 5 .. 15 ms as before.
* FLANGER: the same line swept 1 .. 7 ms, its comb against the dry tracks the jet. PHASER: four first-order allpasses on
* the send, swept together by the chorus LFO once a block (RATE; DEPTH the sweep), notches against the dry. CHORUS
* without FEEDBACK is the loop in fx_buses, bit for bit */
static __attribute__((noinline)) void cho_mode(const int32_t *cho_in, const int32_t *dly_in, int32_t *wet, uint32_t n,
uint32_t cinc)
{
uint32_t i, k, mode = (uint32_t)song.g[G_CMODE], dl = delay_samples();
int32_t fb = song.g[G_CFDBK] * 240, depth = song.g[G_CDEPTH];
int32_t dfb = song.g[G_DFDBK] * 230, col = 2000 + song.g[G_DCOLOR] * 240, dmix = song.g[G_DMIX] * 258;
perf_dub_dly(&dfb, &dmix); /* ((phase 9) DUB's) */
if (mode == 2u) { /* PHASER: a = -0.95 .. -0.15 by the LFO (Q15) */
int32_t lfo = (osc_sine(fx.cho_ph) + 32768) >> 1, a; /* 0 .. 32767 */
fx.cho_ph += cinc * n;
a = -31130 + mulq15(lfo, 3000 + depth * 205);
for (i = 0; i < n; i++) {
int32_t x = (cho_in[i] >> 1) + mulq15(fx.cho_y, fb);
for (k = 0; k < 4u; k++) { /* (a + z^-1) / (1 + a z^-1): w = x - a w1, y = a w + w1 */
int32_t w = clamp(x - mulq15(fx.ph_s[k], a), -262144, 262144);
x = mulq15(w, a) + fx.ph_s[k];
fx.ph_s[k] = w;
}
fx.cho_y = clamp(x, -65536, 65536);
wet[i] = fx.cho_y << 1;
}
} else
for (i = 0; i < n; i++) { /* CHORUS (with FEEDBACK), FLANGER */
int32_t r, f, c0, c1;
uint32_t ri;
cho_buf[fx.cho_w & (CHO_LEN - 1u)] = (int16_t)clamp((cho_in[i] >> 1) + mulq15(fx.cho_y, fb), -32768, 32767);
fx.cho_ph += cinc;
r = mode == 1u ? (44 << 8) + ((osc_sine(fx.cho_ph) + 32768) * depth >> 7) /* 1 .. 7 ms, Q8 */
: (400 << 8) + ((osc_sine(fx.cho_ph) + 32768) * depth * 6 >> 8);
ri = (uint32_t)r >> 8;
f = r & 255;
c0 = cho_buf[(fx.cho_w - ri) & (CHO_LEN - 1u)];
c1 = cho_buf[(fx.cho_w - ri - 1u) & (CHO_LEN - 1u)];
fx.cho_y = c0 + (((c1 - c0) * f) >> 8);
fx.cho_w++;
wet[i] = fx.cho_y << 1;
}
for (i = 0; i < n; i++) { /* the delay as in fx_buses */
int32_t x = dly_buf[(fx.dly_w - dl) & (DLY_LEN - 1u)];
fx.dly_lp += mulq15(x - fx.dly_lp, col);
dly_buf[fx.dly_w & (DLY_LEN - 1u)] = (int16_t)clamp((dly_in[i] >> 1) + mulq15(fx.dly_lp, dfb), -32768, 32767);
fx.dly_w++;
wet[i] += mulq15(x << 1, dmix);
}
}
static int32_t part_buf[CTL]; /* a part's block (mix_part); the fade of a model change */
@@ -291,6 +450,10 @@ static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t
int32_t dmix = song.g[G_DMIX] * 258;
int32_t cdepth = song.g[G_CDEPTH] * 6, rt;
uint32_t cinc = LFO_INC[song.g[G_CRATE] & 127] / CTL;
perf_dub_dly(&fb, &dmix); /* ((phase 9) DUB's) */
if (song.g[G_CMODE] || song.g[G_CFDBK]) /* (Skiff phase 9) another MODE, FEEDBACK: cho_mode, the delay */
cho_mode(cho_in, dly_in, wet, n, cinc); /* too */
else
for (i = 0; i < n; i++) {
int32_t y = 0, x, r;
/* chorus: modulated short delay, 5..15 ms */
@@ -313,25 +476,19 @@ static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t
y += mulq15(x << 1, dmix);
wet[i] = y;
}
rt = song.g[G_RTYPE] == 1;
rt = song.g[G_RTYPE] == 1 || song.g[G_RTYPE] == 2 ? song.g[G_RTYPE] : 0; /* (phase 9) HALL) */
if (rt != fx.rtype) { /* the model changed: the old one's block fades out, */
int32_t *t = part_buf, g = 65536, d = 65536 / (int32_t)n; /* its buffers are cleared, the new */
for (i = 0; i < n; i++) /* one starts from silence */
t[i] = 0;
if (fx.rtype)
rev_spring(rev_in, t, n);
else
rev_room(rev_in, t, n);
rev_model(fx.rtype, rev_in, t, n);
for (i = 0; i < n; i++, g -= d)
wet[i] += mulq16(t[i], (uint32_t)g);
rev_clear();
fx.rtype = (uint8_t)rt;
return;
}
if (rt)
rev_spring(rev_in, wet, n);
else
rev_room(rev_in, wet, n);
rev_model((uint32_t)rt, rev_in, wet, n);
}
/* one block of the whole mix (shared with hostsim.c): events -> each part (with its modulation matrix)
+1 -1
View File
@@ -270,7 +270,7 @@ static uint32_t param_icon(const param_desc_t *d, int32_t v)
static uint32_t mod_src_icon(int32_t s)
{
static const uint8_t I[MS_N] = {ICON_MOD, ICON_LFO_WAVE, ICON_ENV, ICON_ACCENT, ICON_KEYTRACK, ICON_PROB,
ICON_MOD, ICON_MIDI, ICON_LEVEL};
ICON_MOD, ICON_MIDI, ICON_LEVEL, ICON_ENV}; /* ((Skiff phase 9) ENV2: ENV's) */
return I[clamp(s, 0, MS_N - 1)];
}
static uint32_t mod_dst_icon(const track_t *t, int32_t d)
+13 -4
View File
@@ -30,13 +30,14 @@
* presets read and write t->p from the main loop, which the ISR preempts; TIMER5 only fills the MIDI rings),
* and the engines read t->p as before. An engine reads its parameters in note_on (events_block) unmodulated.
* Nothing active (every slot with SRC, DST or AMT at 0): no work, and the sound is bit-identical. */
enum { MS_OFF, MS_LFO, MS_ENV, MS_VEL, MS_KEY, MS_RAND, MS_MODW, MS_AT, MS_EXPR, MS_N };
enum { MS_OFF, MS_LFO, MS_ENV, MS_VEL, MS_KEY, MS_RAND, MS_MODW, MS_AT, MS_EXPR, MS_ENV2, MS_N }; /* (append only) */
enum { MD_OFF, MD_PITCH, MD_CUT, MD_SHP, MD_AMP, MD_PAN, MD_DIST, MD_CHO, MD_DLY, MD_REV, MD_RATE, MD_VIB, MD_E1,
MD_N = MD_E1 + 8 };
_Static_assert(NELEM(N_MSRC) == MS_N && NELEM(N_MDST) == MD_N, "N_MSRC / N_MDST == MS_* / MD_*");
_Static_assert(P_M2SRC == P_M1SRC + 3 && P_M4AMT == P_M1SRC + 11 && P_M4AMT + 1 == P_FM1_ATK, "matrix slots: 3 ids each");
#define NMSLOT 4u
#define MS_VOICE(s) ((s) >= MS_ENV && (s) <= MS_RAND) /* a value per voice */
#define MS_VOICE(s) ((1u << (s)) & (1u << MS_ENV | 1u << MS_VEL | 1u << MS_KEY | 1u << MS_RAND | 1u << MS_ENV2)) /* a
* value per voice */
#define MS_BIPOLAR(s) ((s) == MS_LFO || (s) == MS_KEY || (s) == MS_RAND)
/* the track parameter of a per-block destination */
@@ -49,6 +50,7 @@ static uint32_t mod_param(uint32_t d)
static struct { /* the part in mix_part (one at a time) */
uint8_t on; /* a slot is active: track_render calls mod_voice */
uint8_t env2; /* (Skiff phase 9) a slot's source is ENV2: track_render ticks it (voice.c env2_tick) */
uint8_t amp; /* an AMP slot: the voice gain applies */
uint8_t nv, nk; /* voice terms, per-block parameters held */
int32_t pit, cut, shp, gain; /* per voice, from the per-track sources (gain Q15) */
@@ -83,6 +85,8 @@ static int32_t mod_tsrc(const track_t *t, uint32_t s, int32_t lfo)
return mod_key(t->m_key);
case MS_RAND:
return t->m_rnd;
case MS_ENV2: /* ((Skiff phase 9) the latest note's ENV 2) */
return t->m_env2;
case MS_MODW:
return t->mw * 258;
case MS_AT:
@@ -129,6 +133,8 @@ static __attribute__((noinline)) int mod_begin(track_t *t)
lfo = mulq15(t->lfo_val, t->lfo_fade); /* (the LFO of the block before: track_render ticks it) */
mod.on = 1;
mod.amp = 0;
mod.env2 = p[P_M1SRC] == MS_ENV2 || p[P_M2SRC] == MS_ENV2 || p[P_M3SRC] == MS_ENV2 || p[P_M4SRC] == MS_ENV2; /* (a
* slot off too: a tick for nothing, the loop below as it was) */
mod.nv = mod.nk = 0;
mod.pit = mod.cut = mod.shp = 0;
mod.gain = 32767;
@@ -187,11 +193,14 @@ static __attribute__((noinline)) void mod_voice(track_t *t, voice_t *v, vmod_t *
{
int32_t pit = mod.pit, cut = mod.cut, shp = mod.shp, gain = mod.gain, env = m->envq15;
uint32_t k;
if (v == &t->v[t->m_vi])
if (v == &t->v[t->m_vi]) {
t->m_env = env; /* ENV of the latest note, for per-block destinations */
t->m_env2 = v->env2 >> 9; /* ((Skiff phase 9) its ENV 2 too) */
}
for (k = 0; k < mod.nv; k++) {
uint32_t s = mod.vsrc[k];
int32_t x = s == MS_ENV ? env : s == MS_VEL ? v->mvel * 258 : s == MS_KEY ? mod_key(v->note) : v->mrnd;
int32_t x = s == MS_ENV ? env : s == MS_VEL ? v->mvel * 258 : s == MS_KEY ? mod_key(v->note) :
s == MS_ENV2 ? v->env2 >> 9 : v->mrnd;
mod_voice_add(s, mod.vdst[k], x, mod.vamt[k], &pit, &cut, &shp, &gain);
}
if (pit) {
+29 -13
View File
@@ -21,6 +21,7 @@ static const char *const N_ALLOC[] = {"ROT", "REUSE"};
static const char *const N_DIR[] = {"FWD", "RVRS", "PING", "RAND"}; /* ((Skiff U4, L2) RVRS: REV is reverb) */ /* (Skiff) DIR_* (seq.c seq_next) */
static const char *const N_DKSRC[] = {"OFF", "T1", "T2", "T3", "T4", "T5", "T6"}; /* (Skiff) P_DKSRC: the track ducked under */
_Static_assert(sizeof N_DKSRC / sizeof N_DKSRC[0] == NTRK + 1u, "DUCK's BY: OFF and every track");
static const char *const N_DTYPE[] = {"SOFT", "HARD", "FOLD", "BITS"}; /* (Skiff phase 9) P_DTYPE: DT_* (fx.c) */
#define TRK_STR_(n) #n
#define TRK_STR(n) TRK_STR_(n)
static const char *const N_ORDER[] = {"NOTE", "PLAYED"};
@@ -30,12 +31,13 @@ static const char *const N_ROUTE[] = {"CH1-" TRK_STR(NTRK), "SEL"}; /* MIDI IN
* ignored / all -> selected */
static const char *const N_NOTE[] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"};
static const char *const N_DASH[] = {"--"};
static const char *const N_RTYPE[] = {"ROOM", "SPRING"}; /* G_RTYPE: the reverb bus's model (fx.c) */
static const char *const N_RTYPE[] = {"ROOM", "SPRING", "HALL"}; /* G_RTYPE: the reverb bus's model (fx.c) */
static const char *const N_CMODE[] = {"CHORUS", "FLANGER", "PHASER"}; /* (Skiff phase 9) G_CMODE (fx.c cho_mode) */
static const char *const N_GO[] = {"--", "GO"};
static const char *const N_SLCR[] = {"OFF", "GATE", "STUT"}; /* SL_OFF .. SL_STUT (slicer.c) */
static const char *const N_SLDIV[] = {"1/8", "1/16", "1/32", "8T", "16T", "32T"}; /* SL_DEN */
/* modulation matrix (mod.c): sources, destinations (E1..E8 = P_E0..P_E7: shown with the engine's labels) */
static const char *const N_MSRC[] = {"OFF", "LFO", "ENV", "VEL", "KEY", "RAND", "MODW", "AT", "EXPR"};
static const char *const N_MSRC[] = {"OFF", "LFO", "ENV", "VEL", "KEY", "RAND", "MODW", "AT", "EXPR", "ENV2"}; /* ((phase 9) ENV2) */
static const char *const N_MDST[] = {"OFF", "PITCH", "CUT", "SHP", "AMP", "PAN", "DIST", "CHO", "DLY", "REV", "RATE",
"VIB", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8"};
static const char *const N_ENGNAME[] = {"ANALOG", FELUCCA_FM4 ? "DIGITAL" : "-", "PHASE", "LOFI", "SAMPLE", "VOICE", "TRIO", "WHEEL", "GRAIN", "PHYS",
@@ -126,6 +128,16 @@ static const param_desc_t TP[P_COUNT] = {
[P_DKSRC] = PE("BY", N_DKSRC, 0), /* (Skiff) ducking (duck.c): under that track's hits, */
[P_DKAMT] = PD("DEPTH", F_PCT, 0, 127, 96), /* this far down (100 %: silent), */
[P_DKREL] = PD("RELEASE", F_TIME, 0, 127, 73), /* back in this long (199 ms) */
[P_DTYPE] = PE("TYPE", N_DTYPE, 0), /* (Skiff phase 9) FX > DRIVE (fx.c track_dist): DIST's clipper, */
[P_DTONE] = PD("TONE", F_BIPCT, -64, 63, 0), /* its tone moved from where the drive puts it (0: as before) */
[P_EG2_ATK] = PD("ATTACK", F_TIME, 0, 127, 0), /* (Skiff phase 9) ENV 2 (voice.c env2_tick): MOD's ENV2 */
[P_EG2_DEC] = PD("DECAY", F_TIME, 0, 127, 60),
[P_EG2_SUS] = PD("SUSTAIN", F_PCT, 0, 127, 0),
[P_EG2_REL] = PD("RELEASE", F_TIME, 0, 127, 40),
/* (Skiff phase 9) the DRUM engine's lanes, each moved from its design (eng_drum.c drum_render): 64 = as designed */
#define LANE2(k) [P_LTUNE0 + (k)] = PD("TUNE", F_ST16, 0, 127, 64), [P_LDECAY0 + (k)] = PD("DECAY", F_BIPCT, -64, 63, 0)
LANE2(0), LANE2(1), LANE2(2), LANE2(3), LANE2(4), LANE2(5), LANE2(6), LANE2(7),
#undef LANE2
};
static const param_desc_t GP[G_COUNT] = {
@@ -155,11 +167,10 @@ static const param_desc_t GP[G_COUNT] = {
[G_INITSND] = PE("INIT", N_GO, 0),
/* the reverb's model on the REVERB page: the id of the old GM drum channel (G_DRCH, inert since 1.0) */
[G_RTYPE] = PE("TYPE", N_RTYPE, 0),
/* inert: they set the GM drum part (level, reverb send), which is gone (drums are the DRUM engine
* on any part). On no page; kept so the ids and G_COUNT, which the project format and the
* editor protocol depend on, do not move */
[G_DRLVL] = PD("-", F_INT, 0, 0, 0),
[G_DRREV] = PD("-", F_INT, 0, 0, 0),
/* (Skiff phase 9) GLO > CHORUS's MODE and FEEDBACK, in the ids of the old GM drum part's level and reverb send
* (inert since 1.0: core.h), so G_COUNT, which the project format and the editor protocol depend on, stays */
[G_CMODE] = PE("MODE", N_CMODE, 0),
[G_CFDBK] = PD("FEEDBACK", F_PCT, 0, 127, 0),
};
static const param_desc_t *track_desc(const track_t *t, uint32_t id)
@@ -379,7 +390,8 @@ enum { GR_NONE, GR_ADSR, GR_LFO, GR_STEPS, GR_ARP, GR_SCALE, GR_FX, GR_ROLL, GR_
GR_LANES, /* (Skiff U3, R6) EDIT > LANES (DRUM): the eight lane levels, KNOB 1 the lane (ui.lane) */
GR_ENVDST, GR_LFODST, GR_DELAY, GR_REVERB, GR_CHORUS, GR_GLOBAL, GR_VOICE, GR_VOICE2,
GR_ARP2, /* (Skiff U5, V1) the pages' own graphs, the scope's before (ui_pgraph.c); ARP 2: ARP's */
GR_FMOP, GR_FMALL }; /* (FM6 LAB) EDIT > OPERATOR and ALL OPS: FM6's patch, two sheets (ui_fm6.c) */
GR_FMOP, GR_FMALL, /* (FM6 LAB) EDIT > OPERATOR and ALL OPS: FM6's patch, two sheets (ui_fm6.c) */
GR_DRIVE }; /* (Skiff phase 9) FX > DRIVE: the TYPE's transfer at the drive (ui_pgraph.c) */
typedef struct {
const char *title;
@@ -394,10 +406,12 @@ typedef struct {
static const page_t PAGES[] = {
{"ENV", FAM_ENV, SC_TRACK, GR_ADSR, {P_ATK, P_DEC, P_SUS, P_REL}},
{"ENV DEST", FAM_ENV, SC_TRACK, GR_ENVDST, {P_ED_FLT, P_ED_PIT, P_ED_SHP, 0xFF}}, /* (P_ED_FX: nothing reads it) */
{"ENV 2", FAM_ENV, SC_TRACK, GR_ADSR, {P_EG2_ATK, P_EG2_DEC, P_EG2_SUS, P_EG2_REL}}, /* (Skiff phase 9) MOD's ENV2 */
{"LFO", FAM_LFO, SC_TRACK, GR_LFO, {P_LRATE, P_LWAVE, P_LPHASE, P_LFADE}},
{"LFO DEST", FAM_LFO, SC_TRACK, GR_LFODST, {P_LD_PIT, P_LD_FLT, P_LD_SHP, P_LD_AMP}},
{"MOD", FAM_LFO, SC_TRACK, GR_MOD, {0xFF, P_M1SRC, P_M1DST, P_M1AMT}}, /* KNOB 1: the slot (mod_ui_slot) */
{"FX", FAM_FX, SC_TRACK, GR_FX, {P_DIST, P_CHOR, P_DLY, P_REV}},
{"DRIVE", FAM_FX, SC_TRACK, GR_DRIVE, {P_DIST, P_DTYPE, P_DTONE, 0xFF}}, /* (Skiff phase 9) DIST's TYPE, TONE */
{"SLICER", FAM_FX, SC_TRACK, GR_SLCR, {P_SLCR, P_SLPAT, P_SLRATE, P_SLDEPTH}},
{"DUCK", FAM_FX, SC_TRACK, GR_DUCK, {P_DKSRC, P_DKAMT, P_DKREL, 0xFF}}, /* (Skiff) ducking (duck.c) */
{"SCL", FAM_SCL, SC_TRACK, GR_SCALE, {P_ROOT, P_SCALE, P_QUANT, P_TRANS}},
@@ -406,7 +420,8 @@ static const page_t PAGES[] = {
{"EDIT 2", FAM_EDIT, SC_ENGINE, GR_NONE, {P_E4, P_E5, P_E6, P_E7}},
{"OPERATOR", FAM_EDIT, SC_TRACK, GR_FMOP, {0xFF, 0xFF, 0xFF, 0xFF}}, /* (FM6 LAB) FM6 only: an operator's values */
{"ALL OPS", FAM_EDIT, SC_TRACK, GR_FMALL, {0xFF, 0xFF, 0xFF, 0xFF}}, /* (FM6 LAB) FM6 only: the voice's (ui_fm6.c) */
{"LANES", FAM_EDIT, SC_TRACK, GR_LANES, {0xFF, 0xFF, 0xFF, 0xFF}}, /* DRUM only: LANE, its LEVEL (page_desc) */
{"LANES", FAM_EDIT, SC_TRACK, GR_LANES, {0xFF, 0xFF, 0xFF, 0xFF}}, /* DRUM only: LANE, its LEVEL TUNE DECAY
* (page_desc) */
{"SOUND", FAM_EDIT, SC_TRACK, GR_DXSND, {0xFF, 0xFF, 0xFF, 0xFF}}, /* (Skiff phase 7, 8) DRUM-X only: a sound of the
* project's kit on one sheet (ui_dx.c) */
{"SLICES", FAM_EDIT, SC_TRACK, GR_SLICES, {0xFF, 0xFF, 0xFF, 0xFF}}, /* SLICE only: the slices by hand (ui_slice.c) */
@@ -419,8 +434,8 @@ static const page_t PAGES[] = {
{"VOICE 2", FAM_EDIT, SC_TRACK, GR_VOICE2, {P_ALLOC, P_DETUNE, 0xFF, 0xFF}}, /* ((U3, R4) PAN MUTE: MIXER's) */
{"MIXER", FAM_TRK, SC_TRK, GR_TRK, {0, 1, 2, 3}}, /* GLO button; LEVEL PAN REV MUTE */
{"DELAY", FAM_GLO, SC_GLOBAL, GR_DELAY, {G_DTIME, G_DFDBK, G_DCOLOR, G_DMIX}}, /* ((U3, N4) the buses: FX's before) */
{"REVERB", FAM_GLO, SC_GLOBAL, GR_REVERB, {G_RTYPE, G_RSIZE, G_RDAMP, 0xFF}}, /* TYPE: ROOM / SPRING */
{"CHORUS", FAM_GLO, SC_GLOBAL, GR_CHORUS, {G_CRATE, G_CDEPTH, 0xFF, 0xFF}},
{"REVERB", FAM_GLO, SC_GLOBAL, GR_REVERB, {G_RTYPE, G_RSIZE, G_RDAMP, 0xFF}}, /* TYPE: ROOM / SPRING / HALL */
{"CHORUS", FAM_GLO, SC_GLOBAL, GR_CHORUS, {G_CRATE, G_CDEPTH, G_CMODE, G_CFDBK}}, /* ((phase 9) MODE, FEEDBACK) */
{"GLOBAL", FAM_GLO, SC_GLOBAL, GR_GLOBAL, {G_BPM, G_SWING, 0xFF, 0xFF}}, /* ((U3, R8) CLK TUNE: the MENU's) */
{"PRESETS", FAM_SAVE, SC_GLOBAL, GR_BROWSE, {0xFF, 0xFF, 0xFF, 0xFF}}, /* browser: PRESETS knob / KNOB 1 */
{"USER", FAM_SAVE, SC_GLOBAL, GR_USER, {0xFF, 0xFF, 0xFF, 0xFF}}, /* user presets: SLOT LOAD ERASE SAVE */
@@ -443,8 +458,9 @@ static uint32_t page_lane(void); /* (Skiff U3, R6) EDIT > LANES: the lane KNOB
static const param_desc_t *page_desc(const page_t *pg, uint32_t slot, int16_t **valp)
{
uint32_t id = pg->graph != GR_LANES ? pg->id[slot] : slot == 1u ? P_LN0 + page_lane() : 0xFFu; /* (LANES: its
* LEVEL) */
uint32_t id = pg->graph != GR_LANES ? pg->id[slot] : slot == 1u ? P_LN0 + page_lane() : /* (LANES: its LEVEL, */
slot == 2u ? P_LTUNE0 + page_lane() : slot == 3u ? P_LDECAY0 + page_lane() : 0xFFu; /* (phase 9)
* TUNE, DECAY) */
if (id == 0xFFu) {
*valp = 0;
return 0;
+120 -16
View File
@@ -2,12 +2,15 @@
* Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */
/* PERFORM: the effects of the FX hold layer, on the master. A key pressed while FX is held belongs to the
* layer (seq.c keyboard_block): it plays no note, sends no MIDI, records nothing, and holds its effect until
* it is let go (ui_input.c opens the layer and shows the map). The 10 white keys from the left (F3 .. A4):
* REPEAT 1/8 1/16 1/32, REVERSE, LPF | HPF, TAPE STOP, FREEZE, OCT UP, OCT DN; the other 6 white keys do
* nothing; black keys 1..6 (F#3 G#3 A#3 C#4 D#4 F#4): tracks 1..6 muted while held (not P_MUTE, never saved).
* it is let go (ui_input.c opens the layer and shows the map). The 14 white keys from the left (F3 .. E5):
* REPEAT 1/8 1/16 1/32, REVERSE, LPF | HPF, TAPE STOP, FREEZE, OCT UP, OCT DN, (Skiff phase 9) GATE, DUB,
* FLANGE, VINYL; the other 2 white keys do nothing; black keys 1..6 (F#3 G#3 A#3 C#4 D#4 F#4): tracks 1..6
* muted while held (not P_MUTE, never saved).
* REPEAT and REVERSE start on the next 1/16 (at once while stopped); the others at once; all end when let go,
* with a 2.9 ms ramp. Effects of different kinds stack; of the buffer ones (REPEAT, REVERSE, TAPE STOP,
* FREEZE, OCT UP, OCT DN) the last pressed plays, and letting it go returns to the one held before.
* FREEZE, OCT UP, OCT DN, FLANGE, VINYL) the last pressed plays, and letting it go returns to the one held before.
* (Skiff phase 9) GATE: the mix chopped on the 1/16s (perf_gate). DUB: the dry mix into the delay, its feedback up
* (perf_dub). FLANGE, VINYL: the mix through a short delay that moves, in the buffer as OCT UP / DN's (perf_mdl).
* OCT UP / OCT DN: a harmonizer, the mix an octave up / down beside itself (after the author's earlier
* fxHarmonizer, the classic rotating-delay shifter): two read taps of a delay sweep 128 .. 2176 samples, half a sweep apart, at the
* speed that makes the pitch 2x / 0.5x; a raised-cosine cross-fade (the sine table) hides each tap's jump
@@ -26,12 +29,13 @@
* Chain: [REPEAT / REVERSE / TAPE / FREEZE] -> LPF -> HPF -> CRUSH, after the master level and before
* master_out (the limiter); THROW and the mutes act before the buses (fx.c mix_block / mix_part).
* Idle (no key, no knob, no ramp left) every stage is skipped: the output is bit-identical. */
enum { PF_R8, PF_R16, PF_R32, PF_REV, PF_LPF, PF_HPF, PF_TAPE, PF_FRZ, PF_OUP, PF_ODN, PF_M1, PF_N = PF_M1 + NTRK };
enum { PF_R8, PF_R16, PF_R32, PF_REV, PF_LPF, PF_HPF, PF_TAPE, PF_FRZ, PF_OUP, PF_ODN, PF_GATE, PF_DUB, PF_FLG, PF_VIN,
PF_M1, PF_N = PF_M1 + NTRK }; /* ((Skiff phase 9) GATE .. VINYL: the mutes' bits moved, never stored) */
#define PF_BIT(e) (1u << (e))
#define PF_REPEAT 0x7u /* the three REPEAT rates */
#define PF_Q (PF_REPEAT | PF_BIT(PF_REV)) /* start on the 1/16 */
#define PF_HARM (PF_BIT(PF_OUP) | PF_BIT(PF_ODN))
#define PF_BUF (PF_REPEAT | PF_BIT(PF_REV) | PF_BIT(PF_TAPE) | PF_BIT(PF_FRZ) | PF_HARM)
#define PF_BUF (PF_REPEAT | PF_BIT(PF_REV) | PF_BIT(PF_TAPE) | PF_BIT(PF_FRZ) | PF_HARM | PF_BIT(PF_FLG) | PF_BIT(PF_VIN))
#define PF_MUTE (((1u << NTRK) - 1u) << PF_M1)
#define PB_FRAMES 8192u /* stereo frames in sl_buf (four tracks' of it): 371 ms at 22.05 kHz */
_Static_assert((PB_FRAMES & (PB_FRAMES - 1u)) == 0u && PB_FRAMES * 2u <= NTRK * SL_LEN,
@@ -43,9 +47,11 @@ _Static_assert((PB_FRAMES & (PB_FRAMES - 1u)) == 0u && PB_FRAMES * 2u <= NTRK *
#define HB_MASK 4095u /* OCT UP / DN: the delay's frames (of the loop's 8192) */
#define HB_BASE 128u /* .. the taps' shortest delay, samples; the sweep: 2048 */
#define HB_FB 269 /* .. KNOB 4 (0 .. 100) -> the shimmer, Q15: 0 .. 0.82 */
#define MD_FB 18000 /* FLANGE: its feedback, Q15 (0.55) */
#define DUB_FB 30800 /* DUB: the delay's feedback while held, Q15 (0.94; FEEDBACK's most: 0.84) */
#define PF_TOP (63 << 8) /* filter cutoff index, Q8 (PF_SVF): the LPF's open end */
#define PF_LOW (14 << 8) /* .. the LPF sweep's end, the HPF sweep's (and K1's) top */
enum { BM_NONE, BM_LOOP, BM_TAPE, BM_FRZ, BM_HARM };
enum { BM_NONE, BM_LOOP, BM_TAPE, BM_FRZ, BM_HARM, BM_FLG, BM_VIN };
static volatile uint32_t perf_mask; /* main: the FX button's bit while its layer may own keys, 0 = none */
static volatile uint32_t kb_mask; /* main: the button bits whose hold makes keys a layer's (ui_layer.c), 0 = none */
@@ -101,7 +107,12 @@ static struct {
uint32_t cn;
int32_t td; /* THROW: the share of the dry mix sent, Q15 */
int32_t mg[NTRK]; /* mute gains, Q15 (32768 = open) */
} pf = {.src = PF_N, .next = PF_N, .lc = PF_TOP, .mg = {[0 ... NTRK - 1] = 32768}};
uint32_t gp0; /* (Skiff phase 9) GATE: the block's first sample in its 1/16, */
int32_t gg; /* .. its gain, Q15 (32768 = open) */
int32_t dd, dfb; /* DUB: the share of the dry mix sent, Q15; the delay's feedback (0: the song's) */
int32_t vl[2], ck; /* VINYL: the low-pass, the crackle's pop */
uint32_t seed; /* .. its random */
} pf = {.src = PF_N, .next = PF_N, .lc = PF_TOP, .mg = {[0 ... NTRK - 1] = 32768}, .gg = 32768};
/* the loop length of a REPEAT / REVERSE (1/8) at the tempo, 44.1 kHz samples; 0 = not one */
static const uint8_t PF_DEN[PF_REV + 1] = {2, 4, 8, 2};
@@ -182,6 +193,12 @@ static void perf_buf_start(uint32_t e)
pf.hph = 0;
pf.hinc = e == PF_OUP ? 0u - (1u << 21) : 1u << 20; /* the delay: -1 / +0.5 sample a sample */
pf.hfb = 0;
} else if (e == PF_FLG || e == PF_VIN) { /* (wr, len: as OCT UP / DN's) */
pf.mode = e == PF_FLG ? BM_FLG : BM_VIN;
pf.len = 0;
pf.hph = 0;
pf.hinc = e == PF_FLG ? 0xFFFFFFFFu / (8u * beat_samples()) : 54052u; /* a bar each way; 0.555 Hz */
pf.vl[0] = pf.vl[1] = pf.ck = 0;
} else if (e == PF_FRZ) {
pf.mode = BM_FRZ;
pf.gp[0] = 0;
@@ -249,6 +266,7 @@ static __attribute__((noinline)) AUDIO_RAM int perf_begin(uint32_t n)
ph0 = pf.ph % pf.P; /* the 1/16 in this block (n: none) */
bnd = ph0 ? (pf.P - ph0 < n ? pf.P - ph0 : n) : 0u;
pf.ph += n;
pf.gp0 = ph0; /* (GATE's place) */
pf.act &= held; /* let go: at once */
pf.act |= held & ~PF_Q;
pf.act0 = pf.act;
@@ -259,6 +277,8 @@ static __attribute__((noinline)) AUDIO_RAM int perf_begin(uint32_t n)
pf.act |= q;
}
perf_act = pf.act;
pf.dfb += clamp(((pf.act >> PF_DUB) & 1u ? DUB_FB : 0) - pf.dfb, -24, 120); /* DUB's feedback: up in 0.2 s, down
* in 0.9 s (the echoes ring out) */
/* the filters: LPF from open down over a bar while its key is held, KNOB 1 left; HPF up, KNOB 1 right */
m = perf_k[0];
{
@@ -306,6 +326,28 @@ static __attribute__((noinline)) AUDIO_RAM void perf_mute(uint32_t k, int32_t *b
pf.mg[k] = g;
}
/* (Skiff phase 9) DUB (C5): the dry mix into the delay's send, whole, while held (2.9 ms in and out); meanwhile the
* delay's feedback up to DUB_FB, its return up to MIX's default (perf_begin; fx.c fx_buses): the echoes pile up, and
* ring out after it is let go */
static __attribute__((noinline)) AUDIO_RAM void perf_dub(const int32_t *ml, const int32_t *mr, int32_t *sd, uint32_t n)
{
uint32_t i;
int32_t t = (pf.act >> PF_DUB) & 1u ? 32768 : 0;
for (i = 0; i < n; i++) {
pf.dd += clamp(t - pf.dd, -SL_SLOPE, SL_SLOPE);
sd[i] += mulq16((ml[i] + mr[i]) >> 1, (uint32_t)pf.dd << 1);
}
}
/* the delay's feedback and return (fx.c), Q15: the song's, or DUB's while they are more (its return at MIX's default:
* DUB is heard with the delay's MIX at 0 too) */
static void perf_dub_dly(int32_t *fb, int32_t *mix)
{
if (*fb < pf.dfb)
*fb = pf.dfb;
if (*mix < pf.dfb * 3 / 4)
*mix = pf.dfb * 3 / 4;
}
/* before the buses: THROW (KNOB 3) adds the dry mix to the delay and reverb sends */
static __attribute__((noinline)) AUDIO_RAM void perf_pre(const int32_t *ml, const int32_t *mr, int32_t *sd, int32_t *sr,
uint32_t n)
@@ -320,6 +362,8 @@ static __attribute__((noinline)) AUDIO_RAM void perf_pre(const int32_t *ml, cons
sr[i] += x;
}
}
if (pf.dd || ((pf.act >> PF_DUB) & 1u))
perf_dub(ml, mr, sd, n);
}
/* x towards y by w (Q15, 32768 = y) */
@@ -388,11 +432,11 @@ static inline void perf_grain(uint32_t g, int32_t *yl, int32_t *yr)
pf.gp[g] = p + 1u < PB_GRAIN ? p + 1u : 0u;
}
/* OCT UP / DN: the tap at sweep place ph, both channels (as stored: half the level); silence before the
* delay has that much in it */
static inline void hb_tap(uint32_t ph, int32_t *l, int32_t *r)
/* the buffer's delay at d (Q16 samples: OCT UP / DN, FLANGE, VINYL), both channels (as stored: half the level);
* silence before the delay has that much in it */
static inline void pb_dtap(uint32_t d, int32_t *l, int32_t *r)
{
uint32_t d = (HB_BASE << 16) + (ph >> 5), di = d >> 16; /* the delay, Q16: 128 .. 2176 samples */
uint32_t di = d >> 16;
int32_t f = (int32_t)((d >> 1) & 0x7FFFu);
const int16_t *p, *q;
if (di + 1u > pf.len) {
@@ -404,6 +448,8 @@ static inline void hb_tap(uint32_t ph, int32_t *l, int32_t *r)
*l = p[0] + (((q[0] - p[0]) * f) >> 15);
*r = p[1] + (((q[1] - p[1]) * f) >> 15);
}
/* OCT UP / DN: the tap at sweep place ph: a delay of 128 .. 2176 samples */
static inline void hb_tap(uint32_t ph, int32_t *l, int32_t *r) { pb_dtap((HB_BASE << 16) + (ph >> 5), l, r); }
/* OCT UP / DN on one sample: yl / yr the harmonized mix (see the top). noinline: perf_block's loop keeps its
* code layout (target_budget.py: a block placed out of line looks like a loop round the per-sample code) */
static __attribute__((noinline)) AUDIO_RAM void perf_harm(int32_t l, int32_t r, int32_t *yl, int32_t *yr)
@@ -435,6 +481,62 @@ static __attribute__((noinline)) AUDIO_RAM void perf_harm(int32_t l, int32_t r,
*yr = r + (r >> 3) + ((sr_ * 45875) >> 15);
}
/* (Skiff phase 9) FLANGE (D5) / VINYL (E5) on one sample: the mix into the buffer at 44.1 kHz (as OCT UP / DN's)
* and back from a delay that moves. FLANGE: 0.3 .. 6 ms, a triangle from the press, a bar each way, fed back (MD_FB),
* out with the mix (a comb that sweeps: the jet). VINYL: 0.3 .. 2.6 ms on a sine at 0.555 Hz (a record's turn at 33:
* a wow of +-0.4 %), through a low-pass at ~4.5 kHz, with crackle (~21 pops a second, a few samples each) */
static __attribute__((noinline)) AUDIO_RAM void perf_mdl(int32_t l, int32_t r, int32_t *yl, int32_t *yr)
{
int32_t al, ar, xl, xr, flg = pf.mode == BM_FLG;
uint32_t t = pf.hph < 0x80000000u ? pf.hph : ~pf.hph; /* (FLANGE's triangle, 0 .. 2^31) */
if (pf.mode == BM_HARM) { /* (OCT UP / DN: perf_buf's call for the three) */
perf_harm(l, r, yl, yr);
return;
}
l >>= 1; /* (stored at half: headroom) */
r >>= 1;
pb_dtap(flg ? (13u << 16) + (t >> 15) * 252u : (14u << 16) + (uint32_t)(osc_sine(pf.hph) + 32768) * 100u, &al, &ar);
xl = flg ? l + mulq15(al, MD_FB) : l;
xr = flg ? r + mulq15(ar, MD_FB) : r;
if (pf.len < (uint32_t)SL_RAMP) { /* (the recording fades in, as OCT UP / DN's) */
xl = (xl * (int32_t)pf.len) >> SL_RAMP_LOG2;
xr = (xr * (int32_t)pf.len) >> SL_RAMP_LOG2;
}
pb_put(pf.wr & HB_MASK, xl, xr);
pf.wr++;
if (pf.len <= HB_MASK)
pf.len++;
pf.hph += pf.hinc;
if (flg) {
*yl = l + al; /* (the mix and the delay, a half each: stored at half) */
*yr = r + ar;
return;
}
pf.vl[0] += mulq15(al - pf.vl[0], 15500); /* VINYL: the low-pass, */
pf.vl[1] += mulq15(ar - pf.vl[1], 15500);
pf.seed = pf.seed * 1664525u + 1013904223u; /* the crackle: a pop now and then, */
if (!(pf.seed >> 21))
pf.ck = (int32_t)(pf.seed << 11) >> 20;
*yl = (pf.vl[0] + pf.ck) << 1;
*yr = (pf.vl[1] + pf.ck) << 1;
pf.ck = pf.ck * 3 / 4; /* .. dying in a few samples */
}
/* (Skiff phase 9) GATE (B4): the mix chopped on the 1/16s, open their first half, shut the second (2.9 ms edges);
* DEPTH (KNOB 4) how far it shuts (0: silence). After CRUSH */
static __attribute__((noinline)) AUDIO_RAM void perf_gate(int32_t *bl, int32_t *br, uint32_t n)
{
uint32_t i, p = pf.gp0, h = pf.P >> 1, on = (pf.act >> PF_GATE) & 1u;
int32_t lo = perf_k[3] * 327;
for (i = 0; i < n; i++) {
pf.gg += clamp((on && p >= h ? lo : 32768) - pf.gg, -SL_SLOPE, SL_SLOPE);
bl[i] = mulq16(bl[i], (uint32_t)pf.gg << 1);
br[i] = mulq16(br[i], (uint32_t)pf.gg << 1);
if (++p >= pf.P)
p = 0;
}
}
/* the buffer effect faded out: the next one, or the buffer back. Once per effect, out of the per-sample loop
* (noinline: its calls stay out of perf_block's loop code) */
static __attribute__((noinline)) void perf_buf_done(void)
@@ -506,9 +608,9 @@ static inline void perf_buf(int32_t *pl, int32_t *pr)
yr >>= 10;
on = 1;
}
} else if (pf.mode == BM_HARM) {
perf_harm(l, r, &yl, &yr);
on = 2; /* (KNOB 4 is the shimmer: the level stays full) */
} else { /* OCT UP / DN, (Skiff phase 9) FLANGE, VINYL (perf_mdl: one call */
perf_mdl(l, r, &yl, &yr); /* here, perf_block's loop keeps its layout) */
on = 1 + (pf.mode == BM_HARM); /* (OCT UP / DN: KNOB 4 is the shimmer, the level stays full) */
}
pf.tw = on && pf.src != PF_N ? on == 2 ? 32768 : 32768 - perf_k[3] * 327 : 0;
pf.w += clamp(pf.tw - pf.w, -SL_SLOPE, SL_SLOPE);
@@ -590,6 +692,8 @@ static __attribute__((noinline)) AUDIO_RAM void perf_block(int32_t *bl, int32_t
bl[i] = l;
br[i] = r;
}
if (((pf.act >> PF_GATE) & 1u) || pf.gg != 32768)
perf_gate(bl, br, n);
pf.busy = pf.act || pf.mode != BM_NONE || pf.w || pf.la || pf.ha || pf.cw || pf.td || pf.mute || perf_k[0] ||
perf_k[1] || perf_k[2];
perf_k[1] || perf_k[2] || pf.gg != 32768 || pf.dd || pf.dfb;
}
+89 -17
View File
@@ -23,7 +23,7 @@
* added since (SLICE 8, ..) were appended, no index moved.
*
* Track 4 was the GM drum part until 1.0 (no engine: its byte 0; its level and reverb send in the
* globals G_DRLVL / G_DRREV, which are inert now). A project says which it has in `parts`: 4 (PROJ_PARTS)
* globals G_DRLVL / G_DRREV, now (Skiff phase 9) G_CMODE / G_CFDBK). A project says which it has in `parts`: 4 (PROJ_PARTS)
* when written since, 0 before (a reserved byte, always written 0: the format and its size did not
* change). proj_drums_to_part turns such a track 4 into a DRUM part with its default kit (the GM map, so
* its drum steps still play drums; until 1.0.2 it was the SAMPLE engine's PERC set), keeping its steps, its
@@ -167,7 +167,14 @@ _Static_assert(PROJ_SCENES >= PROJ_SC2, "SKF2's scenes are the first bytes of to
* magic, size, tracks, scene bytes): 68..697 the six tracks' parameters (np 103), engines and presets, 698..889 the
* lists, 890..895 the entries, 896..977 the scenes; (phase 7) the DRUM-X kit at 1175 (PROJ_DX_AT: PROJ_DX_MARK, then
* its 8 lanes, 11 bytes each, drumx_voice.c dx_lane_t; a record of before, 0 there: the factory kit), the FM6 patches
* at 1264, the name at 2032, the hash. The tracks' parameters may grow up to the kit (np 135). SKF2 holds no kit */
* at 1264, the name at 2032, the hash. SKF2 holds no kit.
* (Skiff phase 9) Every format stores PROJ_NP parameters a track, the layout before phase 9 (P_COUNT 103), by count:
* the first PROJ_NP - 8 ids in order, then P_E0..P_E7 (proj_np_put; params_by_count reads them), so firmware before,
* which refuses a count above its own, reads what this one writes. The parameters added since (PROJ_NX of them, P_DTYPE
* .. P_LDECAY7) are SKF3's PX block, before the kit (PROJ_PX_AT, 981..1174: PROJ_PX_MARK, their count n, then each
* track's n values + 64), written only when one is not its default: a project that uses none is the bytes it was, and
* one without the block (every one of before) reads them as the defaults. Firmware before reads it without them. SKF1
* and SKF2 hold none: only old records are written as them again (proj_fetch, a rename, a backup), their defaults */
#define PROJ_MAGIC3 0x534B4633u
#define PROJ_STORE3 2048u
typedef struct { uint32_t magic, size, nt, sc, dx; } proj_fmt_t; /* (dx: 1 = it holds the DRUM-X kit) */
@@ -178,9 +185,18 @@ static const proj_fmt_t PROJ_SKF3 = {PROJ_MAGIC3, PROJ_STORE3, 6u, PROJ_SCENES,
#define PROJ_FM6_AT(f) (PROJ_NAME_AT(f) - (f)->nt * FM6_PACKED)
#define PROJ_DX_MARK 0x58u /* ('X') the kit follows */
#define PROJ_DX_AT(f) (PROJ_FM6_AT(f) - 1u - DV_NLANE * sizeof(dx_lane_t)) /* (a dx format's) */
#define PROJ_HEAD_END(f) ((f)->dx ? PROJ_DX_AT(f) : PROJ_FM6_AT(f)) /* where the tracks, lists and scenes end */
#define PROJ_NP 103u /* (phase 9) the parameters a track a store holds (see above) */
#define PROJ_NX (P_E0 - (PROJ_NP - 8u)) /* .. the ones after them, in the PX block */
#define PROJ_PX_MAX 32u /* .. its room: so many a track */
#define PROJ_PX_MARK 0x50u /* ('P') the PX block follows */
#define PROJ_PX_AT(f) (PROJ_DX_AT(f) - 2u - (f)->nt * PROJ_PX_MAX) /* (a dx format's) */
#define PROJ_HEAD_END(f) ((f)->dx ? PROJ_PX_AT(f) : PROJ_FM6_AT(f)) /* where the tracks, lists and scenes end */
_Static_assert(sizeof(dx_lane_t) == 11u, "a DRUM-X lane is 11 bytes in SKF3");
_Static_assert(NTRK == 6u, "SKF3: six tracks");
_Static_assert(P_COUNT >= PROJ_NP && PROJ_NX <= PROJ_PX_MAX, "the parameters past PROJ_NP fit the PX block");
_Static_assert(68u + 6u * (PROJ_NP + 2u + NENT * 2u + 1u) + PROJ_SCENES <=
PROJ_STORE3 - 4u - PROJ_NAME_LEN - 6u * FM6_PACKED - 1u - DV_NLANE * 11u - 2u - 6u * PROJ_PX_MAX,
"SKF3's tracks, lists and scenes end before its PX block");
typedef union { uint32_t align; uint8_t raw[PROJ_STORE_SIZE]; } project_store_t;
_Static_assert(G_COUNT == 27u, "FUN7 globals retain original IDs");
_Static_assert(sizeof(project_store_t) == 3840u && PROJ_STORE_V7 == sizeof(project_v6_t), "SKF1 / FUN7 sizes");
@@ -324,8 +340,8 @@ static void proj_drums_to_part(project_t *q)
return;
d->engine = ENGI_DRUM; /* DRUM's first kit: independent of today's power-on drum sound */
d->preset = PROJ_DEF_KEEP;
d->p[P_LEVEL] = (int16_t)clamp(q->g[G_DRLVL], 0, 127); /* the drum part's level and reverb send */
d->p[P_REV] = (int16_t)clamp(q->g[G_DRREV], 0, 127);
d->p[P_LEVEL] = (int16_t)clamp(q->g[G_CMODE], 0, 127); /* the drum part's level and reverb send (the ids */
d->p[P_REV] = (int16_t)clamp(q->g[G_CFDBK], 0, 127); /* G_DRLVL / G_DRREV then: core.h) */
q->parts = PROJ_PARTS;
q->sum = proj_sum(q);
}
@@ -535,6 +551,7 @@ static void proj_fm6_init(project_t *q)
}
static int proj_import_old(project_t *q, const void *b, int n);
static int proj_import_any(project_t *q, const void *b, int n);
static const proj_fmt_t *proj_fmt_of(const void *b, int n);
/* every track's engine one this firmware has (DIGITAL, 1, is one: it converts): a project of another number
* is not one (it never was: no engine number past the last was ever stored) */
static int proj_engines_ok(const project_t *q)
@@ -552,6 +569,10 @@ static int proj_import(project_t *q, const void *b, int n)
uint32_t k;
if (!proj_import_any(q, b, n) || !proj_engines_ok(q))
return 0;
if (proj_fmt_of(b, n) != &PROJ_SKF3 && (q->g[G_CMODE] || q->g[G_CFDBK])) { /* (Skiff phase 9) the CHORUS MODE */
q->g[G_CMODE] = q->g[G_CFDBK] = 0; /* and FEEDBACK: in an older format the old GM drum part's level */
q->sum = proj_sum(q); /* and reverb send, read above: as at power-on) */
}
proj_fm4(q);
proj_perc(q);
for (k = NHEAVY; k < NTRK; k++) /* (Skiff phase 6) a light track holding PHYS or GRAIN (no firmware */
@@ -736,23 +757,48 @@ static int proj_mot_get(motion_store_t *m, const uint8_t *b)
return 1;
}
/* (Skiff phase 9) a track's values p -> the PROJ_NP bytes a store holds (+ 64, by count: the first PROJ_NP - 8 ids,
* then P_E0..P_E7; see PROJ_NP): 0 for a value no format holds */
static int proj_np_put(uint8_t *b, const int16_t *p)
{
uint32_t i;
for (i = 0; i < PROJ_NP; i++) {
int32_t v = p[i < PROJ_NP - 8u ? i : P_E0 + i - (PROJ_NP - 8u)];
if (v < -64 || v > 127) return 0;
b[i] = (uint8_t)(v + 64);
}
return 1;
}
/* .. motion m in the ids of a store of PROJ_NP (proj_motion_ids the other way): 0 for one past them (phase 9's) */
static int proj_motion_np(motion_store_t *m)
{
uint32_t i;
for (i = 0; i < m->count && i < MOTION_MAX; i++) {
uint32_t id = MOTION_ID(&m->event[i]);
if (id >= P_E0)
m->event[i].param = (uint8_t)((m->event[i].param & MOTION_LOCK) | (id - PROJ_NX));
else if (id >= PROJ_NP - 8u)
return 0;
}
return 1;
}
/* A stable serialized schema: first header retains FUN6's fields; at byte66
* np, format flags, then four byte-param tracks and nine-byte steps; FUN8: the patches at PROJ_FM6_OFF.
* (Skiff phase 6) The first PROJ_NT tracks: SKF1 holds no more */
static int proj_pack(project_store_t *out, const project_t *q)
{
uint8_t *b = out->raw; uint32_t pos = 68u, t, i; uint32_t magic = PROJ_MAGIC, size = PROJ_STORE_SIZE, sum;
motion_store_t mo = q->motion;
for (t = 0; t < PROJ_NT; t++)
for (i = 0; i < FM6_PACKED; i++)
if (q->fm6[t][i] > 127u) return 0;
if (!chain_valid(&q->chain) || !motion_valid(&q->motion) || P_COUNT > 127u) return 0;
if (!chain_valid(&q->chain) || !motion_valid(&q->motion) || P_COUNT > 127u || !proj_motion_np(&mo)) return 0;
memset(out, 0, sizeof *out); memcpy(b, &magic, 4); memcpy(b + 4, &size, 4);
memcpy(b + 8, q->g, sizeof q->g); b[62] = q->sel; b[63] = q->parts; b[64] = q->phys; b[66] = P_COUNT;
memcpy(b + 8, q->g, sizeof q->g); b[62] = q->sel; b[63] = q->parts; b[64] = q->phys; b[66] = PROJ_NP;
for (t = 0; t < PROJ_NT; t++) {
for (i = 0; i < P_COUNT; i++) {
if (q->t[t].p[i] < -64 || q->t[t].p[i] > 127) return 0;
b[pos++] = (uint8_t)(q->t[t].p[i] + 64);
}
if (!proj_np_put(b + pos, q->t[t].p)) return 0; /* ((phase 9) PROJ_NP, by count) */
pos += PROJ_NP;
b[pos++] = q->t[t].engine; b[pos++] = q->t[t].preset;
for (i = 0; i < NSTEP; i++, pos += 9u)
if (!step_put9(b + pos, &q->t[t].step[i]))
@@ -762,7 +808,7 @@ static int proj_pack(project_store_t *out, const project_t *q)
}
if (pos + sizeof q->chain + PROJ_MOT_BYTES > PROJ_FM6_OFF) return 0;
memcpy(b + pos, &q->chain, sizeof q->chain); pos += sizeof q->chain;
proj_mot_put(b + pos, &q->motion);
proj_mot_put(b + pos, &mo);
memcpy(b + PROJ_FM6_OFF, q->fm6, PROJ_NT * FM6_PACKED);
{ /* the name (0-padded; stops at the first 0) */
char n[PROJ_NAME_LEN + 1u];
@@ -875,18 +921,33 @@ static int proj_pack2(project_store_t *out, const project_t *q, const proj_fmt_t
if (!proj_ent_ok(q) || P_COUNT > 127u) return 0;
memset(out, 0, sizeof *out); memcpy(b, &f->magic, 4); memcpy(b + 4, &f->size, 4);
memcpy(b + 8, q->g, sizeof q->g); b[62] = q->sel; b[63] = q->parts; b[64] = q->phys; b[65] = q->song;
b[66] = P_COUNT;
b[66] = PROJ_NP;
for (t = 0; t < f->nt; t++) {
for (i = 0; i < P_COUNT; i++) {
if (q->t[t].p[i] < -64 || q->t[t].p[i] > 127) return 0;
b[pos++] = (uint8_t)(q->t[t].p[i] + 64);
}
if (!proj_np_put(b + pos, q->t[t].p)) return 0; /* ((phase 9) PROJ_NP, by count) */
pos += PROJ_NP;
b[pos++] = q->t[t].engine; b[pos++] = q->t[t].preset;
}
memcpy(b + pos, q->ent, f->nt * NENT * 2u); pos += f->nt * NENT * 2u;
memcpy(b + pos, q->cur, f->nt); pos += f->nt;
memcpy(b + pos, q->scene, f->sc); pos += f->sc;
if (pos > PROJ_HEAD_END(f)) return 0;
if (f->dx) { /* ((phase 9) the parameters past PROJ_NP: the PX block, if one */
uint32_t any = 0, j; /* is not its default) */
for (t = 0; t < f->nt; t++)
for (j = 0; j < PROJ_NX; j++) {
int32_t v = q->t[t].p[PROJ_NP - 8u + j];
if (v < -64 || v > 127) return 0;
any |= v != TP[PROJ_NP - 8u + j].def;
}
if (any) {
uint8_t *x = b + PROJ_PX_AT(f);
x[0] = PROJ_PX_MARK;
x[1] = (uint8_t)PROJ_NX;
for (t = 0; t < f->nt; t++)
for (j = 0; j < PROJ_NX; j++)
x[2u + t * PROJ_NX + j] = (uint8_t)(q->t[t].p[PROJ_NP - 8u + j] + 64);
}
}
if (f->dx && q->dx_on && dx_kit_ok(q->dx)) { /* (phase 7) the DRUM-X kit (none: 0, the factory's) */
b[PROJ_DX_AT(f)] = PROJ_DX_MARK;
memcpy(b + PROJ_DX_AT(f) + 1u, q->dx, sizeof q->dx);
@@ -941,6 +1002,17 @@ static int proj_unpack2(project_t *q, const uint8_t *b, const proj_fmt_t *f)
for (i = 0; i < NSTEP; i++)
q->t[t].step[i].time = ST_REST; /* (empty: the patterns hold the steps) */
}
if (f->dx && np == PROJ_NP && b[PROJ_PX_AT(f)] == PROJ_PX_MARK) { /* ((phase 9) the parameters past PROJ_NP: */
const uint8_t *x = b + PROJ_PX_AT(f); /* n of them a track, the ones this firmware knows taken) */
uint32_t n = x[1], j;
if (n > PROJ_PX_MAX) return 0;
for (t = 0; t < f->nt; t++)
for (j = 0; j < n; j++) {
if (x[2u + t * n + j] > 191u) return 0;
if (j < PROJ_NX)
q->t[t].p[PROJ_NP - 8u + j] = (int16_t)(x[2u + t * n + j] - 64);
}
}
memcpy(q->ent, b + pos, f->nt * NENT * 2u); pos += f->nt * NENT * 2u;
memcpy(q->cur, b + pos, f->nt); pos += f->nt;
memcpy(q->scene, b + pos, f->sc);
+4 -1
View File
@@ -9,7 +9,8 @@
* engine uses; 0 in older settings = every one's default); [15][27]: SCREEN OFF (1.1.5; 0 = 30 MIN, the default);
* [15][26]: Skiff's LAUNCH (ui.c ui_launch; 0 = LOOP, an unknown value read as LOOP); [15][25]: Skiff's PERFORM KEYS
* (ui.c ui_perf_keys: 0 TRACK, 1 SCENE); [15][24]: bank.c SCENE_FREED; [15][23]: (Skiff U1) ui.c ui_set_rev, the
* one-time changes done. ([14][0] .. [15][17] held Skiff's scenes before phase 5; row 14 is DRUM-X's since.)
* one-time changes done; [15][21]: (Skiff phase 9) PRESETS' LIST type (ui.c ui_ptag; 0 = none, an unknown value
* read as none). ([14][0] .. [15][17] held Skiff's scenes before phase 5; row 14 is DRUM-X's since.)
* MENU's flags (ui.c PREF_*) are append-only bits whose 0 is the default: BPM LOCK (16) is clear in every older setting
* = unlocked, LARGE (32) = OFF, RESTORE LAST OFF (128, 1.2) = ON, read as saved (nothing to migrate, so importing twice changes nothing). */
typedef struct {
@@ -45,6 +46,8 @@ static int settings_import(persist_t *p, int n)
}
if ((p->favorites.factory[15][27] ^ 3u) > 4u) /* SCREEN OFF (1.1.5, ui.c ui_scr): stored ^ 3, unknown = 0 (30 MIN) */
p->favorites.factory[15][27] = 0;
if (p->favorites.factory[15][21] >= 8u) /* (Skiff phase 9) PRESETS' LIST type (ui.c ui_ptag, below PT_N) */
p->favorites.factory[15][21] = 0;
p->magic = PERSIST_MAGIC;
p->palette = palette_to_stored(palette_from_stored(p->palette));
settings.magic = SETTINGS_MAGIC;
+42 -17
View File
@@ -99,6 +99,11 @@ static const uint8_t UNIT_G[3] = {G_CLOCK, G_ROUTE, G_TUNE};
static uint8_t unit_g_adopt __attribute__((section(".pool"))); /* the first boot: a load takes them (main.c) */
static uint32_t unit_g_t __attribute__((section(".pool"))); /* fm1_ms | 1 of a change not saved yet */
static int unit_g_id(uint32_t id) { return id == G_CLOCK || id == G_ROUTE || id == G_TUNE; }
/* (Skiff phase 9) PRESETS' LIST as a type (core.h PT_*, preset_t tag): the factory sounds of that type only. A byte no
* engine uses (0 in every older setting: none, so ALL or FAV, favorites.filter, as before; settings_persist.c keeps it
* below PT_N). favorites.filter stays 0 / 1: firmware before refuses a backup of any other (editor_backup.c) */
#define ui_ptag (favorites.factory[15][21])
_Static_assert(PT_N == 8, "settings_persist.c keeps ui_ptag below 8");
/* MENU > AUDIO CLICK, CLICK LEVEL, COUNT-IN (1.1, Discussion #131; click.c, seq.c): two bits each in another byte no
* engine uses, saved with the settings: bits 0-1 CLICK (OFF REC ON), 2-3 CLICK LEVEL (stored 0 MID, 1 LOW, 2 HIGH),
* 4-5 COUNT-IN (OFF, 1 BAR, 2 BARS); 0 in older settings = OFF / MID / OFF, so nothing clicks or counts in that did
@@ -479,9 +484,10 @@ static int page_visible(uint32_t i)
return TSEL->eng_req % NENGINES == ENGI_DRUM;
if (PAGES[i].graph == GR_ROLL)
return !drum_track(TSEL);
if (e->oneshot && (PAGES[i].fam == FAM_SCL || id == P_ATK || id == P_ED_FLT || id == P_VOICE || id == P_ALLOC))
if (e->oneshot && (PAGES[i].fam == FAM_SCL || id == P_ATK || id == P_ED_FLT || id == P_EG2_ATK || id == P_VOICE ||
id == P_ALLOC))
return 0;
if (e->ownenv && (id == P_ATK || id == P_ED_FLT))
if (e->ownenv && (id == P_ATK || id == P_ED_FLT || id == P_EG2_ATK)) /* ((Skiff phase 9) ENV 2: where ENV is) */
return 0;
#if FELUCCA_SLICE
if (PAGES[i].graph == GR_SLICES)
@@ -607,7 +613,8 @@ static int lock_page_ok(uint32_t i)
uint32_t k;
if (i >= NPAGES || (PAGES[i].scope != SC_TRACK && PAGES[i].scope != SC_ENGINE) || PAGES[i].graph == GR_MOD)
return 0;
if (PAGES[i].graph == GR_LANES) /* ((Skiff U3) LANES: KNOB 2 the lane's level, lock_id) */
if (PAGES[i].graph == GR_LANES) /* ((Skiff U3) LANES: KNOB 2 the lane's level, (phase 9) KNOB 3
* 4 its TUNE DECAY, lock_id) */
return 1;
for (k = 0; k < 4u; k++)
if (PAGES[i].id[k] != 0xFFu && motion_param(PAGES[i].id[k]))
@@ -617,7 +624,9 @@ static int lock_page_ok(uint32_t i)
static uint32_t lock_id(uint32_t k)
{
uint32_t id = !ui.plk_src || !lock_page_ok(ui.plk_src - 1u) ? ENGINES[TSEL->eng_req % NENGINES]->knob[k & 3u] :
PAGES[ui.plk_src - 1u].graph == GR_LANES ? ((k & 3u) == 1u ? P_LN0 + page_lane() : 0xFFu) :
PAGES[ui.plk_src - 1u].graph == GR_LANES ? ((k & 3u) == 1u ? P_LN0 + page_lane() :
(k & 3u) == 2u ? P_LTUNE0 + page_lane() :
(k & 3u) == 3u ? P_LDECAY0 + page_lane() : 0xFFu) :
PAGES[ui.plk_src - 1u].id[k & 3u];
return id < P_COUNT && motion_param(id) ? id : 0xFFu;
}
@@ -965,11 +974,13 @@ static uint32_t fnv(uint32_t h, const void *p, uint32_t n)
return h;
}
static uint32_t steps_sig(const track_t *t) { return fnv(2166136261u, t->step, sizeof t->step); }
static uint32_t track_sig(const track_t *t) /* the sound (an FM6 track's patch too), the steps */
static uint32_t track_sig(const track_t *t) /* the sound (an FM6 track's patch, a DRUM-X track's kit), the steps */
{
uint8_t id[3] = {t->eng_req, t->preset, t->user};
uint32_t h = fnv(fnv(steps_sig(t), t->p, sizeof t->p), id, 3), k = trk_index(t);
h = fnv(h, fm6_patch[k], sizeof fm6_patch[k]); /* (a patch the editor sent between two loads) */
if (t->eng_req % NENGINES == ENGI_DRUMX) /* ((Skiff phase 9) a kit edited between two preset loads) */
h = fnv(h, dx_kit, sizeof dx_kit);
for (uint32_t j = 0; j < motion.count; j++)
if ((motion.event[j].place >> 6) == k) h = fnv(h, &motion.event[j], sizeof motion.event[j]);
return h ^ ((motion.on >> k) & 1u);
@@ -1229,7 +1240,8 @@ static int param_kept(uint32_t i)
/* a retired preset kept as an alias, so stored preset numbers stay valid: SAMPLE 1, once TRANH, is PIANO
* (tools/gen_samples.py SMP_SET_ORIG). It loads as the original; browsing skips it. -> the preset k stands for.
* (SAMPLE 4, once PERC, is past SMP_NPRESETS: apply_preset_to loads it as DRUM) */
* (SAMPLE 4, once PERC: apply_preset_to loads it as DRUM; (Skiff phase 9) SAMPLE's variations follow it, so it is an
* alias among the presets, skipped as 1 is) */
static uint32_t preset_orig(const engine_t *e, uint32_t k)
{
return e->presets == SMP_PRESET_TABLE && k < SMP_NSETS ? SMP_SET_ORIG[k] : k;
@@ -1297,7 +1309,7 @@ static int set_engine_of(track_t *t, uint32_t ei);
static void apply_preset_to(track_t *t, uint32_t pi)
{
const engine_t *e = ENGINES[t->eng_req % NENGINES];
uint32_t i;
uint32_t i, kit;
#if !FELUCCA_FM4
if (t->eng_req % NENGINES == ENGI_DIGITAL) {
fm4_load_preset(t, pi);
@@ -1308,7 +1320,8 @@ static void apply_preset_to(track_t *t, uint32_t pi)
set_engine_of(t, ENGI_DRUM); /* number: the editor's PRESET, a favourite): DRUM's kit */
return; /* (core.h drum_from_perc) */
}
load_begin(t, UNDO_SOUND);
kit = t->eng_req % NENGINES == ENGI_DRUMX ? DRUMX_PKIT[pi % NELEM(DRUMX_PKIT)] : 0u; /* ((phase 9) the kit + 1) */
load_begin(t, UNDO_SOUND | (kit ? UNDO_KIT : 0u));
panic_req |= (uint8_t)(1u << trk_index(t)); /* MONO/POLY may change: release what sounds */
t->user = 0;
if (t == TSEL)
@@ -1338,6 +1351,8 @@ static void apply_preset_to(track_t *t, uint32_t pi)
for (i = 0; i < NELEM(pr->more) && pr->more[i].id; i++) /* ((Skiff) its LFO, GLIDE, ..: core.h) */
t->p[pr->more[i].id] = pr->more[i].v;
}
if (kit) /* ((Skiff phase 9) DRUM-X: the preset's kit, the project's: */
memcpy(dx_kit, DX_KITS[kit - 1u], sizeof dx_kit); /* one undo copy holds it, as INIT's: sound_init) */
fm6_track_loaded(t); /* FM6: the preset's patch (its SLOT) */
load_end(t);
}
@@ -1448,27 +1463,37 @@ static uint32_t preset_all_at(uint32_t n, uint32_t *k)
return e;
}
/* (Skiff phase 9) the LIST (PRESETS KNOB 4): 0 ALL, 1 FAV (favorites.filter), 2.. a type (ui_ptag + 1) */
static uint32_t list_mode(void) { return ui_ptag ? ui_ptag + 1u : favorites.filter; }
static const char *const LIST_NAME[PT_N + 1] = {"ALL", "FAV", "BASS", "LEAD", "PAD", "KEYS", "PLUCK", "DRUM", "FX"};
static int preset_in_list(uint32_t e, uint32_t k) /* a LIST but ALL: the sound is in it (user presets: FAV only) */
{
if (ui_ptag)
return e < NENGINES && ENGINES[e]->presets[k].tag == ui_ptag;
return favorite_has(e, k);
}
static uint32_t preset_pos(uint32_t *total)
{
uint32_t all, current = preset_all_pos(&all), n = 0, pos = 0xFFFFFFFFu;
if (!favorites.filter) { *total = all; return current; }
if (!list_mode()) { *total = all; return current; }
for (uint32_t i = 0; i < all; i++) {
uint32_t k, e = preset_all_at(i, &k);
if (!favorite_has(e, k)) continue;
if (!preset_in_list(e, k)) continue;
if (i == current) pos = n;
n++;
}
*total = n;
return pos == 0xFFFFFFFFu ? n : pos; /* current sound need not be a favorite */
return pos == 0xFFFFFFFFu ? n : pos; /* current sound need not be in the list */
}
static uint32_t preset_at(uint32_t n, uint32_t *k)
{
uint32_t all;
if (!favorites.filter) return preset_all_at(n, k);
if (!list_mode()) return preset_all_at(n, k);
preset_all_pos(&all);
for (uint32_t i = 0; i < all; i++) {
uint32_t e = preset_all_at(i, k);
if (favorite_has(e, *k) && !n--) return e;
if (preset_in_list(e, *k) && !n--) return e;
}
*k = UP_SLOTS;
return NENGINES;
@@ -1541,18 +1566,18 @@ static void eng_list_step(int32_t direction) /* the next / previous soun
static void preset_step(int32_t direction)
{
uint32_t total, cur = preset_pos(&total);
if (!total) { ui_message("NO FAVORITES"); return; }
if (!total) { ui_message(ui_ptag ? "NO SOUNDS" : "NO FAVORITES"); return; }
preset_go(cur >= total ? (direction > 0 ? 0 : total - 1) :
(cur + (direction > 0 ? 1u : total - 1u)) % total);
}
/* Seven display rows. Favorites use a bounded window, not a repeating carousel.
* Return total for an empty row; a non-favorite current sound shows the start. */
/* Seven display rows. A LIST of favorites or of a type uses a bounded window, not a repeating carousel.
* Return total for an empty row; a current sound outside the list shows the start. */
static uint32_t preset_visible(uint32_t cur, uint32_t total, uint32_t row)
{
uint32_t first, last;
if (!total || row >= 7u) return total;
if (!favorites.filter)
if (!list_mode())
return (cur + total * 4u + row - 3u) % total;
first = cur < total && cur > 3u ? cur - 3u : 0u;
last = total > 7u ? total - 7u : 0u;
+11 -8
View File
@@ -511,7 +511,9 @@ static void draw_foot(void)
const engine_t *e = ENGINES[TSEL->eng_req % NENGINES];
const char *ename = e->name;
int32_t x, ly = foot_line_y(); /* (BLOCKS: the one line) */
int hints = act_cols() || ((grid_on() || pg->graph == GR_TILES) && !ui_hints_off); /* (the line says them, not the
int tiles = !ui.home && pg->graph == GR_TILES; /* ((Skiff, issue #3) not the page under HOME: its hints were
* drawn under HOLD HOME SHIFT) */
int hints = act_cols() || ((grid_on() || tiles) && !ui_hints_off); /* (the line says them, not the
* sound; (Skiff U4) MENU > HINTS OFF: the sound) */
sound_name(t, pn);
if (ui.home)
@@ -527,7 +529,7 @@ static void draw_foot(void)
uint32_t ph = song.playing && t->seq_idx / 16u == ui.bank ? t->seq_idx : 0xFFu;
sig = str_hash(0x9E3779B9u, s) + ph * 97u + (song.seq_mode ? ui.cursor : 0xFFu) * 3001u + steps_hash(t) +
(ui.home ? 0u : page_icon(pg)) * 7121u +
ui.bank * 7u + (uint32_t)t->p[P_SLEN] * 13u + favorites.filter * 9173u + (ui.edge_t != 0) * 5501u +
ui.bank * 7u + (uint32_t)t->p[P_SLEN] * 13u + list_mode() * 9173u + (ui.edge_t != 0) * 5501u +
ui_hints_off * 3301u;
}
if (act_cols()) { /* the hint, and whether OCT+ would act */
@@ -539,7 +541,7 @@ static void draw_foot(void)
}
if (grid_on())
sig += 0x51EDu + (uint32_t)black_held(GK_ACC) * 977u;
if (pg->graph == GR_TILES) /* (Skiff U1) the REC hint comes and goes with the arming */
if (tiles) /* (Skiff U1) the REC hint comes and goes with the arming */
sig += ((song.rec >> song.sel) & 1u) * 4421u;
if (!ui.force && sig == ui.foot_sig)
return;
@@ -590,7 +592,7 @@ static void draw_foot(void)
cv_text(x, ly, &AF_S, "ACCENT", T_ACCENT);
else
cv_key_hint(x, ly - KC_TY, KC_KEYS, "STEPS", 1, T_BG);
} else if (pg->graph == GR_TILES && !ui_hints_off) { /* (Skiff) STEP's tiles: what PRESETS does, as the mockup's */
} else if (tiles && !ui_hints_off) { /* (Skiff) STEP's tiles: what PRESETS does, as the mockup's */
x = cv_key_hint(8, ly - KC_TY, KC_PRESETS, "STEP", 1, T_BG);
if (!((song.rec >> song.sel) & 1u)) /* (Skiff U1) not armed, the keys only play: REC writes */
cv_key_hint(x + 10, ly - KC_TY, KC_REC, "WRITE", 1, T_BG);
@@ -617,8 +619,8 @@ static void draw_foot(void)
GFX_HOOK_ALIGN(0, ly + AF_S_CAP_Y, 0, ly + AF_S_CAP_Y + AF_S_CAP_H, AL_V, "footer icons on the names' line");
x += cv_icon_in(x, ly + AF_S_CAP_Y, 0, AF_S_CAP_H, 16, trk_icon(song.sel, 1), T_ACCENT, T_BG) + 5;
x = cv_text_fit(x, ly, &AF_S, ename, T_THEME, T_BG, 80);
if (favorites.filter) /* ((Skiff U2) PRESETS lists the favourites only) */
x = cv_text(x + 6, ly, &AF_S, "FAV", T_ACCENT);
if (list_mode()) /* ((Skiff U2) PRESETS lists the favourites; phase 9: a type) */
x = cv_text(x + 6, ly, &AF_S, LIST_NAME[list_mode()], T_ACCENT);
cv_free_text(x + 10, ly, &AF_S, pn, T_TEXT, T_BG, tx - 12 - (x + 10));
if (pi != ICON_NONE) {
GFX_HOOK_ALIGN(0, ly + AF_S_CAP_Y, 0, ly + AF_S_CAP_Y + AF_S_CAP_H, AL_V,
@@ -777,7 +779,7 @@ static void draw_columns(void)
draw_column(0, "No.", val, u, VAL(0u), -1, ICON_NONE);
draw_column(1, "ENG", ENGINES[TSEL->eng_req]->name, "", VAL(1u), -1, engine_icon(ENGINES[TSEL->eng_req]->name));
draw_column(2, "FAV", preset_favorite() ? "ON" : "OFF", "", VAL(2u), -1, ICON_X_STAR);
draw_column(3, "LIST", favorites.filter ? "FAV" : "ALL", "", VAL(3u), -1, ICON_X_FOLDER);
draw_column(3, "LIST", LIST_NAME[list_mode()], "", VAL(3u), -1, ICON_X_FOLDER);
return;
}
if (sheet_of(cur_page()->graph)) { /* (Skiff phase 7, 8; FM6 LAB) a sheet's window (SHEETS) */
@@ -966,7 +968,8 @@ static void draw_columns(void)
}
param_format(d, *vp, val, &unit);
card_mot_of(vp); /* (a global: never) */
draw_column(c, cur_page()->graph == GR_LANES ? "LEVEL" : d->label, val, unit, card_dead(cur_page(), c) ? T_DIM : VAL(c),
draw_column(c, cur_page()->graph == GR_LANES && c == 1u ? "LEVEL" : d->label, val, unit, /* ((phase 9) TUNE DECAY) */
card_dead(cur_page(), c) ? T_DIM : VAL(c),
d->fmt == F_ENUM && d->max < 2 ? -1 : RATIO(d, enum_rank(d, *vp)), param_icon(d, *vp));
}
}
+11 -2
View File
@@ -27,14 +27,23 @@ static int ev_id_ok(const track_t *t, uint32_t id)
return 0;
if (id >= P_LN0 && id <= P_LN7)
return drum_track(t);
if (id >= P_LTUNE0 && id <= P_LDECAY7) /* ((Skiff phase 9) the lanes' TUNE and DECAY: DRUM's own) */
return t->eng_req % NENGINES == ENGI_DRUM;
d = track_desc(t, id);
return d && d->label && d->label[0] && d->label[0] != '-' && d->max > d->min;
}
/* its name in the list and on the card (b holds 12): the page's word before the card's label where the label alone
* would say two things (ENV ATK, ENV FLT: ENV DEST's, LFO FLT: LFO DEST's) */
* would say two things (ENV ATK, ENV FLT: ENV DEST's, LFO FLT: LFO DEST's; (Skiff phase 9) ENV2 ATTACK, DRIVE TYPE;
* a lane's: SNARE TUNE, CL HAT DCAY) */
static void ev_name(const track_t *t, uint32_t id, char *b)
{
const char *pre = id >= P_ATK && id <= P_ED_SHP ? "ENV " : id >= P_LRATE && id <= P_LD_AMP ? "LFO " : "";
const char *pre = id >= P_ATK && id <= P_ED_SHP ? "ENV " : id >= P_LRATE && id <= P_LD_AMP ? "LFO " :
id >= P_EG2_ATK && id <= P_EG2_REL ? "ENV2 " : id == P_DTYPE || id == P_DTONE ? "DRIVE " : "";
if (id >= P_LTUNE0 && id <= P_LDECAY7) {
str_cpy(b, drum_lane_name(t, (id - P_LTUNE0) % NLANE), 12);
str_cpy(b + str_len(b), id < P_LDECAY0 ? " TUNE" : " DCAY", 12 - str_len(b));
return;
}
str_cpy(b, pre, 12);
str_cpy(b + str_len(b), id == P_LEVEL ? "LEVEL" : id == P_GLIDE ? "GLIDE" :
id >= P_LN0 && id <= P_LN7 && t->eng_req % NENGINES == ENGI_DRUM ? drum_lane_name(t, id - P_LN0) :
+6 -2
View File
@@ -988,7 +988,7 @@ static void graph_slices(void)
str_cpy(t + 4, u, sizeof t - 4);
str_cpy(t + str_len(t), " S", sizeof t - str_len(t));
cv_text(12, 106, &AF_S, t, T_MID);
cv_text_r(228, 106, &AF_S, N_SLC_SRC[src], src && src != SLC_SRC_PIANO ? T_THEME : T_DIM, T_SURF);
cv_text_r(228, 106, &AF_S, N_SLC_SRC[src], SLC_SRC_USR(src) ? T_THEME : T_DIM, T_SURF);
}
#endif
@@ -1532,7 +1532,7 @@ static void graph_browse(void)
uint32_t total, cur = preset_pos(&total), e, k;
int32_t row;
if (!total) {
panel_note("NO FAVORITES", "list ALL to add sounds", 0);
panel_note(ui_ptag ? "NO SOUNDS" : "NO FAVORITES", ui_ptag ? "list ALL" : "list ALL to add sounds", 0);
return;
}
for (row = -3; row <= 3; row++) {
@@ -2341,6 +2341,10 @@ static void draw_graph(void)
cv_oy = 0;
graph_envdst(t, c);
break;
case GR_DRIVE: /* (Skiff phase 9) */
cv_oy = 0;
graph_drive(t, c);
break;
case GR_LFODST:
cv_oy = 0;
graph_lfodst(t, c);
+8 -4
View File
@@ -766,10 +766,14 @@ static void edit_param(uint32_t slot, int32_t steps)
select_engine(eng_step_for(song.sel, TSEL->eng_req, steps)); /* ((Skiff phase 6) what the track may play) */
} else if (slot == 2u) {
preset_mark(steps > 0);
} else if (slot == 3u && favorites.filter != (uint32_t)(steps > 0)) {
favorites.filter = steps > 0;
ui.force = 1;
settings_save();
} else if (slot == 3u) { /* LIST: ALL, FAV, (Skiff phase 9) then the types (ui.c) */
uint32_t v = (uint32_t)clamp((int32_t)list_mode() + steps, 0, PT_N);
if (v != list_mode()) {
favorites.filter = v == 1u;
ui_ptag = (uint8_t)(v > 1u ? v - 1u : 0u);
ui.force = 1;
settings_save();
}
}
return;
}
+16 -10
View File
@@ -735,17 +735,21 @@ static uint32_t layer_leds(uint32_t *br)
* REPEATs' division in the other corner); the footer the keycaps. A cell: RAISE
* (can be pressed), the selection's fill (the value now, SET), the accent (held, HOLD), DIM (cannot now: pressing
* it says why), KEY (a muted track, as the MUTE badge); HOLD cells in a SET layer: a corner triangle */
static const char *const PF_DIV[3] = {"1/8", "1/16", "1/32"}; /* the REPEATs (the other effects: their icon alone) */
static const char *const PF_DIV[3] = {"8", "16", "32"}; /* the REPEATs' 1/8 1/16 1/32 ((Skiff phase 9) 30 px cells: the
* "1/" off); the other effects: their icon alone */
static const uint8_t PF_ICON[PF_M1] = {ICON_X_REPEAT, ICON_X_REPEAT, ICON_X_REPEAT, ICON_X_REVERSE, ICON_CUTOFF,
ICON_X_HPF, ICON_X_TSTOP, ICON_X_FREEZE, ICON_X_OCT_UP, ICON_X_OCT_DN};
ICON_X_HPF, ICON_X_TSTOP, ICON_X_FREEZE, ICON_X_OCT_UP, ICON_X_OCT_DN, ICON_X_CHOP, ICON_X_DUB, ICON_X_FLANGE,
ICON_X_VINYL};
static const char W_NOTE[16] = {'F', 'G', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'A', 'B', 'C', 'D', 'E', 'F', 'G'};
static const char B_NOTE[] = {'F', 'G', 'A', 'C', 'D', 'F'}; /* black keys 1..6: F# G# A# C# D# F# (the MUTEs) */
_Static_assert(sizeof B_NOTE >= NTRK, "a black key's name for every track");
#define LC_X(c) (6 + 58 * (int32_t)(c)) /* cell column c: 54 px wide, 4 px apart */
#define LC_W 54
#define LC_H 42 /* the big cells: rows at y 4 and 50 */
#define LF_X(c) (7 + 46 * (int32_t)(c)) /* FX: the 10 effects, 5 a row (F3 .. C4, D4 .. A4), 42 px: x 7 .. 233 */
#define LF_W 42
#define LF_X(c) (6 + 33 * (int32_t)(c)) /* FX: the 14 effects, 7 a row (an octave each: F3 .. E4, F4 ..
* E5), 30 px: x 6 .. 234 ((Skiff phase 9) were 10, 5 a row) */
#define LF_W 30
#define LF_ROW 7u
#define LM_Y 96 /* the black keys' row (22 px) */
#define LM_H 22
enum { LS_OFF, LS_SEL, LS_HELD, LS_WAIT, LS_DIM, LS_MUTE };
@@ -787,14 +791,16 @@ static uint16_t lc_box(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t fill
static void lcell(int32_t x, int32_t y, int32_t h, const char *note, uint32_t icon, const char *name, uint32_t st)
{
uint16_t ink, fill = lc_fill(st, &ink), idle = fill == T_RAISE;
int32_t in = lc_w < 40 ? 3 : 5; /* ((Skiff phase 9) FX's 30 px cells: the note and a REPEAT's
* division 3 px in, apart) */
fill = lc_box(x, y, lc_w, h, fill);
if (note) /* (a 28 px cell, SEQ TOOLS: y + 1, Barlow's 10 px capitals */
cv_text_on(x + 5, y + (h > 24 && h <= 30 ? 1 : 3), &AF_S, note, idle ? T_MID : ink, fill); /* clear its name) */
cv_text_on(x + in, y + (h > 24 && h <= 30 ? 1 : 3), &AF_S, note, idle ? T_MID : ink, fill); /* clear its name) */
if (h > 30) {
GFX_HOOK_ALIGN(x, 0, x + lc_w, 0, AL_H, "FX cell icon centred across");
cv_icon_on(x + (lc_w - 24) / 2, y + h - 25, 24, icon, ink, fill); /* (its ink: rows 3 .. 20 of 24) */
if (name)
cv_text_r(x + lc_w - 5, y + 3, &AF_S, name, ink, fill);
cv_text_r(x + lc_w - in, y + 3, &AF_S, name, ink, fill);
} else if (h > 24) { /* SEQ TOOLS: the icon (12 px) over the name, 2 px between, */
int32_t b[4], t; /* centred by ink (the icon at a side) */
icon_ink(12, icon, b);
@@ -877,12 +883,12 @@ static void layer_fx(void)
uint32_t held = perf_kill ? 0u : perf_held | perf_latched, act = perf_act, ok = perf_avail(), e;
char n[3] = {0, 0, 0};
lc_w = LF_W;
for (e = 0; e < PF_M1; e++) { /* the effects of the white keys F3 .. A4, 5 a row */
if (e % 5u == 0u)
GFX_HOOK_ALIGN(0, 0, 240, 0, AL_H | AL_CELLS | AL_N(5), "FX cells' row centred");
for (e = 0; e < PF_M1; e++) { /* the effects of the white keys F3 .. E5, an octave a row */
if (e % LF_ROW == 0u)
GFX_HOOK_ALIGN(0, 0, 240, 0, AL_H | AL_CELLS | AL_N(LF_ROW), "FX cells' row centred");
uint32_t st = !((ok >> e) & 1u) ? LS_DIM : !((held >> e) & 1u) ? LS_OFF : (act >> e) & 1u ? LS_HELD : LS_WAIT;
n[0] = W_NOTE[e];
lcell(LF_X(e % 5u), e < 5u ? 4 : 50, LC_H, n, PF_ICON[e], e < 3u ? PF_DIV[e] : 0, st);
lcell(LF_X(e % LF_ROW), e < LF_ROW ? 4 : 50, LC_H, n, PF_ICON[e], e < 3u ? PF_DIV[e] : 0, st);
}
lc_w = LC_W;
for (e = 0; e < NTRK; e++) /* the cuts of the black keys 1..6, while held ((Skiff U2, */
+5 -1
View File
@@ -40,7 +40,7 @@ static const menu_credit_t MENU_CREDITS[] = {
{"", MC_TEXT},
{"H\xFCgelton Instruments", MC_TITLE}, /* Felucca's own: above; these are ours too */
{"Leo Kuroshita", MC_TEXT},
{"CrispyZebra (PHASE waveforms), the DRUM voices, the Sample Pack: GPL-3.0", MC_TEXT},
{"CrispyZebra (PHASE waveforms), the DRUM voices: GPL-3.0", MC_TEXT},
{"Fukiai icon font: MIT", MC_TEXT},
{"https://github.com/hugelton", MC_URL},
{"", MC_TEXT},
@@ -76,6 +76,10 @@ static const menu_credit_t MENU_CREDITS[] = {
{"https://github.com/sgossner/VSCO-2-CE", MC_URL},
{"https://github.com/sgossner/VCSL", MC_URL},
{"", MC_TEXT},
{"YUE2", MC_TITLE}, /* (Skiff phase 9) the music model SLICE's BREAK and FUNK were made with */
{"Multimodal Art Projection: SLICE's BREAK and FUNK", MC_TEXT},
{"https://github.com/multimodal-art-projection/YuE", MC_URL},
{"", MC_TEXT},
{"VOICE", MC_TITLE},
{"Dennis H. Klatt (1980)", MC_TEXT},
{"https://doi.org/10.1121/1.383940", MC_URL},
+229 -16
View File
@@ -208,11 +208,13 @@ static void graph_delay(uint16_t c)
pg_text(14, 16, "DRY", T_MID);
}
/* REVERB: the first reflections, then the tail SIZE long, its top dimmed by DAMP; SPRING: its coil over it */
/* REVERB: the first reflections, then the tail SIZE long, its top dimmed by DAMP; SPRING: its coil over it; (Skiff
* phase 9) HALL: the tail twice as long */
static void graph_reverb(uint16_t c)
{
static const uint8_t ER[5] = {84, 60, 72, 46, 52};
int32_t i, x, e = 32768, len = 40 + song.g[G_RSIZE] * 144 / 127, k = 32768 - 98304 / len;
int32_t hall = song.g[G_RTYPE] == 2;
int32_t i, x, e = 32768, len = (40 + song.g[G_RSIZE] * 144 / 127) * (hall ? 2 : 1), k = 32768 - 98304 / len;
int32_t dim = 20 + song.g[G_RDAMP] * 60 / 127; /* % of the tail's height dimmed */
if (ux.crypt) { /* (Skiff C4) CRYPT: the reflections ! columns, the tail shade
* characters # * + : . fading along it, its top blood (DAMP);
@@ -237,15 +239,31 @@ static void graph_reverb(uint16_t c)
cr_ch(x, 17, &AF_S, '~', T_MID);
pg_text(12, 17, "SPRING", T_MID);
} else
pg_text(12, 17, "ROOM", T_MID);
pg_text(12, 17, hall ? "HALL" : "ROOM", T_MID);
return;
}
for (i = 0; i < 5; i++)
cv_rect(12 + i * 6, 126 - ER[i], 3, ER[i], T_TEXT);
for (i = 0; i < 5; i++) { /* ((Skiff phase 9) NEON: lit tubes; QUARK: calorimeter towers) */
if (ux.neon)
ne_tube(12 + i * 6, 126 - ER[i], 3, ER[i], T_TEXT, T_SURF);
else if (ux.quark)
qk_tower(12 + i * 6 - 1, 126, 4, 84, ER[i], T_TEXT, 0);
else
cv_rect(12 + i * 6, 126 - ER[i], 3, ER[i], T_TEXT);
}
for (x = 44; x <= 228; x++) {
int32_t h = 84 * e >> 15, top = h * dim / 100, t = (x - 44) * 100 / 184;
cv_rect(x, 126 - h, 1, top, ux_mix(c, T_SURF, 55 + t * 30 / 100));
cv_rect(x, 126 - h + top, 1, h - top, ux_mix(c, T_SURF, t * 60 / 100));
int32_t h = 84 * e >> 15, top = h * dim / 100, t = (x - 44) * 100 / 184, y;
if (ux.neon) { /* ((Skiff phase 9) NEON: the sun's bands under it, DAMP's top violet) */
cv_rect(x, 126 - h, 1, top, ux_mix(NE_VIOLET, T_SURF, 45 + t * 30 / 100));
ne_band_col(x, 126 - h + top - 3, 126 - 84, 126);
} else if (ux.quark) { /* ((Skiff phase 9) QUARK: a Monte Carlo fill, DAMP's top sparse) */
for (y = 126 - h; y < 126 - h + top; y++)
if ((x + y) % 3 == 0 && y % 2 == 0)
cv_rect(x, y, 1, 1, T_DIM);
qk_mc(x, 126 - h + top - 2, 126);
} else {
cv_rect(x, 126 - h, 1, top, ux_mix(c, T_SURF, 55 + t * 30 / 100));
cv_rect(x, 126 - h + top, 1, h - top, ux_mix(c, T_SURF, t * 60 / 100));
}
e = e * k >> 15;
}
if (song.g[G_RTYPE] == 1) {
@@ -253,33 +271,228 @@ static void graph_reverb(uint16_t c)
for (x = 64; x <= 228; x++)
cv_pset(x, 13 + sine_i((uint32_t)(x - 64) * 0x0D000000u) * 3 / 32768, T_MID);
} else
pg_text(12, 17, "ROOM", T_MID);
pg_text(12, 17, hall ? "HALL" : "ROOM", T_MID);
}
/* CHORUS: the dry sound and its copy, its pitch drifting (fx.c: one modulated delay): RATE how fast, DEPTH how far */
/* (Skiff phase 9) FLANGER's and PHASER's response at x of 0 .. 216 (low .. high), Q15 (32768: as the dry; up to
* twice): FLANGER the comb of the dry and its copy, DEPTH more teeth, FEEDBACK sharper and higher; PHASER the two
* notches of its four stages, DEPTH wider, FEEDBACK a peak beside each */
static int32_t pg_cho_resp(uint32_t mode, int32_t x)
{
int32_t fb = song.g[G_CFDBK], dp = song.g[G_CDEPTH], v, k, h;
if (mode == 1u) {
uint32_t n = 4u + (uint32_t)dp * 6u / 127u;
v = sine_i((uint32_t)x * n * 9942053u + 0x40000000u); /* (cos: 2^31 / 216 a px and tooth) */
v = v < 0 ? -v : v;
k = (v * v >> 15) * (v * v >> 15) >> 15;
return (v * (127 - fb) + k * fb) / 127 * (127 + fb) / 127;
}
for (h = 32768, k = 0; k < 2; k++) {
int32_t d = x - (k ? 150 : 66), w = 10 + dp / 8, r = d - (d < 0 ? -2 : 2) * w;
h -= 30000 * w * w / (w * w + d * d);
h += fb * 128 * w * w / (w * w + r * r);
}
return h < 0 ? 0 : h;
}
/* CHORUS: the dry sound and its copy, its pitch drifting (fx.c: one modulated delay): RATE how fast, DEPTH how far;
* (Skiff phase 9) FEEDBACK: a fainter second pass; FLANGER, PHASER: their response across the spectrum, drawn as ANALOG's
* FLT draws its curve in each theme */
static void graph_chorus(uint16_t c)
{
int32_t x, py = 74, a = song.g[G_CDEPTH] * 44 / 127;
uint32_t inc = (0xFFFFFFFFu / 216u) * (uint32_t)(1 + song.g[G_CRATE] * 5 / 127);
int32_t x, py = 74, a = song.g[G_CDEPTH] * 44 / 127, fb = song.g[G_CFDBK], b = a * fb / 127, ey;
uint32_t inc = (0xFFFFFFFFu / 216u) * (uint32_t)(1 + song.g[G_CRATE] * 5 / 127), mode = (uint32_t)song.g[G_CMODE];
if (mode == 1u || mode == 2u) {
if (ux.crypt) { /* (CRYPT: ASCII art over its shade, 37 columns of 9 lines, a skull on
* its highest peak) */
uint8_t L[37];
int32_t pk = 0;
for (x = 0; x < 37; x++) { /* (the skull's peak: the highest, nearest the middle) */
L[x] = (uint8_t)clamp(8 - pg_cho_resp(mode, x * 6) * 4 / 32768, 0, 8);
if (L[x] < L[pk] || (L[x] == L[pk] && (x > 18 ? x - 18 : 18 - x) < (pk > 18 ? pk - 18 : 18 - pk)))
pk = x;
}
cr_dots(12, 34, 6, 10, L, 37, 9, T_DIM);
cr_art(12, 34, 6, 10, L, 37, T_THEME);
cr_skull(12 + pk * 6 - 4, 34 + L[pk] * 10 - 12, CR_FLAME, T_SURF, 0);
} else {
for (x = 0; x <= 216; x++) { /* (under it: NEON the sun's bands, QUARK a Monte Carlo fill) */
int32_t y = 124 - pg_cho_resp(mode, x) * 40 / 32768;
if (ux.neon)
ne_band_col(12 + x, y, 44, 124);
else if (ux.quark)
qk_mc(12 + x, y, 124);
else
cv_rect(12 + x, y, 1, 124 - y, ux_mix(c, T_SURF, 75));
if (x)
cv_line_t(12 + x - 1, py, 12 + x, y, c, 3);
py = y;
}
pg_hline(12, 228, 84, T_LINE); /* (the dry's level) */
}
pg_text(12, 16, mode == 1u ? "THE DRY AND ITS COPY: A COMB, SWEPT" : "FOUR STAGES: TWO NOTCHES, SWEPT", T_MID);
return;
}
pg_hline(12, 228, 74, T_MID);
if (ux.crypt) { /* (Skiff C4) CRYPT: the copy a snake, 5 lines of 8 px either way */
uint8_t L[37];
int32_t i, A = (a + 4) / 8;
for (i = 0; i < 37; i++)
if (ux.crypt) { /* (Skiff C4) CRYPT: the copy a snake, 5 lines of 8 px either way;
* ((phase 9) FEEDBACK: its copy ASCII art behind, MID) */
uint8_t L[37], L2[37];
int32_t i, A = (a + 4) / 8, B = (b + 4) / 8;
for (i = 0; i < 37; i++) {
L[i] = (uint8_t)(5 + (sine_i((uint32_t)(i * 6) * inc) * A + (A ? 16384 : 0)) / 32768);
L2[i] = (uint8_t)(5 + (sine_i((uint32_t)(i * 6) * inc - 0x30000000u) * B + (B ? 16384 : 0)) / 32768);
}
if (fb)
cr_art(12, 34, 6, 8, L2, 37, T_MID);
cr_snake(12, 34, 6, 8, L, 36, T_THEME, CR_EMBER); /* (its head and tongue inside the frame) */
pg_text(12, 16, "DRY AND ITS DRIFTING COPY", T_MID);
return;
}
if (fb) { /* ((Skiff phase 9) FEEDBACK: the copy's copy, fainter, behind: NEON a
* ghost, QUARK dotted) */
for (x = 0, py = 74; x <= 216; x += 2) {
int32_t y = 74 + sine_i((uint32_t)x * inc - 0x30000000u) * b / 32768;
if (ux.quark) {
if (x % 6 == 0)
cv_rect(12 + x, y, 1, 1, T_MID);
} else if (x) {
cv_line_t(12 + x - 2, py, 12 + x, y, ux.neon ? ux_mix(c, T_SURF, 55) : T_MID, 1);
}
py = y;
}
py = 74;
}
for (x = 0; x <= 216; x += 2) {
int32_t y = 74 + sine_i((uint32_t)x * inc) * a / 32768;
if (x)
cv_line_t(12 + x - 2, py, 12 + x, y, c, 3);
py = y;
}
ey = 74 + sine_i(216u * inc) * a / 32768; /* ((Skiff phase 9) its end, as LFO's now: NEON a white-hot trail into a
* sparkle, QUARK the electron) */
if (ux.neon) {
for (x = 0; x < 36; x++)
cv_rect(228 - x, 74 + sine_i((uint32_t)(216 - x) * inc) * a / 32768, 1, 2, ux_mix(T_TEXT, c, x * 100 / 36));
ne_spark(228, ey + 1, T_ACCENT, 2);
} else if (ux.quark) {
qk_disc(228, ey, 3, T_ACCENT);
}
pg_text(12, 16, "DRY AND ITS DRIFTING COPY", T_MID);
}
/* (Skiff phase 9) FX > DRIVE: the TYPE's transfer at the DRIVE, as fx.c track_dist shapes it (its low cut and tone left
* out): the input across, the output up, the straight line dim behind it; at the right the TYPE, DIST and TONE (BITS:
* the bits left, the hold) */
static int32_t pg_drive_at(uint32_t type, int32_t d, int32_t x)
{
int32_t g = 4096 + d * d * 2, y = ((x >> 2) * g) >> 10;
if (!d)
return x; /* (DIST 0: no DIST at all) */
if (type == DT_BITS) {
uint32_t s = (uint32_t)d / 11u;
return mulq15(((x + (s ? 1 << (s - 1u) : 0)) >> s) << s, 32000 - d * 20);
}
if (type == DT_HARD) {
y = clamp(y, -24576, 24576);
} else if (type == DT_FOLD) {
int32_t u = (y + 16384) & 65535;
y = (u < 32768 ? u - 16384 : 49152 - u) * 2;
} else {
y = softclip(y + 2400) - softclip(2400);
}
return mulq15(clamp(y, -40000, 40000), 30000 - d * 120);
}
/* the inset: a sine's cycle of 88 samples through the TYPE, BITS' hold, the TONE's two-pole low-pass and the make-up,
* as fx.c runs them (its second pass: the filter settled) */
static void pg_drive_wave(const track_t *t, uint32_t type, int32_t d, int32_t *y)
{
uint32_t i, hm = type == DT_BITS ? (1u << ((uint32_t)d >> 5)) - 1u : 0u;
int32_t lp1 = 0, lp2 = 0, h = 0, k = clamp((type == DT_BITS ? 32700 - d * 40 : 32000 - d * 95) +
t->p[P_DTONE] * 150, 2000, 32700);
for (i = 0; i < 176u; i++) {
int32_t x = sine_i(i * 48806447u) * 3 / 4; /* (2^32 / 88 a sample, -2.5 dBFS) */
if (!(i & hm))
h = pg_drive_at(type, d, x);
lp1 += mulq15(h - lp1, k);
lp2 += mulq15(lp1 - lp2, k);
if (i >= 88u)
y[i - 88u] = d ? lp2 : x;
}
}
static void graph_drive(const track_t *t, uint16_t c)
{
uint32_t type = (uint32_t)t->p[P_DTYPE] & 3u;
int32_t d = t->p[P_DIST], i, py = 0, pk = 0, w[88];
int16_t ys[117];
char b[24];
pg_drive_wave(t, type, d, w);
for (i = 0; i <= 116; i++) { /* (the curve; its highest point, the first) */
ys[i] = (int16_t)(66 - pg_drive_at(type, d, (i - 58) * 32768 / 58) * 58 / 32768);
if (ys[i] < ys[pk])
pk = i;
}
if (ux.crypt) { /* (CRYPT, as LFO's: the straight line faint ASCII art, the curve a
* snake, its head at the end (39 columns of 3 px, 13 lines of 9); the
* wave as OSC's: ASCII art, blood in its teeth (22 of 4, 9 of 8)) */
uint8_t L[39], S[39], W[22];
for (i = 0; i < 39; i++) {
L[i] = (uint8_t)clamp(6 - pg_drive_at(type, d, (i * 2 - 38) * 32768 / 38) * 6 / 32768, 0, 12);
S[i] = (uint8_t)(12 - i * 12 / 38);
}
for (i = 0; i < 22; i++)
W[i] = (uint8_t)clamp(4 - w[i * 4] * 4 / 32768, 0, 8);
pg_hline(12, 128, 66, T_LINE);
cv_rect(70, 8, 1, 117, T_LINE);
pg_hline(140, 227, 88, T_LINE);
cr_art(12, 8, 3, 9, S, 39, T_LINE);
cr_snake(12, 8, 3, 9, L, 38, T_THEME, CR_EMBER); /* (its head and tongue clear of the wave) */
for (i = 0; i + 1 < 22; i++)
if (W[i + 1] <= W[i])
cr_dither(140 + i * 4, 56 + W[i] * 8 + 2, 4, (8 - W[i]) * 8 - 2, CR_BLOOD);
cr_art(140, 56, 4, 8, W, 22, T_THEME);
} else {
for (i = 0; i <= 116; i++) { /* (under the curve, as ANALOG's FLT: NEON the sun's bands, QUARK a
* Monte Carlo fill) */
if (ux.neon)
ne_band_col(12 + i, ys[i], 8, 124);
else if (ux.quark)
qk_mc(12 + i, ys[i], 124);
else
cv_rect(12 + i, ys[i], 1, 124 - ys[i], ux_mix(c, T_SURF, 75));
}
pg_hline(12, 128, 66, T_LINE);
cv_rect(70, 8, 1, 117, T_LINE);
pg_hline(140, 227, 88, T_LINE);
cv_line(12, 124, 128, 8, T_DIM); /* (the straight line: no drive) */
for (i = 1; i <= 116; i++)
cv_line_t(12 + i - 1, ys[i - 1], 12 + i, ys[i], c, 3);
for (i = 0; i < 88; i++) { /* (the wave) */
int32_t y = 88 - w[i] * 32 / 32768;
if (i)
cv_line_t(140 + i - 1, py, 140 + i, y, c, 2);
py = y;
}
py = 88 - w[87] * 32 / 32768; /* (its end, as LFO's now) */
if (ux.quark) { /* (QUARK: a nucleus on the curve's highest point, the electron at
* the wave's end) */
qk_nucleus(12 + pk, ys[pk], T_THEME, 7);
qk_disc(227, py, 3, T_ACCENT);
} else if (ux.neon) { /* (NEON: a sparkle at the curve's end; a white-hot trail into one at
* the wave's) */
ne_spark(128, ys[116] + 1, T_ACCENT, 2);
for (i = 0; i < 24; i++)
cv_rect(227 - i, 88 - w[87 - i] * 32 / 32768, 1, 2, ux_mix(T_TEXT, c, i * 100 / 24));
ne_spark(227, py + 1, T_ACCENT, 1);
}
}
cv_text(140, 26 - AF_M.asc, &AF_M, N_DTYPE[type], d ? c : T_DIM);
if (type == DT_BITS && d) { /* (the bits left of 16, each sample held) */
fmt_int(b, 16 - d / 11);
str_cpy(b + str_len(b), " BITS, HOLD ", 13);
fmt_int(b + str_len(b), 1 << (d >> 5));
pg_text(140, 42, b, T_MID);
}
}
/* GLOBAL: a bar's 16 steps (a beat's tallest), the off steps late by SWING+ (seq: core.h swing_step_len) over a mark
* where they would be straight, the beats numbered; the long and short steps' share */
static void graph_global(uint16_t c)
+4 -4
View File
@@ -75,16 +75,16 @@ static void slice_view(uint32_t *a, uint32_t *b, uint32_t *len)
*b = *a + 1u;
}
/* the edit table of the selected part's slot, the first time from the slices shown (DIV becomes MAN); 0 = BREAK,
* PIANO or an empty slot: nothing to edit (says so) */
/* the edit table of the selected part's slot, the first time from the slices shown (DIV becomes MAN); 0 = a
* built-in source (BREAK, PIANO, FUNK) or an empty slot: nothing to edit (says so) */
static slc_man_t *slice_edit_begin(uint32_t *k)
{
uint32_t src, div, n, i, a, b, st;
const slc_src_t *s = slice_src(&src, &div);
slc_man_t *m;
if (!s || !src || src == SLC_SRC_PIANO) {
if (!s || !SLC_SRC_USR(src)) {
static const char *const EMPTY[3] = {"USR1 EMPTY", "USR2 EMPTY", "USR3 EMPTY"};
ui_message(src && src != SLC_SRC_PIANO ? EMPTY[src - 1u] : "PICK A USR SAMPLE FIRST");
ui_message(SLC_SRC_USR(src) ? EMPTY[src - 1u] : "PICK A USR SAMPLE FIRST");
return 0;
}
*k = src - 1u;
+40 -3
View File
@@ -250,6 +250,7 @@ static void voice_start(track_t *t, voice_t *v, uint32_t note, uint32_t vel, int
v->gate = 1;
v->active = 1;
v->stage = 1;
v->stage2 = 1; /* ((Skiff phase 9) ENV 2: its attack, from where it is) */
v->age = ++vage;
v->pitch16 = (int32_t)note * 16;
v->mvel = t->m_vel; /* mod.c: the note's VEL and RAND */
@@ -259,6 +260,7 @@ static void voice_start(track_t *t, voice_t *v, uint32_t note, uint32_t vel, int
if (!sounding) {
v->env = 0;
v->env_out = 0;
v->env2 = 0;
} /* sounding: the attack starts from the current level */
e->note_on(t, v);
if (sounding && !e->sampled) { /* retrigger / steal: keep phases and filter */
@@ -458,8 +460,8 @@ static void engine_block(track_t *t)
for (i = 0; i < NVOICE; i++) { /* faded to 0: gone */
voice_t *v = &t->v[i];
v->active = v->gate = 0;
v->stage = 0;
v->env = v->env_out = 0;
v->stage = v->stage2 = 0;
v->env = v->env_out = v->env2 = 0;
}
t->engine = eng_idx(t->eng_req);
memset(eng_part(t), 0, eng_size(t)); /* (Skiff) the part's shared engine area, the new engine's now: from
@@ -514,6 +516,38 @@ static int32_t env_tick(track_t *t, voice_t *v)
return v->env >> 9;
}
/* (Skiff phase 9) one control tick of ENV 2 (P_EG2_ATK .. REL): the amplitude envelope's twin, a MOD source only (mod.c
* MS_ENV2), ticked while a slot uses it; its release starts when the gate goes (where the amp envelope's is set), its end
* ends nothing */
static __attribute__((noinline)) void env2_tick(track_t *t, voice_t *v) /* (out of line: the ISR's loops stay as they were) */
{
const int16_t *p = t->p;
if (!v->gate && v->stage2 && v->stage2 < 3u)
v->stage2 = 3;
switch (v->stage2) {
case 1:
v->env2 += (int32_t)ENV_LIN[p[P_EG2_ATK] & 127];
if (v->env2 >= (1 << 24)) {
v->env2 = 1 << 24;
v->stage2 = 2;
}
break;
case 2:
v->env2 += mulq16(((int32_t)p[P_EG2_SUS] << 17) - v->env2, ENV_EXP[p[P_EG2_DEC] & 127]);
break;
case 3:
v->env2 -= mulq16(v->env2, ENV_EXP[p[P_EG2_REL] & 127]);
if (v->env2 < (1 << 12)) {
v->env2 = 0;
v->stage2 = 0;
}
break;
default:
v->env2 = 0;
break;
}
}
/* render one block of a part into out (cleared here); returns the voices rendered */
/* Channel bend is live performance state, outside projects/presets. Q8 semitones. */
static int32_t midi_bend_q8[NTRK], midi_bend_target[NTRK];
@@ -598,8 +632,11 @@ static uint32_t track_render(track_t *t, int32_t *out, uint32_t n)
if (v->vel > 110) /* accent opens the filter with the env */
m.cutoff += (m.envq15 * 24) >> 7;
m.shape = (64 << 8) + ((lfo * p[P_LD_SHP]) >> 7) + ((m.envq15 * p[P_ED_SHP]) >> 7);
if (mod.on) /* the modulation matrix (mod.c) */
if (mod.on) { /* the modulation matrix (mod.c) */
if (mod.env2) /* ((Skiff phase 9) a slot's ENV2) */
env2_tick(t, v);
mod_voice(t, v, &m, v->fine + tune_fine + bend_fine);
}
e->render(t, v, out, n, &m);
nr++;
}
+3 -3
View File
@@ -304,8 +304,8 @@ int main(void)
memcpy(v8, st.raw, 68);
v8[66] = 91;
for (k = 0; k < PROJ_NT; k++) {
for (j = 0; j < 91u; j++) v8[pos++] = st.raw[pos9 + (j < 83u ? j : j + (P_E0 - 83u))];
pos9 += P_COUNT;
for (j = 0; j < 91u; j++) v8[pos++] = st.raw[pos9 + (j < 83u ? j : j + (PROJ_NP - 8u - 83u))];
pos9 += PROJ_NP;
memcpy(v8 + pos, st.raw + pos9, 2u + NSTEP * 9u);
pos += 2u + NSTEP * 9u; pos9 += 2u + NSTEP * 9u + PROJ_NUDGE_BYTES; /* (Skiff: SKF1's NUDGE plane) */
}
@@ -510,7 +510,7 @@ int main(void)
ok &= put_all(0, &w, sizeof w, st_crc32(&w, sizeof w)) == 0 && trk[0].step[0].note[0] == 60u &&
st_load(OBJ_PROJECT0, &st, sizeof st) == (int)PROJ_SKF->size && *(const uint32_t *)st.raw == PROJ_SKF->magic &&
*(const uint32_t *)proj_slot[0].raw == PROJ_SKF->magic && pool_used(0) &&
st.raw[68u + PROJ_SKF->nt * (P_COUNT + 2u)] == 1u;
st.raw[68u + PROJ_SKF->nt * (PROJ_NP + 2u)] == 1u;
bad += check("(phase 5) an older archive: its projects as they came, SKF2 once its music is restored", ok);
}
/* (phase 6) project objects of 1280 (SKF2), 2048 (SKF3) and 3840 bytes (a retained slot holding one): each kept in
+14
View File
@@ -439,6 +439,20 @@ static int last_track(void)
r[BK_MOT + 3u] = 0u;
ok &= pat_keep_rec(id, r) == 0 && !pat_decode(&trk[k], id, st, v, &ms) && !ms.count && st[5].note[0] == 45u;
bad += check(" a record holding a value outside -64..127: its automation dropped, the steps load", ok);
/* (Skiff phase 9) the motion's ids as a store of PROJ_NP has them (firmware before reads the record), unless the
* motion names a parameter added since: then today's */
fresh();
simple(k, 40, 64, DIR_FWD);
ok = motion_put(&trk[k], 3, P_E5, 20, MOTION_LOCK) == 0 && keep_all() == 0 && trk_pid[k] != 0u;
id = trk_pid[k] - 1u;
ok &= !pat_read(id, r) && r[1] == PROJ_NP && r[BK_MOT + 1u] == ((P_E5 - PROJ_NX) | MOTION_LOCK) &&
!pat_decode(&trk[k], id, st, v, &ms) && ms.count == 1u && ms.event[0].param == (P_E5 | MOTION_LOCK);
bad += check(" (phase 9) a lock on E5: the record of 103 parameters (E5 at 100), back at today's P_E5", ok);
ok = motion_put(&trk[k], 4, P_DTONE, -9, MOTION_LOCK) == 0 && keep_all() == 0 && trk_pid[k] == id + 1u;
ok &= !pat_read(id, r) && r[1] == P_COUNT && !pat_decode(&trk[k], id, st, v, &ms) && ms.count == 2u;
for (i = n = 0; i < ms.count; i++)
n += ms.event[i].param == (P_E5 | MOTION_LOCK) || ms.event[i].param == (P_DTONE | MOTION_LOCK);
bad += check(" .. and one on DRIVE's TONE (phase 9's): the record of today's ids, both back", ok && n == 2u);
return bad;
}
+17
View File
@@ -142,6 +142,23 @@ int main(void)
printf("%s%d", i ? "," : "", DX_KIT_DEF[k].b[i]);
printf("]]");
}
printf("],\n\"DX_KITS\":["); /* (Skiff phase 9) the kits a DRUM-X preset loads (eng_drumx.c) */
for (e = 0; e < NELEM(DX_KITS); e++) {
printf("%s[", e ? "," : "");
for (k = 0; k < 8u; k++) {
printf("%s[%d,[", k ? "," : "", DX_KITS[e][k].mode);
for (i = 0; i < DXP_N; i++)
printf("%s%d", i ? "," : "", DX_KITS[e][k].a[i]);
printf("],[");
for (i = 0; i < DXP_N; i++)
printf("%s%d", i ? "," : "", DX_KITS[e][k].b[i]);
printf("]]");
}
printf("]");
}
printf("],\n\"DRUMX_PKIT\":[");
for (k = 0; k < NELEM(DRUMX_PKIT); k++)
printf("%s%d", k ? "," : "", DRUMX_PKIT[k]);
printf("],\n\"FM4\":{\"presets\":["); /* DIGITAL (retired): its presets and conversions (fm4_convert.c) */
for (k = 0; k < FM4_NPRESETS; k++) {
const preset_t *p = &DIGITAL_PRESETS[k];
+169
View File
@@ -0,0 +1,169 @@
/* SPDX-License-Identifier: GPL-3.0-only */
/* Host test of Skiff's FX > DRIVE (phase 9; firmware/src/fx.c track_dist: DIST's TYPE and TONE). A 110 Hz saw at
* -6 dBFS, 1 s, straight into one track's DIST insert at DRIVE 40, 80 and 127:
* 1. every TYPE (SOFT HARD FOLD BITS) under full scale, no DC (under 2 % of its peak), its RMS within 9 dB of SOFT's at
* the same drive (each its own make-up), and another sound than SOFT's (not the same samples);
* 2. HARD flat at its ceiling, FOLD brighter than SOFT (bright(): the RMS of the steps over the RMS), BITS held: runs of 8
* equal samples before the tone at DRIVE 127 (the low-pass smooths them after);
* 3. TONE: +63 brighter than -64 for every TYPE; 0 is SOFT as it was (the same samples as the tone left alone:
* DIST_TONE moves nothing at 0); DRIVE 0 passes the signal unchanged whatever the TYPE.
* Built and run by tests/run_tests.sh. */
#define main hostsim_main
#include "hostsim.c"
#undef main
static int check(const char *what, int ok)
{
printf("drive: %-76s %s\n", what, ok ? "ok" : "FAIL");
return ok ? 0 : 1;
}
#define N (1378u * CTL) /* 1 s, whole blocks */
static int32_t in[N], out[N];
static void run(int32_t type, int32_t drive, int32_t tone)
{
track_t *t = &trk[0];
uint32_t i;
t->dist_hp = t->dist_lp1 = t->dist_lp2 = t->dist_dc = 0;
t->p[P_DIST] = (int16_t)drive;
t->p[P_DTYPE] = (int16_t)type;
t->p[P_DTONE] = (int16_t)tone;
memcpy(out, in, sizeof out);
for (i = 0; i < N; i += CTL)
track_dist(t, out + i, CTL);
}
static double rms(void)
{
double s = 0;
for (uint32_t i = N / 10u; i < N; i++)
s += (double)out[i] * out[i];
return sqrt(s / (N - N / 10u));
}
static int32_t peak(void)
{
int32_t p = 0;
for (uint32_t i = 0; i < N; i++)
p = abs(out[i]) > p ? abs(out[i]) : p;
return p;
}
static double dc(void)
{
double s = 0;
for (uint32_t i = N / 10u; i < N; i++)
s += out[i];
return s / (N - N / 10u);
}
static double bright(void) /* the mean step over the RMS: the more highs, the more */
{
double s = 0;
for (uint32_t i = N / 10u + 1u; i < N; i++)
s += ((double)out[i] - out[i - 1]) * ((double)out[i] - out[i - 1]); /* (squared: a smoothed jump counts less) */
return sqrt(s / (N - N / 10u - 1u)) / (rms() + 1e-9);
}
/* SOFT as fx.c had it before phase 9 (the same code), for TONE 0's samples */
static void old_soft(track_t *t, int32_t *b, uint32_t n)
{
int32_t d = t->p[P_DIST], i, g, k, mk, bias = 2400, b0;
if (!d)
return;
g = 4096 + d * d * 2;
k = 32000 - d * 95;
mk = 30000 - d * 120;
b0 = softclip(bias);
for (i = 0; i < (int32_t)n; i++) {
int32_t x = b[i], y;
t->dist_hp += (x - t->dist_hp + 64) >> 7;
x = clamp(x - t->dist_hp, -230000, 230000);
y = softclip((((x >> 2) * g) >> 10) + bias) - b0;
t->dist_lp1 += mulq15(y - t->dist_lp1, k);
t->dist_lp2 += mulq15(t->dist_lp1 - t->dist_lp2, k);
b[i] = mulq15(t->dist_lp2, mk);
}
}
int main(void)
{
static int32_t soft[N];
static const int32_t DRV[3] = {40, 80, 127};
int bad = 0, ok = 1, okd = 1, okr = 1, okn = 1, okt = 1;
uint32_t i, k, ty;
double rs;
host_tracks_init();
for (i = 0; i < N; i++) /* a saw, 110 Hz, -6 dBFS */
in[i] = (int32_t)((((uint64_t)i * 110u * 65536u / 44100u) & 65535u)) / 2 - 16384;
run(DT_SOFT, 0, 0);
for (ty = 0; ty < 4u; ty++) {
run((int32_t)ty, 0, 63);
okd &= !memcmp(out, in, sizeof out);
}
bad += check("DRIVE 0: the signal unchanged, whatever TYPE and TONE", okd);
for (k = 0, okd = 1; k < 3u; k++) {
static int32_t was[N];
track_t *t = &trk[0];
run(DT_SOFT, DRV[k], 0);
t->dist_hp = t->dist_lp1 = t->dist_lp2 = 0;
memcpy(was, in, sizeof was);
for (i = 0; i < N; i += CTL)
old_soft(t, was + i, CTL);
okd &= !memcmp(out, was, sizeof was);
}
bad += check("SOFT at TONE 0: the samples of before phase 9, bit for bit (DRIVE 40, 80, 127)", okd);
for (k = 0; k < 3u; k++) {
run(DT_SOFT, DRV[k], 0);
memcpy(soft, out, sizeof soft);
rs = rms();
printf("drive: SOFT at DRIVE %d: RMS %.0f, peak %d, DC %.0f, brightness %.3f\n", DRV[k], rs, peak(), dc(), bright());
for (ty = 1; ty < 4u; ty++) {
double r;
run((int32_t)ty, DRV[k], 0);
r = rms();
if (!(peak() < 32767 && fabs(dc()) < peak() * 0.02)) {
printf("drive: %s at DRIVE %d: peak %d, DC %.0f\n", (const char *[]){"SOFT", "HARD", "FOLD", "BITS"}[ty],
DRV[k], peak(), dc());
ok = 0;
}
okr &= r > rs * 0.355 && r < rs * 2.82; /* (within 9 dB) */
okn &= memcmp(out, soft, sizeof soft) != 0;
if (k == 2u)
printf("drive: DRIVE 127 %s: RMS %.0f (SOFT %.0f), peak %d, DC %.0f, brightness %.3f\n",
(const char *[]){"SOFT", "HARD", "FOLD", "BITS"}[ty], r, rs, peak(), dc(), bright());
}
}
bad += check("every TYPE: under full scale, no DC", ok);
bad += check(" its RMS within 9 dB of SOFT's at DRIVE 40, 80, 127 (its own make-up)", okr);
bad += check(" another sound than SOFT's", okn);
{
uint32_t runs = 0;
double cs, cf;
int32_t g = 4096 + 127 * 127 * 2, hard = 0;
run(DT_SOFT, 127, 0); cs = bright();
run(DT_FOLD, 127, 0); cf = bright();
for (i = 0; i < N; i++) /* the clip itself, as dist_hard has it, before the tone */
hard = clamp(((clamp(in[i], -230000, 230000) >> 2) * g) >> 10, -24576, 24576) == 24576 ? hard + 1 : hard;
{ /* BITS at 127: a held run of 8 (as dist_bits takes it, before the tone) */
int32_t h = 0, last = 0;
uint32_t s = 127u / 11u, hm = (1u << (127u >> 5)) - 1u, same = 0;
for (i = 0; i < 64u; i++) {
if (!(i & hm))
h = ((in[i] + (1 << (s - 1u))) >> s) << s;
same += i && h == last;
last = h;
}
runs = same;
}
bad += check("HARD: flat at its ceiling; FOLD brighter than SOFT; BITS: runs of 8 held samples at 127",
hard > 1000u && cf > cs && runs >= 56u);
}
for (ty = 0; ty < 4u; ty++) {
double lo, hi;
run((int32_t)ty, 80, -64); lo = bright();
run((int32_t)ty, 80, 63); hi = bright();
printf("drive: TONE %s: -64 %.4f, +63 %.4f\n", (const char *[]){"SOFT", "HARD", "FOLD", "BITS"}[ty], lo, hi);
okt &= hi > lo;
}
bad += check("TONE: +63 brighter than -64, every TYPE", okt);
printf(bad ? "DRIVE TEST FAILED\n" : "drive tests passed\n");
return bad != 0;
}
+57
View File
@@ -730,6 +730,62 @@ static void lane_levels(void)
fails += bad != 0;
}
/* (Skiff phase 9) each lane's TUNE and DECAY (P_LTUNE0.., P_LDECAY0..; EDIT > LANES): TUNE 64 and DECAY 0 play as
* designed, another lane's leave a lane bit for bit; TUNE 127 (+12 semitones) raises a pitched lane (more zero
* crossings), DECAY +63 rings longer and -64 shorter (the energy after the first 23 ms). One note struck alone, nb blocks
* of the part */
static double lane_try(uint32_t note, uint32_t id, int16_t v, uint32_t nb, uint64_t *hash, uint32_t *cross, double *late)
{
int32_t o[CTL], last = 0;
double e = 0;
uint32_t i, k;
kit_fresh();
trk[0].p[id] = v;
trk_note_on(&trk[0], note, 110);
*hash = 1469598103934665603ull;
*cross = 0;
*late = 0;
for (i = 0; i < nb; i++) {
track_render(&trk[0], o, CTL);
for (k = 0; k < CTL; k++) {
e += (double)o[k] * o[k];
*late += i >= 32u ? (double)o[k] * o[k] : 0.0;
*cross += (o[k] < 0) != (last < 0);
last = o[k];
*hash = (*hash ^ (uint32_t)o[k]) * 1099511628211ull;
}
}
return e;
}
static void lane_tune_decay(void)
{
static const uint8_t NOTE[NLANE] = {36, 38, 39, 42, 46, 45, 37, 56};
static const uint8_t PITCHED[NLANE] = {1, 0, 0, 0, 0, 1, 1, 1}; /* (the snare, the clap, the hats: mostly noise) */
uint32_t l, bad = 0, c0, c1, cx;
uint64_t h0, h1, h2;
double l0, l1, lx;
kit_fresh();
for (l = 0; l < NLANE; l++)
bad += trk[0].p[P_LTUNE0 + l] != 64 || trk[0].p[P_LDECAY0 + l] != 0;
for (l = 0; l < NLANE; l++) {
(void)lane_try(NOTE[l], P_LTUNE0 + l, 64, 128, &h0, &c0, &l0);
(void)lane_try(NOTE[l], P_LTUNE0 + (l + 1u) % NLANE, 127, 128, &h1, &cx, &lx);
(void)lane_try(NOTE[l], P_LDECAY0 + (l + 3u) % NLANE, -64, 128, &h2, &cx, &lx);
bad += h1 != h0 || h2 != h0; /* another lane's: this one as it was */
(void)lane_try(NOTE[l], P_LTUNE0 + l, 127, 128, &h1, &c1, &lx);
bad += h1 == h0 || (PITCHED[l] && c1 < c0 + c0 / 4u);
(void)lane_try(NOTE[l], P_LDECAY0 + l, 63, 128, &h1, &cx, &l1);
(void)lane_try(NOTE[l], P_LDECAY0 + l, -64, 128, &h2, &cx, &lx);
bad += !(l1 > l0 && lx < l0);
if (bad)
printf("drum_test: lane %u: crossings %u -> %u at TUNE 127; late energy %.3g, DECAY +63 %.3g, -64 %.3g\n", l,
c0, c1, l0, l1, lx);
}
printf("drum_test: (phase 9) lane TUNE and DECAY: another lane's leave a lane bit for bit; TUNE +12 st raises a "
"pitched lane, DECAY +63 longer, -64 shorter: %s\n", bad ? "FAIL" : "ok");
fails += bad != 0;
}
static void engine(void)
{
/* the 8 lanes: KICK SNARE CLAP HAT CL HAT OP TOM RIM BELL (the closed hat first: it would choke the open one) */
@@ -1372,6 +1428,7 @@ int main(int argc, char **argv)
retired();
lane_budget();
lane_levels();
lane_tune_decay();
engine();
if (argc > 1)
demos(argv[1]);
+32
View File
@@ -135,6 +135,38 @@ int main(int argc, char **argv)
snprintf(nm, sizeof nm, "%s: sounds, under full scale, no DC, ends", NAME[l]);
check(nm, pk > 1036 && pk < 32000 && fabs(dc) < pk * 0.02 && ended, "peak %d, DC %.0f", pk, dc);
}
/* 1b (Skiff phase 9) every kit a preset loads (eng_drumx.c DRUMX_PKIT): the same, every lane at A and at B */
for (i = 2; i < ENG_DRUMX.npresets; i++) {
int32_t lo = 32767, hi = 0;
int all = 1;
char why[48] = "";
for (l = 0; l < 16u; l++) {
track_t *t = &trk[0];
int32_t pk = 0;
double dc = 0;
uint32_t j;
host_tracks_init();
host_preset(t, ENGI_DRUMX, i);
t->p[P_E0] = l < 8u ? 0 : 127;
for (j = 0; j < 4u; j++)
t->p[P_DIST + j] = 0;
strike(t, l & 7u, FS / 2u);
for (j = 0; j < FS / 2u; j++) {
pk = abs(buf[j]) > pk ? abs(buf[j]) : pk;
dc += buf[j];
}
dc /= FS / 2u;
if (!(pk > 1036 && pk < 32000 && fabs(dc) < pk * 0.02 && !strike(t, l & 7u, MAXN)) && all) {
snprintf(why, sizeof why, "; %s at %s: peak %d, DC %.0f", NAME[l & 7u], l < 8u ? "A" : "B", pk, dc);
all = 0;
}
lo = pk < lo ? pk : lo;
hi = pk > hi ? pk : hi;
}
snprintf(nm, sizeof nm, "%s: every lane at A and B sounds, under full scale, no DC, ends",
ENG_DRUMX.presets[i].name);
check(nm, all && !memcmp(dx_kit, DX_KITS[DRUMX_PKIT[i] - 1u], sizeof dx_kit), "peaks %d .. %d%s", lo, hi, why);
}
/* 2 */
{
+63 -18
View File
@@ -8,36 +8,48 @@ preset/ANALOG/04_ACID 986dcfd301a0c1d8
preset/ANALOG/05_SINE_KEY d7674364f5cad608
preset/ANALOG/06_RAVE b8342efda12f2968
preset/ANALOG/07_SUB_BASS 494b91d900b36aec
preset/ANALOG/08_PLUCK a8060629ca06fb68
preset/ANALOG/09_BRASS 5687cf7b6f558044
preset/ANALOG/10_WIND 8a038e70ab813a10
preset/ANALOG/11_STRINGS 978e9d31de7cab88
preset/ANALOG/08_SYNTH_PLUCK a8060629ca06fb68
preset/ANALOG/09_SYNTH_BRASS 5687cf7b6f558044
preset/ANALOG/10_WIND_SWEEP 8a038e70ab813a10
preset/ANALOG/11_STRINGS 4833e163ce732de0
preset/ANALOG/12_BONE_FLUTE daebafe649c79760
preset/ANALOG/13_WAR_HORN cfafd7e4b838e360
preset/ANALOG/14_DARK_STRINGS c3d33e459bc8438c
preset/ANALOG/14_DARK_STRINGS 679a67020d979cb0
preset/ANALOG/15_NIGHT_BASS e8a9bc68ad928928
preset/ANALOG/16_NEON_LEAD 4bfc30e4ad4a8868
preset/ANALOG/17_SUNSET_PAD 27921a121bb4e7d0
preset/ANALOG/18_HERO_BRASS 541b50a0a9f18668
preset/ANALOG/19_SYN_TOM c890553987662eb0
preset/ANALOG/20_QUANTA 02f7ac477c82b808
preset/PHASE/00_BRASS 36d318d48984648c
preset/PHASE/01_ORGAN b856dd588dba78a0
preset/PHASE/02_STRING 8b106b798f1afc04
preset/ANALOG/21_REESE 08822311fe5d8748
preset/ANALOG/22_DRIVE_BASS 1c89b6d7a65e634c
preset/PHASE/00_PD_BRASS 36d318d48984648c
preset/PHASE/01_PD_ORGAN b856dd588dba78a0
preset/PHASE/02_PD_STRINGS 8b106b798f1afc04
preset/PHASE/03_RESO 952647fec7de415c
preset/PHASE/04_BELL 441b1e9c767faa24
preset/PHASE/04_PD_BELL 441b1e9c767faa24
preset/PHASE/05_WIRE 3934a84c47276ee4
preset/PHASE/06_NEUTRINO ec9a807ef35f9f60
preset/PHASE/07_PD_BASS 3fdb684428c06108
preset/PHASE/08_SOFT_KEYS c50e005bc72b76fc
preset/LOFI/00_PULSE_LD 88b38645b5205194
preset/LOFI/01_WAVE_BASS d250f2b2fcc9cd28
preset/LOFI/02_ARP_8BIT 3ad3bf739180610c
preset/LOFI/03_WAVE_LEAD 15f8189d440450c0
preset/LOFI/04_STEP_LEAD cd4df2efdfb77414
preset/LOFI/05_PHOTON d6e8f75692126ed8
preset/LOFI/06_TRI_BASS 8b28e6a7bf85d70c
preset/LOFI/07_CHIP_BELL 1298c19551a5b7b4
preset/SAMPLE/00_PIANO 069e63129f9b1ee4
preset/SAMPLE/01_PIANO 069e63129f9b1ee4
preset/SAMPLE/02_FLUTE 6bf2e2c9a21c593c
preset/SAMPLE/03_SAX 7dc8e10233b62a8c
preset/SAMPLE/04_PIANO 069e63129f9b1ee4
preset/SAMPLE/05_LOFI_PIANO 0cf88744d9728d34
preset/SAMPLE/06_MUSIC_BOX 726278d1cab67c9c
preset/SAMPLE/07_FLUTE_PAD 40f830fc492509e4
preset/SAMPLE/08_DARK_SAX 2fbfbeba75017280
preset/SAMPLE/09_KOTO eb902a7995418fac
preset/VOICE/00_CHOIR_AAH 2e617411a71be888
preset/VOICE/01_VOX_LEAD 5d0b545bf96c234c
preset/VOICE/02_WOW_BASS 12ec9334413aab38
@@ -45,6 +57,7 @@ preset/VOICE/03_WHISPER e0fe82b7e146727c
preset/VOICE/04_CRYPT_CHOIR 868e97fc8eecd410
preset/VOICE/05_MONK_CHANT 555e516d71ad30c0
preset/VOICE/06_DREAM_CHOIR 0fda1f12f0d2cb5c
preset/VOICE/07_ROBOT_TALK 15fd5d5488219d58
preset/TRIO/00_FAT_BASS 1306f7d1578d79bc
preset/TRIO/01_ARP_LEAD b5a6b2079bf2e6a4
preset/TRIO/02_SYNC_LEAD af824451d88c6aa8
@@ -53,17 +66,23 @@ preset/TRIO/04_CHIP_CHOIR fc6850659a970c68
preset/TRIO/05_TURBO_SYNC 8d3d0fbef89c8a98
preset/TRIO/06_NEON_ARP e3af408d3f268a3c
preset/TRIO/07_COLLIDER 39481e18217ec2a4
preset/TRIO/08_DIRTY_BASS 4eab1da0a6819ed0
preset/WHEEL/00_FULL_ORGAN f9f117a8d1a85d34
preset/WHEEL/01_JAZZ_PERC 56dcdf47d4f8ea64
preset/WHEEL/02_GOSPEL e1613f3e7a5367d4
preset/WHEEL/03_SOFT_FLUTE a89099dcede943f8
preset/WHEEL/04_ROCK_DRIVE d17130b66bcd1948
preset/WHEEL/05_CATHEDRAL d2aa0b1e999393b4
preset/WHEEL/06_PEDAL_BASS 1ca897b497c9fb30
preset/WHEEL/07_CLARINET c3474a24ccfad0d8
preset/GRAIN/00_CLOUD_PAD 0f529c71a15d8050
preset/GRAIN/01_GLITCH 457407330424e8e4
preset/GRAIN/02_FROZEN 6d546dc1495a7f28
preset/GRAIN/03_SHIMMER b329d0a4ed334bf0
preset/GRAIN/04_QUARK_CLOUD 7492b89800155444
preset/GRAIN/05_PIANO_HAZE 707772166d301498
preset/GRAIN/06_SAX_DRONE e3b326d0528defe4
preset/GRAIN/07_SCATTER 3bf63f4154064240
preset/PHYS/00_BELL_TREE af222b5577a69170
preset/PHYS/01_MARIMBA 25a229621bcfc438
preset/PHYS/02_PLUCK e0f744106512f7c8
@@ -74,32 +93,58 @@ preset/PHYS/06_TOMS 1f98d309370b37cc
preset/PHYS/07_DRONE_STRING 809d919a2e5f66c4
preset/PHYS/08_HARP b2833b38746154a4
preset/PHYS/09_HARPSICHORD fe615a5c09fd21f0
preset/PHYS/10_UPRIGHT aae413cca10bb9fc
preset/DRUM/00_DRUM_KIT b564eca443439374
preset/DRUM/01_WAR_DRUMS 2718fea2acc1b144
preset/DRUM/02_NEON_KIT 012aaea299539220
preset/DRUM/03_BOOM_KIT 8db8e4147638b4d0
preset/DRUM/04_CRISP_KIT ee3b62af3fcb23e4
preset/DRUM/05_RHYTHM_BOX faf7e1c08bac2780
preset/DRUM/06_ELECTRO_KIT 25ba05a713bfa12c
preset/DRUM/07_STUDIO_KIT 2e998b9686141d8c
preset/DRUM/08_TIGHT_KIT e4250765fe91add4
preset/DRUM/09_LOFI_KIT fed68b31d11f2f38
preset/NOISE/00_WIND 1c6641c3d683e27c
preset/NOISE/01_RAIN 6c08f98161409d14
preset/NOISE/01_RAIN f558b1b7409f053c
preset/NOISE/02_ARCADE 6ca2c9a2a067976c
preset/NOISE/03_METAL a290d7b537152b64
preset/NOISE/04_CAVE_WIND 48fba7c1812d5ad0
preset/NOISE/05_GEIGER 0cefe9624708a770
preset/NOISE/06_PLASMA d6e17292e89f7ab0
preset/NOISE/07_OCEAN f410de569becd4f0
preset/FM6/00_TINE_EP c8e9d21888cadda4
preset/FM6/01_BELL 31175329008f8318
preset/FM6/01_GLASS_BELL 31175329008f8318
preset/FM6/02_FM_BASS 61118eebac511660
preset/FM6/03_BRASS f902d353d47669cc
preset/FM6/03_FM_BRASS f902d353d47669cc
preset/FM6/04_PAD 8c4806a14aa334a8
preset/FM6/05_MARIMBA 45c048d726466024
preset/FM6/06_ORGAN 799809fad7f68698
preset/FM6/07_PLUCK 91e9132dd7237f14
preset/FM6/05_FM_MARIMBA 45c048d726466024
preset/FM6/06_FM_ORGAN 799809fad7f68698
preset/FM6/07_NYLON_PICK 91e9132dd7237f14
preset/FM6/08_GRAVE_BELL 18479ad10182f1d0
preset/FM6/09_GLASS_KEYS bceae97c1b29d304
preset/FM6/10_ISOTOPE bf4ce8f0695e708c
preset/FM6/11_DARK_MATTER 51a0ab75e7da1a20
preset/SLICE/00_CHOP 6d1e706b5119b570
preset/SLICE/01_STUTTER 94226b45e8a75cf0
preset/DRUM-X/00_DRUM_KIT 11f92bc98122d834
preset/FM6/12_PICK_BASS f8bb28d087327734
preset/FM6/13_GROWL_BASS 605c7a955320dad0
preset/SLICE/00_CHOP d98818c99cc9a594
preset/SLICE/01_STUTTER 0a72d9e877311474
preset/SLICE/02_LOW_BREAK 1b498fe5d8217cc4
preset/SLICE/03_BACK_BREAK 342c08da2d5c5720
preset/SLICE/04_BREAK_HITS a0c8a96a0f833c78
preset/SLICE/05_SHORT_CHOP 9f0da6282307f8f4
preset/SLICE/06_FAST_BREAK 1307ad3ae589cb1c
preset/SLICE/07_ROLL_LOOP 7ec9f85a6c32d518
preset/SLICE/08_FUNK_BREAK ff18948c8b79da34
preset/DRUM-X/00_OWN_KIT 11f92bc98122d834
preset/DRUM-X/01_HADRON_KIT bb7f7017a885b2a0
preset/DRUM-X/02_FACTORY_KIT 11f92bc98122d834
preset/DRUM-X/03_DEEP_KIT 0b112ce2f1ac2a00
preset/DRUM-X/04_CLICK_KIT 7a8d5c5fac3c6aa8
preset/DRUM-X/05_INDUSTRIAL 322a505dc8d2edc0
preset/DRUM-X/06_SOFT_KIT d537d8425f82554c
preset/DRUM-X/07_GLITCH_KIT ca036a1921f5f6a8
preset/DRUM-X/08_TRIBAL_KIT d9c6df1b2b27e108
preset/DRUM-X/09_LASER_KIT b72e3c5602e3cd74
drums/drum_gm_kit a88dcac7803e88d4
drums/kit_80 e3de7e091a481244
drums/kit_10 0cd4e95937dc519c
+2
View File
@@ -102,6 +102,8 @@ static void host_preset_values(track_t *t, uint32_t e, uint32_t pi, const preset
t->p[P_DIST + i] = (int16_t)(p->fx[i] ? p->fx[i] - 1 : FX_DEF[i]);
for (i = 0; i < NELEM(p->more) && p->more[i].id; i++) /* (Skiff) its LFO, GLIDE, .. */
t->p[p->more[i].id] = p->more[i].v;
if (e == ENGI_DRUMX && pi < NELEM(DRUMX_PKIT) && DRUMX_PKIT[pi]) /* ((Skiff phase 9) its kit: ui.c apply_preset_to) */
memcpy(dx_kit, DX_KITS[DRUMX_PKIT[pi] - 1u], sizeof dx_kit);
fm6_track_loaded(t); /* FM6: the preset's patch (ui.c apply_preset_to) */
}
static void host_preset_req(track_t *t, uint32_t e, uint32_t pi)
Regular → Executable
View File
File mode changed.
+37
View File
@@ -620,12 +620,49 @@ static int demos(const char *dir)
return n == 5u;
}
/* (Skiff phase 9) ENV 2 (voice.c env2_tick), a MOD source of its own: its own times (a pluck under a slow amp attack),
* released with the gate, back to 0; not run without a slot of it */
static void test_env2(void)
{
track_t *t = &trk[0];
uint32_t i, peak_at = 0;
int32_t top = 0, amp_at_top = 0;
fresh(0, 0);
t->p[P_ATK] = 100; /* a slow amp attack */
t->p[P_EG2_ATK] = 0;
t->p[P_EG2_DEC] = 30;
t->p[P_EG2_SUS] = 0;
t->p[P_EG2_REL] = 20;
slot(t, 0, MS_ENV2, MD_CUT, 60);
trk_note_on(t, 60, 100);
for (i = 0; i < 400u; i++) { /* 290 ms */
blocks(1);
if (t->v[t->m_vi].env2 > top) {
top = t->v[t->m_vi].env2;
peak_at = i;
amp_at_top = t->v[t->m_vi].env;
}
}
check("ENV 2 (phase 9): its own times, a pluck at once under a slow amp attack",
top == 1 << 24 && peak_at < 4u && amp_at_top < (1 << 20) && t->v[t->m_vi].env2 < top / 4 &&
t->v[t->m_vi].env > (1 << 21) && t->m_env2 == t->v[t->m_vi].env2 >> 9);
t->p[P_EG2_SUS] = 127;
trk_note_off(t, 60);
blocks(400);
check(" released with the gate, back to 0", !t->v[t->m_vi].env2 && !t->v[t->m_vi].stage2);
fresh(0, 0);
trk_note_on(t, 60, 100);
blocks(50);
check(" no slot of it: not run (ENV 2 stays 0)", !t->v[t->m_vi].env2 && t->v[t->m_vi].stage2 == 1u);
}
int main(int argc, char **argv)
{
test_off();
test_math();
test_midi();
test_cost();
test_env2();
if (argc > 1)
check("demos written", demos(argv[1]));
printf("%s\n", bad ? "MOD MATRIX TEST FAILED" : "mod matrix test passed");
+2 -2
View File
@@ -87,7 +87,7 @@ static int compact_project(void)
corrupt = packed; corrupt.raw[68] = 255; uint32_t sum = proj_hash(corrupt.raw, sizeof corrupt - 4u);
memcpy(corrupt.raw + sizeof corrupt - 4u, &sum, 4);
bad += check("compact parameter range is validated even with a correct hash", !proj_import(&after, &corrupt, sizeof corrupt));
corrupt = packed; uint32_t probability_byte = 68u + P_COUNT + 2u + 8u; corrupt.raw[probability_byte] = 127;
corrupt = packed; uint32_t probability_byte = 68u + PROJ_NP + 2u + 8u; corrupt.raw[probability_byte] = 127;
sum = proj_hash(corrupt.raw, sizeof corrupt - 4u); memcpy(corrupt.raw + sizeof corrupt - 4u, &sum, 4);
bad += check("invalid probability is refused even with a correct hash", !proj_import(&after, &corrupt, sizeof corrupt));
project_v6_t old; memset(&old, 0, sizeof old); old.magic = PROJ_MAGIC_V6; old.size = sizeof old;
@@ -166,7 +166,7 @@ static int fun7_89(void)
bad += check(" its motion: E0 (81) -> P_E0, REV and FM OP1 ATK (61) kept",
after.motion.count == 3u && after.motion.event[0].param == P_REV && after.motion.event[1].param == P_E0 &&
after.motion.event[1].value == 40 && after.motion.event[2].param == P_FM1_ATK);
bad += check(" written again (P_COUNT parameters): the same project", proj_pack(&old, &after) && old.raw[66] == P_COUNT &&
bad += check(" written again ((phase 9) PROJ_NP parameters): the same project", proj_pack(&old, &after) && old.raw[66] == PROJ_NP &&
proj_import(&before, &old, sizeof old) && !memcmp(&before, &after, sizeof before));
m.event[1].param = 82; /* (any id P_E0 .. P_E7 of then moves up) */
pack_fun7_89(&old, &before, &m);
+173 -5
View File
@@ -9,7 +9,7 @@
* 3. a REPEAT too long for the loop (1/8 and REVERSE below 81 BPM) does nothing at all.
* 4. the SLICER: its recordings are not used meanwhile and are dropped afterwards.
* 5. the keys: a layer key plays nothing and sends no MIDI; a key held before FX stays a note; the white
* keys past the first 10 are the layer's too but do nothing.
* keys past the first 14 are the layer's too but do nothing.
* 6. idle: nothing held, nothing ramping, the mix is bit-identical (and the goldens of regress.c too).
* 7. no clicks, no overflow; the filters, the CRUSH and THROW macros and the mutes do what they say.
* 8. cost: instructions per sample of the song, idle and with every effect at once (proc_pid_rusage).
@@ -23,7 +23,12 @@
* away after the input stops; KNOB 4 at 0 is plain (the delay holds only the input); the cost: over the
* idle song, and the harmonizer's own over REPEAT 1/16 alone (the layer's stage, which every effect of it
* pays): about 2 % at most (device estimate: 1.7 % per 100 instructions per sample).
* Demos (WAV) into DEMO_DIR; with a second directory, the harmonizer's (a melody with OCT UP, OCT DN, and
* 10. (Skiff phase 9) GATE: open the first half of every 1/16 bit for bit, shut the second, the input back when let
* go. DUB: the dry mix into the delay's send alone, whole; the delay's feedback up to DUB_FB in 0.2 s and back in
* under 1 s after (its return at MIX's default at least meanwhile). FLANGE: a 1 kHz sine's level swept by the comb
* (notches pass it), under full scale. VINYL: a 1 kHz sine's pitch wobbling (the wow, +-0.4 %: zero crossings), a
* 6 kHz one low-passed, crackle in silence (~21 pops a second). Each: the input back when let go.
* Demos (WAV) into DEMO_DIR (with phase 9's fx_gate, fx_dub, fx_flange, fx_vinyl); with a second directory, the harmonizer's (a melody with OCT UP, OCT DN, and
* OCT UP with the shimmer) into it. */
#define main hostsim_main
#include "hostsim.c"
@@ -55,6 +60,7 @@ static void perf_reset(void)
memset(&pf, 0, sizeof pf);
pf.src = pf.next = PF_N;
pf.lc = PF_TOP;
pf.gg = 32768;
for (uint32_t k = 0; k < NTRK; k++)
pf.mg[k] = 32768;
perf_held = perf_act = 0;
@@ -390,7 +396,7 @@ static int test_keys(void)
fm1_in.notes = 0;
fm1_in.buttons = 0;
keyboard_block();
{ /* the white keys past the first 10 (B4 on), and black keys past the mutes: the layer's, nothing */
{ /* the white keys past the first 14 (F5 on), and black keys past the mutes: the layer's, nothing */
uint32_t q, ok = 1, assigned = 0;
for (q = 0; q < 27u; q++)
if (perf_key(q) < PF_N)
@@ -409,8 +415,9 @@ static int test_keys(void)
ok &= !kb_layer && !perf_held && mo_w == mo0;
}
fm1_in.buttons = 0;
bad += check("the keys without an effect (white from B4, black past the tracks' mutes): silent, nothing held",
ok && assigned == 0x17FFFu); /* F3 .. A4 but G#4 ((phase 6) D#4 and F#4 mute T5 and T6) */
bad += check("the keys without an effect (white from F5, black past the tracks' mutes): silent, nothing held",
ok && assigned == 0xAD7FFFu); /* F3 .. G4 but G#4, the white A4 .. E5 ((phase 6) D#4 and F#4 mute T5
* and T6; (phase 9) B4 .. E5 GATE DUB FLANGE VINYL) */
kb_mask = perf_mask = 0;
}
usb.config = 0;
@@ -702,6 +709,134 @@ static int test_harm(void)
return bad;
}
/* --------------------------------- 10. (Skiff phase 9) GATE, DUB, FLANGE, VINYL --- */
static int cmp_dbl(const void *a, const void *b)
{
double x = *(const double *)a, y = *(const double *)b;
return x < y ? -1 : x > y;
}
static int test_p9(void)
{
int bad = 0, ok;
uint32_t t, k;
char what[200];
{ /* GATE held for 4 sixteenths at 120 BPM: each 1/16's first half the input (after the 2.9 ms edge), the second
* silent (DEPTH 0); let go in an open half: the input */
ev_t ev[] = {{0, PF_GATE + 1}, {4u * P16 + 32u, -(PF_GATE + 1)}};
test_signal(220, 16000, 330, 12000);
run(120, 1, ev, 2, 6u * P16);
ok = 1;
for (k = 0; k < 4u; k++) {
uint32_t a = k * P16, h = a + P16 / 2u;
ok &= same(a + (k ? 130u : 0u), h);
for (t = h + 130u; t < a + P16; t++)
ok &= out_l[t] == 0 && out_r[t] == 0;
}
ok &= same(4u * P16 + 130u, 6u * P16); /* (let go on a 1/16's opening edge: it opens on) */
bad += check("GATE: the first half of every 1/16 bit for bit, the second shut; let go: the input", ok);
}
{ /* DUB, the stages alone on a steady mix */
static int32_t ml[CTL], mr[CTL], sd[CTL], sr[CTL], bl[CTL], br[CTL];
int32_t fb = 0, mix = 0;
uint32_t f, up = 0, down = 0;
perf_reset();
for (t = 0; t < CTL; t++)
ml[t] = mr[t] = 10000;
perf_press(PF_DUB, 1);
for (f = 0; f < FS / 2u; f += CTL) {
memset(sd, 0, sizeof sd);
memset(sr, 0, sizeof sr);
perf_begin(CTL);
perf_pre(ml, mr, sd, sr, CTL);
perf_block(bl, br, CTL);
if (!up && pf.dfb == DUB_FB)
up = f + CTL;
}
ok = sd[CTL - 1u] == 10000 && sr[CTL - 1u] == 0;
perf_dub_dly(&fb, &mix);
ok &= fb == DUB_FB && mix == DUB_FB * 3 / 4;
fb = mix = 32000;
perf_dub_dly(&fb, &mix);
ok &= fb == 32000 && mix == 32000;
perf_press(PF_DUB, 0);
for (f = 0; f < 3u * FS / 2u; f += CTL) {
memset(sd, 0, sizeof sd);
memset(sr, 0, sizeof sr);
perf_begin(CTL);
perf_pre(ml, mr, sd, sr, CTL);
perf_block(bl, br, CTL);
if (!down && !pf.dfb)
down = f + CTL;
}
snprintf(what, sizeof what, "DUB: the mix into the delay's send alone, whole; its feedback up in %.2f s, back in %.2f s",
up / (double)FS, down / (double)FS);
bad += check(what, ok && !sd[CTL - 1u] && up && up < FS / 4u && down > FS / 2u && down < FS && !pf.busy);
fb = 1000;
mix = 2000;
perf_dub_dly(&fb, &mix);
bad += check(" let go and rung out: the song's feedback and return again", fb == 1000 && mix == 2000);
}
{ /* FLANGE for 2 bars (4 s at 120 BPM: the sweep up and down): a 1 kHz sine's 10 ms peaks rise and fall by more
* than 4x as the comb's notches pass it, under full scale; let go: the input */
ev_t ev[] = {{0, PF_FLG + 1}, {4u * FS, -(PF_FLG + 1)}};
int32_t lo = 1 << 30, hi = 0, pk;
test_signal(1000, 12000, 1000, 12000);
run(120, 1, ev, 2, 5u * FS);
for (t = FS / 10u; t + 441u < 4u * FS; t += 441u) {
pk = peak(out_l, t, t + 441u);
lo = pk < lo ? pk : lo;
hi = pk > hi ? pk : hi;
}
snprintf(what, sizeof what, "FLANGE: a 1 kHz sine swept by the comb: 10 ms peaks %d .. %d; let go: the input", lo, hi);
bad += check(what, hi > 4 * lo && hi < 32767 && same(4u * FS + 512u, 5u * FS));
}
{ /* VINYL: the pitch of a 1 kHz sine from its upward zero crossings (the mean of the middle 12 of each 20
* periods: a pop near a crossing left out), over 3.6 s (two turns of the record) */
ev_t ev[] = {{0, PF_VIN + 1}, {4u * FS, -(PF_VIN + 1)}};
static double per[8000], win[400];
double last = -1, mean = 0, mn = 1e9, mx = 0, dev, rin = 0, rout = 0;
uint32_t np = 0, nw = 0, pops = 0;
test_signal(1000, 12000, 1000, 12000);
run(120, 1, ev, 2, 5u * FS);
for (t = FS / 5u; t < 19u * FS / 5u; t++)
if (out_l[t - 1u] < 0 && out_l[t] >= 0) {
double x = t - 1u + (double)-out_l[t - 1u] / (out_l[t] - out_l[t - 1u]);
if (last >= 0 && np < 8000u)
per[np++] = x - last;
last = x;
}
for (k = 0; k + 20u <= np && nw < 400u; k += 20u) {
double w[20], s = 0;
memcpy(w, per + k, sizeof w);
qsort(w, 20, sizeof w[0], cmp_dbl);
for (t = 4; t < 16u; t++)
s += w[t];
win[nw++] = s / 12.0;
}
for (k = 0; k < nw; k++) {
mean += win[k] / nw;
mn = win[k] < mn ? win[k] : mn;
mx = win[k] > mx ? win[k] : mx;
}
dev = nw ? (mx - mn) / (2.0 * mean) * 100.0 : 0;
ok = same(4u * FS + 512u, 5u * FS);
test_signal(6000, 12000, 6000, 12000);
run(120, 1, ev, 1, 2u * FS);
for (t = FS / 2u; t < 2u * FS; t++) {
rin += (double)in_l[t] * in_l[t];
rout += (double)out_l[t] * out_l[t];
}
test_signal(0, 0, 0, 0);
run(120, 1, ev, 1, 2u * FS);
for (t = 1; t < 2u * FS; t++)
pops += abs(out_l[t]) > abs(out_l[t - 1u]);
snprintf(what, sizeof what, "VINYL: the wow +-%.2f %% (1 kHz, %u windows), 6 kHz at %.2f, %u pops in 2 s; let go: the input",
dev, nw, sqrt(rout / rin), pops);
bad += check(what, ok && nw > 100u && dev > 0.25 && dev < 0.6 && sqrt(rout / rin) < 0.8 && pops >= 24u && pops <= 70u);
}
return bad;
}
/* -------------------------------------------------------------- 8. cost --- */
static uint64_t instr_now(void)
{
@@ -779,6 +914,37 @@ static void demo_at(uint32_t t)
if (D[i].t == t)
perf_press((uint32_t)abs(D[i].e) - 1u, D[i].e > 0);
}
/* (Skiff phase 9) a demo each of GATE, DUB, FLANGE, VINYL: the song a bar, the effect held two, a bar after */
static uint32_t p9_e;
static void p9_at(uint32_t t)
{
uint32_t bar = 4u * FS * 60u / 120u;
if (t == ((bar + CTL - 1u) / CTL) * CTL)
perf_press(p9_e, 1);
if (t == ((3u * bar + CTL - 1u) / CTL) * CTL)
perf_press(p9_e, 0);
}
static void p9_demos(const char *dir)
{
static const uint8_t E[4] = {PF_GATE, PF_DUB, PF_FLG, PF_VIN};
static const char *const NAME[4] = {"fx_gate", "fx_dub", "fx_flange", "fx_vinyl"};
char path[512];
FILE *f;
uint32_t t, m, frames = 4u * 4u * FS * 60u / 120u;
for (m = 0; m < 4u; m++) {
song_setup();
p9_e = E[m];
song_render(frames, p9_at);
snprintf(path, sizeof path, "%s/%s.wav", dir, NAME[m]);
if (!(f = fopen(path, "wb")))
return;
wav_hdr(f, frames);
for (t = 0; t < frames; t++)
wav_put(f, song_l[t], song_r[t]);
fclose(f);
printf("perform: demo %s (the song, then %s held for bars 2 and 3)\n", path, NAME[m] + 3);
}
}
static void demos(const char *dir)
{
char path[512];
@@ -794,6 +960,7 @@ static void demos(const char *dir)
wav_put(f, song_l[t], song_r[t]);
fclose(f);
printf("perform: demo %s (REPEAT 1/8, a 1/16 -> 1/32 roll, LPF, HPF, REVERSE, TAPE STOP, FREEZE, MUTE 1, KNOB 3 THROW)\n", path);
p9_demos(dir);
}
/* the harmonizer on a melody: plain, OCT UP (a bar), OCT DN (a bar), OCT UP with the shimmer (a bar) */
@@ -852,6 +1019,7 @@ int main(int argc, char **argv)
bad += test_idle();
bad += test_misc();
bad += test_harm();
bad += test_p9();
bad += test_cost();
if (argc > 1)
demos(argv[1]);
+1 -1
View File
@@ -653,7 +653,7 @@ int main(void)
old = proj_slot[0];
project_capture(&proj_scratch); /* (an SKF1 slot: the format before phase 5's) */
proj_pack(&proj_slot[0], &proj_scratch);
proj_slot[0].raw[68 + P_COUNT + 2 + 4] = 7; /* track 1 step 1: n = 7 */
proj_slot[0].raw[68 + PROJ_NP + 2 + 4] = 7; /* track 1 step 1: n = 7 */
bad += check("damaged FUN7 slot (hash ok, n > 4) is refused", (memcpy(proj_slot[0].raw + PROJ_STORE_SIZE - 4,
&(uint32_t){proj_hash(proj_slot[0].raw, PROJ_STORE_SIZE - 4)}, 4), !project_used(0)));
st_save(OBJ_PROJECT0, &proj_slot[0], sizeof proj_slot[0]);
+3 -1
View File
@@ -309,7 +309,7 @@ static void demo_write(const char *dir, const char *name, uint32_t secs, void (*
}
/* a phrase per preset: (time in 1/8 s, note, length in 1/8 s, velocity); chords share a time */
#define NPHRASE 10
#define NPHRASE 11
static const uint8_t PHRASE[NPHRASE][24][4] = {
{{0, 84, 6, 110}, {6, 91, 6, 80}, {12, 96, 6, 100}, {20, 88, 8, 70}, {28, 79, 10, 110}, {29, 86, 10, 90},
{30, 91, 10, 90}, {44, 84, 12, 120}}, /* BELL TREE */
@@ -336,6 +336,8 @@ static const uint8_t PHRASE[NPHRASE][24][4] = {
{6, 62, 2, 100}, {7, 65, 2, 90}, {8, 69, 2, 90}, {9, 74, 2, 100}, {10, 69, 2, 90}, {11, 65, 2, 90},
{12, 64, 2, 100}, {13, 68, 2, 90}, {14, 71, 2, 90}, {15, 76, 2, 100}, {16, 45, 8, 110}, {16, 57, 8, 100},
{16, 64, 8, 100}}, /* (Skiff) HARPSICHORD */
{{0, 33, 3, 115}, {4, 40, 2, 90}, {6, 45, 2, 95}, {8, 36, 3, 110}, {12, 43, 2, 90}, {14, 48, 2, 95},
{16, 31, 3, 115}, {20, 38, 2, 90}, {22, 43, 2, 95}, {24, 28, 6, 120}}, /* (Skiff phase 9) UPRIGHT */
};
static void play_preset(uint32_t f, uint32_t pi)
{
+46 -22
View File
@@ -51,7 +51,7 @@ static int pow_on(const project_t *q)
/* (Skiff) an SKF1 record as FUN9 laid it out (no NUDGE planes; the patches at 3120, the name at 3632) */
static void fun9_from(uint8_t *v9, const project_store_t *st)
{
uint32_t k, pos = 68u, pos9 = 68u, n = P_COUNT + 2u + NSTEP * 9u, sum;
uint32_t k, pos = 68u, pos9 = 68u, n = PROJ_NP + 2u + NSTEP * 9u, sum;
memset(v9, 0, PROJ_STORE_V9);
memcpy(v9, st->raw, 68);
for (k = 0; k < PROJ_NT; k++, pos += n, pos9 += n + PROJ_NUDGE_BYTES)
@@ -207,7 +207,8 @@ int main(void)
bad += check("layout: SLICER after DETUNE, then the matrix just before P_E0 ((Skiff) DIR, the ducking after the lane levels)",
P_SLCR == P_DETUNE + 1 && P_SLDEPTH + 1 == P_M1SRC && P_M4AMT + 1 == P_FM1_ATK && P_FM4_LEVEL + 1 == P_CHRD && P_VOIC + 1 == P_LN0 &&
P_LN7 + 1 == P_DIR && P_DIR + 1 == P_DKSRC && P_DKREL + 1 == P_E0 && P_E0 == 95 && P_COUNT == PROJ_NP_V3 + 46u &&
P_LN7 + 1 == P_DIR && P_DIR + 1 == P_DKSRC && P_DKREL + 1 == P_DTYPE && P_LDECAY7 + 1 == P_E0 && P_E0 == 117 &&
P_COUNT == PROJ_NP_V3 + 68u && PROJ_NP == 103u && PROJ_NX == 22u &&
PROJ_NP_V3 == PROJ_NP_V2 + 4u);
bad += check("SKF1 fits one flash object, the retained cache in NOINIT", sizeof(project_store_t) <= 4096u - 256u &&
sizeof(project_store_t) == 3840u && 0xC8u + 4u * sizeof(project_store_t) <= 0x3D50u);
@@ -228,11 +229,11 @@ int main(void)
bad += check("FUN2 -> FUN6: converted, valid format 5 slot", ok && proj_ok(&q) && q.magic == PROJ_MAGIC);
ok = q.sel == 2;
for (i = 0; i < G_COUNT; i++)
ok &= q.g[i] == (i == G_RTYPE ? 0 : (int16_t)(500 + i));
bad += check("FUN2 -> FUN6: globals (id 24, the old drum channel: ROOM) and selected track", ok);
ok &= q.g[i] == (i == G_RTYPE || i == G_CMODE || i == G_CFDBK ? 0 : (int16_t)(500 + i));
bad += check("FUN2 -> FUN6: globals (id 24, the old drum channel: ROOM; 25 26 CHORUS MODE, FEEDBACK 0) and selected track", ok);
ok = 1;
for (t = 0; t < PROJ_NT; t++)
ok &= track_ok(&q.t[t], &v2.t[t], t, t == 3u, 127, 127); /* (G_DRLVL / G_DRREV 525 / 526: 127) */
ok &= track_ok(&q.t[t], &v2.t[t], t, t == 3u, 127, 127); /* (G_DRLVL / G_DRREV 525 / 526: 127; G_CMODE / G_CFDBK now) */
bad += check("FUN2 -> FUN6: every parameter mapped, SLICER and matrix OFF (4 tracks; more: power-on)", ok && pow_on(&q));
bad += check("FUN2 -> FUN6: engine bytes kept (WHEEL 7, ANALOG 0, TRIO 6)",
@@ -259,26 +260,28 @@ int main(void)
ok = proj_import(&q, &buf, (int)sizeof v3) && proj_ok(&q) && q.magic == PROJ_MAGIC && q.sel == 3 &&
q.parts == PROJ_PARTS;
for (i = 0; i < G_COUNT; i++)
ok &= q.g[i] == (i == G_RTYPE ? 0 : (int16_t)(600 + i));
ok &= q.g[i] == (i == G_RTYPE || i == G_CMODE || i == G_CFDBK ? 0 : (int16_t)(600 + i));
for (t = 0; t < PROJ_NT; t++)
ok &= track_v3_ok(&q.t[t], &v3.t[t], t);
bad += check("FUN3 -> FUN6: every parameter kept, the matrix OFF, steps, globals (24: ROOM)", ok && pow_on(&q));
bad += check("FUN3 -> FUN6: every parameter kept, the matrix OFF, steps, globals (24: ROOM; 25 26: 0)", ok && pow_on(&q));
/* a FUN3 written before 1.0 (parts 0: track 4 the drum part, engine byte 0) */
v3.parts = 0;
v3.t[3] = v3.t[0];
v3.t[3].engine = 0;
v3.t[3].preset = 0;
v3.g[G_DRLVL] = 90;
v3.g[G_DRREV] = 20;
v3.g[G_CMODE] = 90; /* (the drum level and reverb send: G_DRLVL / G_DRREV then) */
v3.g[G_CFDBK] = 20;
v3.sum = proj_hash(&v3, sizeof v3 - 4u);
memcpy(&buf, &v3, sizeof v3);
ok = proj_import(&q2, &buf, (int)sizeof v3) && proj_ok(&q2) && q2.parts == PROJ_PARTS && q2.t[3].engine == ENGI_DRUM &&
q2.t[3].preset == PROJ_DEF_KEEP && q2.t[3].p[P_LEVEL] == 90 && q2.t[3].p[P_REV] == 20 &&
q2.t[3].p[P_PAN] == oldv3(0, P_PAN) && q2.t[3].p[P_SLEN] == oldv3(0, P_SLEN) &&
q2.t[3].p[P_SLCR] == oldv3(0, P_SLCR) && q2.t[3].p[P_M1SRC] == 0 &&
steps_grid_same(q2.t[3].step, v3.t[0].step) && !memcmp(&q2.t[0], &q.t[0], sizeof q.t[0]) && pow_on(&q2);
bad += check("FUN3 before 1.0: the drum track -> part 4 (LEVEL / REV from G_DRLVL / G_DRREV), never a later one", ok);
steps_grid_same(q2.t[3].step, v3.t[0].step) && !memcmp(&q2.t[0], &q.t[0], sizeof q.t[0]) && pow_on(&q2) &&
!q2.g[G_CMODE] && !q2.g[G_CFDBK];
bad += check("FUN3 before 1.0: the drum track -> part 4 (LEVEL / REV from G_DRLVL / G_DRREV), never a later one; "
"(phase 9) those ids then 0: CHORUS, no FEEDBACK", ok);
/* a FUN6 round trip: stored as is (a matrix slot set; an engine added since: SLICE, 8; a DRUM track with
* notes on its lanes stays so: only an older format is converted) */
@@ -451,7 +454,7 @@ int main(void)
project_store_t st, st2;
uint32_t i, zero = 1;
bad += check("SKF1 name at the end of the reserved tail, the FM6 patches before it, after the data (32 spare)",
PROJ_NAME_OFF == 3824u && PROJ_FM6_OFF == 3312u && 68u + PROJ_NT * (P_COUNT + 2u + NSTEP * 9u +
PROJ_NAME_OFF == 3824u && PROJ_FM6_OFF == 3312u && 68u + PROJ_NT * (PROJ_NP + 2u + NSTEP * 9u +
PROJ_NUDGE_BYTES) + sizeof(chain_config_t) + sizeof(motion_store_t) + 32u == PROJ_FM6_OFF);
memset(&a, 0, sizeof a);
a.magic = PROJ_MAGIC; a.size = sizeof a; a.parts = PROJ_PARTS; a.phys = PROJ_PHYS;
@@ -495,6 +498,9 @@ int main(void)
memset(&a, 0, sizeof a);
a.magic = PROJ_MAGIC; a.size = sizeof a; a.parts = PROJ_PARTS; a.phys = PROJ_PHYS;
chain_defaults(&a.chain);
for (k = 0; k < PROJ_NT; k++) /* ((phase 9) SKF1 holds none past PROJ_NP: their defaults) */
for (i = PROJ_NP - 8u; i < P_E0; i++)
a.t[k].p[i] = TP[i].def;
for (k = 0; k < PROJ_NT; k++)
for (i = 0; i < NSTEP; i += 5u) {
a.t[k].step[i] = (step_t){{(uint8_t)(48u + i)}, 1, ST_NOTE, 0, 100};
@@ -503,6 +509,10 @@ int main(void)
a.sum = proj_sum(&a);
ok = proj_pack(&st, &a) && proj_import(&c, &st, sizeof st) && !memcmp(c.t, a.t, PROJ_NT * sizeof a.t[0]) && pow_on(&c);
bad += check("SKF1: each step's NUDGE round trips (-32, 31, -1, 1, ..), the rest of the step kept", ok);
a.motion.count = 1; /* ((phase 9) a lock on DRIVE's TONE: SKF1 cannot name it) */
a.motion.event[0] = (motion_event_t){1u << 6 | 2u, (uint8_t)(P_DTONE | MOTION_LOCK), 5};
bad += check(" (phase 9) SKF1 refuses a motion record of a parameter added since 103", !proj_pack(&st, &a));
a.motion.count = 0;
a.t[2].step[7].nudge = NUDGE_MAX + 1;
bad += check("SKF1: a NUDGE outside -32..31 cannot be packed", !proj_pack(&st, &a));
a.t[2].step[7].nudge = 0;
@@ -551,7 +561,7 @@ int main(void)
ok && proj_pack(&st2, &c) && !memcmp(&st, &st2, sizeof st));
m.motion.on = (uint8_t)((1u << NTRK) - 1u); /* every track's automation on (as at power-on) */
m.sum = proj_sum(&m);
ok = proj_pack(&st2, &m) && st2.raw[68u + PROJ_NT * (P_COUNT + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) +
ok = proj_pack(&st2, &m) && st2.raw[68u + PROJ_NT * (PROJ_NP + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) +
sizeof(chain_config_t) + 1u] == 0x0Fu &&
proj_import(&c, &st2, sizeof st2) && c.motion.on == 0x0Fu && c.motion.count == 2u;
bad += check(" saved with every track's automation on: SKF1 holds the four tracks' bits (more: left out)", ok);
@@ -565,8 +575,8 @@ int main(void)
m.motion.count = 2; m.motion.event[1] = m.motion.event[2]; /* (back to two: then a value of 200 stored) */
m.sum = proj_sum(&m);
ok = proj_pack(&st2, &m);
st2.raw[68u + PROJ_NT * (P_COUNT + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) + 4u + 2u] = 200u;
st2.raw[68u + PROJ_NT * (P_COUNT + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) + 4u + 3u] = 0u;
st2.raw[68u + PROJ_NT * (PROJ_NP + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) + 4u + 2u] = 200u;
st2.raw[68u + PROJ_NT * (PROJ_NP + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) + 4u + 3u] = 0u;
{
uint32_t sum = proj_hash(st2.raw, PROJ_STORE_SIZE - 4u);
memcpy(st2.raw + PROJ_STORE_SIZE - 4u, &sum, 4);
@@ -595,7 +605,7 @@ int main(void)
f.sum = proj_sum(&f);
ok = proj_pack(&st, &f) && proj_import(&g, &st, sizeof st) && !memcmp(&f.motion, &g.motion, sizeof f.motion);
bad += check("SKF1 round trip: locks on a lane level (P_LN2) and an engine value (P_E5) kept", ok &&
st.raw[68u + PROJ_NT * (P_COUNT + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) +
st.raw[68u + PROJ_NT * (PROJ_NP + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) + sizeof(chain_config_t) +
4u + 8u + 1u] ==
(P_LN2 | MOTION_LOCK) && g.motion.event[3].param == (P_E5 | MOTION_LOCK));
}
@@ -607,8 +617,8 @@ int main(void)
memcpy(v8, st.raw, 68);
v8[66] = 91;
for (k = 0; k < PROJ_NT; k++) {
for (j = 0; j < 91u; j++) v8[pos++] = st.raw[pos9 + (j < 83u ? j : j + (P_E0 - 83u))];
pos9 += P_COUNT;
for (j = 0; j < 91u; j++) v8[pos++] = st.raw[pos9 + (j < 83u ? j : j + (PROJ_NP - 8u - 83u))];
pos9 += PROJ_NP;
memcpy(v8 + pos, st.raw + pos9, 2u + NSTEP * 9u);
pos += 2u + NSTEP * 9u; pos9 += 2u + NSTEP * 9u + PROJ_NUDGE_BYTES; /* (Skiff: SKF1's NUDGE plane) */
}
@@ -826,8 +836,9 @@ int main(void)
memset(&a, 0, sizeof a);
for (t = 0; t < PROJ_NT; t++) {
a.t[t].engine = (uint8_t)(t == 3u ? ENGI_DRUM : 0u);
for (i = 0; i < P_COUNT; i++)
a.t[t].p[i] = (int16_t)clamp(param_desc_of(a.t[t].engine, i)->def + (int32_t)t, -64, 127);
for (i = 0; i < P_COUNT; i++) /* ((phase 9) SKF2 holds none past PROJ_NP: their defaults) */
a.t[t].p[i] = (int16_t)clamp(param_desc_of(a.t[t].engine, i)->def +
(i >= PROJ_NP - 8u && i < P_E0 ? 0 : (int32_t)t), -64, 127);
}
a.parts = PROJ_PARTS; a.phys = PROJ_PHYS; a.sel = 2; a.g[G_BPM] = 133;
a.ent[0][0][0] = 5 + 1; a.ent[0][0][1] = 2 - 1; a.ent[0][3][0] = 63 + 1; a.ent[3][15][0] = 0 + 1; a.ent[3][15][1] = 16 - 1;
@@ -849,7 +860,7 @@ int main(void)
ok = !proj_import(&c, &st2, (int)PROJ_STORE2);
#define SKF2_BAD(off, v) (st2 = st, st2.raw[(off)] = (v), sum = proj_hash(st2.raw, PROJ_STORE2 - 4u), \
memcpy(st2.raw + PROJ_STORE2 - 4u, &sum, 4), !proj_import(&c, &st2, (int)PROJ_STORE2))
e = 68u + PROJ_NT * (P_COUNT + 2u); /* the lists */
e = 68u + PROJ_NT * (PROJ_NP + 2u); /* the lists */
ok &= SKF2_BAD(e, NPAT + 1u) && SKF2_BAD(e + 1u, 16u) && SKF2_BAD(e + PROJ_NT * NENT * 2u, 16u) &&
SKF2_BAD(65u, 2u) && !SKF2_BAD(e, NPAT) && !SKF2_BAD(e + 1u, 15u);
#undef SKF2_BAD
@@ -883,12 +894,25 @@ int main(void)
!memcmp(c.ent, a.ent, sizeof a.ent) && !memcmp(c.cur, a.cur, sizeof a.cur) && c.song == 1u &&
!memcmp(c.scene, a.scene, sizeof a.scene) && !memcmp(c.name, a.name, sizeof a.name) &&
c.fm6[k][5] == 77u && c.sel == k && c.g[G_BPM] == 97);
e = 68u + NTRK * (P_COUNT + 2u); /* the lists (698 with 103 parameters), the entries, the scenes */
e = 68u + NTRK * (PROJ_NP + 2u); /* the lists (698 with 103 parameters), the entries, the scenes */
ok = ((const uint32_t *)st.raw)[0] == PROJ_MAGIC3 && ((const uint32_t *)st.raw)[1] == 2048u &&
st.raw[e + (k * NENT + 15u) * 2u] == 64u && st.raw[e + NTRK * NENT * 2u + k] == 15u &&
st.raw[e + NTRK * NENT * 2u + NTRK + PROJ_SC2] == 0x05u && e + NTRK * NENT * 2u + NTRK + 82u <= 1264u &&
st.raw[1264u + k * FM6_PACKED + 5u] == 77u && !memcmp(st.raw + 2032u, "SKF3 TEST", 9);
bad += check(" 2048 bytes: lists, entries, 82 scene bytes after the six tracks; FM6 at 1264, the name at 2032", ok);
ok = PROJ_PX_AT(&PROJ_SKF3) == 981u && st.raw[981] == PROJ_PX_MARK && st.raw[982] == PROJ_NX &&
st.raw[983u + k * PROJ_NX + (P_DTONE - (PROJ_NP - 8u))] == (uint8_t)(a.t[k].p[P_DTONE] + 64);
bad += check(" (phase 9) the parameters past 103: the PX block at 981 (its mark, 22 a track), round trip", ok);
{
static project_t d;
d = a;
for (t = 0; t < NTRK; t++)
for (i = PROJ_NP - 8u; i < P_E0; i++)
d.t[t].p[i] = TP[i].def;
ok = proj_pack2(&st2, &d, &PROJ_SKF3) && !st2.raw[981] && proj_import(&c, &st2, (int)PROJ_STORE3) &&
c.t[1].p[P_EG2_DEC] == TP[P_EG2_DEC].def && c.t[1].p[P_LTUNE3] == 64;
bad += check(" .. all at their defaults: no block (a project of before), read as the defaults", ok);
}
bad += check(" read from a retained 3840-byte slot too; loaded and saved again: byte for byte",
proj_import(&c, &st, (int)sizeof st) && c.ent[k][15][0] == 64u &&
proj_pack2(&st2, &c, &PROJ_SKF3) && !memcmp(&st, &st2, sizeof st));
+5 -5
View File
@@ -177,7 +177,7 @@ static int projects(void)
after.t[0].step[i].vel == before.t[0].step[i].vel;
bad += check("FUN8: x1..x4 round trip with their velocity, accent, chance (0 and 30 %) and lane hits", ok &&
step_ratchet(&after.t[3].step[5]) == 4u && after.t[3].step[5].hit == 0x81);
pos = 68u + P_COUNT + 2u + 3u * 9u; /* step 3 of track 1: x4 -> bit 7 of its velocity and chance */
pos = 68u + PROJ_NP + 2u + 3u * 9u; /* step 3 of track 1: x4 -> bit 7 of its velocity and chance */
bad += check(" x4 is bit 7 of the velocity and the chance bytes", (packed.raw[pos + 5] & 128u) && (packed.raw[pos + 8] & 128u) &&
(packed.raw[pos + 5] & 127u) == before.t[0].step[3].vel);
for (k = 0; k < NTRK; k++)
@@ -186,15 +186,15 @@ static int projects(void)
project_capture(&before);
proj_pack(&packed, &before);
ok = 1;
for (k = 0, pos = 68u; k < PROJ_NT; k++, pos += P_COUNT + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) /* ((Skiff) SKF1) */
for (k = 0, pos = 68u; k < PROJ_NT; k++, pos += PROJ_NP + 2u + NSTEP * 9u + PROJ_NUDGE_BYTES) /* ((Skiff) SKF1) */
for (i = 0; i < NSTEP; i++)
ok &= packed.raw[pos + P_COUNT + 2u + i * 9u + 5u] < 128u && packed.raw[pos + P_COUNT + 2u + i * 9u + 8u] < 128u;
ok &= packed.raw[pos + PROJ_NP + 2u + i * 9u + 5u] < 128u && packed.raw[pos + PROJ_NP + 2u + i * 9u + 8u] < 128u;
bad += check(" a project without ratchets: every velocity and chance byte below 128, as firmware before wrote", ok);
{ /* a FUN7 image (its tracks without patches) as firmware before RATCH wrote it: x1 */
project_store_t old;
uint32_t sum, magic = PROJ_MAGIC_V7, size = PROJ_STORE_V7;
project_t fun7;
uint32_t src = 68u, dst = 68u, n = P_COUNT + 2u + NSTEP * 9u;
uint32_t src = 68u, dst = 68u, n = PROJ_NP + 2u + NSTEP * 9u;
memcpy(&old, &packed, sizeof old);
for (k = 0; k < PROJ_NT; k++, src += n + PROJ_NUDGE_BYTES, dst += n) /* ((Skiff) SKF1's NUDGE planes out) */
memmove(old.raw + dst, packed.raw + src, n);
@@ -421,7 +421,7 @@ static int flam(void)
project_capture(&before);
proj_power_on(&before, PROJ_NT); before.sum = proj_sum(&before); /* ((Skiff phase 6) four tracks in SKF1) */
ok = proj_pack(&packed, &before) && proj_import(&after, &packed, sizeof packed) && !memcmp(&before, &after, sizeof before);
pos = 68u + P_COUNT + 2u + 3u * 9u; /* step 3 of track 1 */
pos = 68u + PROJ_NP + 2u + 3u * 9u; /* step 3 of track 1 */
ok &= (packed.raw[pos + 4] & 128u) && (after.t[0].step[3].flags & SF_FLAM) && (after.t[0].step[3].flags & SF_ACCENT);
packed.raw[pos + 5] |= 128u; /* FLAM with RATCH x2: no such step, refused */
{
+188
View File
@@ -337,6 +337,192 @@ static void test_switch(void)
check(" and back to ROOM", fx.rtype == 0);
}
/* --------------------------------------------------------------- HALL --- */
/* (Skiff phase 9) HALL (G_RTYPE 2), ROOM's network at half the rate: a longer tail than ROOM's at the same SIZE (RT60
* 1.6x at least), stable at the corners (full-scale noise, then silence: bounded, dies away), its level within 6 dB
* of ROOM's, a change to it and back while the bus rings without a click */
static void model_run(uint32_t m, const int32_t *x, uint32_t len, uint32_t n) /* model m's response into ir[] */
{
static int32_t in[CTL];
uint32_t t, i;
for (t = 0; t < n; t += CTL) {
for (i = 0; i < CTL; i++) {
in[i] = t + i < len ? x[t + i] : 0;
ir[t + i] = 0;
}
rev_model(m, in, ir + t, CTL);
}
}
static void test_hall(void)
{
static int32_t imp[1] = {200000}, burst[2u * FS];
static const int16_t SZ[2] = {64, 127};
double rr[2], rh[2], er = 0, eh = 0;
char what[200];
uint32_t k, i;
host_tracks_init();
for (k = 0; k < 2u; k++) {
song.g[G_RSIZE] = SZ[k];
song.g[G_RDAMP] = 60;
rev_clear();
model_run(0, imp, 1, IRN);
rr[k] = rt60(ir, IRN);
rev_clear();
model_run(2, imp, 1, IRN);
rh[k] = rt60(ir, IRN);
}
snprintf(what, sizeof what, "HALL (phase 9): a longer tail than ROOM's: RT60 %.2f s (ROOM %.2f) at SIZE 64, %.2f (%.2f) at 127",
rh[0], rr[0], rh[1], rr[1]);
check(what, rh[0] >= 1.6 * rr[0] && rh[1] >= 1.6 * rr[1] && rh[1] < 12.0);
for (k = 0; k < 2u; k++) {
int32_t pk = 0, tail = 0;
for (i = 0; i < 2u * FS; i++)
burst[i] = noise(1 << 19);
song.g[G_RSIZE] = 127;
song.g[G_RDAMP] = k ? 127 : 0;
rev_clear();
model_run(2, burst, 2u * FS, IRN);
for (i = 0; i < IRN; i++) {
int32_t v = abs(ir[i]);
pk = v > pk ? v : pk;
if (i >= IRN - FS)
tail = v > tail ? v : tail;
}
snprintf(what, sizeof what, " at SIZE 127 DAMP %d: 2 s of full-scale noise: peak %d, the last second %d", k ? 127 : 0,
pk, tail);
check(what, pk <= 6 * 32768 && tail * 100 < pk);
}
song.g[G_RSIZE] = 90;
song.g[G_RDAMP] = 60;
for (k = 0; k < 2u; k++) { /* the level against ROOM's: the same burst, defaults */
static int32_t in[CTL], o[CTL];
uint32_t t;
rev_clear();
xs = 99;
for (t = 0; t < 2u * FS; t += CTL) {
for (i = 0; i < CTL; i++) {
in[i] = t < FS / 4u ? noise(20000) : 0;
o[i] = 0;
}
rev_model(k ? 2u : 0u, in, o, CTL);
for (i = 0; i < CTL; i++)
*(k ? &eh : &er) += (double)o[i] * o[i];
}
}
snprintf(what, sizeof what, " its tail %.1f dB from ROOM's (the same burst, SIZE 90 DAMP 60)", 10 * log10(eh / er));
check(what, fabs(10 * log10(eh / er)) <= 6.0);
{ /* ROOM -> HALL while the tail rings, and back */
static int32_t c[CTL], d[CTL], r[CTL], w[CTL];
uint32_t b;
int32_t prev = 0, step = 0, own = 0;
rev_clear();
memset(dly_buf, 0, sizeof dly_buf);
memset(cho_buf, 0, sizeof cho_buf);
fx.rtype = 0;
song.g[G_RTYPE] = 0;
for (b = 0; b < 3u * FS / CTL; b++) {
if (b == 2u * FS / CTL)
song.g[G_RTYPE] = 2;
for (i = 0; i < CTL; i++) {
c[i] = d[i] = 0;
r[i] = b < FS / CTL ? (int32_t)(30000 * sin(2 * M_PI * 220 * (b * CTL + i) / FS)) : 0;
}
fx_buses(c, d, r, w, CTL);
for (i = 0; i < CTL; i++) {
int32_t s = abs(w[i] - prev);
if (b >= 2u * FS / CTL - 4u && b <= 2u * FS / CTL + 4u)
step = s > step ? s : step;
else if (b > FS / CTL + 100u && b < 2u * FS / CTL - 4u)
own = s > own ? s : own;
prev = w[i];
}
}
k = fx.rtype;
song.g[G_RTYPE] = 0;
fx_buses(c, d, r, w, CTL);
snprintf(what, sizeof what, " ROOM -> HALL while the tail rings: largest step %d (the tail's own %d); and back", step, own);
check(what, step <= 2 * own + 64 && k == 2u && fx.rtype == 0);
}
rev_clear();
}
/* ------------------------------------------------------- CHORUS's MODE --- */
/* (Skiff phase 9) GLO > CHORUS MODE and FEEDBACK (fx.c cho_mode), the bus alone (the delay and the reverb silent):
* FLANGER at DEPTH 0 echoes an impulse 1 ms later (44 samples), with FEEDBACK again every 44, each echo the feedback's
* share of the one before; PHASER, four allpasses, keeps an impulse's energy (within 1 dB); every MODE at FEEDBACK 127
* under 2 s of full-scale noise: bounded, 34 dB down a second after */
static void bus_run(const int32_t *x, uint32_t len, uint32_t n)
{
static int32_t c[CTL], z[CTL];
uint32_t t, i;
for (t = 0; t < n; t += CTL) {
for (i = 0; i < CTL; i++) {
c[i] = t + i < len ? x[t + i] : 0;
z[i] = 0;
}
fx_buses(c, z, z, ir + t, CTL);
}
}
static void bus_fresh(int16_t mode, int16_t depth, int16_t fb)
{
host_tracks_init();
rev_clear();
memset(dly_buf, 0, sizeof dly_buf);
memset(cho_buf, 0, sizeof cho_buf);
fx.cho_w = fx.cho_ph = 0;
fx.cho_y = 0;
memset(fx.ph_s, 0, sizeof fx.ph_s);
song.g[G_CMODE] = mode;
song.g[G_CDEPTH] = depth;
song.g[G_CFDBK] = fb;
}
static void test_chorus_modes(void)
{
static int32_t imp[1] = {40000}, burst[2u * FS];
char what[200];
uint32_t i, at = 0, m;
int32_t pk = 0, e2 = 0;
double ei = 0, eo = 0;
bus_fresh(1, 0, 0);
bus_run(imp, 1, FS / 10u);
for (i = 0; i < FS / 10u; i++)
if (abs(ir[i]) > pk) {
pk = abs(ir[i]);
at = i;
}
bus_fresh(1, 0, 100);
bus_run(imp, 1, FS / 10u);
for (i = 80u; i < 100u; i++)
e2 = abs(ir[i]) > e2 ? abs(ir[i]) : e2;
snprintf(what, sizeof what, "FLANGER (phase 9) at DEPTH 0: an impulse echoed at %u samples (1 ms: 44); FEEDBACK 100: "
"the next %d (%.2f of the first)", at, e2, (double)e2 / (pk + 1e-9));
check(what, at >= 43u && at <= 46u && pk > 30000 && e2 > pk * 0.6 && e2 < pk * 0.85);
bus_fresh(2, 64, 0);
bus_run(imp, 1, FS / 2u);
for (i = 0; i < FS / 2u; i++)
eo += (double)ir[i] * ir[i];
ei = (double)imp[0] * imp[0];
snprintf(what, sizeof what, "PHASER: four allpasses keep an impulse's energy: %.2f dB", 10 * log10(eo / ei));
check(what, fabs(10 * log10(eo / ei)) < 1.0);
for (m = 0; m < 3u; m++) {
int32_t big = 0, tail = 0;
for (i = 0; i < 2u * FS; i++)
burst[i] = noise(1 << 17);
bus_fresh((int16_t)m, 127, 127);
bus_run(burst, 2u * FS, 4u * FS);
for (i = 0; i < 4u * FS; i++) {
int32_t v = abs(ir[i]);
big = v > big ? v : big;
if (i >= 3u * FS)
tail = v > tail ? v : tail;
}
snprintf(what, sizeof what, " %s at FEEDBACK 127, DEPTH 127: 2 s of full-scale noise: peak %d, the last second %d",
(const char *[]){"CHORUS", "FLANGER", "PHASER"}[m], big, tail);
check(what, big <= 4 * 65536 && tail * 50 < big); /* (-34 dB a second on: dying away) */
}
bus_fresh(0, 60, 0);
}
/* ---------------------------------------------------------------- cost --- */
static double cost_of(int what) /* 0 rev_room, 1 rev_spring, 2 fx_buses ROOM, 3 fx_buses SPRING */
{
@@ -432,6 +618,8 @@ int main(int argc, char **argv)
test_spring();
test_clear();
test_switch();
test_hall();
test_chorus_modes();
test_cost();
if (argc > 1) {
demo(argv[1], "spring_drums", 1, 0);
Regular → Executable
+3
View File
@@ -242,6 +242,8 @@ if [ -f build/gen/felucca_tables.h ]; then
run "FX layer effects: on the 1/16, stereo, too-long REPEAT, SLICER, silent keys, idle bit-identical, clicks, OCT UP / DN, cost, demos" "$OUT/perform_test" build/perform_demo build/fx_demo
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/duck_test" tests/duck_test.c -lm
run "ducking (Skiff): under the source's hits (a kit's KICK only), DEPTH, RELEASE, no click, OFF bit-identical" "$OUT/duck_test"
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/drive_test" tests/drive_test.c -lm
run "DRIVE (Skiff phase 9): DIST's TYPE SOFT HARD FOLD BITS and TONE; SOFT at TONE 0 as before, bit for bit" "$OUT/drive_test"
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/reverb_test" tests/reverb_test.c -lm
run "REVERB TYPE: ROOM bit-identical, SPRING decay / chirp / stability / level, model change, cost, demos" "$OUT/reverb_test" build/fx_demo
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/regress" tests/regress.c -lm
@@ -278,6 +280,7 @@ if [ -f build/gen/felucca_tables.h ]; then
# SLICE is in the standard build (firmware/src/core.h): its test always runs (after #22 by andreahaku)
if grep -q '^#define SLC_BREAK_BPM ' build/gen/felucca_samples.h; then
mkdir -p build/slice_demo
python3 tools/gen_waves.py build/genwav >/dev/null # (the loop's drums; the BREAK no longer uses them)
python3 tests/slice_loop.py build/slice_demo/loop
python3 tools/fm1_sample_upload.py build LOOP build/slice_demo/loop build/slice_demo/loop.wav:60 >/dev/null
$CC -O2 -w -Ibuild/gen -Ifirmware/src -o "$OUT/slice_test" tests/slice_test.c -lm
+47 -18
View File
@@ -341,21 +341,28 @@ int main(int argc, char **argv)
int32_t worst;
long n;
/* 1 */
check("BREAK: build-time table == decoder states", !(bad = table_check(&SLC_BREAK)), "%u of %u differ", bad,
SLC_GRID + SLC_BREAK.nauto);
/* 2: the detector on BREAK (hits = its build-time AUTO table) */
/* 1, 2: the built-in loops (Skiff phase 9: BREAK and FUNK from assets/breaks/): their build-time tables == the
* decoder's states, and their AUTO slices == what the detector finds in them (gen_samples.py runs slc_scan's
* integer steps: the same starts, to the sample) */
{
static const slc_src_t *const BUILT[] = {&SLC_BREAK, &SLC_FUNK};
static slc_src_t tmp;
tmp = SLC_BREAK;
tmp.len = 0;
slc_scan(&tmp, SLC_BREAK.len);
tmp.len = SLC_BREAK.len;
bad = memcmp(tmp.grid, SLC_BREAK.grid, sizeof tmp.grid) != 0;
check("BREAK: slc_scan grid == build-time grid", !bad, 0);
check("BREAK: slc_scan finds the hits (-6 .. +1 ms)",
match(&tmp, SLC_BREAK.apos, SLC_BREAK.nauto, 132, 22, msg, sizeof msg, &worst), "%s", msg);
char what[96];
for (i = 0; i < NELEM(BUILT); i++) {
const slc_src_t *b = BUILT[i];
const char *name = i ? "FUNK" : "BREAK";
snprintf(what, sizeof what, "%s: build-time table == decoder states", name);
check(what, !(bad = table_check(b)), "%u of %u differ", bad, SLC_GRID + b->nauto);
tmp = *b;
tmp.len = 0;
slc_scan(&tmp, b->len);
tmp.len = b->len;
snprintf(what, sizeof what, "%s: slc_scan grid == build-time grid", name);
check(what, !memcmp(tmp.grid, b->grid, sizeof tmp.grid), 0);
snprintf(what, sizeof what, "%s: slc_scan finds its AUTO slices, exactly", name);
check(what, match(&tmp, b->apos, b->nauto, 132, 22, msg, sizeof msg, &worst) && tmp.nauto == b->nauto &&
!memcmp(tmp.apos, b->apos, b->nauto * sizeof b->apos[0]), "%s", msg);
}
}
/* 2: the user loop, through the slot image and smp_user_scan */
@@ -488,8 +495,8 @@ int main(int argc, char **argv)
track_t *t = &trk[0];
voice_t *v;
uint32_t a, b, st, ok = 1, j, p0;
check("engine 13 is SLICE (the protocol's number), two factory presets",
ENGINES[SLC_ENG] == &ENG_SLICE && ENG_SLICE.npresets == 2u && str_eq(ENG_SLICE.presets[0].name, "CHOP") &&
check("engine 13 is SLICE (the protocol's number), its factory presets CHOP STUTTER, (phase 9) 9 in all",
ENGINES[SLC_ENG] == &ENG_SLICE && ENG_SLICE.npresets == 9u && str_eq(ENG_SLICE.presets[0].name, "CHOP") &&
str_eq(ENG_SLICE.presets[1].name, "STUTTER"), 0);
slc_bounds(s, SLC_DIV_MAN, 3, &a, &b, &st);
ok &= slc_count(s, SLC_DIV_MAN) == s->nauto && a == s->apos[3] && b == s->apos[4] && st == s->ast[3];
@@ -852,9 +859,31 @@ int main(int argc, char **argv)
#else
check("PIANO (SRC 4): none in a build without the CC0 samples", !slc_get(SLC_SRC_PIANO), 0);
#endif
check("SRC: BREAK USR1 USR2 USR3 PIANO (append-only: 1.0.3's numbers kept)",
ENG_SLICE.edit[0].max == 4 && str_eq(N_SLC_SRC[0], "BREAK") && str_eq(N_SLC_SRC[1], "USR1") &&
str_eq(N_SLC_SRC[3], "USR3") && str_eq(N_SLC_SRC[4], "PIANO") && SLC_BREAK.len != 0u, 0);
check("SRC: BREAK USR1 USR2 USR3 PIANO FUNK (append-only: 1.0.3's numbers kept)",
ENG_SLICE.edit[0].max == 5 && str_eq(N_SLC_SRC[0], "BREAK") && str_eq(N_SLC_SRC[1], "USR1") &&
str_eq(N_SLC_SRC[3], "USR3") && str_eq(N_SLC_SRC[4], "PIANO") && str_eq(N_SLC_SRC[5], "FUNK") &&
SLC_BREAK.len != 0u && slc_get(SLC_SRC_FUNK) == &SLC_FUNK && !SLC_SRC_USR(SLC_SRC_FUNK) &&
!SLC_SRC_USR(SLC_SRC_PIANO) && !SLC_SRC_USR(0u) && SLC_SRC_USR(1u) && SLC_SRC_USR(3u), 0);
{ /* (Skiff phase 9) SRC 5 FUNK: DIV 8, the lowest key plays its first eighth of the material */
track_t *t = &trk[0];
voice_t *v;
uint32_t ok;
int32_t o[2 * CTL], pk = 0;
voices_off();
host_tracks_init();
host_preset(t, SLC_ENG, 0);
t->p[P_E0] = (int16_t)SLC_SRC_FUNK;
t->p[P_E1] = 1;
trk_note_on(t, 60, 100);
v = voice_of(t, 60);
ok = v && ((uint32_t)v->s[4] & 7u) == SLC_SRC_FUNK && v->ph[0] == 0u && v->ph[2] == slc_gpos(&SLC_FUNK, 16u);
for (i = 0; i < 40u; i++) {
mix_block(o, CTL);
for (n = 0; n < (long)CTL; n++)
pk = abs(o[2 * n]) > pk ? abs(o[2 * n]) : pk;
}
check("FUNK (SRC 5): DIV 8, a key plays its slice, sounding", ok && pk > 2000, "peak %d", pk);
}
sine_ok("SLICE on an empty USR2: A4", sine_run(SLC_ENG, 2, 69), 440.0);
sine_ok("SLICE on an empty USR2: A3", sine_run(SLC_ENG, 2, 57), 220.0);
sine_ok("SAMPLE on an empty USR2: A4", sine_run(4u, (int16_t)(SMP_NSETS + 1), 69), 440.0);
+5 -1
View File
@@ -28,10 +28,14 @@ FUNCS = ["analog_render", "digital_render", "digital_render_legacy", "digital_re
"click_render", # the metronome's click (click.c), while it sounds
"mod_begin", "mod_voice", "mod_end", # the modulation matrix (mod.c), called when active
"perf_begin", "perf_mute", "perf_pre", "perf_block", "perf_master", # the FX layer (perform.c), when busy
"perf_gate", "perf_dub", # (Skiff phase 9) its GATE, DUB (FLANGE / VINYL: perf_mdl, a
# sample a call, no loop: as perf_harm, not here)
"duck_block", "duck_apply", # (Skiff) ducking (duck.c): each block; a ducked track
"launch_step", "launch_swap", # (Skiff) live switching (launch.c): a staged pattern
"throw_on", "throw_off", # (Skiff) throws (throw.c): while one is out
"rev_room", "rev_spring"] # the reverb bus (fx.c): REVERB TYPE ROOM / SPRING
"rev_room", "rev_spring", # the reverb bus (fx.c): REVERB TYPE ROOM / SPRING
"dist_hard", "dist_fold", "dist_bits", # (Skiff phase 9) FX > DRIVE's TYPEs (fx.c), on a track that uses one
"rev_hall", "cho_mode"] # (Skiff phase 9) REVERB TYPE HALL; CHORUS MODE / FEEDBACK (fx.c)
# built only with FELUCCA_FM4=1 (DIGITAL, src/eng_digital.c; not in the default build, so not in BUDGET): absent,
# they are skipped; present, checked against these (their budget lines until the engine was retired in 1.0)
OPTIONAL = {"digital_render": 12, "digital_render_legacy": 333, "digital_render_custom": 558,
+8 -1
View File
@@ -44,15 +44,22 @@ fm1_alnk0_irq 37502
fm1_timer5_irq 33387
click_render 30
mod_begin 158
mod_voice 30
mod_voice 35
mod_end 7
perf_begin 28
perf_mute 21
perf_pre 27
perf_block 814
perf_master 31
perf_gate 36
perf_dub 22
rev_room 218
rev_spring 126
dist_hard 45
dist_fold 46
dist_bits 32
rev_hall 233
cho_mode 168
duck_block 123
duck_apply 13
launch_step 28
+17
View File
@@ -716,6 +716,8 @@ enum { S_HOME, S_HOME_IDLE, S_MESSAGE, S_MESSAGE_KEY, S_MESSAGE_NOFILE, S_PRESET
S_LFO_DEST, S_VOICE2, S_VOICE2_UNI, S_ARP_ON, S_ARP2, S_EDIT_FLT, S_GLOBAL_SWING, S_VOICE_GLIDE, /* (Skiff U5) */
S_SHIFT_ENV, S_SHIFT_STEP, S_SHIFT_HOME, S_LFO_RUN, S_LFO_DEST_RUN, S_HOME_SCOPE,
S_FM_TONE, S_FM_ENV, S_FM_KEYS, S_FM_ALGO, S_FM_PITCH, S_FM_LFO, S_FM_INIT, /* (FM6 LAB) */
S_DRIVE_SOFT, S_DRIVE_HARD, S_DRIVE_FOLD, S_DRIVE_BITS, S_ENV2, S_LANES_TUNE, S_REVERB_HALL, S_CHORUS_FB,
S_CHORUS_FLANGER, S_CHORUS_PHASER, S_PRESETS_BASS, /* (Skiff phase 9) */
S_MOCK_HOME, S_MOCK_PRESETS, S_MOCK_SEQ, S_MOCK_DRUM, S_MOCK_MIXER, S_MOCK_DIALOG, S_MOCK_MENU, S_COUNT };
static const char *const S_NAME[S_COUNT] = {"home", "home_idle", "message", "message_key", "message_nofile", "presets", "presets_nofav", "user",
"project", "lanes", "step", "pattern", "chance", "motion", "drum",
@@ -743,6 +745,8 @@ static const char *const S_NAME[S_COUNT] = {"home", "home_idle", "message", "mes
"lfo_dest", "voice_2", "voice_2_uni", "arp_on", "arp_2", "edit_flt", "global_swing", "voice_glide",
"shift_env", "shift_step", "shift_home", "lfo_run", "lfo_dest_run", "home_scope",
"fm_op_tone", "fm_op_env", "fm_op_keys", "fm_all_algo", "fm_all_pitch", "fm_all_lfo", "fm_init",
"drive_soft", "drive_hard", "drive_fold", "drive_bits", "env_2", "lanes_tune", "reverb_hall", "chorus_feedback",
"chorus_flanger", "chorus_phaser", "presets_bass",
"mock_home", "mock_presets", "mock_seq", "mock_drum", "mock_mixer", "mock_dialog", "mock_menu"};
/* the scenes of the UI design screens: the state the UI-redesign
@@ -909,6 +913,19 @@ static void setup(int s)
case S_USER: song.playing = 0; up_store(3, "MY LONG BASS NAME"); up_store(4, "PAD"); ui.uslot = 3; go_page(GR_USER); break;
case S_PROJECT: song.playing = 0; project_save(1); song.g[G_SLOT] = 2; go_page(GR_SLOTS); ui.act = 4; break;
case S_LANES: drum(0); go_title("LANES"); ui.lane = 1; ui.hot_col = 1; ui.hot_t = 30; break; /* ((U3, R6) the one page) */
case S_DRIVE_SOFT: case S_DRIVE_HARD: case S_DRIVE_FOLD: case S_DRIVE_BITS: /* (Skiff phase 9) each TYPE at 96 */
TSEL->p[P_DIST] = 96; TSEL->p[P_DTYPE] = (int16_t)(s - S_DRIVE_SOFT); TSEL->p[P_DTONE] = -20;
go_title("DRIVE"); ui.hot_col = 1; ui.hot_t = 30; break;
case S_ENV2: TSEL->p[P_EG2_ATK] = 30; TSEL->p[P_EG2_DEC] = 70; TSEL->p[P_EG2_SUS] = 40; TSEL->p[P_EG2_REL] = 60;
go_title("ENV 2"); break;
case S_LANES_TUNE: drum(0); go_title("LANES"); ui.lane = 1; TSEL->p[P_LTUNE0 + 1] = 80; TSEL->p[P_LDECAY0 + 1] = -24;
ui.hot_col = 2; ui.hot_t = 30; break;
case S_REVERB_HALL: go_title("REVERB"); song.g[G_RTYPE] = 2; ui.hot_col = 0; ui.hot_t = 30; break;
case S_CHORUS_FB: go_title("CHORUS"); song.g[G_CFDBK] = 70; ui.hot_col = 3; ui.hot_t = 30; break;
case S_CHORUS_FLANGER: case S_CHORUS_PHASER:
go_title("CHORUS"); song.g[G_CMODE] = (int16_t)(s == S_CHORUS_FLANGER ? 1 : 2); song.g[G_CFDBK] = 60;
ui.hot_col = 2; ui.hot_t = 30; break;
case S_PRESETS_BASS: ui_ptag = PT_BASS; go_page(GR_BROWSE); break;
case S_STEP: song.rec = 1; go_page(GR_ROLL); ui.cursor = 6; break;
case S_PATTERN: my_steps(TSEL); go_title("PATTERN"); ui.cursor = 3; break; /* ((Skiff S1) with notes) */
case S_CHANCE: go_page(GR_CHANCE); step_set_chance(&TSEL->step[0], 65); break;
+205 -27
View File
@@ -144,6 +144,7 @@ static void ui_power_on(void)
proj_cur = PROJ_NO_SLOT;
memset(&favorites, 0, sizeof favorites);
memset(undo_ring, 0, sizeof undo_ring); /* (Skiff: the undo ring, ui.c) */
memcpy(dx_kit, DX_KIT_DEF, sizeof dx_kit); /* ((Skiff phase 9) the factory kit: a DRUM-X preset loads others) */
memset(bk_ram, 0xFF, sizeof bk_ram); /* (Skiff: the pattern bank erased, as from a new unit) */
bank_boot();
memset(launch_q, 0, sizeof launch_q); /* (.. nothing staged: launch.c) */
@@ -444,9 +445,11 @@ static int test_sound_loads(void)
project_load(1);
bad += check("a project load drops the copies and takes none", undo_n == 0 && undo_depth == 0);
ui_power_on();
bad += check("SAMPLE factory browsing has four melodic presets and no PERC",
ENGINES[4]->npresets == 4u && str_eq(ENGINES[4]->presets[0].name, "PIANO") &&
str_eq(ENGINES[4]->presets[3].name, "SAX"));
bad += check("SAMPLE factory browsing: PIANO .. SAX, (phase 9) PERC's slot a hidden PIANO, the variations after",
ENGINES[4]->npresets == 10u && str_eq(ENGINES[4]->presets[0].name, "PIANO") &&
str_eq(ENGINES[4]->presets[3].name, "SAX") && str_eq(ENGINES[4]->presets[4].name, "PIANO") &&
str_eq(ENGINES[4]->presets[5].name, "LOFI PIANO") && preset_shown(4) == 8u &&
preset_orig(ENGINES[4], SMP_SET_PERC) == 0u && preset_orig(ENGINES[4], 5u) == 5u);
{ /* TRANH (SET 1, preset 1) is gone: both are PIANO aliases, kept for old data, never offered */
const param_desc_t *sd = &ENGINES[4]->edit[0];
uint32_t all, pos, k, e, pos0, shown = 0;
@@ -462,7 +465,7 @@ static int test_sound_loads(void)
apply_preset_to(TSEL, 1);
bad += check("SAMPLE: old SET 1 / preset 1 (TRANH) play PIANO; browsing and knobs skip them",
SMP_SETS[1].z0 == SMP_SETS[0].z0 && SMP_SETS[1].nz == SMP_SETS[0].nz && pos == pos0 &&
shown == 3u && e == 4u && k == 2u && TSEL->preset == 0u && TSEL->p[P_E0] == 0 &&
shown == 8u && e == 4u && k == 2u && TSEL->preset == 0u && TSEL->p[P_E0] == 0 &&
str_eq(sd->names[1], "PIANO") && enum_step(sd, 0, 1) == 2 && enum_step(sd, 2, 1) == 0 &&
enum_step(sd, 1, 2) == 2 && enum_orig(sd, 1) == 0 && enum_orig(sd, 5) == 5 &&
enum_orig(&ENGINES[8]->edit[0], 1) == 0);
@@ -533,7 +536,7 @@ static int test_sound_loads(void)
for (uint32_t st = 0; st < NSTEP; st++) memcpy(&legacy.t[ti].step[st], &decoded.t[ti].step[st], sizeof(step10_t));
}
legacy.t[3].engine = 0;
legacy.g[G_DRLVL] = 71; legacy.g[G_DRREV] = 43;
legacy.g[G_CMODE] = 71; legacy.g[G_CFDBK] = 43; /* (the drum level and reverb send then: G_DRLVL / G_DRREV) */
legacy.g[G_RTYPE] = 10; /* (id 24 was the GM drum part's MIDI channel: 10) */
legacy.sum = proj_hash(&legacy, offsetof(project_v6_t, sum));
memcpy(&proj_slot[1], &legacy, sizeof legacy);
@@ -972,6 +975,33 @@ static uint32_t lane_steps(const track_t *t, uint32_t l) /* bit i: lane l stri
return m;
}
/* (issue #3) HOME after SEQ's first page (STEP: the tiles; a drum track's grid): its footer as after any other page.
* The tiles' PRESETS: STEP and REC: WRITE were drawn under HOLD [HOME] SHIFT (draw_foot asked the page under HOME) */
static int test_home_footer(void)
{
static uint16_t ref[240 * 240];
uint32_t d, ok = 1;
for (d = 0; d < 2u; d++) { /* a melodic track, then a drum track (the report's) */
ui_power_on();
if (d) {
set_engine_of(&trk[0], ENGI_DRUM);
trk[0].engine = trk[0].eng_req;
}
open_family(FAM_ENV);
frame();
press(B_HOME);
frame();
memcpy(ref, host_screen, sizeof ref);
open_family(FAM_SEQ);
frame();
ok &= cur_page()->graph == GR_TILES && grid_on() == (int)d;
press(B_HOME);
frame();
ok &= ui.home && !memcmp(ref + foot_y() * 240, host_screen + foot_y() * 240, 240u * foot_h() * sizeof *ref);
}
return check("#3 HOME after SEQ's first page (the tiles, a drum grid): the footer as after any other page", ok);
}
static int test_grid(void)
{
int bad = 0;
@@ -1230,6 +1260,76 @@ static int test_favorites(void)
return bad;
}
/* (Skiff phase 9) PRESETS' LIST by type: KNOB 4 steps ALL, FAV, then the types (ui.c list_mode); a type lists that
* type's factory sounds of every engine (no user preset), the PRESETS knob browses them; it stops at FX; the type
* survives the settings' save and load; every factory sound the browser shows has a type */
static int test_preset_tags(void)
{
int bad = 0, ok = 1;
uint32_t total, all, k, e, i, r, engs = 0;
ui_power_on();
favorites.filter = 0;
ui_ptag = 0;
go_page(GR_BROWSE);
for (r = 0; r < NENG_SHOWN; r++)
for (e = eng_vis(r), k = 0; k < ENGINES[e]->npresets; k++)
ok &= preset_orig(ENGINES[e], k) != k ||
(ENGINES[e]->presets[k].tag > PT_NONE && ENGINES[e]->presets[k].tag < PT_N);
bad += check("every factory sound the browser shows has a type", ok);
{ /* (phase 9) and a name of its own: a type's list mixes the engines (two WINDs read as one sound twice); the
* retired DIGITAL of a FELUCCA_FM4 build keeps its names (PAD, MARIMBA: FM6's, PHYS's) */
const char *nm[256];
uint32_t n = 0, j;
for (r = 0, ok = 1; r < NENG_SHOWN; r++)
for (e = eng_vis(r), k = 0; k < ENGINES[e]->npresets; k++)
if (preset_orig(ENGINES[e], k) == k && n < 256u && !(FELUCCA_FM4 && e == ENGI_DIGITAL)) {
for (j = 0; j < n; j++)
if (str_eq(nm[j], ENGINES[e]->presets[k].name)) {
printf("ui: %s twice\n", nm[j]);
ok = 0;
}
nm[n++] = ENGINES[e]->presets[k].name;
}
bad += check(" every one its own name, across the engines", ok && n > 100u && n < 256u);
}
up_store(30, "Mine");
preset_pos(&all);
turn(EN_K4, 1);
turn(EN_K4, 1);
preset_pos(&total);
ok = list_mode() == 2u && ui_ptag == PT_BASS && !favorites.filter && total > 4u && total < all;
for (i = 0; i < total; i++) {
e = preset_at(i, &k);
ok &= e < NENGINES && ENGINES[e]->presets[k].tag == PT_BASS;
engs |= e < NENGINES ? 1u << e : 0u;
}
bad += check("LIST BASS: the factory basses only (several engines, no user preset)", ok && (engs & (engs - 1u)));
for (i = 0, ok = 1; i < total; i++) {
turn(EN_PRESET, 1);
ok &= !TSEL->user && ENGINES[TSEL->eng_req]->presets[TSEL->preset].tag == PT_BASS;
}
bad += check("the PRESETS knob browses the basses, every one in turn", ok);
for (i = 0; i < 10u; i++)
turn(EN_K4, 1);
bad += check("LIST stops at its last type, FX", list_mode() == PT_N && ui_ptag == PT_FX && !favorites.filter);
{
persist_t p;
settings_export(&p);
ui_ptag = 0;
settings_import(&p, (int)sizeof p);
bad += check("the LIST type survives the settings' save and load", ui_ptag == PT_FX);
p.favorites.factory[15][21] = 0x7F;
settings_import(&p, (int)sizeof p);
bad += check("an unknown stored type reads as none (LIST ALL)", !ui_ptag && !list_mode());
}
for (i = 0; i < 12u; i++)
turn(EN_K4, -1);
preset_pos(&total);
bad += check("LIST ALL again: the whole list", !list_mode() && total == all);
up_put(30, 0);
return bad;
}
static int test_display_preferences(void)
{
int bad = 0, k;
@@ -1992,7 +2092,7 @@ static int test_layer(void)
bad += check("FX tap: nothing on press, the FX page when let go", ok && !ui.home && cur_page()->fam == FAM_FX);
frames(320); /* (not a double tap: #83) */
press(B_FX);
bad += check(" a second tap: the next page of the family (SLICER)", str_eq(cur_page()->title, "SLICER"));
bad += check(" a second tap: the next page of the family ((phase 9) DRIVE)", str_eq(cur_page()->title, "DRIVE"));
ui_power_on();
btn_down(B_FX);
for (flash = 0, i = 0; i < 22u; i++) { frame(); flash |= ui.layer; } /* 0.35 s */
@@ -2099,7 +2199,7 @@ static int test_layer(void)
key_up(white(0)); key_up(white(4)); frame();
bad += check("FX let go first: the key holds its effect and the map; a new key is a note", ok && !ui.layer && !perf_held);
/* OCT UP (G4) and OCT DN (A4), the 9th and 10th white keys: held effects, silent; KNOB 4 the shimmer while
* held, back to 0 with FX; B4 on does nothing */
* held, back to 0 with FX; ((Skiff phase 9) B4 GATE .. E5 VINYL) F5 on does nothing */
ui_power_on();
usb.config = 1; mo = mo_w;
btn_down(B_FX); key_down(white(8)); frame();
@@ -2110,9 +2210,13 @@ static int test_layer(void)
key_up(white(8)); key_down(white(9)); frame();
ok &= perf_held == PF_BIT(PF_ODN) && !gates() && mo_w == mo;
key_up(white(9)); key_down(white(10)); frame();
ok &= !perf_held && (kb_layer >> white(10)) & 1u && !gates();
key_up(white(10)); btn_up(B_FX); frame();
bad += check("FX + G4 / A4: OCT UP / OCT DN held, silent, no MIDI; KNOB 4 turns; B4 nothing; FX let go: K4 back to 0",
ok &= perf_held == PF_BIT(PF_GATE) && !gates() && mo_w == mo;
key_up(white(10)); key_down(white(13)); frame();
ok &= perf_held == PF_BIT(PF_VIN) && !gates() && mo_w == mo;
key_up(white(13)); key_down(white(14)); frame();
ok &= !perf_held && (kb_layer >> white(14)) & 1u && !gates();
key_up(white(14)); btn_up(B_FX); frame();
bad += check("FX + G4 / A4: OCT UP / DN held, silent, no MIDI; K4 turns; B4 GATE, E5 VINYL; F5 nothing; FX let go: K4 0",
ok && !perf_held && !ui.layer && !perf_k[3] && mo_w == mo);
/* REVERB > TYPE ((U3, N4) GLO's family, global): ROOM / SPRING on KNOB 1, kept by a project */
ui_power_on();
@@ -2122,18 +2226,22 @@ static int test_layer(void)
turn(EN_K1, 1);
ok &= song.g[G_RTYPE] == 1 && str_eq(GP[G_RTYPE].names[song.g[G_RTYPE]], "SPRING");
turn(EN_K1, 5);
ok &= song.g[G_RTYPE] == 2 && str_eq(GP[G_RTYPE].names[song.g[G_RTYPE]], "HALL"); /* ((phase 9) the last) */
turn(EN_K1, -1);
ok &= song.g[G_RTYPE] == 1;
song.playing = 0;
project_save(2);
turn(EN_K1, -1);
ok &= song.g[G_RTYPE] == 0;
project_load(2);
bad += check("REVERB page: TYPE ROOM -> SPRING on KNOB 1 (SIZE, DAMP beside it); a project keeps SPRING",
bad += check("REVERB page: TYPE ROOM -> SPRING -> HALL on KNOB 1 (SIZE, DAMP beside it); a project keeps SPRING",
ok && song.g[G_RTYPE] == 1);
go_title("CHORUS");
bad += check(" CHORUS page (GLO's): RATE DEPTH (U3: were CRT CDP)", cur_page()->fam == FAM_GLO && cur_page()->id[0] == G_CRATE &&
cur_page()->id[1] == G_CDEPTH && cur_page()->id[2] == 0xFFu && str_eq(GP[G_CRATE].label, "RATE") &&
str_eq(GP[G_CDEPTH].label, "DEPTH"));
bad += check(" CHORUS page (GLO's): RATE DEPTH (U3: were CRT CDP), (phase 9) MODE FEEDBACK",
cur_page()->fam == FAM_GLO && cur_page()->id[0] == G_CRATE && cur_page()->id[1] == G_CDEPTH &&
cur_page()->id[2] == G_CMODE && cur_page()->id[3] == G_CFDBK && str_eq(GP[G_CRATE].label, "RATE") &&
str_eq(GP[G_CDEPTH].label, "DEPTH") && str_eq(GP[G_CMODE].label, "MODE") &&
str_eq(GP[G_CFDBK].label, "FEEDBACK"));
/* chording: a key held before FX stays a note, its note-off arrives */
ui_power_on();
mo = mo_w;
@@ -2234,9 +2342,9 @@ static int test_layer(void)
a = leds_at(0); b2 = leds_at(250);
k = white(1);
ok = ((a >> k) & 1u) && ((b2 >> k) & 1u); /* held: lit */
for (i = 0; i < 10u; i++) /* the other effects (F3 .. A4): breathe */
for (i = 0; i < 14u; i++) /* the other effects (F3 .. E5): breathe */
ok &= i == 1u || ((a ^ b2) >> white(i)) & 1u;
for (i = 10; i < 16u; i++) /* B4 .. G5: no effect, dark */
for (i = 14; i < 16u; i++) /* F5, G5: no effect, dark */
ok &= !((a | b2) >> white(i) & 1u);
ok &= ((a ^ b2) >> key_at(1, 0)) & 1u && !((a | b2) >> key_at(1, NTRK) & 1u); /* a mute breathes, a spare black dark */
song.g[G_BPM] = 72;
@@ -2246,7 +2354,7 @@ static int test_layer(void)
song.g[G_BPM] = 120;
}
key_up(white(1)); btn_up(B_FX); frame();
bad += check("map LEDs: held lit, the 10 effects breathe, B4 .. G5 and a too-long REPEAT dark", ok);
bad += check("map LEDs: held lit, the 14 effects breathe, F5 G5 and a too-long REPEAT dark", ok);
usb.config = 0;
return bad;
}
@@ -2715,6 +2823,39 @@ static int test_edit_cycle(void)
press(B_OCTUP);
bad += check("INIT on DRUM: the DRUM-X kit stays, the dialog plain", ok && !memcmp(dx_kit, edited, sizeof edited));
}
{ /* (Skiff phase 9) a DRUM-X preset loads its kit as the project's (eng_drumx.c DRUMX_PKIT): a switch to DRUM-X
* (its first preset) and HADRON KIT keep the kit; one undo copy holds the kit across a browse; a kit edited
* between two loads gets a copy of its own (ui.c track_sig hashes it) */
static dx_lane_t edited[DV_NLANE];
uint32_t k;
set_engine_of(TSEL, ENGI_DRUM); go_home(); frame();
undo_clear(); /* (no copy of the INIT tests before: this browse's own) */
dx_kit[DV_KICK].a[DXP_DECAY] = 9;
memcpy(edited, dx_kit, sizeof edited);
set_engine_of(TSEL, ENGI_DRUMX); frame();
ok = !memcmp(dx_kit, edited, sizeof edited) && TSEL->preset == 0u;
apply_preset(1u); frame();
bad += check("phase 9: a switch to DRUM-X (DRUM KIT) and HADRON KIT keep the project's kit",
ok && !memcmp(dx_kit, edited, sizeof edited));
ok = DRUMX_PKIT[2] == 1u && !memcmp(DX_KITS[0], DX_KIT_DEF, sizeof dx_kit);
for (k = 2; k < ENGINES[ENGI_DRUMX]->npresets; k++) {
apply_preset(k); frame();
ok &= DRUMX_PKIT[k] && !memcmp(dx_kit, DX_KITS[DRUMX_PKIT[k] - 1u], sizeof dx_kit) && dx_kit_ok(dx_kit);
}
bad += check("phase 9: every kit preset loads its own kit, FACTORY KIT the factory's", ok);
hold(B_SAVE);
bad += check("phase 9: SAVE held after the browse: the kit (and DRUM) as before it, one undo copy",
!memcmp(dx_kit, edited, sizeof edited) && TSEL->eng_req == ENGI_DRUM);
set_engine_of(TSEL, ENGI_DRUMX); frame();
apply_preset(3u); frame(); /* DEEP KIT */
dx_kit[DV_SNARE].a[DXP_PITCH] = 77; /* (an edit on EDIT > SOUND) */
memcpy(edited, dx_kit, sizeof edited);
apply_preset(4u); frame(); /* CLICK KIT */
hold(B_SAVE);
bad += check("phase 9: a kit edited after a load: the next load takes a copy of its own (SAVE held: the edit)",
!memcmp(dx_kit, edited, sizeof edited) && TSEL->eng_req == ENGI_DRUMX && TSEL->preset == 3u);
set_engine_of(TSEL, ENGI_DRUM); go_home(); frame();
}
memcpy(dx_kit, keep, sizeof keep);
}
go_title("OP2 ENV"); ui.fam_last[FAM_EDIT] = ui.page;
@@ -6653,8 +6794,8 @@ static int test_u4(void)
ok = str_eq(page_head(), "OSC") && str_eq(ti, "1/4");
go_title("ENV"); frame();
page_pos(ti);
bad += check("U4 L5: the header names the page (EDIT 1 on ANALOG: OSC), the footer only where (1/4, ENV 1/2)",
ok && str_eq(page_head(), "ENV") && str_eq(ti, "1/2"));
bad += check("U4 L5: the header names the page (EDIT 1 on ANALOG: OSC), the footer only where (1/4, ENV 1/3)",
ok && str_eq(page_head(), "ENV") && str_eq(ti, "1/3")); /* ((phase 9) ENV ENV DEST ENV 2) */
}
ui_power_on(); /* F7: no silent dead ends */
ui_prefs |= PREF_BPM_LOCK; /* (SELECT: the pages) */
@@ -6703,7 +6844,7 @@ static int test_u4(void)
static int test_u5(void)
{
static const char *const T[] = {"ENV DEST", "LFO DEST", "VOICE", "VOICE 2", "EDIT 1", "EDIT 2", "DELAY", "REVERB",
"CHORUS", "GLOBAL", "ARP", "ARP 2"};
"CHORUS", "GLOBAL", "ARP", "ARP 2", "ENV 2", "DRIVE"};
int bad = 0, ok = 1;
uint32_t i, h;
smap_t m[12];
@@ -6859,6 +7000,11 @@ static int test_u3(void)
turn(EN_K1, 3);
bad += check("U3 R6: LANES: KNOB 1 the lane (the grid's too); a held step's KNOB 2 locks that lane's level",
ui.lane == 3u && lock_id(1) == P_LN0 + 3u && lock_id(0) == 0xFFu);
turn(EN_K3, 5); /* ((Skiff phase 9) KNOB 3 4: the lane's TUNE, DECAY) */
turn(EN_K4, -7);
bad += check(" (phase 9) KNOB 3 TUNE, KNOB 4 DECAY: that lane's, the others untouched; a held step's locks them",
TSEL->p[P_LTUNE0 + 3u] == 69 && TSEL->p[P_LDECAY0 + 3u] == -7 && TSEL->p[P_LTUNE0 + 2u] == 64 &&
!TSEL->p[P_LDECAY0 + 4u] && lock_id(2) == P_LTUNE0 + 3u && lock_id(3) == P_LDECAY0 + 3u);
ui_power_on(); /* A2: the project in the header, changed since */
ok = !project_mark();
project_save(2);
@@ -6955,22 +7101,25 @@ static int test_select_pages(void)
turn(EN_SELECT, 1);
ok = str_eq(cur_page()->title, "ENV DEST");
turn(EN_SELECT, 1);
ok &= str_eq(cur_page()->title, "ENV DEST"); /* (the last: no wrap) */
turn(EN_SELECT, -1);
ok &= str_eq(cur_page()->title, "ENV 2"); /* ((Skiff phase 9) ENV 2) */
turn(EN_SELECT, 1);
ok &= str_eq(cur_page()->title, "ENV 2"); /* (the last: no wrap) */
turn(EN_SELECT, -2);
ok &= str_eq(cur_page()->title, "ENV");
turn(EN_SELECT, -1);
ok &= str_eq(cur_page()->title, "ENV") && song.g[G_BPM] == b0 && !ui.msg_t;
bad += check("SELECT: ENV DEST, back to ENV, the ends where they are (no wrap), no tempo, no message", ok);
go_title("FX"); frame();
turn(EN_SELECT, 2);
ok = str_eq(cur_page()->title, "DUCK"); /* ((U3) FX SLICER DUCK: the buses are GLO's) */
turn(EN_SELECT, 3);
ok = str_eq(cur_page()->title, "DUCK"); /* ((U3) FX (phase 9: DRIVE) SLICER DUCK: the buses
* are GLO's) */
press(B_FX);
ok &= str_eq(cur_page()->title, "FX"); /* (FX's button steps on from there: round) */
turn(EN_SELECT, 2);
turn(EN_SELECT, 3);
ok &= str_eq(cur_page()->title, "DUCK");
turn(EN_SELECT, -3);
turn(EN_SELECT, -4);
ok &= str_eq(cur_page()->title, "FX");
bad += check("SELECT: two FX pages on (DUCK), the FX button round (FX), SELECT on and three back (FX)", ok);
bad += check("SELECT: three FX pages on (DUCK), the FX button round (FX), SELECT on and four back (FX)", ok);
press(B_GLO);
ok = cur_page()->fam == FAM_TRK; /* (MIXER) */
turn(EN_SELECT, 1);
@@ -7584,6 +7733,32 @@ static int test_song_page(void)
return bad;
}
/* (Skiff phase 9) FX > DRIVE after FX: KNOB 2 its TYPE, KNOB 3 its TONE; ENV 2 after ENV DEST, hidden where ENV is
* (DRUM's one-shots, FM6's own envelopes) */
static int test_p9_pages(void)
{
int bad = 0, ok;
uint32_t i, e2 = NPAGES;
ui_power_on();
go_title("DRIVE"); frame();
ok = cur_page()->fam == FAM_FX && cur_page()->id[0] == P_DIST && cur_page()->id[1] == P_DTYPE &&
cur_page()->id[2] == P_DTONE && str_eq(PAGES[ui.page - 1u].title, "FX");
turn(EN_K2, 2);
turn(EN_K3, -5);
bad += check("(phase 9) FX > DRIVE after FX: KNOB 2 TYPE (FOLD after two), KNOB 3 TONE",
ok && TSEL->p[P_DTYPE] == 2 && TSEL->p[P_DTONE] == -5);
for (i = 0; i < NPAGES; i++)
if (str_eq(PAGES[i].title, "ENV 2"))
e2 = i;
ok = e2 < NPAGES && str_eq(PAGES[e2 - 1u].title, "ENV DEST") && PAGES[e2].graph == GR_ADSR && page_visible(e2);
set_engine_of(TSEL, ENGI_DRUM);
ok &= !page_visible(e2);
set_engine_of(TSEL, ENGI_FM6);
ok &= !page_visible(e2);
bad += check(" ENV 2 after ENV DEST (its ADSR), hidden where ENV is (DRUM, FM6)", ok);
return bad;
}
/* Skiff: FX > DUCK (duck.c; the sound itself: tests/duck_test.c): after SLICER; KNOB 1 BY steps over the track itself
* (T2: OFF T1 T3 T4; T4: up to T3; T1: down to OFF), KNOB 2 DEPTH, KNOB 3 REL; a sound load keeps all three (the mix's);
* DEPTH and REL can be automation, BY not (routing) */
@@ -7777,8 +7952,10 @@ int main(void)
bad += test_actions();
bad += test_tracks();
bad += test_grid();
bad += test_home_footer();
bad += test_screen();
bad += test_favorites();
bad += test_preset_tags();
bad += test_display_preferences();
bad += test_menu_tabs();
bad += test_information();
@@ -7802,6 +7979,7 @@ int main(void)
bad += test_scenes(); /* Skiff: scenes (the PERFORM layer's KEYS SCENE) */
bad += test_song_page(); /* Skiff phase 5: SEQ > SONG */
bad += test_duck_page(); /* Skiff: FX > DUCK */
bad += test_p9_pages(); /* (Skiff phase 9) FX > DRIVE, ENV 2 */
bad += test_six_tracks(); /* Skiff phase 6: six tracks on the layers */
bad += test_div_order();
bad += test_knob_accel();
+2 -2
View File
@@ -280,8 +280,8 @@ int main(void)
r.p[i] = (int16_t)(2000 + i);
up_params(&r, v, def);
ok = P_SLCR == 45 && P_SLDEPTH + 1 == P_M1SRC && P_M4AMT + 1 == P_FM1_ATK && P_FM4_LEVEL + 1 == P_CHRD &&
P_VOIC + 1 == P_LN0 && P_LN7 + 1 == P_DIR && P_DKREL + 1 == P_E0 && P_E0 == 95 && P_COUNT == 103; /* ((Skiff) DIR,
* the ducking) */
P_VOIC + 1 == P_LN0 && P_LN7 + 1 == P_DIR && P_DKREL + 1 == P_DTYPE && P_LDECAY7 + 1 == P_E0 &&
P_E0 == 117 && P_COUNT == 125; /* ((Skiff) DIR, the ducking; phase 9: DRIVE, ENV 2, the lanes) */
for (i = 0; i < 45u; i++)
ok &= v[i] == (int16_t)(2000 + i);
for (i = P_SLCR; i < P_E0; i++)
Regular → Executable
+2 -1
View File
@@ -7,7 +7,7 @@
Outputs in build/: felucca.bin (app), loader/ota.bin (update loader),
felucca.fwsc (package). A release build (--release X.Y) writes skiff-X.Y.fwsc and a folder
release-X.Y/ with the package, the app, SHA256SUMS, the sample attribution and the licence files.
release-X.Y/ with the package, the app, SHA256SUMS, the samples' attributions and the licence files.
See BUILDING.md for the toolchain and the SDK.
The JieLi toolchain is Linux x86-64 only. JIELI_TOOLCHAIN points at it; on
@@ -382,6 +382,7 @@ def main():
shutil.copy(SRC / doc, rel / doc)
if att.exists():
shutil.copy(att, rel / "ATTRIBUTION.txt")
shutil.copy(SRC / "assets" / "breaks" / "ATTRIBUTION.txt", rel / "ATTRIBUTION-BREAKS.txt") # (Skiff phase 9)
print(f"release {rel}/")
return 0
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
+4 -1
View File
@@ -88,6 +88,8 @@ EXTRA = {
# OCT UP / OCT DN (the harmonizer): stand-ins until Fukiai has a pitch-shift glyph;
# the first of each tuple the font has
"x_oct_up": ("symbol_pitch_up", "control_arrow_up"), "x_oct_dn": ("symbol_pitch_down", "control_arrow_down"),
# (Skiff phase 9) GATE, DUB, FLANGE, VINYL: a pulse (the chop), echoes trailing off, a comb, a record
"x_chop": "waveform_pulse_half", "x_dub": "symbol_echo_oval", "x_flange": "function_filter_comb", "x_vinyl": "symbol_disc",
# a missing sample (the header message, the SLICES page): SAMPLE NOT FOUND
"x_nofile": "symbol_document_disabled",
# the MENU's tabs (ui_menu.c, 1.0.5): DISPLAY (CONTROL x_knob, AUDIO x_speaker, SYSTEM x_cog)
@@ -114,7 +116,8 @@ NOT_DRAWN = ["tape"]
# the 24 px set: the header battery (Fukiai's battery is a wide, short glyph: at 16 px its body was 12 x 6)
# and the FX map's effect cells (ui_layer.c layer_fx: the icon alone, no name)
HUGE_DEFAULT = ["x_bat0", "x_bat1", "x_bat3", "x_bat4", "x_bat_chg", "x_usb", # (+ the USB-C plug: as flat)
"x_repeat", "x_reverse", "cutoff", "x_hpf", "x_tstop", "x_freeze", "x_oct_up", "x_oct_dn"]
"x_repeat", "x_reverse", "cutoff", "x_hpf", "x_tstop", "x_freeze", "x_oct_up", "x_oct_dn",
"x_chop", "x_dub", "x_flange", "x_vinyl"]
# the 16 px set: header, footer, dialogs and menu rows (everything else only exists at 12 px)
# (1.0.5: the MENU rows lost their icons, the tabs carry them)
+8 -3
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0-only
"""The README's pictures from the firmware's own screen renders (tests/ui_render.c: build/ui_new/ppm), pixel for pixel
at twice their size: docs/img/<screen>.png, docs/img/themes.png (HOME in every THEME, 3 x 2) and docs/img/fm6_themes.png (FM6's
OPERATOR in CRYPT, NEON and QUARK).
at twice their size: docs/img/<screen>.png, docs/img/themes.png (HOME in every THEME, 3 x 2), docs/img/fm6_themes.png (FM6's
OPERATOR in CRYPT, NEON and QUARK) and docs/img/new_1_2.png (1.2's release: a type's list, DRIVE, the FX layer held).
tools/gen_readme_shots.py build/ui_new/ppm
"""
@@ -15,7 +15,8 @@ SHOTS = ["step_tiles", "roll_chords", "drum", "chance_flam", "auto_list", "layer
"song_playing", "pool", "layer_perform_scenes", "layer_glo_active",
"env", "lfo_dest", "dly", "reverb_spring", "global_swing", "voice_glide", "edit_analog", "edit_fm6",
"dx_sound", "slices_break", "edit_phys", "chord", "fx_duck", "menu", "splash",
"fm_op_tone", "fm_op_env", "fm_op_keys", "fm_all_lfo"]
"fm_op_tone", "fm_op_env", "fm_op_keys", "fm_all_lfo",
"presets_bass", "drive_fold", "env_2", "lanes_tune", "chorus_flanger", "six_fx", "perform_held"] # (phase 9)
THEMES = ["SKIFF", "HI-CON", "PAPER", "CRYPT", "NEON", "QUARK"]
@@ -33,6 +34,10 @@ def main(ppm):
for i, t in enumerate(["CRYPT", "NEON", "QUARK"]):
fm6.paste(big(f"{t}_fm_op_tone"), (i * (480 + gap), 0))
fm6.save(out / "fm6_themes.png", optimize=True)
new = Image.new("RGBA", (3 * 480 + 2 * 24, 480), (0, 0, 0, 0)) # (1.2) its release notes' picture
for i, s in enumerate(["SKIFF_presets_bass", "CRYPT_drive_fold", "NEON_perform_held"]):
new.paste(big(s), (i * (480 + gap), 0))
new.save(out / "new_1_2.png", optimize=True)
print(f"wrote {len(SHOTS)} screens and themes.png to {out}")
Regular → Executable
+92 -95
View File
@@ -21,12 +21,13 @@ Set 4 was PERC, the GM-mapped drum kit (Felucca's generated drums and CC0 hand p
loads as DRUM with its default kit (core.h drum_from_perc); what that cannot reach (GRAIN's
SRC, a value sent live) plays the alias, PIANO.
The SLICE engine's built-in BREAK (eng_slice.c) is rendered here: one bar of 16ths arranged
from Felucca's generated drums (tools/gen_waves.py, the Hügelton Sample Pack; no third-party
loop), stored after every set (their
offsets do not move) and NOT one of the SAMPLE sets (the SET list, its presets and the
USR1-3 numbers stay as they were). Its slice table (decoder states on a 128-point grid,
the hits as AUTO slices) is written with it: SLC_BREAK_INIT.
The SLICE engine's built-in loops (eng_slice.c) are encoded here from assets/breaks/ (Skiff phase 9:
made with the YuE2 music model, see ATTRIBUTION.txt there; before, BREAK was arranged from
Felucca's generated drums): BREAK, one bar at 120 BPM, and FUNK, two beats at 86.33 BPM. They
are stored after every set (their offsets do not move) and are NOT SAMPLE sets (the SET list,
its presets and the USR1-3 numbers stay as they were). Each one's slice table (decoder states
on a 128-point grid, AUTO slices where the firmware's own detector finds the hits) is written
with it: SLC_BREAK_INIT, SLC_FUNK_INIT.
SLICE's SRC PIANO (added in 1.0.4 after BREAK and USR1-3) is the PIANO set's middle C zone itself:
no data of its own, only its slice table (one AUTO slice, the note's attack): SLC_PIANO_INIT.
@@ -40,7 +41,6 @@ import hashlib
import math
import os
import re
import subprocess
import sys
from pathlib import Path
@@ -49,9 +49,9 @@ import sampleio as sio # noqa: E402
from sampleio import detect_hz, hz_to_midi, ima_encode, key_split, onset, peak, read_any_wav, resample # noqa: E402
SRC = Path(__file__).resolve().parents[1]
GENDIR = SRC / "build" / "genwav"
CACHE = SRC / "build" / "gen_samples.cache"
CC0 = SRC / "assets" / "samples-cc0"
BREAKS = SRC / "assets" / "breaks" # (Skiff phase 9) SLICE's BREAK and FUNK
TR = 22050 # stored sample rate
# CC0 library: set -> kind ("oneshot" decaying, "sus" looped sustain, "kit" one sample per key)
@@ -67,25 +67,20 @@ KIT_BASE = 53 # F3, the lowest FM-1 key
NOTE = {"C": 0, "C#": 1, "D": 2, "D#": 3, "E": 4, "F": 5, "F#": 6, "G": 7, "G#": 8, "A": 9, "A#": 10, "B": 11}
# the generated drums by role (from gen_waves.py's file names), for SLICE's BREAK
GM_ROLE_WORDS = [("bassdrum", "kick"), ("kick", "kick"), ("snare", "snare"), ("hihat", "chh"), ("chat", "chh"),
("ohat", "ohh"), ("clap", "clap"), ("tom lo", "tomlo"), ("tom hi", "tomhi"), ("tom", "tom"),
("rim", "rim"), ("cowbell", "cowbell"), ("tamb", "tamb"), ("shaker", "shaker"),
("conga", "conga"), ("claves", "claves"), ("wood", "wood"), ("crash", "crash"), ("ride", "ride")]
GM_KEEP = {"crash": 0.5, "ride": 0.5, "ohh": 0.5} # the cymbals cut to 0.5 s ...
GM_FADE = {"crash": 0.2, "ride": 0.2} # ... with a long raised-cosine fade (s); the others 30 ms linear
# SLICE's BREAK: (step, GM role, gain) on a bar of 16ths; the open hat is choked by the next hat
BREAK_BPM, BREAK_STEPS = 120, 16
BREAK_HITS = [(0, "kick", 1.0), (0, "chh", 0.55), (2, "kick", 0.7), (2, "chh", 0.4), (4, "snare", 1.0),
(4, "chh", 0.45), (6, "chh", 0.4), (7, "kick", 0.8), (8, "chh", 0.55), (9, "snare", 0.3),
(10, "kick", 0.9), (10, "ohh", 0.4), (12, "snare", 1.0), (12, "chh", 0.45), (14, "chh", 0.4),
(14, "snare", 0.35)]
BREAK_BPM, BREAK_STEPS = 120, 16 # SLICE's BREAK: one bar of 16ths (assets/breaks/break.wav)
SLC_PIANO_NOTE = 60 # SLICE's SRC PIANO: the PIANO zone of this root (middle C)
SLC_GRID, SLC_AUTO = 128, 32 # eng_slice.c slc_src_t
SLC_GRID, SLC_AUTO, SLC_HOP = 128, 32, 32 # eng_slice.c slc_src_t, its AUTO detector's hop
ENV = {"wave":(5, 80, 100, 50), "kit": (0, 127, 127, 60), "multi": (0, 85, 0, 75),
"oneshot": (0, 127, 127, 70), "sus": (12, 80, 120, 60)}
SET_TAG = {"PIANO": "PT_KEYS", "FLUTE": "PT_LEAD", "SAX": "PT_LEAD"} # (Skiff phase 9) core.h PT_*: PRESETS' LIST
SET_VARIANTS = [ # (Skiff phase 9) SAMPLE's presets after PERC's slot: (name, e, env, mono, fx, tag[, more]), apply9.py
("LOFI PIANO", [0, 0, 110, 1, 30, 0, 30, 0], [0, 127, 127, 70], 0, [40, 10, 20, 40], "PT_KEYS", [("P_DTYPE", 3), ("P_LRATE", 40), ("P_LD_PIT", 1)]),
("MUSIC BOX", [0, 24, 0, 0, 110, 0, 0, 0], [0, 90, 0, 80], 0, [0, 30, 40, 60], "PT_PLUCK"),
("FLUTE PAD", [2, 0, 0, 1, 90, 0, 0, 0], [80, 90, 120, 100], 0, [0, 60, 25, 90], "PT_PAD"),
("DARK SAX", [3, -12, 0, 1, 26, 0, 48, 0], [22, 80, 120, 55], 1, [0, 15, 20, 60], "PT_LEAD", [("P_LD_PIT", 1), ("P_LRATE", 84), ("P_LFADE", 100)]),
("KOTO", [0, 12, 0, 0, 120, 0, 22, 0], [0, 72, 0, 50], 0, [0, 0, 25, 30], "PT_PLUCK", [("P_ED_PIT", 2)]),
]
# PIANO's notes cut to 0.75 s (saves flash), faded out over the last SET_FADE s
SET_KEEP = {"PIANO": 0.75}
@@ -168,48 +163,12 @@ def cc0_entries(setname, kind):
return out
def gm_role(name):
n = name.lower()
return next((r for w, r in GM_ROLE_WORDS if w in n), None)
def gm_kit_sources():
"""role -> wav path: Felucca's own synthesized drums (generated by gen_waves.py)"""
src = {}
for p in sorted(GENDIR.glob("D *.wav")):
r = gm_role(p.stem)
if r and r not in src:
src[r] = p
return src
def gm_kit_entry(role, path):
sr, x = wav(path)
x = resample(x[max(0, onset(x) - 16):], sr, TR)
x = x[:int(GM_KEEP.get(role, 0.45) * TR)]
pk = peak(x)
end = len(x) # drop the silent tail
while end > 64 and abs(x[end - 1]) < 0.004 * pk:
end -= 1
x = x[:end]
if role in GM_FADE:
cos_fade(x, min(len(x) // 2, int(GM_FADE[role] * TR)))
else:
fade = min(len(x) // 4, int(0.03 * TR))
for i in range(fade):
x[len(x) - fade + i] *= 1 - i / fade
return [int(v * 30000 / pk) for v in x]
def ima_states(data, positions):
"""IMA ADPCM decoder state before sample p for each p (ascending), packed as eng_slice.c reads it:
(predictor & 0xFFFF) | index << 16 (segment 0)"""
pred, idx, out, want = 0, 0, [], list(positions)
for n in range(max(want) + 1 if want else 0):
while want and want[0] == n:
out.append((pred & 0xFFFF) | idx << 16)
want.pop(0)
code = (data[n >> 1] >> (4 * (n & 1))) & 15
def ima_steps(data, n):
"""an IMA ADPCM decoder (from predictor 0 / index 0, as eng_slice.c's) over n samples of data: its
(predictor, index) before each sample, and after the last; a predictor after a sample is that sample"""
pred, idx, out = 0, 0, [(0, 0)]
for k in range(n):
code = (data[k >> 1] >> (4 * (k & 1))) & 15
step = sio.IMA_STEP[idx]
vd = step >> 3
if code & 4:
@@ -220,25 +179,40 @@ def ima_states(data, positions):
vd += step >> 2
pred = max(-32768, min(32767, pred - vd if code & 8 else pred + vd))
idx = max(0, min(88, idx + sio.IMA_IDX[code & 7]))
out.append((pred, idx))
return out
def break_loop():
"""SLICE's BREAK: BREAK_HITS from Felucca's generated drums at TR -> (int16 samples, hit positions)"""
src = gm_kit_sources() # generated sounds only: the same on every build
n = int(round(TR * 60 / BREAK_BPM * 4))
x = [0.0] * n
pos = [s * n // BREAK_STEPS for s in range(BREAK_STEPS + 1)]
for step, role, gain in BREAK_HITS:
smp = gm_kit_entry(role, src[role])
if role == "ohh": # choked by the next hat
nxt = min([s for s, r, _ in BREAK_HITS if r in ("chh", "ohh") and s > step] or [BREAK_STEPS])
keep, fade = pos[nxt] - pos[step], int(0.004 * TR)
smp = [v * min(1.0, (keep - i) / fade) for i, v in enumerate(smp[:keep])]
for i, v in enumerate(smp): # the tails wrap round: a seamless loop
x[(pos[step] + i) % n] += v * gain
pk = peak(x)
return [int(v * 30000 / pk) for v in x], sorted({pos[s] for s, _, _ in BREAK_HITS})
def ima_states(data, positions):
"""IMA ADPCM decoder state before sample p for each p, packed as eng_slice.c reads it:
(predictor & 0xFFFF) | index << 16 (segment 0)"""
st = ima_steps(data, max(positions, default=0))
return [(st[p][0] & 0xFFFF) | st[p][1] << 16 for p in positions]
def slc_onsets(x):
"""eng_slice.c slc_scan's AUTO slices of decoded samples x at TR, in the same integer steps (so the table
written here is what the firmware finds): per hop of SLC_HOP the peak of the first difference and the
plain peak; an onset is a hop where either rises 1.75x over its follower, above 1/12 (1/8) of its largest
value, at least 50 ms after the last one; the slice starts one hop before the hop that rose"""
gap = ((int(round(TR / 44100 * 65536)) >> 4) * 44100 >> 12) // 20
prev = pkd = pkr = 0
for v in x:
pkd, pkr, prev = max(pkd, abs(v - prev)), max(pkr, abs(v)), v
thd, thr = pkd // 12, pkr // 8
out, prev, envd, envr, last, h0 = [0], 0, 0, 0, 0, 0
for hs in range(0, len(x), SLC_HOP):
hd = hr = 0
for v in x[hs:hs + SLC_HOP]:
hd, hr, prev = max(hd, abs(v - prev)), max(hr, abs(v)), v
if hs and ((hd > thd and hd * 4 > envd * 7) or (hr > thr and hr * 4 > envr * 7)) and h0 >= last + gap \
and len(out) < SLC_AUTO:
out.append(h0)
last = h0
envd = hd if hd > envd else envd - envd // 16
envr = hr if hr > envr else envr - envr // 64
h0 = hs
return out
class Builder:
@@ -246,17 +220,22 @@ class Builder:
self.zones, self.sets, self.blob, self.kinds = [], [], bytearray(), {}
self.alias = {} # set index -> the set index it aliases
self.brk = None
self.fnk = None
self.pno = None
def slice_break(self):
"""SLICE's BREAK, after every set; its slice table: decoder states at k * len / SLC_GRID, the hits"""
x, hits = break_loop()
def slice_loop(self, name):
"""a built-in SLICE loop (assets/breaks/NAME.wav), after every set; its slice table: decoder states at
k * len / SLC_GRID, the AUTO slices slc_scan finds (eng_slice.c, which scans a user slot at boot)"""
sr, x = read_any_wav(BREAKS / f"{name}.wav")
x = resample(x, sr, TR)
pk = peak(x)
x = [int(v * 30000 / pk) for v in x]
off, _ = self.add(x, 0)
n = len(x)
data = self.blob[off:off + (n + 1) // 2]
grid = ima_states(data, [k * n // SLC_GRID for k in range(SLC_GRID)])
hits = hits[:SLC_AUTO]
self.brk = dict(off=off, n=n, grid=grid, apos=hits, ast=ima_states(data, hits))
hits = slc_onsets([p for p, _ in ima_steps(data, n)[1:]])
return dict(off=off, n=n, grid=grid, apos=hits, ast=ima_states(data, hits))
def slice_piano(self):
"""SLICE's PIANO: the PIANO set's SLC_PIANO_NOTE zone (its data, no copy); its slice table: decoder states
@@ -337,26 +316,37 @@ class Builder:
L.append(f"#define SMP_NSETS {max(1, len(sets))}")
named = sets or [("NONE", 0, 0)]
perc = PERC_SLOT if len(named) > PERC_SLOT else len(named)
L.append(f"#define SMP_NPRESETS {perc}")
# (Skiff phase 9) the variations follow PERC's slot, only with the CC0 sets their SET values name (PERC's
# alias then is a preset among them, hidden as the other alias)
var = SET_VARIANTS if len(named) == PERC_SLOT + 1 else []
npre = len(named) + len(var) if var else perc
L.append(f"#define SMP_NPRESETS {npre}")
if len(named) > PERC_SLOT:
L.append(f"#define SMP_PERC_SLOT {PERC_SLOT} /* once PERC (the GM kit): an alias, its sounds load as DRUM */")
L.append("/* the initializers from SMP_NPRESETS on (the retired PERC's alias) are outside factory browsing */")
L.append("/* a preset per set (an alias: its original's, hidden by its name; PERC's past SMP_NPRESETS unless")
L.append(" * variations follow, ui.c apply_preset_to loads it as DRUM), (Skiff phase 9) then the variations */")
L.append("static const preset_t SMP_PRESET_TABLE[] = {")
for i, (name, _, _) in enumerate(named):
k = self.kinds.get(name, "wave")
a, d, s_, r = ENV[k]
loop = 0 if k == "kit" else 1
si = self.alias.get(i, i) # an alias: the original's preset (hidden by its name)
L.append(f' {{"{name}", {{{si}, 0, 0, {loop}, 127, 0, 0, 0}}, {{{a}, {d}, {s_}, {r}}}, 0, 0}},')
L.append(f' {{"{name}", {{{si}, 0, 0, {loop}, 127, 0, 0, 0}}, {{{a}, {d}, {s_}, {r}}}, 0, 0, '
f'TAG({SET_TAG.get(name, "PT_NONE")})}},')
for name, e, env, mono, fx, tag, *more in var: # (more: [(id, value)], as the engines' MORE)
mo = ", ".join(f"{{{i}, {v}}}" for i, v in more[0]) if more else ""
L.append(f' {{"{name}", {{{", ".join(map(str, e))}}}, {{{", ".join(map(str, env))}}}, 0, {mono}, '
f'FX({", ".join(map(str, fx))}), ' + (f"MORE({mo}), " if mo else "") + f'TAG({tag})}},')
L.append("};")
orig = [self.alias.get(i, i) for i in range(len(named))]
L.append("/* SET i plays SMP_SET_ORIG[i]: != i for a retired set kept as an alias (its preset i too) */")
L.append("static const uint8_t SMP_SET_ORIG[] = {" + ", ".join(map(str, orig)) + "};")
L.append(f"#define SMP_NALIAS {sum(1 for i, o in enumerate(orig) if o != i and i < perc)} /* among the presets */")
L.append(f"#define SMP_NALIAS {sum(1 for i, o in enumerate(orig) if o != i and i < npre)} /* among the presets */")
names = ", ".join(f'"{n}"' for n, _, _ in named)
L.append("#define SMP_SET_NAMES_INIT " + names)
L.append("static const char *const SMP_SET_NAMES[] = {" + names + "};")
L += self.break_header()
L += self.funk_header()
L += self.piano_header()
return "\n".join(L) + "\n"
@@ -381,6 +371,13 @@ class Builder:
f"#define SLC_BREAK_BPM {BREAK_BPM}", f"#define SLC_BREAK_STEPS {BREAK_STEPS}"] + \
self.slc_init("SLC_BREAK_INIT", b)
def funk_header(self):
"""SLC_FUNK_INIT: SLICE's FUNK (Skiff phase 9; {0}: none)"""
b = self.fnk
if not b:
return ["#define SLC_FUNK_INIT {0}"]
return ["", f"/* SLICE's FUNK: two beats at 86.33 BPM, {len(b['apos'])} hits */"] + self.slc_init("SLC_FUNK_INIT", b)
def piano_header(self):
"""SLC_PIANO_INIT: SLICE's PIANO, the PIANO zone of middle C ({0}: none, no CC0 library)"""
b = self.pno
@@ -390,7 +387,7 @@ class Builder:
f"#define SLC_PIANO_NOTE {SLC_PIANO_NOTE}"] + self.slc_init("SLC_PIANO_INIT", b)
def summary(self):
brk = f", SLICE BREAK {self.brk['n']} samples" if self.brk else ""
brk = f", SLICE BREAK {self.brk['n']} + FUNK {self.fnk['n']} samples" if self.brk else ""
brk += f", SLICE PIANO (shared) {self.pno['n']} samples" if self.pno else ""
return f"samples: {len(self.sets)} sets, {len(self.zones)} zones, {len(self.blob)} B ADPCM{brk}"
@@ -407,7 +404,7 @@ def input_key(have_cc0):
for p in (here / "gen_samples.py", here / "sampleio.py"):
h.update(p.read_bytes())
h.update(repr((sys.version_info[:2], have_cc0, slice_on())).encode()) # sum() differs across versions
files = sorted(GENDIR.glob("*.wav"))
files = sorted(BREAKS.glob("*.wav"))
if have_cc0:
files += sorted(CC0.glob("*/*.wav"))
for p in files:
@@ -417,7 +414,6 @@ def input_key(have_cc0):
def main(out):
subprocess.run([sys.executable, str(Path(__file__).with_name("gen_waves.py")), str(GENDIR)], check=True)
have_cc0 = CC0.exists() and any(CC0.glob("*/*.wav"))
if not have_cc0:
print("samples: CC0 library not fetched (tools/fetch_cc0.py) - no SAMPLE sets")
@@ -437,8 +433,9 @@ def main(out):
b.alias_set(name)
else:
b.cc0_set(name, kind)
if slice_on(): # SLICE's BREAK: only when that engine is built
b.slice_break() # last: the sets' offsets stay as they were
if slice_on(): # SLICE's loops: only when that engine is built
b.brk = b.slice_loop("break") # last: the sets' offsets stay as they were
b.fnk = b.slice_loop("funk")
b.slice_piano() # (no data of its own: the PIANO set's)
text = b.header()
Path(out).write_text(text)
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
+24 -7
View File
@@ -55,6 +55,13 @@ takes P_COUNT and P_E0 from `INFO` keeps working (see "The chord keys" below).
levels), went in before the engine parameters, which moved from 83..90 to 91..98: P_COUNT 99, P_E0 91. No command
changed; projects are FUN9 (3648 bytes, see "Projects (FUN9)"). See "The DRUM lane levels" below.
**Skiff phase 9 (125 parameters):** twenty-two track parameters went in before the engine parameters, which moved
from 95..102 to 117..124: FX > DRIVE's `TYPE` (95: SOFT HARD FOLD BITS, DIST's clipper) and `TONE` (96, −64..63),
ENV 2's `ATTACK` `DECAY` `SUSTAIN` `RELEASE` (97..100: the MOD matrix's source ENV2, `SRC` value 9, appended), the
DRUM lanes' `TUNE` (101..108, 0..127, 64 as designed) and `DECAY` (109..116, −64..63, 0 as designed): P_COUNT 125,
P_E0 117. No command changed. Projects keep 103 values a track (the layout before), the new ones in SKF3's PX block (see "Projects
(Skiff phase 6: SKF3)"); user presets store all 125.
## Framing
A request is `F0 7D 46 4C <cmd> <args...> F7`:
@@ -80,7 +87,7 @@ watches (v2, `WATCH`), the device also sends push frames (cmds 23, 24, 26) at an
| track | 0..NTRK−1: tracks 1..NTRK (synth parts; `INFO`'s NTRK: 4, Skiff phase 6 six) |
| engine byte | 0..NENGINES−1 (firmware before 1.0: NENGINES = its drum track, no engine). The numbers are fixed, new engines are appended: 0 ANALOG, 1 reserved (DIGITAL before 1.0: see below), 2 PHASE, 3 LOFI, 4 SAMPLE, 5 VOICE, 6 TRIO, 7 WHEEL, 8 GRAIN, 9 PHYS, 10 DRUM, 11 NOISE, 12 FM6, 13 SLICE, (Skiff phase 7) 14 DRUM-X (NENGINES 15, Felucca and Skiff before: 14; a build with `FELUCCA_SLICE=0` keeps 13 reserved). The device and the editor list them in another order (ANALOG FM6 PHASE LOFI SAMPLE VOICE TRIO WHEEL GRAIN PHYS NOISE SLICE DRUM DRUM-X: `ENGINE_ORDER`); the numbers stay. Engine NENGINES (15 now) still names a user slot in the favourites messages |
The engine parameters are `P_E0..P_E7`: P_COUNT−8 .. P_COUNT−1 (91..98), and `INFO` gives `P_E0`.
The engine parameters are `P_E0..P_E7`: P_COUNT−8 .. P_COUNT−1 (117..124 since Skiff phase 9), and `INFO` gives `P_E0`.
Their meaning, range and names depend on the current engine, so re-read `DESC` for them
after an engine change.
@@ -308,7 +315,8 @@ those at their defaults, which change nothing. Then the chord keys (ids 81, 82):
stored with 89 (or 69) load with CHRD OFF and VOIC CLOSE, their engine values at 83..90. Then the DRUM lane levels
(ids 83..90): P_COUNT 99, P_E0 91; records stored with 91 (1.0.x) or fewer load with every lane at 127 (100 %), their
engine values at 91..98.
Skiff: the play direction `DIR` (id 91): P_COUNT 100, P_E0 92. A version 4 or 5 record keeps its pattern's 16
Skiff: the play direction `DIR` (id 91): P_COUNT 100, P_E0 92; the ducking (92..94): P_COUNT 103, P_E0 95; phase 9
(95..116): P_COUNT 125, P_E0 117, records of 103 loading those at their defaults. A version 4 or 5 record keeps its pattern's 16
NUDGE values in the last 12 bytes of the value area (bytes 132..143 of it, beyond any P_COUNT below 128): 6 bits
each, two's complement, 4 steps in 3 bytes; all 0 is on the grid, which every record of before holds. `UP_GET` /
`UP_PUT` do not carry them (an `UP_PUT` record is on the grid); backups carry the whole record.
@@ -379,10 +387,13 @@ grid lives in the steps themselves, so every engine has it:
NENGINES, no presets (`UP_LOAD` / `UP_STORE` rc 1), its level the global `G_DRLVL`. Drums are now the
DRUM engine on any part: the first C key is the kick (C2 = 36), notes are GM numbers.
- The globals `G_DRCH`, `G_DRLVL`, `G_DRREV` (ids 24..26: the old drum track's MIDI channel, level and
reverb send) keep their ids, and `G_COUNT` stays 27. `G_DRLVL` and `G_DRREV` are inert: `DESC` gives
label "-", range 0..0, and no page shows them. Id 24 (`G_DRCH`, never read since 1.0) is `G_RTYPE`
since 1.0: the reverb's model, `DESC` label "TYPE", enum ROOM (0) / SPRING (1), on the REVERB
page (FX); projects of formats before FUN7 load it as ROOM. MIDI channel 10 is no longer special (channels 1..4 play
reverb send) keep their ids, and `G_COUNT` stays 27. Id 24 (`G_DRCH`, never read since 1.0) is `G_RTYPE`
since 1.0: the reverb's model, `DESC` label "TYPE", enum ROOM (0) / SPRING (1), (Skiff phase 9) HALL (2), on the
REVERB page (GLO); projects of formats before FUN7 load it as ROOM, and Skiff before phase 9 loads HALL as SPRING
(its range ends there). `G_DRLVL` and `G_DRREV` were inert (`DESC` label "-", range 0..0); since Skiff phase 9
they are `G_CMODE` and `G_CFDBK`, the chorus's MODE (enum CHORUS 0 / FLANGER 1 / PHASER 2) and FEEDBACK (0..127),
KNOB 3 and 4 of GLO › CHORUS. A project of any format but SKF3 loads both as 0 (they held the old drum part's
values there); Skiff before phase 9 reads them as 0. MIDI channel 10 is no longer special (channels 1..4 play
tracks 1..4, channels 5..16 are ignored since 1.0.3; Skiff phase 6: channels 1..6 play tracks 1..6, 7..16 are
ignored; with ROUT SEL every channel the selected track).
- Selecting a track with `TRACK` does not push `RELOAD` (the editor re-reads `DUMP`, the steps and the
@@ -601,7 +612,13 @@ when the track's engine is not the saved one).
values 0..127 each (PITCH PMOD DECAY NOISE COLOR). SKF3 holds it at 1175: `58` ("X"), then the 88 bytes, just
before the FM6 patches; 0 there (the factory kit unedited is not written; a record of before; a kit with a value out
of range): the factory kit. SKF2
holds none (its four-track projects load with the factory kit).
holds none (its four-track projects load with the factory kit). (Skiff phase 9) A DRUM-X factory preset may load a
kit of its own (FACTORY KIT .. LASER KIT); `PRESET` then changes the kit too, so read it again (`KIT_GET`).
- **The PX block (Skiff phase 9).** Every project format stores 103 values a track (byte 66 says 103), by count:
ids 0..94, then `P_E0..P_E7`. The parameters after them (ids 95..116 today) are SKF3's PX block at 981..1174: `50`
("P"), a count n (22), then each track's n values, value + 64; written only when one of them is not its default,
so a project that uses none is the bytes it was before phase 9. A record without the block (every one before)
loads them at their defaults; Skiff before phase 9 reads an SKF3 with the block and ignores it.
- **MIDI clock** has no SysEx. `G_CLOCK` selects the source: 0 INT, 1 USB, 2 TRS. With 1 or 2 the sequencer
steps on that port's Clock pulses (the other port's are ignored), Start (0xFA) restarts from step 0,
Continue (0xFB) resumes and Stop (0xFC) stops; BPM follows the incoming tempo (40..240), and 500 ms
+123 -35
View File
@@ -548,6 +548,17 @@ const DX_KIT_DEF = [[16, [9, 70, 72, 4, 20], [14, 100, 88, 10, 60]], [5, [40, 30
[4, [60, 0, 46, 127, 84], [54, 0, 58, 127, 76]], [10, [100, 0, 22, 96, 116], [108, 0, 14, 112, 122]],
[10, [100, 0, 62, 96, 112], [108, 0, 74, 112, 118]], [16, [30, 40, 66, 10, 30], [36, 60, 76, 20, 50]],
[27, [63, 10, 14, 16, 46], [70, 24, 20, 30, 60]], [6, [69, 0, 72, 0, 40], [74, 0, 84, 12, 56]]];
/* (Skiff phase 9) the factory kits a DRUM-X preset loads as the project's kit (eng_drumx.c DX_KITS: 0 the factory's,
then the kits of FACTORY KIT on) and each preset's kit + 1 (DRUMX_PKIT; 0 keeps the kit); test_web.mjs checks both */
const DX_KITS = [DX_KIT_DEF,
[[48, [6, 60, 84, 2, 10], [10, 80, 92, 4, 30]], [4, [36, 20, 60, 90, 60], [40, 28, 70, 100, 70]], [4, [56, 0, 52, 127, 70], [52, 0, 64, 127, 64]], [10, [92, 0, 18, 100, 104], [96, 0, 24, 110, 110]], [10, [92, 0, 70, 100, 100], [96, 0, 84, 110, 106]], [48, [22, 50, 80, 6, 20], [28, 70, 92, 10, 40]], [27, [58, 8, 16, 10, 40], [62, 16, 22, 20, 50]], [6, [64, 0, 80, 0, 36], [70, 0, 92, 10, 48]]],
[[16, [16, 100, 60, 10, 40], [20, 120, 68, 20, 70]], [9, [60, 10, 40, 70, 110], [66, 0, 46, 90, 120]], [8, [70, 0, 30, 127, 100], [66, 0, 40, 127, 96]], [10, [116, 0, 8, 60, 124], [120, 0, 12, 80, 127]], [10, [116, 0, 40, 60, 120], [120, 0, 50, 80, 124]], [17, [40, 60, 36, 0, 50], [46, 80, 44, 0, 70]], [27, [80, 20, 8, 0, 60], [86, 30, 10, 10, 80]], [5, [88, 0, 30, 0, 80], [92, 0, 40, 0, 90]]],
[[145, [10, 90, 70, 20, 70], [14, 110, 80, 30, 100]], [134, [44, 30, 50, 100, 80], [50, 40, 60, 110, 90]], [6, [64, 0, 46, 120, 90], [60, 0, 56, 124, 84]], [138, [104, 0, 20, 110, 116], [110, 0, 28, 120, 122]], [10, [104, 0, 72, 110, 112], [110, 0, 84, 120, 118]], [18, [28, 50, 60, 20, 60], [34, 70, 72, 30, 80]], [151, [70, 20, 20, 30, 70], [76, 30, 26, 40, 90]], [7, [60, 10, 90, 10, 60], [66, 20, 94, 20, 74]]],
[[16, [12, 40, 76, 0, 4], [14, 54, 86, 2, 14]], [0, [42, 10, 46, 60, 50], [44, 16, 56, 70, 56]], [0, [60, 0, 40, 127, 60], [58, 0, 50, 127, 56]], [6, [90, 0, 16, 100, 90], [94, 0, 22, 110, 96]], [6, [90, 0, 60, 100, 86], [94, 0, 70, 110, 92]], [16, [32, 20, 60, 4, 10], [36, 30, 70, 8, 20]], [20, [66, 4, 12, 20, 40], [70, 8, 16, 30, 50]], [4, [78, 0, 60, 0, 20], [80, 0, 72, 4, 30]]],
[[81, [12, 80, 56, 10, 60], [18, 110, 64, 20, 90]], [69, [50, 60, 40, 90, 100], [58, 80, 48, 100, 110]], [10, [76, 20, 30, 110, 110], [70, 30, 40, 120, 104]], [74, [110, 30, 10, 80, 120], [118, 50, 14, 90, 126]], [11, [108, 20, 44, 80, 116], [114, 30, 52, 90, 122]], [65, [36, 90, 40, 10, 80], [44, 110, 48, 20, 100]], [91, [84, 40, 10, 30, 80], [90, 60, 14, 40, 100]], [101, [72, 50, 50, 0, 90], [80, 70, 60, 10, 100]]],
[[48, [14, 50, 80, 0, 20], [18, 64, 90, 4, 30]], [20, [46, 40, 50, 40, 50], [50, 50, 58, 50, 60]], [4, [58, 0, 40, 127, 72], [54, 0, 48, 127, 66]], [6, [96, 0, 14, 110, 100], [100, 0, 18, 120, 106]], [6, [96, 0, 40, 110, 96], [100, 0, 50, 120, 102]], [48, [30, 60, 70, 4, 24], [36, 80, 80, 8, 34]], [23, [74, 10, 18, 4, 50], [78, 16, 22, 10, 60]], [7, [76, 0, 70, 0, 40], [80, 0, 80, 4, 50]]],
[[16, [10, 110, 70, 0, 30], [14, 127, 80, 6, 50]], [101, [50, 70, 50, 80, 90], [56, 90, 60, 90, 100]], [4, [62, 0, 44, 127, 86], [58, 0, 54, 127, 80]], [10, [106, 0, 14, 90, 120], [110, 0, 18, 100, 124]], [10, [106, 0, 56, 90, 116], [110, 0, 64, 100, 120]], [112, [40, 100, 60, 0, 40], [48, 120, 70, 0, 60]], [121, [90, 90, 20, 0, 80], [96, 110, 26, 0, 100]], [96, [70, 127, 50, 0, 40], [80, 127, 60, 0, 60]]]];
const DRUMX_PKIT = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8];
const DX = { lanes: ["KICK", "SNARE", "CLAP", "CL HAT", "OP HAT", "TOM", "RIM", "BELL"], waves: ["SINE", "FM", "METAL", "BELL"],
filters: ["LP", "BP", "HP"], shapes: ["DECAY", "LONG", "NOISE", "SINE"], values: ["PITCH", "P MOD", "DECAY", "NOISE", "COLOR"] };
function readHits(r, o) {
@@ -1522,6 +1533,10 @@ const P_CHORD = [81, 82]; /* core.h P_CHRD, P_VOIC (sin
const P_LANES = [83, 84, 85, 86, 87, 88, 89, 90]; /* core.h P_LN0..P_LN7: the DRUM lane levels (since P_COUNT 99, P_E0 91) */
const P_DIR = 91; /* (Skiff) core.h P_DIR: the play direction, the track's (P_COUNT 100, P_E0 92) */
const P_DUCK = [92, 93, 94]; /* (Skiff) core.h P_DKSRC P_DKAMT P_DKREL: the ducking, the track's (P_COUNT 103, P_E0 95) */
/* (Skiff phase 9, P_COUNT 125, P_E0 117) core.h P_DTYPE P_DTONE (FX > DRIVE), P_EG2_ATK .. REL (ENV 2), P_LTUNE0..7 and
P_LDECAY0..7 (the DRUM lanes' TUNE and DECAY): sound parameters, as the engine's */
const P_DRIVE = [95, 96], P_ENV2 = [97, 98, 99, 100];
const P_LTUNE = Array.from({ length: 8 }, (_, i) => 101 + i), P_LDECAY = Array.from({ length: 8 }, (_, i) => 109 + i);
const trackOwn = (i, pe0) => TRACK_OWN.has(i) || (pe0 >= 83 && P_CHORD.includes(i)) || (pe0 >= 92 && i === P_DIR) ||
(pe0 >= 95 && P_DUCK.includes(i));
/* play a patch without writing flash, as UP_LOAD would load it: the sound only. SET the engine (G_ENGSEL:
@@ -1945,7 +1960,7 @@ function makeMockDevice(opt = {}) {
const NONOFF = ["OFF", "ON"], NDIV = ["1/4", "1/8", "1/16", "1/32", "8T", "16T", "1/2", "1/1", "2BAR", "4BAR"], NGO = ["--", "GO"], NDASH = ["--"];
const D = (label, fmt, min, max, def, names = null, unit = "") => ({ label, fmt, min, max, def, names, unit });
const E = (label, names, def) => D(label, F.ENUM, 0, names.length - 1, def, names);
const MSRC = ["OFF", "LFO", "ENV", "VEL", "KEY", "RAND", "MODW", "AT", "EXPR"];
const MSRC = ["OFF", "LFO", "ENV", "VEL", "KEY", "RAND", "MODW", "AT", "EXPR", "ENV2"]; /* ((Skiff phase 9) ENV2) */
const MDST = ["OFF", "PITCH", "CUT", "SHP", "AMP", "PAN", "DIST", "CHO", "DLY", "REV", "RATE", "VIB", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8"];
const TP = [
D("LEVEL", F.DB, 0, 127, 104),
@@ -1972,8 +1987,9 @@ function makeMockDevice(opt = {}) {
E("ENGINE", ["ANALOG", "-", "PHASE", "LOFI", "SAMPLE", "VOICE", "TRIO", "WHEEL",
"GRAIN", "PHYS", "DRUM", "NOISE", "FM6", "SLICE", "DRUM-X"], 0), E("SET", NGO, 0),
E("CLRSQ", NGO, 0), E("INIT", NGO, 0),
E("TYPE", ["ROOM", "SPRING"], 0), /* G_RTYPE (id 24, was G_DRCH): the reverb's model */
D("-", F.INT, 0, 0, 0), D("-", F.INT, 0, 0, 0), /* G_DRLVL, G_DRREV: inert since 1.0 */
E("TYPE", ["ROOM", "SPRING", "HALL"], 0), /* G_RTYPE (id 24, was G_DRCH): the reverb's model ((Skiff phase 9) HALL) */
E("MODE", ["CHORUS", "FLANGER", "PHASER"], 0), D("FEEDBACK", F.PCT, 0, 127, 0), /* 25, 26: (Skiff phase 9) the CHORUS bus
(G_CMODE, G_CFDBK; G_DRLVL, G_DRREV before: inert since 1.0) */
];
const NONE = D("-", F.INT, 0, 0, 0);
const RATIO = [".5", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "14", "16"];
@@ -1985,18 +2001,21 @@ function makeMockDevice(opt = {}) {
P("SQR BASS", [1, 0, 0, 0, 50, 70, 40, 64], [0, 60, 40, 30], 1, 2), P("PWM STR", [4, 8, 40, 0, 75, 20, 0, 48], [60, 80, 110, 85], 0, 5),
P("ACID", [0, 0, 0, 0, 50, 100, 25, 64], [0, 55, 20, 30], 1, 1), P("SINE KEY", [3, 6, 50, 0, 127, 0, 0, 0], [2, 80, 30, 70], 0, 6),
P("RAVE", [4, 30, 64, 0, 85, 20, 30, 64], [20, 80, 110, 60], 1, 13), P("SUB BASS", [3, 0, 0, 0, 40, 0, 20, 0], [0, 60, 100, 20], 1, 8),
P("PLUCK", [0, 8, 50, 0, 30, 40, 0, 64], [0, 88, 0, 60], 0, 3), P("BRASS", [0, 10, 64, 0, 45, 20, 10, 64], [35, 70, 90, 45], 0, 6),
P("WIND", [0, 0, 0, 90, 30, 90, 0, 0], [60, 90, 60, 80], 0, 5), P("STRINGS", [0, 25, 64, 0, 70, 10, 0, 32], [70, 90, 115, 90], 0, 5),
P("SYNTH PLUCK", [0, 8, 50, 0, 30, 40, 0, 64], [0, 88, 0, 60], 0, 3), P("SYNTH BRASS", [0, 10, 64, 0, 45, 20, 10, 64], [35, 70, 90, 45], 0, 6),
P("WIND SWEEP", [0, 0, 0, 90, 30, 90, 0, 0], [60, 90, 60, 80], 0, 5), P("STRINGS", [4, 6, 64, 0, 92, 8, 0, 48], [48, 90, 118, 72], 0, 5, [[15, 20], [9, 72], [13, 1], [12, 80]]),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("BONE FLUTE", [2, 3, 30, 22, 84, 15, 0, 64], [56, 80, 110, 64], 1, 0, [[9, 84], [12, 90], [13, 1]]),
P("WAR HORN", [0, 5, 64, 4, 42, 12, 20, 64], [72, 80, 110, 80], 1, 0, [[9, 80], [12, 96], [13, 1]]),
P("DARK STRINGS", [0, 22, 64, 0, 56, 8, 0, 40], [92, 90, 120, 100], 0, 0, [[9, 36], [14, 5]]),
P("DARK STRINGS", [1, 4, 64, 6, 40, 34, 22, 40], [100, 90, 120, 105], 0, 0, [[9, 30], [14, 8], [13, 1], [12, 110]]),
P("NIGHT BASS", [0, 7, 64, 0, 40, 35, 15, 64], [0, 64, 50, 30], 1),
P("NEON LEAD", [0, 14, 64, 0, 92, 25, 12, 64], [6, 70, 110, 55], 1, 0, [[9, 86], [12, 92], [13, 2], [38, 28]]),
P("SUNSET PAD", [4, 9, 55, 0, 74, 15, 0, 48], [78, 90, 115, 92], 0, 0, [[10, 1], [9, 52], [15, 48]]),
P("HERO BRASS", [0, 16, 64, 0, 50, 18, 8, 56], [50, 75, 95, 55]),
P("SYN TOM", [3, 0, 0, 6, 127, 0, 25, 0], [0, 76, 0, 60], 0, 0, [[6, 63]]),
P("QUANTA", [3, 0, 0, 0, 127, 0, 0, 0], [0, 64, 127, 50], 1, 0, [[10, 4], [9, 96], [13, 40]])] },
P("QUANTA", [3, 0, 0, 0, 127, 0, 0, 0], [0, 64, 127, 50], 1, 0, [[10, 4], [9, 96], [13, 40]]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("REESE", [0, 40, 64, 0, 52, 15, 30, 32], [0, 64, 127, 30], 1, 0, [[9, 30], [14, 8]]),
P("DRIVE BASS", [0, 14, 64, 0, 62, 20, 10, 64], [0, 64, 64, 25], 1, 0, [[95, 1], [96, -32]])] },
/* 1: reserved (DIGITAL, retired: src/fm4_convert.c ENG_FM4_GONE; its sounds load as FM6, FM4 above) */
{ name: "-", titles: ["-", "-"], edit: [D("-", F.INT, 0, 7, 0), D("-", F.INT, 0, 14, 1), D("-", F.INT, 0, 14, 1),
D("-", F.INT, 0, 14, 1), D("-", F.PCT, 0, 127, 60), D("-", F.INT, 0, 127, 60), D("-", F.PCT, 0, 127, 0), NONE],
@@ -2004,22 +2023,35 @@ function makeMockDevice(opt = {}) {
{ name: "PHASE", titles: ["PHASE", "LINE"], edit: [E("WAVE", ["SAW", "SQR", "PLS", "DSIN", "SPLS", "RSAW", "RTRI", "RTRP"], 0),
E("WAVE2", ["-", "SAW", "SQR", "PLS", "DSIN", "SPLS", "RSAW", "RTRI", "RTRP"], 0), D("DCW", F.PCT, 0, 127, 60), D("ENV", F.PCT, 0, 127, 64),
D("DETUNE", F.INT, 0, 127, 0, null, "ct"), E("LINE", ["MIX", "RING"], 0), D("SUB", F.PCT, 0, 127, 0), NONE],
presets: [P("BRASS", [0, 0, 30, 90, 0, 0, 0, 0], [8, 70, 90, 40], 0, 6), P("ORGAN", [3, 0, 40, 0, 0, 0, 0, 0], [0, 127, 127, 30], 0, 6),
P("STRING", [0, 4, 50, 40, 12, 0, 0, 0], [40, 90, 100, 70], 0, 5), P("RESO", [5, 0, 60, 60, 0, 0, 0, 0], [0, 70, 30, 60], 0, 1),
P("BELL", [6, 0, 80, 50, 0, 0, 0, 0], [0, 95, 0, 90], 0, 7), P("WIRE", [4, 7, 70, 40, 7, 0, 0, 0], [10, 80, 80, 60], 0, 4),
presets: [P("PD BRASS", [0, 0, 30, 90, 0, 0, 0, 0], [8, 70, 90, 40], 0, 6), P("PD ORGAN", [3, 0, 40, 0, 0, 0, 0, 0], [0, 127, 127, 30], 0, 6),
P("PD STRINGS", [0, 4, 50, 40, 12, 0, 0, 0], [40, 90, 100, 70], 0, 5), P("RESO", [5, 0, 60, 60, 0, 0, 0, 0], [0, 70, 30, 60], 0, 1),
P("PD BELL", [6, 0, 80, 50, 0, 0, 0, 0], [0, 95, 0, 90], 0, 7), P("WIRE", [4, 7, 70, 40, 7, 0, 0, 0], [10, 80, 80, 60], 0, 4),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("NEUTRINO", [3, 0, 20, 70, 0, 0, 0, 0], [0, 80, 0, 75])] },
P("NEUTRINO", [3, 0, 20, 70, 0, 0, 0, 0], [0, 80, 0, 75]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("PD BASS", [0, 0, 50, 80, 4, 0, 60, 0], [0, 60, 60, 25], 1),
P("SOFT KEYS", [3, 0, 30, 60, 6, 0, 0, 0], [0, 85, 30, 60])] },
{ name: "LOFI", titles: ["CHIP", "MOTION"], edit: [E("CHIP", ["4BIT", "4B/2", "8BIT", "1BIT", "STEP"], 0), E("WAVE", ["PLS", "TRI", "SAW", "NOIS", "WRAM"], 0), D("DUTY", F.INT, 0, 127, 64),
D("CRUSH", F.PCT, 0, 127, 0), D("SWEEP", F.PCT, 0, 127, 0), D("VIBRATO", F.PCT, 0, 127, 0), E("ARP", ["OFF", "OCT", "MAJ", "MIN"], 0), D("TONE", F.PCT, 0, 127, 127)],
presets: [P("PULSE LD", [0, 0, 32, 0, 0, 20, 0, 127], [0, 60, 90, 30], 1, 4), P("WAVE BASS", [1, 1, 0, 0, 0, 0, 0, 90], [0, 50, 70, 20], 1, 2),
P("ARP 8BIT", [2, 0, 96, 0, 0, 0, 2, 110], [0, 60, 80, 40], 0, 13), P("WAVE LEAD", [0, 4, 92, 0, 0, 18, 0, 110], [0, 70, 90, 30], 1, 3),
P("STEP LEAD", [4, 0, 40, 34, 0, 16, 0, 127], [0, 64, 127, 55], 1, 4),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("PHOTON", [2, 1, 64, 0, 16, 0, 0, 120], [0, 70, 0, 40])] },
P("PHOTON", [2, 1, 64, 0, 16, 0, 0, 120], [0, 70, 0, 40]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("TRI BASS", [0, 1, 64, 0, 0, 0, 0, 100], [0, 60, 90, 20], 1),
P("CHIP BELL", [2, 0, 20, 0, 30, 0, 0, 110], [0, 70, 0, 50])] },
{ name: "SAMPLE", titles: ["SET", "TONE"], edit: [E("SET", ["PIANO", "PIANO", "FLUTE", "SAX", "PIANO", "USR1", "USR2", "USR3"], 0), D("PITCH", F.SEMI, -24, 24, 0), D("BITS", F.INT, 0, 127, 0),
E("LOOP", NONOFF, 1), D("CUTOFF", F.INT, 0, 127, 127), NONE, D("DRIVE", F.PCT, 0, 127, 0), NONE],
presets: [P("PIANO", [0, 0, 0, 1, 127, 0, 0, 0], [0, 127, 127, 70]), P("PIANO", [0, 0, 0, 1, 127, 0, 0, 0], [0, 127, 127, 70]),
P("FLUTE", [2, 0, 0, 1, 127, 0, 0, 0], [12, 80, 120, 60]), P("SAX", [3, 0, 0, 1, 127, 0, 0, 0], [12, 80, 120, 60])] },
P("FLUTE", [2, 0, 0, 1, 127, 0, 0, 0], [12, 80, 120, 60]), P("SAX", [3, 0, 0, 1, 127, 0, 0, 0], [12, 80, 120, 60]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("PIANO", [0, 0, 0, 1, 127, 0, 0, 0], [0, 127, 127, 70]),
P("LOFI PIANO", [0, 0, 110, 1, 30, 0, 30, 0], [0, 127, 127, 70], 0, 0, [[95, 3], [9, 40], [13, 1]]),
P("MUSIC BOX", [0, 24, 0, 0, 110, 0, 0, 0], [0, 90, 0, 80]),
P("FLUTE PAD", [2, 0, 0, 1, 90, 0, 0, 0], [80, 90, 120, 100]),
P("DARK SAX", [3, -12, 0, 1, 26, 0, 48, 0], [22, 80, 120, 55], 1, 0, [[13, 1], [9, 84], [12, 100]]),
P("KOTO", [0, 12, 0, 0, 120, 0, 22, 0], [0, 72, 0, 50], 0, 0, [[6, 2]])] },
{ name: "VOICE", titles: ["VOWEL", "TONE"], edit: [D("VOWEL", F.INT, 0, 127, 0), D("VOWEL2", F.INT, 0, 127, 64), D("TALK", F.TIME, 0, 127, 0),
D("PITCH", F.SEMI, -12, 12, 0), D("BUZZ", F.PCT, 0, 127, 64), D("BREATH", F.PCT, 0, 127, 10), D("Q", F.PCT, 0, 127, 64), D("RANDOM", F.PCT, 0, 127, 0)],
presets: [P("CHOIR AAH", [0, 0, 0, 0, 40, 22, 60, 0], [85, 90, 115, 95], 0, 5), P("VOX LEAD", [32, 0, 0, 2, 90, 8, 72, 0], [6, 70, 105, 55], 1, 4),
@@ -2027,7 +2059,9 @@ function makeMockDevice(opt = {}) {
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("CRYPT CHOIR", [112, 0, 0, -3, 34, 30, 64, 14], [90, 90, 118, 100], 0, 0, [[9, 70], [13, 1]]),
P("MONK CHANT", [95, 0, 96, -5, 80, 12, 80, 0], [50, 80, 115, 85], 1, 0, [[9, 82], [12, 96], [13, 1]]),
P("DREAM CHOIR", [0, 20, 0, 3, 55, 45, 55, 8], [80, 90, 118, 95])] },
P("DREAM CHOIR", [0, 20, 0, 3, 55, 45, 55, 8], [80, 90, 118, 95]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("ROBOT TALK", [20, 100, 40, -12, 110, 4, 90, 30], [0, 70, 100, 30], 1)] },
{ name: "TRIO", titles: ["OSC", "TONE"], edit: [E("WAVE", ["SAW3", "PLS3", "PPT", "SST", "TRI3", "S&T", "P&S", "P+N", "NOIS", "SYNC", "SYNCP", "SYNC3",
"RING", "RING3", "R+S", "R+SP"], 0), D("PITCH2", F.SEMI, -24, 24, 0), D("PITCH3", F.SEMI, -24, 24, -12), D("DETUNE", F.INT, 0, 50, 6, null, "ct"),
E("MODE", ["LP", "BP", "HP", "NOT"], 0), D("CUTOFF", F.CUTOFF, 0, 127, 80), D("RES", F.PCT, 0, 127, 40), D("PW", F.PCT, 0, 127, 64)],
@@ -2037,7 +2071,9 @@ function makeMockDevice(opt = {}) {
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("TURBO SYNC", [9, 7, 0, 3, 0, 92, 28, 64], [2, 72, 105, 45], 1, 0, [[38, 24], [9, 86], [12, 90], [13, 1]]),
P("NEON ARP", [1, 12, 0, 5, 0, 70, 35, 40], [0, 66, 0, 45]),
P("COLLIDER", [13, 0, 23, 9, 2, 60, 50, 64], [0, 70, 0, 55], 0, 0, [[6, 36]])] },
P("COLLIDER", [13, 0, 23, 9, 2, 60, 50, 64], [0, 70, 0, 55], 0, 0, [[6, 36]]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("DIRTY BASS", [1, -12, 0, 8, 1, 62, 85, 30], [0, 50, 50, 20], 1, 0, [[95, 1], [96, -10]])] },
{ name: "WHEEL", titles: ["BARS", "TONE"], edit: [E("REG", ["FLUTE", "MELLOW", "HOLLOW", "SMOOTH", "3BAR", "BLUES", "GOSPEL", "ROCK",
"TOPS", "CLARI", "REED", "STRNG", "CHAPL", "BRITE", "BASS", "FULL"], 4), D("SUB", F.INT, -8, 8, 0), D("BODY", F.INT, -8, 8, 0), D("TOP", F.INT, -8, 8, 0),
E("PERC", ["OFF", "2ND", "3RD", "2SOFT", "3SOFT", "2SLOW", "3SLOW"], 0), D("CLICK", F.PCT, 0, 127, 40), D("DRIVE", F.PCT, 0, 127, 0), E("ROTOR", ["OFF", "SLOW", "FAST"], 1)],
@@ -2045,14 +2081,21 @@ function makeMockDevice(opt = {}) {
P("GOSPEL", [6, 0, 0, 0, 1, 60, 40, 2], [0, 64, 127, 45], 0, 6), P("SOFT FLUTE", [1, 0, -2, 0, 0, 10, 0, 1], [0, 64, 127, 55], 0, 5),
P("ROCK DRIVE", [7, 0, 0, 0, 0, 70, 100, 2], [0, 64, 127, 40], 0, 4),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("CATHEDRAL", [12, 2, 0, 0, 0, 6, 0, 0], [48, 64, 127, 72])] },
P("CATHEDRAL", [12, 2, 0, 0, 0, 6, 0, 0], [48, 64, 127, 72]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("PEDAL BASS", [14, 4, 0, -4, 0, 20, 10, 0], [0, 64, 127, 30], 1),
P("CLARINET", [9, 0, 2, -5, 0, 0, 14, 1], [24, 64, 120, 45], 1, 0, [[13, 1], [9, 89], [12, 70]])] },
{ name: "GRAIN", titles: ["GRAIN", "SPRAY"], edit: [E("SOURCE", ["PIANO", "PIANO", "FLUTE", "SAX", "PIANO", "USR1", "USR2", "USR3"], 0),
D("POS", F.PCT, 0, 127, 32), D("SIZE", F.PCT, 0, 127, 80), D("DENSITY", F.PCT, 0, 127, 80),
D("PITCH", F.SEMI, -24, 24, 0), D("SPREAD", F.PCT, 0, 127, 30), D("RANDOM", F.PCT, 0, 127, 10), D("TONE", F.PCT, 0, 127, 127)],
presets: [P("CLOUD PAD", [2, 50, 92, 88, 0, 40, 14, 100], [70, 90, 120, 90], 0, 5), P("GLITCH", [3, 64, 24, 112, 0, 100, 90, 127], [0, 70, 100, 30], 0, 4),
P("FROZEN", [0, 40, 108, 72, 0, 0, 10, 92], [50, 100, 127, 100], 0, 5), P("SHIMMER", [0, 30, 70, 100, 12, 30, 24, 110], [30, 90, 110, 90], 0, 7),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("QUARK CLOUD", [2, 70, 6, 124, 12, 120, 70, 115], [50, 90, 120, 95])] },
P("QUARK CLOUD", [2, 70, 6, 124, 12, 120, 70, 115], [50, 90, 120, 95]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("PIANO HAZE", [0, 20, 100, 80, 0, 50, 20, 90], [70, 90, 120, 100]),
P("SAX DRONE", [3, 60, 120, 90, -12, 20, 10, 80], [90, 90, 127, 100]),
P("SCATTER", [2, 64, 40, 70, 12, 50, 0, 110], [0, 70, 100, 50])] },
{ name: "PHYS", titles: ["BODY", "EXCITE"], edit: [E("MODEL", ["MODAL", "STRNG", "MEMB", "SYMP"], 0), D("STRUCT", F.PCT, 0, 127, 64),
D("BRIGHT", F.PCT, 0, 127, 80), D("DAMP", F.PCT, 0, 127, 80), D("POS", F.PCT, 0, 127, 20), D("ACCENT", F.PCT, 0, 127, 90),
D("BOW", F.PCT, 0, 127, 0), D("EXCITE", F.PCT, 0, 127, 0)],
@@ -2062,45 +2105,78 @@ function makeMockDevice(opt = {}) {
P("TOMS", [2, 0, 52, 40, 30, 100, 40, 30], [0, 100, 127, 70], 0, 2), P("DRONE STRING", [3, 127, 80, 88, 64, 100, 92, 0], [0, 100, 127, 90], 0, 3),
P("HARP", [3, 8, 62, 74, 60, 90, 0, 0], [0, 100, 127, 80], 0, 3),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("HARPSICHORD", [1, 44, 112, 76, 10, 127, 0, 24], [0, 100, 127, 50])] },
P("HARPSICHORD", [1, 44, 112, 76, 10, 127, 0, 24], [0, 100, 127, 50]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("UPRIGHT", [1, 60, 60, 90, 20, 127, 0, 60], [0, 100, 127, 40], 1)] },
{ name: "DRUM", titles: ["KIT", "HIT"], edit: [E("KIT", ["STD", "66", "10", "77", "80", "10", "66", "55", "77"], 0), D("PITCH", F.ST16, 0, 127, 64),
D("TONE", F.PCT, 0, 127, 64), D("DECAY", F.PCT, 0, 127, 64), D("SNAP", F.PCT, 0, 127, 64), D("ACCENT", F.PCT, 0, 127, 100),
E("KICK", ["PUNCH", "ROUND"], 0), D("DRIVE", F.PCT, 0, 127, 0)],
presets: [P("DRUM KIT", [0, 64, 70, 64, 64, 100, 0, 0], [0, 100, 127, 100], 0, 12),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("WAR DRUMS", [0, 40, 38, 108, 40, 110, 1, 24], [0, 100, 127, 100]),
P("NEON KIT", [4, 60, 80, 56, 90, 100, 0, 20], [0, 100, 127, 100])] },
P("NEON KIT", [4, 60, 80, 56, 90, 100, 0, 20], [0, 100, 127, 100]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("BOOM KIT", [4, 58, 60, 100, 50, 100, 0, 10], [0, 100, 127, 100]),
P("CRISP KIT", [5, 64, 76, 60, 80, 100, 0, 0], [0, 100, 127, 100]),
P("RHYTHM BOX", [6, 66, 64, 56, 64, 100, 0, 0], [0, 100, 127, 100]),
P("ELECTRO KIT", [7, 64, 70, 60, 70, 100, 0, 15], [0, 100, 127, 100]),
P("STUDIO KIT", [8, 64, 64, 64, 64, 100, 0, 0], [0, 100, 127, 100]),
P("TIGHT KIT", [0, 70, 80, 30, 100, 110, 0, 10], [0, 100, 127, 100]),
P("LOFI KIT", [0, 56, 30, 70, 40, 100, 1, 50], [0, 100, 127, 100])] },
{ name: "NOISE", titles: ["SOURCE", "MOVE"], edit: [E("MODE", ["ANLG", "DUST", "LFSR", "META"], 0), D("COLOR", F.PCT, 0, 127, 64),
D("CUTOFF", F.CUTOFF, 0, 127, 80), D("RES", F.PCT, 0, 127, 30), D("KEYTRK", F.PCT, 0, 127, 64), D("DENSITY", F.PCT, 0, 127, 0),
D("DRIFT", F.PCT, 0, 127, 0), D("CRUSH", F.PCT, 0, 127, 0)],
presets: [P("WIND", [0, 64, 70, 100, 127, 0, 70, 0], [90, 90, 110, 90], 0, 5), P("RAIN", [1, 30, 88, 80, 64, 105, 40, 0], [10, 90, 127, 70], 0, 5),
presets: [P("WIND", [0, 64, 70, 100, 127, 0, 70, 0], [90, 90, 110, 90], 0, 5), P("RAIN", [1, 30, 88, 80, 64, 105, 40, 0], [50, 90, 127, 70], 0, 5),
P("ARCADE", [2, 0, 127, 0, 127, 112, 0, 84], [0, 80, 0, 50], 0, 3), P("METAL", [3, 0, 100, 40, 100, 32, 0, 0], [0, 75, 40, 60], 0, 7),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("CAVE WIND", [0, 100, 70, 112, 127, 0, 100, 0], [100, 90, 120, 100]),
P("GEIGER", [1, 10, 100, 40, 64, 34, 0, 0], [0, 90, 127, 40]),
P("PLASMA", [3, 0, 90, 90, 100, 40, 80, 0], [60, 90, 110, 90], 0, 0, [[9, 56], [14, 18]])] },
P("PLASMA", [3, 0, 90, 90, 100, 40, 80, 0], [60, 90, 110, 90], 0, 0, [[9, 56], [14, 18]]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("OCEAN", [0, 50, 60, 20, 0, 0, 40, 0], [100, 90, 120, 110], 0, 0, [[9, 20], [14, 40], [10, 1]])] },
{ name: "FM6", titles: ["OPS", "PATCH"], edit: [D("ALGO", F.INT, 0, 32, 0), D("FEEDBACK", F.INT, -7, 7, 0), D("MOD LVL", F.BIPCT, -64, 63, 0),
D("RATIO", F.INT, -16, 16, 0), D("MOD ENV", F.BIPCT, -64, 63, 0), D("VEL MOD", F.INT, -7, 7, 0), D("DETUNE", F.PCT, 0, 127, 0),
D("PATCH", F.INT, 0, FM6.FACTORY_PK.length, 0)], /* F1..F8, then OWN (eng_fm6.c, 1.0.3) */
presets: [P("TINE EP", [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 127, 0], 0, 6), P("BELL", [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 127, 0], 0, 7),
P("FM BASS", [0, 0, 0, 0, 0, 0, 0, 2], [0, 0, 127, 0], 1, 2), P("BRASS", [0, 0, 0, 0, 0, 0, 0, 3], [0, 0, 127, 0], 0, 4),
P("PAD", [0, 0, 0, 0, 0, 0, 30, 4], [0, 0, 127, 0], 0, 5), P("MARIMBA", [0, 0, 0, 0, 0, 0, 0, 5], [0, 0, 127, 0], 0, 3),
P("ORGAN", [0, 0, 0, 0, 0, 0, 0, 6], [0, 0, 127, 0], 0, 6), P("PLUCK", [0, 0, 0, 0, 0, 0, 0, 7], [0, 0, 127, 0], 0, 13),
presets: [P("TINE EP", [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 127, 0], 0, 6), P("GLASS BELL", [0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 127, 0], 0, 7),
P("FM BASS", [0, 0, 0, 0, 0, 0, 0, 2], [0, 0, 127, 0], 1, 2), P("FM BRASS", [0, 0, 0, 0, 0, 0, 0, 3], [0, 0, 127, 0], 0, 4),
P("PAD", [0, 0, 0, 0, 0, 0, 30, 4], [0, 0, 127, 0], 0, 5), P("FM MARIMBA", [0, 0, 0, 0, 0, 0, 0, 5], [0, 0, 127, 0], 0, 3),
P("FM ORGAN", [0, 0, 0, 0, 0, 0, 0, 6], [0, 0, 127, 0], 0, 6), P("NYLON PICK", [0, 0, 0, 0, 0, 0, 0, 7], [0, 0, 127, 0], 0, 13),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("GRAVE BELL", [0, 0, 6, 0, 20, 0, 30, 1], [0, 0, 127, 0]),
P("GLASS KEYS", [0, 0, 8, 0, 0, 0, 24, 0], [0, 0, 127, 0]),
P("ISOTOPE", [0, 0, 14, 2, -10, 0, 50, 1], [0, 0, 127, 0]),
P("DARK MATTER", [0, 4, 16, 0, 10, 0, 0, 2], [0, 0, 127, 0], 1)] },
{ name: "SLICE", titles: ["SLICE", "PLAYBACK"], edit: [E("SOURCE", ["BREAK", "USR1", "USR2", "USR3", "PIANO"], 0),
P("DARK MATTER", [0, 4, 16, 0, 10, 0, 0, 2], [0, 0, 127, 0], 1),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("PICK BASS", [0, 2, 12, 0, 16, 2, 0, 7], [0, 0, 127, 0], 1),
P("GROWL BASS", [0, 5, 8, 0, 20, 0, 8, 3], [0, 0, 127, 0], 1, 0, [[14, 36], [9, 80], [95, 2]])] },
{ name: "SLICE", titles: ["SLICE", "PLAYBACK"], edit: [E("SOURCE", ["BREAK", "USR1", "USR2", "USR3", "PIANO", "FUNK"], 0),
E("DIV", ["4", "8", "16", "32", "AUTO", "MAN"], 2), D("START", F.INT, 0, 31, 0), D("PITCH", F.SEMI, -24, 24, 0),
E("MODE", ["ONE", "GATE", "LOOP"], 0), E("RVRS", ["OFF", "ON"], 0), D("DECAY", F.TIME, 0, 127, 127), D("CUTOFF", F.INT, 0, 127, 127)],
presets: [P("CHOP", [0, 2, 0, 0, 0, 0, 127, 127], [0, 127, 127, 30], 0, 9), P("STUTTER", [0, 1, 0, 0, 1, 0, 90, 110], [0, 127, 127, 12], 0, 10)] },
presets: [P("CHOP", [0, 2, 0, 0, 0, 0, 127, 127], [0, 127, 127, 30], 0, 9), P("STUTTER", [0, 1, 0, 0, 1, 0, 90, 110], [0, 127, 127, 12], 0, 10),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("LOW BREAK", [0, 2, 0, -7, 0, 0, 127, 100], [0, 127, 127, 30]),
P("BACK BREAK", [0, 2, 0, 0, 0, 1, 127, 127], [0, 127, 127, 30]),
P("BREAK HITS", [0, 4, 0, 0, 0, 0, 127, 127], [0, 127, 127, 30]),
P("SHORT CHOP", [0, 2, 0, 0, 0, 0, 80, 127], [0, 127, 127, 20]),
P("FAST BREAK", [0, 2, 0, 5, 0, 0, 110, 127], [0, 127, 127, 25], 0, 0, [[95, 1]]),
P("ROLL LOOP", [0, 3, 0, 0, 2, 0, 127, 127], [0, 127, 127, 20]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("FUNK BREAK", [5, 1, 0, 0, 0, 0, 127, 127], [0, 127, 127, 30])] },
{ name: "DRUM-X", titles: ["KIT", "HIT"], edit: [D("MORPH", F.PCT, 0, 127, 64), D("PITCH", F.ST16, 0, 127, 64), /* (Skiff: JIANT FM's) */
D("COLOR", F.PCT, 0, 127, 64), D("DECAY", F.PCT, 0, 127, 64), D("NOISE", F.PCT, 0, 127, 64), D("FM", F.PCT, 0, 127, 0),
D("FOLD", F.PCT, 0, 127, 0), D("DRIVE", F.PCT, 0, 127, 0)],
presets: [P("DRUM KIT", [64, 64, 70, 64, 64, 0, 0, 0], [0, 100, 127, 100], 0, 12),
presets: [P("OWN KIT", [64, 64, 70, 64, 64, 0, 0, 0], [0, 100, 127, 100], 0, 12),
/* (Skiff) the themes' sounds (src/eng_*.c) */
P("HADRON KIT", [100, 72, 90, 40, 80, 70, 60, 25], [0, 100, 127, 100])] },
P("HADRON KIT", [100, 72, 90, 40, 80, 70, 60, 25], [0, 100, 127, 100]),
/* (Skiff phase 9) more for every engine (src/eng_*.c) */
P("FACTORY KIT", [64, 64, 70, 64, 64, 0, 0, 0], [0, 100, 127, 100]),
P("DEEP KIT", [64, 60, 64, 62, 60, 0, 0, 10], [0, 100, 127, 100]),
P("CLICK KIT", [64, 64, 70, 64, 64, 0, 0, 0], [0, 100, 127, 100]),
P("INDUSTRIAL", [64, 62, 70, 64, 70, 20, 30, 40], [0, 100, 127, 100]),
P("SOFT KIT", [64, 64, 56, 60, 56, 0, 0, 0], [0, 100, 127, 100]),
P("GLITCH KIT", [64, 64, 70, 60, 64, 30, 20, 0], [0, 100, 127, 100]),
P("TRIBAL KIT", [64, 64, 64, 64, 60, 0, 0, 0], [0, 100, 127, 100]),
P("LASER KIT", [64, 64, 70, 64, 64, 10, 0, 10], [0, 100, 127, 100])] },
];
const FM6_E = ENG.findIndex((e) => e.name === "FM6"), FM6_OWN = FM6.FACTORY_PK.length, DRUM_E = ENG.findIndex((e) => e.name === "DRUM");
/* factory PATTERNS[] (engines.c; the device loads them from SEQ > PATTERNS, presets only suggest one): absolute
@@ -2128,7 +2204,12 @@ function makeMockDevice(opt = {}) {
TP.push(E("DIR", ["FWD", "RVRS", "PING", "RAND"], 0)); /* 91: (Skiff) the play direction */
TP.push(E("BY", ["OFF", "T1", "T2", "T3", "T4", "T5", "T6"], 0), D("DEPTH", F.PCT, 0, 127, 96), D("RELEASE", F.TIME, 0, 127, 73)); /* 92..94:
(Skiff) the ducking */
const P_COUNT = 103, G_COUNT = 27, NSTEP = 64, P_E0 = 95, G_ENGSEL = 20, P_SLCR = 45;
TP.push(E("TYPE", ["SOFT", "HARD", "FOLD", "BITS"], 0), D("TONE", F.BIPCT, -64, 63, 0)); /* 95, 96: (Skiff phase 9) DRIVE */
TP.push(D("ATTACK", F.TIME, 0, 127, 0), D("DECAY", F.TIME, 0, 127, 60), D("SUSTAIN", F.PCT, 0, 127, 0),
D("RELEASE", F.TIME, 0, 127, 40)); /* 97..100: (Skiff phase 9) ENV 2 */
for (let k = 0; k < 8; k++) TP.push(D("TUNE", F.ST16, 0, 127, 64)); /* 101..108: (phase 9) the DRUM lanes' TUNE, */
for (let k = 0; k < 8; k++) TP.push(D("DECAY", F.BIPCT, -64, 63, 0)); /* 109..116: .. DECAY (0: as designed) */
const P_COUNT = 125, G_COUNT = 27, NSTEP = 64, P_E0 = 117, G_ENGSEL = 20, P_SLCR = 45;
const clamp = (v, a, b) => Math.max(a, Math.min(b, v));
const enumOrig = (d, v) => d.fmt === F.ENUM && d.names ? aliasOf(d.names, v - d.min) + d.min : v; /* params.c enum_orig */
/* six tracks (firmware v3; Skiff phase 6), a synth part each; engine / preset / p / step below are the selected track's */
@@ -2192,6 +2273,8 @@ function makeMockDevice(opt = {}) {
st.p[37] = pr.mono ? 2 : 0;
st.p[33] = 0; st.p[34] = 24; st.p[35] = 28; st.p[36] = 36;
for (const [id, v] of pr.more) st.p[id] = v; /* (Skiff) its LFO, GLIDE, .. (core.h preset_t more) */
if (e.name === "DRUM-X" && DRUMX_PKIT[pi]) /* ((Skiff phase 9) its kit, the project's: eng_drumx.c DRUMX_PKIT) */
st.kit = DX_KITS[DRUMX_PKIT[pi] - 1].map(([mode, x, y]) => ({ mode, a: x.slice(), b: y.slice() }));
if (st.engine === FM6_E) { /* eng_fm6.c fm6_track_loaded */
const t = st.tracks[st.sel];
t.own = null;
@@ -3516,20 +3599,24 @@ const EXPECT = { pcount: 91, gcount: 27, pe0: 83 };
/* the same layout without the chord keys (P_COUNT 89, P_E0 81), the FM operator ENVs too (69, 61) or the matrix
(firmware 1.0: 57, 49) */
const knownLayout = (info) => info.gcount === EXPECT.gcount &&
[[103, 95], [100, 92], [99, 91], [91, 83], [89, 81], [69, 61], [57, 49]].some(([c, e]) => info.pcount === c && info.pe0 === e);
[[125, 117], [103, 95], [100, 92], [99, 91], [91, 83], [89, 81], [69, 61], [57, 49]].some(([c, e]) => info.pcount === c && info.pe0 === e);
const P = { LEVEL: 0, SLEN: 29 };
const LAYOUT = (pe0) => [
{ t: "ENV", pages: [["ENV", 0, [1, 2, 3, 4]], ["ENV DEST", 0, [5, 6, 7]]] }, /* ((Skiff W5) P_ED_FX, 8: nothing reads it) */
{ t: "ENV", pages: [["ENV", 0, [1, 2, 3, 4]], ["ENV DEST", 0, [5, 6, 7]], /* ((Skiff W5) P_ED_FX, 8: nothing reads it) */
...(pe0 >= 117 ? [["ENV 2", 0, P_ENV2]] : [])] }, /* ((Skiff phase 9) ENV 2: the MOD matrix's ENV2) */
{ t: "LFO", pages: [["LFO", 0, [9, 10, 11, 12]], ["LFO DEST", 0, [13, 14, 15, 16]]] },
...(pe0 >= 61 ? [{ t: "MOD", mod: 49 }] : []), /* the matrix: P_M1SRC 49 .. P_M4AMT 60, one row per slot */
{ t: "EDIT", engine: true, pages: [["EDIT 1", 0, [pe0, pe0 + 1, pe0 + 2, pe0 + 3]], ["EDIT 2", 0, [pe0 + 4, pe0 + 5, pe0 + 6, pe0 + 7]],
...(pe0 >= 91 && ["DRUM", "DRUM-X"].includes(engName()) ? [["LANES", 0, P_LANES.slice(0, 4)], ["LANES 2", 0, P_LANES.slice(4)]] : [])] }, /* lane levels 83..90 */
...(pe0 >= 91 && ["DRUM", "DRUM-X"].includes(engName()) ? [["LANES", 0, P_LANES.slice(0, 4)], ["LANES 2", 0, P_LANES.slice(4)]] : []), /* lane levels 83..90 */
...(pe0 >= 117 && engName() === "DRUM" ? [["TUNE", 0, P_LTUNE.slice(0, 4)], ["TUNE 2", 0, P_LTUNE.slice(4)], /* ((Skiff phase 9) */
["DECAY", 0, P_LDECAY.slice(0, 4)], ["DECAY 2", 0, P_LDECAY.slice(4)]] : [])] },
...(pe0 >= 81 && engName() === "DIGITAL" ? [{ t: "OP ENV", pages: [ /* P_FM1_ATK 61: ATK DEC SUS REL LVL per operator (a
FELUCCA_FM4=1 firmware only: DIGITAL retired, its engine is "-") */
...[0, 1, 2, 3].map((k) => [`OP${k + 1}`, 0, [61 + 5 * k, 62 + 5 * k, 63 + 5 * k, 64 + 5 * k]]),
["OP LVL", 0, [65, 70, 75, 80]]] }] : []),
{ t: "VOICE", pages: [["LEVEL", 0, [0]], ["VOICE", 0, [37, 38, 41, 42]], ["VOICE 2", 0, [43, 44, 39, 40]]] },
{ t: "FX", pages: [["FX", 0, [33, 34, 35, 36]], ["SLICER", 0, [45, 46, 47, 48]], ...(pe0 >= 95 ? [["DUCK", 0, P_DUCK]] : []), ["DLY", 1, [4, 5, 6, 7]], ["REVERB", 1, [24, 8, 9]], ["CHORUS", 1, [10, 11]]] }, /* G_RTYPE 24: ROOM / SPRING */
{ t: "FX", pages: [["FX", 0, [33, 34, 35, 36]], ...(pe0 >= 117 ? [["DRIVE", 0, [33, ...P_DRIVE]]] : []),
["SLICER", 0, [45, 46, 47, 48]], ...(pe0 >= 95 ? [["DUCK", 0, P_DUCK]] : []), ["DLY", 1, [4, 5, 6, 7]], ["REVERB", 1, [24, 8, 9]], ["CHORUS", 1, pe0 >= 117 ? [10, 11, 25, 26] : [10, 11]]] }, /* G_RTYPE 24: ROOM / SPRING */
{ t: "SCL", pages: [["SCL", 0, [25, 26, 27, 28]], ...(pe0 >= 83 ? [["CHORD", 0, P_CHORD]] : [])] }, /* CHRD VOIC 81, 82 */
{ t: "ARP", pages: [["ARP", 0, [17, 18, 19, 20]], ["ARP 2", 0, [21, 22, 23, 24]]] },
{ t: "SEQ PATTERN", tab: "seqgroups", pages: [["PATTERN", 0, [29, 30, 31, 32]], ...(pe0 >= 92 ? [["PLAY", 0, [P_DIR]]] : [])] },
@@ -4020,6 +4107,7 @@ async function afterSoundChange(msg = "ready", d = dev) {
needReload = false; /* this re-reads everything a RELOAD asks for */
d.dump = await getDump(d);
await rereadEngineDesc(d);
if (d === dev && kitShown()) await readKit(d); /* ((Skiff phase 9) a DRUM-X preset loads its own kit) */
updateBrowser();
refreshAll();
await loadStepsIfShown(d); /* (a sound load keeps them; read anyway after a RELOAD) */
+38 -34
View File
@@ -38,7 +38,7 @@ const E = vm.runInNewContext(proto + `
;({ frame, unframe, parse, req, Link, parseWav, resample, normalize, takeSample, autoTrim, zoomView, rootFromName, buildSlot, makeMockDevice, CMD, SMP,
UP, bank, capturePatch, auditionPatch, lightRefuses, startWatch, libraryFile, readLibraryFile, paramKeys, patternFromSteps, stepsFromPattern, upName,
mixer, parseNotes, parseHits, hitsText, gridFromSteps, LANE_NOTE, LANE_OF, readDevicePreferences, devicePresetRows, TC_NAMES, engineOrder, ENGINE_ORDER, aliasOf, fmtValue, FM6, enumShown, F,
FM4, fromDigital, fromPerc, DRUM_KIT_E, DX_KIT_DEF,
FM4, fromDigital, fromPerc, DRUM_KIT_E, DX_KIT_DEF, DX_KITS, DRUMX_PKIT,
MENU: typeof MENU === "undefined" ? null : MENU, MENU_TABS: typeof MENU_TABS === "undefined" ? null : MENU_TABS,
readDeviceMenu: typeof readDeviceMenu === "undefined" ? null : readDeviceMenu })`,
{ setTimeout, clearTimeout, setInterval, clearInterval, console });
@@ -51,7 +51,7 @@ async function editorMock() {
const rq = async (r, o) => link.request(r, o);
const info = E.parse[E.CMD.INFO](await rq(E.req.info()));
ok(info.nengines === 15 && info.engines[1] === "-" && info.engines[12] === "FM6" && info.engines[13] === "SLICE" && info.engines[14] === "DRUM-X"
&& info.engines[5] === "VOICE" && info.engines[6] === "TRIO" && info.engines[7] === "WHEEL" && info.engines[8] === "GRAIN" && info.engines[9] === "PHYS" && info.engines[10] === "DRUM" && info.engines[11] === "NOISE" && info.pcount === 103 && info.pe0 === 95 && info.engines[4] === "SAMPLE",
&& info.engines[5] === "VOICE" && info.engines[6] === "TRIO" && info.engines[7] === "WHEEL" && info.engines[8] === "GRAIN" && info.engines[9] === "PHYS" && info.engines[10] === "DRUM" && info.engines[11] === "NOISE" && info.pcount === 125 && info.pe0 === 117 && info.engines[4] === "SAMPLE",
"editor: INFO");
let descs = 0;
for (let i = 0; i < info.pcount; i++) if (E.parse[E.CMD.DESC](await rq(E.req.desc(0, i))).label) descs++;
@@ -77,7 +77,7 @@ async function editorMock() {
const md = [];
for (let i = 49; i < 61; i++) md.push(E.parse[E.CMD.DESC](await rq(E.req.desc(0, i))));
ok(md.map((d) => d.label).join() === "SRC1,DEST1,AMT1,SRC2,DEST2,AMT2,SRC3,DEST3,AMT3,SRC4,DEST4,AMT4"
&& md[0].names.join() === "OFF,LFO,ENV,VEL,KEY,RAND,MODW,AT,EXPR" && md[1].names.length === 20
&& md[0].names.join() === "OFF,LFO,ENV,VEL,KEY,RAND,MODW,AT,EXPR,ENV2" && md[1].names.length === 20
&& md[1].names[11] === "VIB" && md[1].names[19] === "E8" && md[2].min === -64 && md[2].max === 63 && md.every((d) => d.def === 0),
"editor: matrix parameters 49..60 over DESC (20 DST names)");
await rq(E.req.set(0, 52, 1));
@@ -241,9 +241,10 @@ async function editorMock() {
const r0 = E.parse[E.CMD.SET](await rq(E.req.set(1, 24, 0)));
const inert = [25, 26].map(async (id) => E.parse[E.CMD.DESC](await rq(E.req.desc(1, id))));
const [d25, d26] = await Promise.all(inert);
ok(rd.label === "TYPE" && rd.def === 0 && eq(rd.names, ["ROOM", "SPRING"]) && r1.value === 1 && r0.value === 0 &&
d25.label === "-" && d26.label === "-" && d25.max === 0 && info.gcount === 27,
"editor: REVERB TYPE (ROOM / SPRING, global id 24; 25, 26 still inert)");
ok(rd.label === "TYPE" && rd.def === 0 && eq(rd.names, ["ROOM", "SPRING", "HALL"]) && r1.value === 2 && r0.value === 0 &&
d25.label === "MODE" && eq(d25.names, ["CHORUS", "FLANGER", "PHASER"]) && d26.label === "FEEDBACK" && d26.max === 127 &&
info.gcount === 27,
"editor: REVERB TYPE (ROOM / SPRING / HALL, global id 24); (phase 9) CHORUS MODE, FEEDBACK (25, 26)");
}
const st = E.parse[E.CMD.STEP_SET](await rq(E.req.stepSet(5, { n: 2, notes: [60, 64], time: 0, flags: 1, vel: 100 })));
ok(st.n === 2 && st.notes[1] === 64 && st.vel === 100, "editor: STEP_SET");
@@ -274,9 +275,10 @@ async function editorSamplePresets() {
const names = E.parse[C.NAMES](await rq(E.req.names(4)));
await rq(E.req.preset(4, 0));
const set = E.parse[C.DESC](await rq(E.req.desc(0, info.pe0)));
ok(eq(names.names, ["PIANO", "PIANO", "FLUTE", "SAX"]) && eq(set.names.slice(0, 4), ["PIANO", "PIANO", "FLUTE", "SAX"])
&& set.names[4] === "PIANO" && eq(set.names.slice(5), ["USR1", "USR2", "USR3"]),
"SAMPLE: TRANH and PERC removed, SET 1 and 4 kept as PIANO aliases, indices unchanged");
ok(eq(names.names.slice(0, 6), ["PIANO", "PIANO", "FLUTE", "SAX", "PIANO", "LOFI PIANO"]) && names.names.length === 10 &&
eq(set.names.slice(0, 4), ["PIANO", "PIANO", "FLUTE", "SAX"]) && set.names[4] === "PIANO" &&
eq(set.names.slice(5), ["USR1", "USR2", "USR3"]),
"SAMPLE: TRANH and PERC removed, SET 1 and 4 kept as PIANO aliases, indices unchanged; (phase 9) the variations after");
ok(E.aliasOf(names.names, 1) === 0 && E.aliasOf(names.names, 2) === 2 && E.aliasOf(set.names, 5) === 5 &&
E.aliasOf(set.names, 4) === 0, "SAMPLE: an entry named like an earlier one is an alias of it");
const alias = E.parse[C.PRESET](await rq(E.req.preset(4, 1)));
@@ -323,11 +325,11 @@ function mockTables() {
const m0 = E.makeMockDevice({ auto: false }), ph = m0.tables.ENG[9], dr = m0.tables.ENG[10];
m0.stop();
ok(ph.name === "PHYS" && ph.edit[0].names.join() === "MODAL,STRNG,MEMB,SYMP" && ph.edit[0].max === 3 &&
ph.presets.length === 10 && !ph.presets.some((p) => p.name === "RAIN" || p.name === "DRUM KIT"),
"editor: PHYS models MODAL STRNG MEMB SYMP (no DUST, no DRUM), 10 presets");
ph.presets.length === 11 && !ph.presets.some((p) => p.name === "RAIN" || p.name === "DRUM KIT"),
"editor: PHYS models MODAL STRNG MEMB SYMP (no DUST, no DRUM), 11 presets");
ok(dr.name === "DRUM" && dr.edit.map((d) => d.label).join() === "KIT,PITCH,TONE,DECAY,SNAP,ACCENT,KICK,DRIVE" &&
dr.presets.length === 3 && dr.presets[0].name === "DRUM KIT",
"editor: DRUM engine 10 (KIT PITCH TONE DECAY SNAP ACCENT KICK DRIVE), DRUM KIT first of 3");
dr.presets.length === 10 && dr.presets[0].name === "DRUM KIT",
"editor: DRUM engine 10 (KIT PITCH TONE DECAY SNAP ACCENT KICK DRIVE), DRUM KIT first of 10");
}
const dj = DESC;
if (!existsSync(dj)) { console.log("editor: mock tables == firmware (no build/host/desc.json) skip"); return; }
@@ -364,6 +366,8 @@ function mockTables() {
cmp("DRUM grid: the lanes' GM notes", [...E.LANE_NOTE], fw.LANE_NOTE);
cmp("DRUM grid: the lane of GM 35..81", E.LANE_OF, fw.LANE_OF);
cmp("DRUM-X factory kit", E.DX_KIT_DEF, fw.DX_KIT);
cmp("DRUM-X preset kits (phase 9)", E.DX_KITS, fw.DX_KITS);
cmp("DRUM-X preset -> kit", E.DRUMX_PKIT, fw.DRUMX_PKIT);
const mj = join(DESC, "../menu.json");
if (E.MENU && existsSync(mj)) { /* the MENU settings: tests/editor_test.c's MENU_DESC replies */
const fm = JSON.parse(readFileSync(mj, "utf8"));
@@ -443,7 +447,7 @@ async function editorFm4() {
want = E.FM4.convert(digital(5, d0.p), info.pe0);
ok(d.engine === 12 && d.preset === 4 && eq(d.p, owned(want.p)) && E.FM6.name(E.FM6.unpack(await fm6Of())) === "PAD",
"DIGITAL retired: PRESET 1 5 (its PAD) -> FM6, the converted patch named PAD, SLOT OWN, preset FM6 PAD");
/* library files of DIGITAL sounds: today's 103 parameters (P_E0 95: (Skiff) DIR at 91, the ducking 92..94), 91 (P_E0 83: before the DRUM lane levels),
/* library files of DIGITAL sounds: today's parameters (INFO's: (Skiff) DIR at 91, the ducking 92..94, phase 9's 95..116), 91 (P_E0 83: before the DRUM lane levels),
89 (P_E0 81), 69 (P_E0 61, no OP ENV) */
const PC = info.pcount, PE = info.pe0;
const base = Array.from({ length: PC }, (_, i) => (i < PE ? pdesc[i].def : 0));
@@ -635,10 +639,10 @@ async function editorLibrarian() {
ok(rc === 0 && (await E.bank.get(rq, info, 13)).name === `${info.engines[d4.engine]} 14`, "librarian: UP_STORE with no name -> automatic name");
/* library files */
const ctx = { keys, engines: info.engines, firmware: info.version, pe0: info.pe0 };
const ctx = { keys, engines: info.engines, firmware: info.version, pe0: info.pe0 }, PC = info.pcount, PE = info.pe0;
const pts = [cap, { ...bass, engineName: info.engines[bass.engine], tags: ["bass", "device"] }];
const file = JSON.parse(JSON.stringify(E.libraryFile("library", pts, ctx)));
ok(file.format === "felucca-library" && file.version === 1 && file.pCount === 103 && file.paramLabels.length === 103 && file.paramLabels[81] === "CHORD" && file.paramLabels[82] === "VOICING" &&
ok(file.format === "felucca-library" && file.version === 1 && file.pCount === PC && file.paramLabels.length === PC && file.paramLabels[81] === "CHORD" && file.paramLabels[82] === "VOICING" &&
file.paramLabels[83] === "KICK" && file.paramLabels[90] === "BELL" && file.paramLabels[91] === "DIR" && file.paramLabels[92] === "BY" && file.engines.length === 15,
"library file: versioned, with P_COUNT, labels and engines");
const back = E.readLibraryFile(file, ctx);
@@ -652,7 +656,7 @@ async function editorLibrarian() {
"DEPTH", "SRC1", "DST1", "AMT1", "SRC2", "DST2", "AMT2", "SRC3", "DST3", "AMT3", "SRC4", "DST4", "AMT4",
"ATK", "DEC", "SUS", "REL", "LVL", "ATK", "DEC", "SUS", "REL", "LVL", "ATK", "DEC", "SUS", "REL", "LVL", "ATK", "DEC", "SUS",
"REL", "LVL", "CHRD", "VOIC", "KICK", "SNARE", "CLAP", "HATCL", "HATOP", "TOM", "RIM", "BELL", "DIR", "BY", "DEPTH", "REL"];
const oldKeys = E.paramKeys(OLD.map((label) => ({ label })), OLD.length, OLD.length).concat(keys.slice(info.pe0));
const oldKeys = E.paramKeys(OLD.map((label) => ({ label })), OLD.length, OLD.length).concat(keys.slice(OLD.length)); /* ((phase 9) 95..: today's) */
const lp = E.readLibraryFile({ ...file, paramLabels: oldKeys }, ctx).patches[0].p;
ok(oldKeys[0] === "LVL" && keys[0] === "LEVEL" && eq(lp, cap.p), "library file: a file keyed by the labels before U4 (LVL ATK ..) maps by id");
}
@@ -661,43 +665,43 @@ async function editorLibrarian() {
const eng2 = ["PHASE", "ANALOG", "SAMPLE"];
const fut = E.readLibraryFile(file, { keys: keys2, engines: eng2 });
const p0 = fut.patches[0].p;
ok(fut.patches.length === 2 && p0.length === 104 && p0[5] === null && p0[6] === cap.p[5] && p0[103] === cap.p[102]
ok(fut.patches.length === 2 && p0.length === PC + 1 && p0[5] === null && p0[6] === cap.p[5] && p0[PC] === cap.p[PC - 1]
&& fut.patches[0].engine === 1 && fut.patches[1].engine === 0, "library file: other ids / engine order mapped by label and name");
const lost = E.readLibraryFile({ ...file, patches: [{ ...file.patches[0], engineName: "WAVETABLE" }] }, ctx);
ok(lost.patches.length === 0 && lost.skipped === 1, "library file: a patch for an unknown engine is skipped");
const bankFile = E.libraryFile("bank", [{ ...g, engineName: "ANALOG", slot: 10 }], ctx);
ok(bankFile.kind === "bank" && bankFile.patches[0].slot === 10 && E.readLibraryFile(bankFile, ctx).patches[0].slot === 10, "library file: bank export keeps slot numbers");
{ /* files from the 69-parameter firmware (P_E0 61): the engine's 8 land on E0..E7 (95..102), FM op ENV, the
{ /* files from the 69-parameter firmware (P_E0 61): the engine's 8 land on E0..E7, FM op ENV, the
chord keys, the lane levels, DIR and the ducking stay unset */
const p69 = [...cap.p.slice(0, 61), ...cap.p.slice(95, 103)];
const p69 = [...cap.p.slice(0, 61), ...cap.p.slice(PE, PE + 8)];
const sp = E.readLibraryFile({ format: "felucca-patch", version: 1, engine: cap.engine, engineName: info.engines[cap.engine], p: p69 }, ctx).patches[0].p;
const keys69 = [...keys.slice(0, 61), ...keys.slice(95)];
const keys69 = [...keys.slice(0, 61), ...keys.slice(PE)];
const lp = E.readLibraryFile({ ...file, pCount: 69, paramLabels: keys69, patches: [{ ...file.patches[0], params: p69 }] }, ctx).patches[0].p;
const nk = E.readLibraryFile({ ...file, paramLabels: undefined, patches: [{ ...file.patches[0], params: p69 }] }, ctx).patches[0].p;
const good = (q) => q.length === 103 && eq(q.slice(0, 61), cap.p.slice(0, 61)) && eq(q.slice(95), cap.p.slice(95)) && q.slice(61, 95).every((v) => v === null);
ok(good(sp) && good(lp) && good(nk), "library file: 69-parameter files (patch, labelled, unlabelled) map the engine's 8 to 95..102");
const good = (q) => q.length === PC && eq(q.slice(0, 61), cap.p.slice(0, 61)) && eq(q.slice(PE), cap.p.slice(PE)) && q.slice(61, PE).every((v) => v === null);
ok(good(sp) && good(lp) && good(nk), "library file: 69-parameter files (patch, labelled, unlabelled) map the engine's 8 to E0..E7");
}
{ /* files from the 89-parameter firmware (P_E0 81, before the chord keys): the engine's 8 land on 95..102, the FM
{ /* files from the 89-parameter firmware (P_E0 81, before the chord keys): the engine's 8 land on E0..E7, the FM
op ENV in place, CHRD VOIC unset (left as the track has them), the lane levels unset */
const p89 = [...cap.p.slice(0, 81), ...cap.p.slice(95, 103)];
const keys89 = [...keys.slice(0, 81), ...keys.slice(95)];
const p89 = [...cap.p.slice(0, 81), ...cap.p.slice(PE, PE + 8)];
const keys89 = [...keys.slice(0, 81), ...keys.slice(PE)];
const sp = E.readLibraryFile({ format: "felucca-patch", version: 1, engine: cap.engine, engineName: info.engines[cap.engine], p: p89 }, ctx).patches[0].p;
const lp = E.readLibraryFile({ ...file, pCount: 89, pE0: 81, paramLabels: keys89, patches: [{ ...file.patches[0], params: p89 }] }, ctx).patches[0].p;
const nk = E.readLibraryFile({ ...file, paramLabels: undefined, patches: [{ ...file.patches[0], params: p89 }] }, ctx).patches[0].p;
const good = (q) => q.length === 103 && eq(q.slice(0, 81), cap.p.slice(0, 81)) && q.slice(81, 95).every((v) => v === null) && eq(q.slice(95), cap.p.slice(95));
const good = (q) => q.length === PC && eq(q.slice(0, 81), cap.p.slice(0, 81)) && q.slice(81, PE).every((v) => v === null) && eq(q.slice(PE), cap.p.slice(PE));
ok(keys89[81] === "E0" && good(sp) && good(lp) && good(nk),
"library file: 89-parameter files (patch, labelled, unlabelled) map the engine's 8 to 95..102, the chord keys unset");
"library file: 89-parameter files (patch, labelled, unlabelled) map the engine's 8 to E0..E7, the chord keys unset");
}
{ /* files from 1.0.x (91 parameters, P_E0 83, before the DRUM lane levels): the engine's 8 land on 95..102, the
{ /* files from 1.0.x (91 parameters, P_E0 83, before the DRUM lane levels): the engine's 8 land on E0..E7, the
chord keys in place, the lane levels unset (a sound load sets them to 100 %) */
const p91 = [...cap.p.slice(0, 83), ...cap.p.slice(95, 103)];
const keys91 = [...keys.slice(0, 83), ...keys.slice(95)];
const p91 = [...cap.p.slice(0, 83), ...cap.p.slice(PE, PE + 8)];
const keys91 = [...keys.slice(0, 83), ...keys.slice(PE)];
const sp = E.readLibraryFile({ format: "felucca-patch", version: 1, engine: cap.engine, engineName: info.engines[cap.engine], p: p91 }, ctx).patches[0].p;
const lp = E.readLibraryFile({ ...file, pCount: 91, pE0: 83, paramLabels: keys91, patches: [{ ...file.patches[0], params: p91 }] }, ctx).patches[0].p;
const nk = E.readLibraryFile({ ...file, paramLabels: undefined, patches: [{ ...file.patches[0], params: p91 }] }, ctx).patches[0].p;
const good = (q) => q.length === 103 && eq(q.slice(0, 83), cap.p.slice(0, 83)) && q.slice(83, 95).every((v) => v === null) && eq(q.slice(95), cap.p.slice(95));
const good = (q) => q.length === PC && eq(q.slice(0, 83), cap.p.slice(0, 83)) && q.slice(83, PE).every((v) => v === null) && eq(q.slice(PE), cap.p.slice(PE));
ok(keys91[83] === "E0" && good(sp) && good(lp) && good(nk),
"library file: 91-parameter files (1.0.x: patch, labelled, unlabelled) map the engine's 8 to 95..102, the lane levels unset");
"library file: 91-parameter files (1.0.x: patch, labelled, unlabelled) map the engine's 8 to E0..E7, the lane levels unset");
}
const old = E.readLibraryFile({ format: "felucca-patch", version: 1, engine: 0, preset: 4, engineName: "ANALOG", presetName: "ACID", p: d2.p, steps: E.stepsFromPattern(cap.pattern) }, ctx);
ok(old.patches.length === 1 && eq(old.patches[0].p, d2.p) && js(old.patches[0].pattern) === js(cap.pattern), "library file: reads the old \"Save to file\" format");
@@ -979,7 +983,7 @@ async function editorLive() {
const dump = E.parse[C.DUMP](await pend, info);
const ch = ev.pushes.find((f) => f.cmd === C.CHANGED);
const cv = ch && E.parse[C.CHANGED](ch.a);
ok(dump.p.length === 103 && ch && ch.pending === C.DUMP && cv.scope === 0 && cv.id === 9 && cv.value === kn.value && !ev.unknown.length,
ok(dump.p.length === 125 && ch && ch.pending === C.DUMP && cv.scope === 0 && cv.id === 9 && cv.value === kn.value && !ev.unknown.length,
"live: CHANGED while DUMP waits -> push handler, reply still matched");
const rl = m.sim.reload();
m.sim.step(3);