From a05a1909ba0dcb8124e5b284f5c5da8617b7865b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 17 Oct 2026 01:17:17 +0000 Subject: [PATCH 1/2] 0.8.5: DRUM-X octaves: ratchets x2 / x4 / x8 above the kit, SHORT / GHOST / FLAM below, recorded as played On a DRUM track the keys keep the kit on the same keys at every OCT (drum_keys no longer adds the octave); OCT says how they play and the screen names it on each press (RATCHET x2 / x4 / x8, SHORT, GHOST, FLAM, DRUM-X KIT). OCT 0 is the kit exactly as before (bit for bit: every golden render unchanged). Above (seq.c dxo_*): the hit, then again x2 / x4 / x8 a step while held: playing on the step's RATCH grid (each step's start, then every step/n, swing included), stopped every step/n of the track's DIV from the press; the release ends it. Below (eng_drum.c DXO_*, per-hit modulation of the DRUM-X voice, no new voice type): SHORT -14 DECAY (half the decay time), GHOST -14 DECAY -24 TONE and ~45 % velocity, FLAM a grace hit at ~45 % then the hit itself DXO_FLAM blocks later (~20 ms, tempo-independent, a retrigger of the same lane). Live REC stores what was played, played back identically (tested to the block): the hit plus the step's RATCH x2 / x4; x8 (past RATCH's x4) as ECHO x8 with the new EVEN flag (carg bit 7: every repeat at the step's level); below, the new step component TOUCH (carg SHORT / GHOST / FLAM). A ratchet held over several steps writes each step before the sequencer plays it (the held note is silent there); an early release in the last one puts that step back, as a held synth note's TIE. The count-in keeps the octave too. They show and edit on SEQ > COMP like any step (TOUCH: HIT SHORT / GHOST / FLAM; ECHO: x8 EVEN, KNOB 3 keeps EVEN). They are the step's: everything on that step plays with them; a centre-octave hit leaves them alone. MIDI: 35..81 the GM map exactly as before. The notes around it, which played their octave of 36..47 plain, are now the octaves' bands by pitch class: 23..34 SHORT, 11..22 GHOST, 0..10 FLAM, 82..93 x2, 94..105 x4, 106..127 x8; the keys send those notes to MIDI OUT. Compat flag: songs / MIDI setups sending drum notes below 35 or above 81 now hear these variations (move them into 35..81 to keep the old sound); stored step notes play as before whatever their number; keys with OCT moved no longer reach GM 56..81. No format change: TOUCH is a comp value (firmware before 0.8.5 refuses a project holding one, as any unknown component), EVEN a bit older firmware reads as a fading ECHO. Installer (web/index_pkg.html): before writing 0.8.5 the preview installer (its version ends -preview) shows a notice in English / Japanese (its languages) and Spanish: the feature, that existing songs / MIDI setups may change, how to keep the old sound, back up first (editor backup); install asks to confirm. The public installer (web/STABLE, 0.7.4) never shows it; web/STABLE untouched. The notice keys on the package version v0.8.5: FELUCCA_VERSION is still "v0.8.4". Cost (on 0.8.4): callgrind every entry within 0.3 % (song/cputest 3079 -> 3082, seq/heavy 2786 -> 2788, eng/DRUM 1579 -> 1581); target loops unchanged (drum_render 33, dx_run 419; perf_block 522 -> 528, layout); flash image 498108 -> 498260 B; .data+.bss 84848 -> 85600 B (held ratchets 4 a part, their recording backup, 3 bytes a lane); RAM code 21676 -> 21768 B; LOWBUF 28064 B and the pool 247584 B unchanged. Tests: new tests/drumx_oct_test.c (centre bit for bit and recorded plain; x2 / x4 / x8 stopped and playing on the grid; SHORT / GHOST / FLAM length, level, brightness and the grace hit measured; live REC both ways played back as heard, early release, late press; MIDI bands, MIDI REC, a FUNC round trip; the OCT message, COMP TOUCH and ECHO EVEN); web/test_web.mjs: the installer notice (preview only, 0.8.5 only, EN / JA / ES). Manuals EN / ES, cheat sheets regenerated, README v0.8.5. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh --- README.md | 36 +- docs/MANUAL.es.md | 40 ++- docs/MANUAL.md | 40 ++- docs/cheatsheet/controls.html | 2 +- docs/cheatsheet/sound.html | 2 +- firmware/src/core.h | 15 +- firmware/src/eng_drum.c | 73 +++- firmware/src/midi_control.c | 14 +- firmware/src/seq.c | 286 ++++++++++++++-- firmware/src/ui.c | 5 +- firmware/src/ui_draw.c | 3 +- firmware/src/ui_input.c | 8 +- tests/drumx_oct_test.c | 605 ++++++++++++++++++++++++++++++++++ tests/run_tests.sh | 6 + tools/gen_cheatsheets.py | 4 +- web/index_pkg.html | 35 +- web/test_web.mjs | 10 + 17 files changed, 1129 insertions(+), 55 deletions(-) create mode 100644 tests/drumx_oct_test.c diff --git a/README.md b/README.md index da04ed7d..7d522c53 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,10 @@ and takes its song system from [SLOOP](https://github.com/isod89/sloop-fm1). the FM-1, with sound, and is played with your computer keyboard or the mouse. The emulator, the installer and the editor update themselves with every change merged into `main`. -> **Status: in development (v0.8.4).** It builds and passes every test (Felucca's and its own), Back up the flash before installing it. +> **Status: in development (v0.8.5).** It builds and passes every test (Felucca's and its own), Back up the flash before installing it. + **DRUM-X octaves** (0.8.5): the kit stays on its keys at every OCT; above the centre it ratchets in time (x2, x4, x8), + below it plays SHORT, GHOST or FLAM, and live recording keeps exactly what you played. MIDI drum notes outside 35–81 + now trigger these variations: see the changelog before installing. > ⚡ **New in 0.6.85 – 0.6.92: a song generator you steer, a compact sequencer that breathes, a delay that feeds back.** > - **GEN (HOME + SELECT)**: a screen of three pages — GENRE (43 genres or RANDOM), SEED, ENERGY, FORM (loop, parts, @@ -537,6 +540,37 @@ JIANT's modifications are distributed under the same license. Every update is listed here, newest first. (Since 0.6.80 at the end of the page: what the synth does comes first.) +### v0.8.5 +- **DRUM-X octaves** (the owner: "in the centre octave the DRUM-X as it is now; going up the octaves the same sounds in + ratchet with the step components that exist, an octave up half the ratchet time and so on; going down something + else"). On a DRUM track the keys keep the kit on the same keys at every OCT (C the kick, D the snare …); OCT now says + **how** they play, and the screen names it: **+1 RATCHET x2, +2 x4, +3 x8** (in time while held: playing on the step's + RATCH grid, swing included, stopped every step/n from the press); **−1 SHORT** (half the decay), **−2 GHOST** (short, + ~45 % of the level, darker: a ghost note), **−3 FLAM** (a soft grace hit, the hit ~20 ms later whatever the tempo). + OCT 0 is the kit as it was, bit for bit (every golden render unchanged). +- **Recorded as played** ("y que se graben así en record en la secuencia"): live REC writes the hit and the step's own + components, so the pass after sounds as you heard it (tested to the block): **RATCH x2 / x4**, **ECHO x8 EVEN** for + x8 (RATCH stops at x4; ECHO's new **EVEN** keeps every repeat at one level), and the new component **TOUCH** (SHORT / + GHOST / FLAM) below. A ratchet held over several steps writes each of them (an early release in the last one puts + it back, as a held note's TIE). They show and edit on SEQ > COMP like any step. They are the step's: a kick already + on the step ratchets along; a centre-octave hit leaves a step's RATCH / TOUCH alone. +- **MIDI**: 35–81 play the GM drum map exactly as before. The notes around it, which played their octave of 36–47 plain, + are now the octaves' bands by pitch class: 23–34 SHORT, 11–22 GHOST, 0–10 FLAM, 82–93 x2, 94–105 x4, 106–127 x8 (MIDI + OUT sends the keys' notes the same way). **A song or setup that sent drum notes below 35 or above 81 sounds different + now**: move them into 35–81 to keep the old sound. Notes stored in steps play as before, whatever their number; the + keys with OCT moved no longer reach GM 56–81 (MIDI still does). +- **Projects**: no new format. TOUCH is a component (the comp byte), EVEN bit 7 of ECHO's argument. Firmware before 0.8.5 + refuses a project holding a TOUCH (as it would any component it does not know: back up first) and plays an ECHO + EVEN as an ordinary, fading ECHO. +- **Cost**: CPU callgrind every entry within 0.3 % of 0.8.4 (song/cputest 3079 → 3082, eng/DRUM 1579 → 1581: a table + look-up a hit, a byte test a block when nothing is held); target loops unchanged (drum_render 33, dx_run 419). Flash + image 498108 → 498260 B; .data+.bss 84848 → 85600 B (the held ratchets, 4 a track, and their recording; three bytes a + lane); RAM code 21676 → 21768 B; LOWBUF and the pool unchanged (28064 B, 247584 B). +- Tests: tests/drumx_oct_test.c (centre bit for bit, the ratchets stopped and playing on the grid, SHORT / GHOST / FLAM + measured, live REC played back as heard both ways, MIDI bands and MIDI REC, a project round trip, the OCT message, COMP); + web/test_web.mjs: the installer's 0.8.5 notice. The preview installer shows a notice (EN / JA / ES) before writing + 0.8.5 and asks to confirm a backup; the public one (web/STABLE) does not. + ### v0.8.4 - **RAM freed for what comes next** (the owner: room for assignable FX buses). The sound is the same (every golden render bit for bit), projects and backups unchanged. diff --git a/docs/MANUAL.es.md b/docs/MANUAL.es.md index 164a0967..3248aa0e 100644 --- a/docs/MANUAL.es.md +++ b/docs/MANUAL.es.md @@ -108,7 +108,7 @@ Los nombres de abajo son los que usa el firmware (la pantalla HARDWARE CALIBRATI | **SEQ** | Páginas SEQ: en una página SEQ, el siguiente juego de perillas del nivel de zoom en el que estás; desde otro lado, vuelve al nivel y al juego que usaste por última vez en esa pista. | Capa **SEQ TOOLS** (en todas las páginas SEQ). | | **PLAY** | Arranca / para. | — | | **REC** | Arma / desarma la grabación en la pista seleccionada. | Capa **REC**: CLEAR, CLICK. | -| **OCT− / OCT+** | Octava del teclado (−3 a +3; los dos juntos: vuelve a 0). En páginas de acción y en diálogos: **OCT−** = atrás / NO, **OCT+** = hacerlo / YES. | — | +| **OCT− / OCT+** | Octava del teclado (−3 a +3; los dos juntos: vuelve a 0; en una pista DRUM el kit queda en sus teclas: ratchets arriba, SHORT / GHOST / FLAM abajo, ver [5](#5-drum-x)). En páginas de acción y en diálogos: **OCT−** = atrás / NO, **OCT+** = hacerlo / YES. | — | ### Las teclas @@ -566,6 +566,39 @@ DRUM-X es un kit sintetizado de ocho sonidos, **BD SD CP CH OH TM RS CB**, gener - **EDIT mantenido + SELECT** tira un kit nuevo alrededor del de fábrica. **EDIT mantenido + F3 (INIT)** trae de vuelta el kit de fábrica. +### El kit en cada octava (0.8.5) + +Las teclas tocan el kit en las mismas teclas en **cualquier OCT** (C el bombo, D la caja, F# el hi-hat cerrado …); OCT +ahora cambia **cómo** suenan, no qué sonido. La pantalla lo dice cuando apretás OCT en una pista DRUM: + +| OCT | Qué hace una tecla | Se graba (REC) como | +|---|---|---| +| **+3** | **RATCHET x8**: el golpe ocho veces por paso mientras la mantenés | el golpe + el **ECHO x8 EVEN** del paso (todas al mismo nivel) | +| **+2** | **RATCHET x4** | el golpe + el **RATCH x4** del paso | +| **+1** | **RATCHET x2** | el golpe + el **RATCH x2** del paso | +| **0** | el kit como siempre | el golpe | +| **−1** | **SHORT**: la mitad del decay | el golpe + el **TOUCH SHORT** del paso | +| **−2** | **GHOST**: corto, más suave (~45 %), más oscuro: una nota fantasma | el golpe + **TOUCH GHOST** | +| **−3** | **FLAM**: un golpe de adorno suave y el golpe ~20 ms después (sea cual sea el tempo) | el golpe + **TOUCH FLAM** | + +- Los ratchets van **a tempo**: con PLAY caen en la grilla del RATCH del paso (el comienzo de cada paso y cada paso/n, + con swing); parado, cada paso/n del DIV de la pista desde que tocás. Al soltar se detienen. +- **La grabación en vivo guarda lo que tocaste**: el paso donde cae el golpe recibe el golpe y el RATCH (o ECHO x8 EVEN, o + TOUCH); si mantenés un ratchet varios pasos, cada paso en el que sigue apretado también se escribe (y lo toca el + secuenciador, así la vuelta siguiente suena exactamente como lo escuchaste). Si soltás antes de la mitad del último, + ese paso vuelve a como estaba, igual que con una nota sostenida de un sinte. Se ven y se editan como cualquier paso: + SEQ > COMP muestra RATCH / ECHO / **TOUCH** (KNOB 3: SHORT, GHOST, FLAM); la página CHANCE el RATCH. +- RATCH, ECHO y TOUCH son **del paso**: todo lo que hay en ese paso suena con ellos. Grabar un ratchet en un paso que ya + tiene un bombo hace ratchet también del bombo; un golpe de la octava central deja el RATCH / TOUCH del paso como está. +- **MIDI** (0.8.5): las notas 35–81 siguen tocando el mapa GM de batería exactamente como antes. Las notas alrededor, + que antes sonaban como su octava de 36–47 sin más, ahora son estas octavas, por clase de altura: **23–34 SHORT, 11–22 + GHOST, 0–10 FLAM, 82–93 x2, 94–105 x4, 106–127 x8** (84 el bombo x2, 24 el bombo SHORT, 90 el hi-hat cerrado x2). Las + teclas mandan esas notas por MIDI OUT. **Una canción o un setup MIDI que mandaba notas de batería debajo de 35 o arriba + de 81** (un bombo en 24, por ejemplo) ahora va a escuchar estas variaciones: movelas a 35–81 (36–47 para las del kit) + para conservar el sonido de antes. Las notas guardadas en los pasos suenan como antes, sea cual sea su número. +- Con el ARP prendido las teclas alimentan el arpegio sin cambios (sin ratchet ni TOUCH). Las teclas de carril de la + grilla DRUM son siempre la octava central. + Un kit por sección, compartido por todas las pistas en DRUM: mientras otra pista toca DRUM-X, recorrer kits en una pista distinta deja ese kit como está ("KIT OF T4 KEPT", 0.8.1); cargá los kits en la pista de batería. El kit se guarda con cada sección de un proyecto (no con los presets de usuario — ver [12](#12-guardar-y-cargar)). --- @@ -666,6 +699,11 @@ seleccionada se graban como **automatización**. MENU > AUDIO tiene el **CLICK** FIRST solo la primera vez (una intro), !FIRST todas menos la primera (0.6.92; antes era TIMES). - **FILL**: el paso suena solo mientras mantenés **FX**. - **KILL**: el paso primero corta todo lo que suena en la pista (releases largos, notas sostenidas) y después toca. + - **TOUCH** (0.8.5, una pista DRUM): cómo se golpean sus sonidos, KNOB 3 **SHORT** (la mitad del decay), **GHOST** + (corto, más suave, más oscuro), **FLAM** (un golpe de adorno suave ~20 ms antes). Lo que graban OCT −1 / −2 / −3 + (ver [5](#5-drum-x)). En otros motores no hace nada. + - **EVEN** del ECHO (0.8.5): un ECHO grabado desde OCT +3 en un kit mantiene cada repetición al nivel del paso (un + ratchet más allá del x4 de RATCH); la tarjeta muestra "x8 EVEN", KNOB 3 lo conserva. - **WALK** y **CLIMB** (0.6.98, a la manera de los componentes evolutivos del OP-Z y el OP-XY): las notas del paso se mueven un grado de la escala (WALK) o una octava (CLIMB) **cada tantas vueltas** del patrón (KNOB 4: 1 … 10, 12, 16 vueltas por movimiento), dentro de un **rango** (WALK 3, 5, 7 o 12 grados; CLIMB 1 … 4 octavas), y vuelven a diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 4108e146..0b892bcb 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -107,7 +107,7 @@ The names below are the ones the firmware uses (the HARDWARE CALIBRATION screen | **SEQ** | SEQ pages: on a SEQ page, the next set of knobs of the zoom level you are on; from elsewhere, back to the level and set you last used on that track. | **SEQ TOOLS** layer (on every SEQ page). | | **PLAY** | Start / stop. | — | | **REC** | Arms / disarms recording on the selected track. | **REC** layer: CLEAR, CLICK. | -| **OCT− / OCT+** | Keyboard octave (−3 to +3; both together: back to 0). On action pages and in dialogs: **OCT−** = back / NO, **OCT+** = do it / YES. | — | +| **OCT− / OCT+** | Keyboard octave (−3 to +3; both together: back to 0; on a DRUM track the kit stays on its keys: ratchets above, SHORT / GHOST / FLAM below, see [5](#5-drum-x)). On action pages and in dialogs: **OCT−** = back / NO, **OCT+** = do it / YES. | — | ### The keys @@ -543,6 +543,39 @@ DRUM-X is a synthesized kit of eight sounds, **BD SD CP CH OH TM RS CB**, genera - **EDIT held + SELECT** rolls a new kit around the factory one. **EDIT held + F3 (INIT)** brings the factory kit back. +### The kit in every octave (0.8.5) + +The keys play the kit on the same keys at **every OCT** (C the kick, D the snare, F# the closed hat …); OCT now +changes **how** they play, not which sound. The screen says it when you press OCT on a DRUM track: + +| OCT | What a key does | Recorded (REC) as | +|---|---|---| +| **+3** | **RATCHET x8**: the hit eight times a step while held | the hit + the step's **ECHO x8 EVEN** (all at one level) | +| **+2** | **RATCHET x4** | the hit + the step's **RATCH x4** | +| **+1** | **RATCHET x2** | the hit + the step's **RATCH x2** | +| **0** | the kit as it always was | the hit | +| **−1** | **SHORT**: half the decay | the hit + the step's **TOUCH SHORT** | +| **−2** | **GHOST**: short, softer (~45 %), darker: a ghost note | the hit + **TOUCH GHOST** | +| **−3** | **FLAM**: a soft grace hit, then the hit ~20 ms later (whatever the tempo) | the hit + **TOUCH FLAM** | + +- The ratchets are **in time**: playing, the hits fall on the step's RATCH grid (each step's start, then every step/n, + swing included); stopped, every step/n of the track's DIV from the press. Letting go stops them. +- **Live recording keeps what you played**: the step you hit gets the hit and the RATCH (or ECHO x8 EVEN, or TOUCH); + hold a ratchet over several steps and every step it is held into is written too (and plays from the sequencer, so + the next pass sounds exactly as you heard it). Let go before the middle of the last one and that step is put back, + as with a held synth note. They show and edit like any step: SEQ > COMP shows RATCH / ECHO / **TOUCH** (KNOB 3: + SHORT, GHOST, FLAM); the CHANCE page the RATCH. +- RATCH, ECHO and TOUCH are **the step's**: everything on that step plays with them. Recording a ratchet onto a step that + already has a kick ratchets the kick too; a hit of the centre octave leaves a step's RATCH / TOUCH as they are. +- **MIDI** (0.8.5): notes 35–81 still play the GM drum map exactly as before. The notes around it, which used to play + their octave of 36–47 plain, are now these octaves, by pitch class: **23–34 SHORT, 11–22 GHOST, 0–10 FLAM, 82–93 + x2, 94–105 x4, 106–127 x8** (84 the kick x2, 24 the kick SHORT, 90 the closed hat x2). The keys send those notes to + MIDI OUT. **A song or MIDI setup that sent drum notes below 35 or above 81** (a kick on 24, say) will now hear these + variations: move them into 35–81 (36–47 for the kit's own) to keep the old sound. Notes stored in the steps play as + before, whatever their number. +- With the ARP on, the keys feed the arp plain (no ratchet or TOUCH). The DRUM grid's lane keys are always the centre + octave. + One kit per section, shared by every track on DRUM: while another track plays DRUM-X, browsing kit presets on a different track keeps that kit ("KIT OF T4 KEPT", 0.8.1); load kits on the drum track itself. The kit is saved with each section of a project (not with user presets — see [12](#12-saving-and-loading)). --- @@ -638,6 +671,11 @@ recorded into the pattern, quantized to its steps, overdubbing. Knob moves on th the first time (an intro), !FIRST every loop but the first (0.6.92; it was TIMES). - **FILL**: the step plays only while **FX** is held. - **KILL**: the step first cuts everything the track is sounding (long releases, held notes), then plays. + - **TOUCH** (0.8.5, a DRUM track): how its hits are struck, KNOB 3 **SHORT** (half the decay), **GHOST** (short, + softer, darker), **FLAM** (a soft grace hit ~20 ms before). What OCT −1 / −2 / −3 record (see + [5](#5-drum-x)). On other engines it does nothing. + - ECHO's **EVEN** (0.8.5): an ECHO recorded from OCT +3 on a kit keeps every repeat at the step's level (a ratchet + past RATCH's x4); the card shows "x8 EVEN", KNOB 3 keeps it. - **WALK** and **CLIMB** (0.6.98, after the OP-Z's and OP-XY's evolving components): the step's notes move one degree of the scale (WALK) or one octave (CLIMB) **every so many loops** of the pattern (KNOB 4: 1 … 10, 12, 16 loops a move), over a **range** (WALK 3, 5, 7 or 12 degrees; CLIMB 1 … 4 octaves), then round again. KNOB 3 the diff --git a/docs/cheatsheet/controls.html b/docs/cheatsheet/controls.html index c85cf064..dd3e9982 100644 --- a/docs/cheatsheet/controls.html +++ b/docs/cheatsheet/controls.html @@ -53,7 +53,7 @@ ul { padding-left: 18px; } li { margin: 2px 0; }

JIANT FM · CONTROLS

every button, knob, layer, combo and page

firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
-
THE PANEL

KNOBS AND TRANSPORT

MASTERMaster volume.
SELECTScrolls the section's pages (SEQ: zooms PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its dice (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.
PRESETSBrowses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. Hold a page button + PRESETS: jump through its pages.
ALGORITHMSelects the track from any page: T1–T4, or T1–T6 with TRACKS 6.
KNOB 1–4The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.
OCT− · OCT+The keyboard's octave (both together: back to 0). On action pages and dialogs: back / confirm.
PLAYStart / stop. GLO + PLAY: restart from the top.
RECArms live recording on the selected track (notes and knob moves, overdub).
HOMETap: the ecosystem. Hold: the MENU.
KEYS27 keys play the selected track in its scale; with a layer held they become that layer's.

PAGE BUTTONS

BUTTONTAP: ITS PAGES, ONE PER TAPHOLD
ENVENV · ENV DEST—
LFOLFO · LFO DEST · MOD · MSEQ · MSEQ 2MACROS M1–M4 (stay latched)
FXFX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)PUNCH-IN FX
SCLSCL · CHORDROOT by key
EDITEDIT 1 · EDIT 2 · FILTER · VOICE (FM6: OPERATOR · OP ENV · OPERATOR 2; DRUM: KIT · KIT 2 · KIT 3 · X-MOD · FILTER · SOUND 1–4 · LEVELS 1–2 · STEREO)INIT · RECALL · sound mutes
GLOMIXER · GLOBAL · SYSTEMMUTE · SOLO · LEVEL · TAP
SAVEPRESETS · USER · PROJECT · ARRANGE · TOOLSSONG layer
ARPARP · ARP 2—
SEQthe zoom level's sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2SEQ TOOLS
REC(transport)CLEAR · CLICK

BUTTON + PRESETS jumps through its pages (no wrap). SELECT alone scrolls the section's pages.

LAYERS · HOLD A BUTTON

FX · PUNCH-IN EFFECTS

F3REP 1/8
G3REP 1/16
A3REP 1/32
B3LPF
C4HPF
D4OCT−
E4OCT+
F4½ TEMPO
G4DEC−
A4DEC+
B4STUT 1/8
C5STUT 1/16
D5ATK+
E5ARP
F5RAND
G5ERASE
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#
A#TGT
C#
D#
F#

A key plays its effect while held (MENU FX LATCH ON: toggles); hold FX and let go untouched: LOCKED open, FX again unlocks; OCT- all off. In on the next 1/16. Black 1–6 mute T1–T6, A#4 picks which tracks the MIDI ones touch (all · synths · drums). With REC armed and playing they record into the section's lane; G5 erases it.

KNOBS

FILTERCRUSHTHROWDEPTH

GLO · MIX

F3SOLO 1
G3SOLO 2
A3SOLO 3
B3SOLO 4
C4SOLO 5
D4SOLO 6
E4ALL
F4TAP
G4UNDO
A4
B4
C5
D5
E5
F5
G5
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#KICK
A#SNR
C#HAT
D#PERC
F#

Black 1–6 mute T1–T6 (latched), 7–10 the DRUM-X groups. White: solo while held, E4 unmutes all, F4 tap tempo, G4 UNDO the last big change (again: redo), A4 FREEZE MUTATE. SELECT: the tempo. PLAY: restart.

KNOBS

LEVEL T1LEVEL T2LEVEL T3LEVEL T4

T5 or T6 selected: the knobs are T3–T6.

SAVE · SONG

F3PLAY A
G3PLAY B
A3PLAY C
B3PLAY D
C4STORE A
D4STORE B
E4STORE C
F4STORE D
G4
A4
B4
C5
D5LOOP/ SONG
E5SONG REC
F5
G5SONG
F#
G#
A#
C#
D#
F#
G#
A#
C#
D#
F#

PLAY A–D on the next bar (several in one hold: a quick chain), STORE the section into A–D. OCT+ stores the playing section, OCT− recalls it. On the SONG page KNOB 4 stores a scene.

KNOBS

SONG 1–8---

EDIT · SOUND

F3INIT
G3RECALL
A3
B3
C4
D4
E4
F4
G4
A4
B4
C5
D5
E5
F5
G5
F#BD
G#SD
A#CP
C#CH
D#OH
F#TM
G#RS
A#CB
C#
D#
F#

INIT: the factory sound (DRUM: the kit too). RECALL: the sound stored in the section. On a DRUM track black 1–8 mute each DRUM-X sound.

KNOBS

EDIT 1EDIT 2EDIT 3EDIT 4

LFO · MACROS

Knobs M1–M4; they stay latched when let go (LFO again: off). F3 rolls new routes, G3 clears them (only tracks that sound). LFO + SELECT: the track's LFO diced.

KNOBS

M1M2M3M4

SCL · SCALE

Any key sets the ROOT. ROOT and SCALE are every melodic track's (and RESO's).

KNOBS

ROOTSCLOFSPIT

SEQ · TOOLS

On the SEQ pages: F3 CLEAR · G3 REVERSE · A3 B3 SHIFT · C4 RANDOM · D4 COOK · E4 BEAT · F4 CLR AUTO (the automation).

KNOBS

LENDIVSWINGGATE

REC · RECORD

F3 CLEAR the track (at once; GLO + G4 undoes it), G3 the metronome CLICK.

KNOBS

CLICK---
COMBOS

BUTTONS TOGETHER

HOME · EDIT · SEQ · LFO · FX + SELECTTheir dice: everything · sound · sequence · LFO · effects (KEEP? OK / CANCEL).
PAGE BUTTON + PRESETSJump through that button's pages.
REC + FXEDITENVLFOSCLARPGLOClear that part's automation on the selected track (FX: the punch-in lane too).
SEQ + RECCLEAR ALL SEQUENCES? (OCT+ confirms).
SAVE + OCT+ / OCT−Store / recall the playing section.
GLO + PLAYRestart from the top.
GLO + SELECTTempo (from any page).
STEP HELD + KNOBA parameter lock on that step (roll, grid).
HOME heldMENU: knob accel, FX latch, hold time, USB level, palettes, animation…
EVERY PAGE · KNOB 1 – 4

ENV

ENV
ATKDECSUSREL
ENV DEST
FILTERPITCHSHAPELOOP

LFO

LFO
RATEWAVEPHASEFADE
LFO DEST
PITCHFILTERSHAPEAMP
MOD
SLOTSRCDESTAMT
MSEQ
STEPLEVELLENSLEW
MSEQ 2
DIV---

SCL · ARP

SCLROOT SCALE QUANT ALL TR
CHORD
CHORDVOICINGSTRUM-
ARP
MODERATEOCTGATE
ARP 2
SWINGPROBHOLDORDER

FX

FX
DISTCHORUSDLYREV
DIST
DISTTYPETONE-
AUTO PAN
DEPTHRATESYNCWAVE
SLICER
MODEPATRATEDEPTH
SL BUS
T1T2T3T4
SL BUS 2
T5T6FX-
SL PITCH
STEPPITCHLENQUANT
DLY
TIMEFEEDBKTONEMIX
DLY 2
WIDEPITCHSPRAYMOD
DLY 3
TYPEPING--
REVERB
TYPESIZEDAMPPRE/AIR
REVERB 2
MODRATEFILTWIDE
CHORUS
RATEDEPTHSTEREO-
MASTER
CLIPPUNCHDUCKREL
PUNCH
LENRESRECCLEAR

EDIT

EDIT 1
E1E2E3E4
EDIT 2
E5E6E7E8
RETRIG
RTRG---
OPERATOR
OPRATIOFINELEVEL
OP ENV
OPSTAGERATELEVEL
OPERATOR 2
OPMODEDETUNEVEL
FILTER
TYPECUTRESDRIVE
VOICE
VOICEGLIDEMODEPRIO
KIT 3
BPFEEDBK--
X-MOD
RATEDEPTHSHAPERAND
LEVELS
KICKSNARECLAPHATCL
LEVELS 2
HATOPTOMRIMBELL
SOUND
SOUNDSIDEPITCHPMOD
SOUND 2
SOUNDDECAYNOISECOLOR
SOUND 3
SOUNDMODEPM.TYPEDRIVE
SOUND 4
SOUNDLAYERFEEDBKSEND
STEREO
IMAGE---

SEQ

PATTERN
LENDIVSWINGGATE
STRETCH
x/÷REPEATNUDGEROTATE
PLAYHEADS
HEADRATEDIRINTVL
TRACKPITCH CHANCE HUMAN REC Q
MUTATE
SOUNDPATTERNAMOUNTMODE
STEP
STEPNOTETIMEFLAG
STEP · DRUM
STEPLANEHITACC
NOTE
FOCUSPITCHMOVEMICRO
AUTOMATION
PLAYEVENTLOCKCLEAR
AUTO LIST
ROWSTEPPARAMVALUE
COMP
STEPTYPEVALEVERY
COMP 2
STEPTYPEVALEVERY

GLO · SAVE

MIXER
LEVELPANREVMUTE
GLOBAL
BPMSWINGCLOCKTUNE
SYSTEM
TRACKSLOADROUTECPU
PRESETS
No.ENGFAVLIST
USER
SLOTLOADERASESAVE
PROJECT
PROJSECTLOADSAVE
ARRANGE
ROWSECTBARSSCENE
TOOLSCLEAR SEQ · INIT SOUND · DEL ROW · CLEAR SONG · NEW PROJECT · CPU TEST: K1 picks, OCT+
+
THE PANEL

KNOBS AND TRANSPORT

MASTERMaster volume.
SELECTScrolls the section's pages (SEQ: zooms PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its dice (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.
PRESETSBrowses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. Hold a page button + PRESETS: jump through its pages.
ALGORITHMSelects the track from any page: T1–T4, or T1–T6 with TRACKS 6.
KNOB 1–4The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.
OCT− · OCT+The keyboard's octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM. On action pages and dialogs: back / confirm.
PLAYStart / stop. GLO + PLAY: restart from the top.
RECArms live recording on the selected track (notes and knob moves, overdub).
HOMETap: the ecosystem. Hold: the MENU.
KEYS27 keys play the selected track in its scale; with a layer held they become that layer's.

PAGE BUTTONS

BUTTONTAP: ITS PAGES, ONE PER TAPHOLD
ENVENV · ENV DEST—
LFOLFO · LFO DEST · MOD · MSEQ · MSEQ 2MACROS M1–M4 (stay latched)
FXFX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)PUNCH-IN FX
SCLSCL · CHORDROOT by key
EDITEDIT 1 · EDIT 2 · FILTER · VOICE (FM6: OPERATOR · OP ENV · OPERATOR 2; DRUM: KIT · KIT 2 · KIT 3 · X-MOD · FILTER · SOUND 1–4 · LEVELS 1–2 · STEREO)INIT · RECALL · sound mutes
GLOMIXER · GLOBAL · SYSTEMMUTE · SOLO · LEVEL · TAP
SAVEPRESETS · USER · PROJECT · ARRANGE · TOOLSSONG layer
ARPARP · ARP 2—
SEQthe zoom level's sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2SEQ TOOLS
REC(transport)CLEAR · CLICK

BUTTON + PRESETS jumps through its pages (no wrap). SELECT alone scrolls the section's pages.

LAYERS · HOLD A BUTTON

FX · PUNCH-IN EFFECTS

F3REP 1/8
G3REP 1/16
A3REP 1/32
B3LPF
C4HPF
D4OCT−
E4OCT+
F4½ TEMPO
G4DEC−
A4DEC+
B4STUT 1/8
C5STUT 1/16
D5ATK+
E5ARP
F5RAND
G5ERASE
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#
A#TGT
C#
D#
F#

A key plays its effect while held (MENU FX LATCH ON: toggles); hold FX and let go untouched: LOCKED open, FX again unlocks; OCT- all off. In on the next 1/16. Black 1–6 mute T1–T6, A#4 picks which tracks the MIDI ones touch (all · synths · drums). With REC armed and playing they record into the section's lane; G5 erases it.

KNOBS

FILTERCRUSHTHROWDEPTH

GLO · MIX

F3SOLO 1
G3SOLO 2
A3SOLO 3
B3SOLO 4
C4SOLO 5
D4SOLO 6
E4ALL
F4TAP
G4UNDO
A4
B4
C5
D5
E5
F5
G5
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#KICK
A#SNR
C#HAT
D#PERC
F#

Black 1–6 mute T1–T6 (latched), 7–10 the DRUM-X groups. White: solo while held, E4 unmutes all, F4 tap tempo, G4 UNDO the last big change (again: redo), A4 FREEZE MUTATE. SELECT: the tempo. PLAY: restart.

KNOBS

LEVEL T1LEVEL T2LEVEL T3LEVEL T4

T5 or T6 selected: the knobs are T3–T6.

SAVE · SONG

F3PLAY A
G3PLAY B
A3PLAY C
B3PLAY D
C4STORE A
D4STORE B
E4STORE C
F4STORE D
G4
A4
B4
C5
D5LOOP/ SONG
E5SONG REC
F5
G5SONG
F#
G#
A#
C#
D#
F#
G#
A#
C#
D#
F#

PLAY A–D on the next bar (several in one hold: a quick chain), STORE the section into A–D. OCT+ stores the playing section, OCT− recalls it. On the SONG page KNOB 4 stores a scene.

KNOBS

SONG 1–8---

EDIT · SOUND

F3INIT
G3RECALL
A3
B3
C4
D4
E4
F4
G4
A4
B4
C5
D5
E5
F5
G5
F#BD
G#SD
A#CP
C#CH
D#OH
F#TM
G#RS
A#CB
C#
D#
F#

INIT: the factory sound (DRUM: the kit too). RECALL: the sound stored in the section. On a DRUM track black 1–8 mute each DRUM-X sound.

KNOBS

EDIT 1EDIT 2EDIT 3EDIT 4

LFO · MACROS

Knobs M1–M4; they stay latched when let go (LFO again: off). F3 rolls new routes, G3 clears them (only tracks that sound). LFO + SELECT: the track's LFO diced.

KNOBS

M1M2M3M4

SCL · SCALE

Any key sets the ROOT. ROOT and SCALE are every melodic track's (and RESO's).

KNOBS

ROOTSCLOFSPIT

SEQ · TOOLS

On the SEQ pages: F3 CLEAR · G3 REVERSE · A3 B3 SHIFT · C4 RANDOM · D4 COOK · E4 BEAT · F4 CLR AUTO (the automation).

KNOBS

LENDIVSWINGGATE

REC · RECORD

F3 CLEAR the track (at once; GLO + G4 undoes it), G3 the metronome CLICK.

KNOBS

CLICK---
COMBOS

BUTTONS TOGETHER

HOME · EDIT · SEQ · LFO · FX + SELECTTheir dice: everything · sound · sequence · LFO · effects (KEEP? OK / CANCEL).
PAGE BUTTON + PRESETSJump through that button's pages.
REC + FXEDITENVLFOSCLARPGLOClear that part's automation on the selected track (FX: the punch-in lane too).
SEQ + RECCLEAR ALL SEQUENCES? (OCT+ confirms).
SAVE + OCT+ / OCT−Store / recall the playing section.
GLO + PLAYRestart from the top.
GLO + SELECTTempo (from any page).
STEP HELD + KNOBA parameter lock on that step (roll, grid).
HOME heldMENU: knob accel, FX latch, hold time, USB level, palettes, animation…
EVERY PAGE · KNOB 1 – 4

ENV

ENV
ATKDECSUSREL
ENV DEST
FILTERPITCHSHAPELOOP

LFO

LFO
RATEWAVEPHASEFADE
LFO DEST
PITCHFILTERSHAPEAMP
MOD
SLOTSRCDESTAMT
MSEQ
STEPLEVELLENSLEW
MSEQ 2
DIV---

SCL · ARP

SCLROOT SCALE QUANT ALL TR
CHORD
CHORDVOICINGSTRUM-
ARP
MODERATEOCTGATE
ARP 2
SWINGPROBHOLDORDER

FX

FX
DISTCHORUSDLYREV
DIST
DISTTYPETONE-
AUTO PAN
DEPTHRATESYNCWAVE
SLICER
MODEPATRATEDEPTH
SL BUS
T1T2T3T4
SL BUS 2
T5T6FX-
SL PITCH
STEPPITCHLENQUANT
DLY
TIMEFEEDBKTONEMIX
DLY 2
WIDEPITCHSPRAYMOD
DLY 3
TYPEPING--
REVERB
TYPESIZEDAMPPRE/AIR
REVERB 2
MODRATEFILTWIDE
CHORUS
RATEDEPTHSTEREO-
MASTER
CLIPPUNCHDUCKREL
PUNCH
LENRESRECCLEAR

EDIT

EDIT 1
E1E2E3E4
EDIT 2
E5E6E7E8
RETRIG
RTRG---
OPERATOR
OPRATIOFINELEVEL
OP ENV
OPSTAGERATELEVEL
OPERATOR 2
OPMODEDETUNEVEL
FILTER
TYPECUTRESDRIVE
VOICE
VOICEGLIDEMODEPRIO
KIT 3
BPFEEDBK--
X-MOD
RATEDEPTHSHAPERAND
LEVELS
KICKSNARECLAPHATCL
LEVELS 2
HATOPTOMRIMBELL
SOUND
SOUNDSIDEPITCHPMOD
SOUND 2
SOUNDDECAYNOISECOLOR
SOUND 3
SOUNDMODEPM.TYPEDRIVE
SOUND 4
SOUNDLAYERFEEDBKSEND
STEREO
IMAGE---

SEQ

PATTERN
LENDIVSWINGGATE
STRETCH
x/÷REPEATNUDGEROTATE
PLAYHEADS
HEADRATEDIRINTVL
TRACKPITCH CHANCE HUMAN REC Q
MUTATE
SOUNDPATTERNAMOUNTMODE
STEP
STEPNOTETIMEFLAG
STEP · DRUM
STEPLANEHITACC
NOTE
FOCUSPITCHMOVEMICRO
AUTOMATION
PLAYEVENTLOCKCLEAR
AUTO LIST
ROWSTEPPARAMVALUE
COMP
STEPTYPEVALEVERY
COMP 2
STEPTYPEVALEVERY

GLO · SAVE

MIXER
LEVELPANREVMUTE
GLOBAL
BPMSWINGCLOCKTUNE
SYSTEM
TRACKSLOADROUTECPU
PRESETS
No.ENGFAVLIST
USER
SLOTLOADERASESAVE
PROJECT
PROJSECTLOADSAVE
ARRANGE
ROWSECTBARSSCENE
TOOLSCLEAR SEQ · INIT SOUND · DEL ROW · CLEAR SONG · NEW PROJECT · CPU TEST: K1 picks, OCT+
GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP JIANT FM v0.8.4
\ No newline at end of file diff --git a/docs/cheatsheet/sound.html b/docs/cheatsheet/sound.html index 128fe748..7d39a0b7 100644 --- a/docs/cheatsheet/sound.html +++ b/docs/cheatsheet/sound.html @@ -53,7 +53,7 @@ ul { padding-left: 18px; } li { margin: 2px 0; }

JIANT FM · SOUND · FX · MOD

engines, effects, modulation, sequencer and songs

firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
-
ENGINES · EDIT 1 / EDIT 2

NINE ENGINES, ALL SYNTHESIS

ENGINEEDIT 1EDIT 2WHAT TO KNOW
ANALOG
WAVEDETUNEMIXNOISE
CUTRESDRIVEINT
SAW SQR TRI SIN PWM SYNC RING SAW3; INT: osc 2 ±24 st. Its filter is per voice.
FM6
ALGFBMODRATIO
MEGVMODDETUNESLOT
Dexed's 6 operators, 32 algorithms drawn, .syx patches (SLOT), MOD / RATIO move the modulators. OPERATOR · OP ENV · OPERATOR 2: each operator on the device (ratio / fixed, fine, level, its envelope, mode, detune, velocity). SLOT B1–B32: a 32-voice .syx sent from the web editor.
PHASE
WAVEWAVE2DCWENV
DETUNELINESUBFB
Phase distortion (CZ); FB feeds the output back into the phase: hard edge to growl.
LOFI
CHIPWAVEDUTYCRUSH
-VIBBENDMASK
Chip: PLS TRI SAW NOIS WRAM. BYTE: ALGO VAR · MOTN GRIT BEND LOOP. FLOAT (floatbeat): ALGO VAR · MOTN FBK BEND LOOP; CHIP sets FULL / 4BIT / 1BIT.
VOICE
VOWELVOWEL2TALKSHIFT
BUZZBREATHQRAND
Formant voice (after klattsch): vowels, talk, breath.
WHEEL
REGSUBBODYTOP
PERCCLICKDRIVEROTOR
Drawbar organ: registrations, percussion, rotary.
NOISE
MODECOLORFREQPEAK
TRKDENSEDRIFTCRUSH
Coloured and metallic noise, tracked or free.
DRUM-X
MORPHTUNETONEDECAY
NOISEFMENVFOLDDRIVE
8 sounds BD SD CP CH OH TM RS CB, sides A / B: MORPH morphs the kit. The kit first: KIT 3 BP FEEDBK, X-MOD RATE DEPTH SHAPE RAND. Then a sound (KNOB 1 the sound): SIDE PITCH PMOD · DECAY NOISE COLOR · MODE PM.TYPE DRIVE · LAYER (no note) FEEDBK SEND (CHO / DLY / REV). Last LEVELS and STEREO IMAGE (a knob through the kit's stereo placings).
ANIMAL
MODEPRESSCHAOSSIZE
SWEEPRATEGROUPTEMP
Animal calls (0.8.3), MODE the source: CMOS the 40106 / 4093 bird circuit (TOUCH COUPLE CAP · HYST RATE GROUP FM) · PULSE crickets, cicadas, frogs (CLICK Q · DETUNE) · WHSTL birds, a Hopf whistle · WING mosquito, bee, fly (BUZZ DRIFT · DOPPLR) · GLOTT wolf, bark, roar, purr (MOUTH ROUGH · AIR). GROUP: syllables + gaps; TEMP °C speeds a cricket up (Dolbear). A note is a call.

FILTER · EVERY ENGINE

TYPECUTRESDRV

LP · HP · BP · COMB. COMB rings tuned to the note: CUT moves it ±32 st, RES how much it rings. ANALOG and LOFI: per voice; the others: on the track, following LFO / ENV DEST FLT (DRV = the track's DIST).

VOICE · PLAYING

VCEGLDGLMODPRIO

POLY · MONO · LEG · UNI; glide and its mode; LAST / LOW / HIGH priority. 8 voices shared by the six tracks (MONO and LEGATO keep their note).

DICE

EDIT + SELECT: a random factory preset of the engine, every parameter moved up to a quarter of its range. DRUM-X: both sides of every sound around the factory kit. Heard at once: OCT+ OK keeps it, OCT- CANCEL brings the sound back. SEQ / LFO / FX + SELECT: the sequence, the LFO, the effects, the same way. HOME + SELECT: GEN, the song generator: GENRE (43 or RANDOM) · SEED · ENERGY · FORM; DRUMS · BASS · CHORDS · ARP · LEAD amounts; COMPLEX · SWING · HUMAN. OCT+ makes the piece (again: a new seed), HOME done. GLO + G4 undoes.

MODULATION

ENV · LFO

ENV

ATKDECSUSREL

ENV DEST

FLTPITSHPLOOP

LOOP: held, the envelope cycles from the sustain: an ADSR-shaped LFO.

LFO

RATEWAVEPHSFADE

SIN TRI SAW SQR S&H

LFO DEST

PITFLTSHPAMP

MOD MATRIX · 4 SLOTS A TRACK

SLOTSRCDSTAMT

SOURCES

LFOENVVELKEYRANDMODWATEXPRM1M2M3M4STEP

DESTINATIONS

PITCHCUTSHPAMPPANDISTCHODLYREVRATEVIBE1…E8CLIPPNCHD.TIMD.FBD.TOND.MIXR.SIZR.DMPC.RATC.DEP

E1…E8: the engine's own EDIT knobs. CLIP / PNCH: the master. D. R. C.: the DELAY, REVERB and CHORUS buses (a STEP source on D.TIM sequences the delay time).

MSEQ · MACROS

MSEQ · A CV SEQUENCER PER TRACK

STEPLVLLENSLEW

16 levels, DIV on MSEQ 2, in time with the transport. Use it from MOD, SRC STEP.

MACROS M1–M4

Hold LFO: the knobs are M1–M4, latched until LFO again. Each session starts with 2 random routes a track; F3 rolls new ones, G3 clears. By hand: MOD, SRC M1…M4. Saved with the project.

SEQUENCER

64 steps a track, up to 4 notes a step, piano roll and drum grid. LENTE: SELECT zooms PATTERN (the bars; PRESETS the bar) · BAR (the roll / grid) · STEP (one step large, its chips); SEQ taps round the level's sets and comes back to the track's last. Hold a step + turn a knob: a parameter lock. Step recording: hold a chord + KNOB 1 its length; + ARP: arpeggiated (K1 rate, K2 order, K3 oct). COMP / COMP 2: two components a step (CHANCE, RATCH, ARP NOTES / SEQ / SCALE, TRIG, RAND, OCT, TONAL, BEND, ECHO, PULSE, JUMP, REV, FILL, KILL, WALK, CLIMB); a TRIG or FILL wins; WALK / CLIMB: a degree / an octave further every N loops (K4), UP DOWN UP-DN RND over a range (K3), stackable; ARP: ORDER × range, RATE in note values (x1 1/32 1/32T 1/64 1/64T 1/128); RATCH / ECHO: DIV; EVERY (KNOB 4): the loops the step's components play on (ALWAYS 1:2 2:2 1:3 .. 4:4 1:8 FIRST !FIRST SKIP). TRACK: PITCH, CHANCE thins the whole track, HUMAN one amount (velocity, timing, gate, decay / release), REC Q. STRETCH / REPEAT act as the knob turns; ROTATE reads the sequence from another step; NOTE's MICRO moves a step off the grid. REC + knobs while playing: automation (64 records a section, MOTION page plays / clears them, AUTO LIST edits them).

PATTERN · TRACK

LENDIVSWGGATE
PITCHNHUMRECQ

SCALE · ARP

ROOT and SCALE are every melodic track's: CHR MAJ MIN DOR MIX PEN MPEN HARM PHRY LYD LOC MEL BLUES WHOLE DIMHW DIMWH. QNT snaps keys or the sequence, ALL TR (SCL KNOB 4) moves every sequence along the scale. CHORD: a key plays a chord (TRIAD 7TH ADD9 SUS2 SUS4 in key, MAJ MIN 7 MAJ7 MIN7 POWER), VOICING LEAD leads each to the next, STRUM as a harp.

ARP MODES

OFF UP DN UPDN RND ORD REPEAT DNUP UP+8 CONV DIVG PINKY THUMB WALK CHORD TRNS (the keys transpose the sequence)

SONGS

8 projects × 4 sections (A–D), a song of up to 16 rows by bars (SAVE › ARRANGE; END: STOP, x2–x8, LOOP), SLOOP style. Each row can hold a scene: mutes, DRUM-X group mutes, macros and MIDI punch-ins. SAVE held plays sections live on the next bar, stores them, records the song (SONG REC). Each section keeps its sounds, steps, motion, kit and its SLICER.

EFFECTS

PER TRACK

FX · SENDS

DSTCHODLYREV

DIST

DSTTYPETONE-

SOFT · HARD · FOLD · CRUSH · RECT.

AUTO PAN

DEPTHRATESYNCWAVE

The track's pan swung L–R around its PAN. SYNC BEAT: RATE 4 BARS … 1/32, in time with the bar; FREE: in Hz. SIN · TRI · SAW · SQR · S&H, never a click.

SLICER · ONE ON A BUS

SLCRPATRATEDEPTH

OFF · GATE · STUT, 16 patterns, 1/8 … 32T. SL BUS: T1–T6 and FX (the delay / reverb / chorus returns) ON / OFF: everything on = the whole mix chopped after the effects. SL PITCH: the repeats' 16-step pitch (±24 st, tape style, QNT SCL to the scale).

DELAY · CHORUS

DLY

TIMEFDBKTONEMIX

DLY 2

WIDEPITCHSPRYMOD

DLY 3

TYPEPING--

Synced or free (5 ms – 2.95 s; past 0.74 s darker); PITCH / SPRY: a grain delay.

CHORUS

RATEDEPTHSTER-

STER: 0 as always, down to mono, up to twice as wide.

REVERB · FIVE MODELS

TYPESIZEDAMPPRE
MODRATEFILTWIDE
TYPEWHAT IT ISSIZEDAMPMODRATEWIDE
ROOMClassic roomdecaydarkenschorus on the tailits speedstereo
SPRINGAmp spring tanklength · decaydarkenswobblewobble speedstereo
SHIMRUp an octave on every pass; PRE → AIR (±24 st: down darker and lower, up airier and higher)decaydarkenshow much shimmer——
RESO4 strings tuned to the scale; PRE → PITCH (0–14 steps up), DAMP → FOLW (OFF / T1–T6: the chord follows that track's notes)how long they ringFOLWpast half: the chord opens——
CLOUDGranular wash; SIZE max freezes it; PRE → AIR (±24 st: the cloud down / up, darker / airier)decay · freezedarkensgrains pitched + chorusgrain densitygrain spread

MASTER

CLIPPNCHDUCKREL

CLIP saturates without getting louder. PNCH drives the drums: denser body. DUCK: the kick pulls the rest down (REL its release). An always-on leveler (slow 2:1, −9…+6 dB) before the limiter keeps patches at a steady volume.

PUNCH-IN FX (FX HELD)

REPEAT 1/8 · 1/16 · 1/32, LPF, HPF; on the notes: OCT−/+, ½ TEMPO, DEC−/+, STUTTER, ATK+, ARP, RANDOM. Knobs: FILTER CRUSH THROW DEPTH. Recordable per section.

+
ENGINES · EDIT 1 / EDIT 2

NINE ENGINES, ALL SYNTHESIS

ENGINEEDIT 1EDIT 2WHAT TO KNOW
ANALOG
WAVEDETUNEMIXNOISE
CUTRESDRIVEINT
SAW SQR TRI SIN PWM SYNC RING SAW3; INT: osc 2 ±24 st. Its filter is per voice.
FM6
ALGFBMODRATIO
MEGVMODDETUNESLOT
Dexed's 6 operators, 32 algorithms drawn, .syx patches (SLOT), MOD / RATIO move the modulators. OPERATOR · OP ENV · OPERATOR 2: each operator on the device (ratio / fixed, fine, level, its envelope, mode, detune, velocity). SLOT B1–B32: a 32-voice .syx sent from the web editor.
PHASE
WAVEWAVE2DCWENV
DETUNELINESUBFB
Phase distortion (CZ); FB feeds the output back into the phase: hard edge to growl.
LOFI
CHIPWAVEDUTYCRUSH
-VIBBENDMASK
Chip: PLS TRI SAW NOIS WRAM. BYTE: ALGO VAR · MOTN GRIT BEND LOOP. FLOAT (floatbeat): ALGO VAR · MOTN FBK BEND LOOP; CHIP sets FULL / 4BIT / 1BIT.
VOICE
VOWELVOWEL2TALKSHIFT
BUZZBREATHQRAND
Formant voice (after klattsch): vowels, talk, breath.
WHEEL
REGSUBBODYTOP
PERCCLICKDRIVEROTOR
Drawbar organ: registrations, percussion, rotary.
NOISE
MODECOLORFREQPEAK
TRKDENSEDRIFTCRUSH
Coloured and metallic noise, tracked or free.
DRUM-X
MORPHTUNETONEDECAY
NOISEFMENVFOLDDRIVE
8 sounds BD SD CP CH OH TM RS CB, sides A / B: MORPH morphs the kit. The kit first: KIT 3 BP FEEDBK, X-MOD RATE DEPTH SHAPE RAND. Then a sound (KNOB 1 the sound): SIDE PITCH PMOD · DECAY NOISE COLOR · MODE PM.TYPE DRIVE · LAYER (no note) FEEDBK SEND (CHO / DLY / REV). Last LEVELS and STEREO IMAGE (a knob through the kit's stereo placings).
ANIMAL
MODEPRESSCHAOSSIZE
SWEEPRATEGROUPTEMP
Animal calls (0.8.3), MODE the source: CMOS the 40106 / 4093 bird circuit (TOUCH COUPLE CAP · HYST RATE GROUP FM) · PULSE crickets, cicadas, frogs (CLICK Q · DETUNE) · WHSTL birds, a Hopf whistle · WING mosquito, bee, fly (BUZZ DRIFT · DOPPLR) · GLOTT wolf, bark, roar, purr (MOUTH ROUGH · AIR). GROUP: syllables + gaps; TEMP °C speeds a cricket up (Dolbear). A note is a call.

FILTER · EVERY ENGINE

TYPECUTRESDRV

LP · HP · BP · COMB. COMB rings tuned to the note: CUT moves it ±32 st, RES how much it rings. ANALOG and LOFI: per voice; the others: on the track, following LFO / ENV DEST FLT (DRV = the track's DIST).

VOICE · PLAYING

VCEGLDGLMODPRIO

POLY · MONO · LEG · UNI; glide and its mode; LAST / LOW / HIGH priority. 8 voices shared by the six tracks (MONO and LEGATO keep their note).

DICE

EDIT + SELECT: a random factory preset of the engine, every parameter moved up to a quarter of its range. DRUM-X: both sides of every sound around the factory kit. Heard at once: OCT+ OK keeps it, OCT- CANCEL brings the sound back. SEQ / LFO / FX + SELECT: the sequence, the LFO, the effects, the same way. HOME + SELECT: GEN, the song generator: GENRE (43 or RANDOM) · SEED · ENERGY · FORM; DRUMS · BASS · CHORDS · ARP · LEAD amounts; COMPLEX · SWING · HUMAN. OCT+ makes the piece (again: a new seed), HOME done. GLO + G4 undoes.

MODULATION

ENV · LFO

ENV

ATKDECSUSREL

ENV DEST

FLTPITSHPLOOP

LOOP: held, the envelope cycles from the sustain: an ADSR-shaped LFO.

LFO

RATEWAVEPHSFADE

SIN TRI SAW SQR S&H

LFO DEST

PITFLTSHPAMP

MOD MATRIX · 4 SLOTS A TRACK

SLOTSRCDSTAMT

SOURCES

LFOENVVELKEYRANDMODWATEXPRM1M2M3M4STEP

DESTINATIONS

PITCHCUTSHPAMPPANDISTCHODLYREVRATEVIBE1…E8CLIPPNCHD.TIMD.FBD.TOND.MIXR.SIZR.DMPC.RATC.DEP

E1…E8: the engine's own EDIT knobs. CLIP / PNCH: the master. D. R. C.: the DELAY, REVERB and CHORUS buses (a STEP source on D.TIM sequences the delay time).

MSEQ · MACROS

MSEQ · A CV SEQUENCER PER TRACK

STEPLVLLENSLEW

16 levels, DIV on MSEQ 2, in time with the transport. Use it from MOD, SRC STEP.

MACROS M1–M4

Hold LFO: the knobs are M1–M4, latched until LFO again. Each session starts with 2 random routes a track; F3 rolls new ones, G3 clears. By hand: MOD, SRC M1…M4. Saved with the project.

SEQUENCER

64 steps a track, up to 4 notes a step, piano roll and drum grid. LENTE: SELECT zooms PATTERN (the bars; PRESETS the bar) · BAR (the roll / grid) · STEP (one step large, its chips); SEQ taps round the level's sets and comes back to the track's last. Hold a step + turn a knob: a parameter lock. Step recording: hold a chord + KNOB 1 its length; + ARP: arpeggiated (K1 rate, K2 order, K3 oct). COMP / COMP 2: two components a step (CHANCE, RATCH, ARP NOTES / SEQ / SCALE, TRIG, RAND, OCT, TONAL, BEND, ECHO, PULSE, JUMP, REV, FILL, KILL, WALK, CLIMB, TOUCH: a kit's SHORT / GHOST / FLAM); a TRIG or FILL wins; WALK / CLIMB: a degree / an octave further every N loops (K4), UP DOWN UP-DN RND over a range (K3), stackable; ARP: ORDER × range, RATE in note values (x1 1/32 1/32T 1/64 1/64T 1/128); RATCH / ECHO: DIV; EVERY (KNOB 4): the loops the step's components play on (ALWAYS 1:2 2:2 1:3 .. 4:4 1:8 FIRST !FIRST SKIP). TRACK: PITCH, CHANCE thins the whole track, HUMAN one amount (velocity, timing, gate, decay / release), REC Q. STRETCH / REPEAT act as the knob turns; ROTATE reads the sequence from another step; NOTE's MICRO moves a step off the grid. REC + knobs while playing: automation (64 records a section, MOTION page plays / clears them, AUTO LIST edits them).

PATTERN · TRACK

LENDIVSWGGATE
PITCHNHUMRECQ

SCALE · ARP

ROOT and SCALE are every melodic track's: CHR MAJ MIN DOR MIX PEN MPEN HARM PHRY LYD LOC MEL BLUES WHOLE DIMHW DIMWH. QNT snaps keys or the sequence, ALL TR (SCL KNOB 4) moves every sequence along the scale. CHORD: a key plays a chord (TRIAD 7TH ADD9 SUS2 SUS4 in key, MAJ MIN 7 MAJ7 MIN7 POWER), VOICING LEAD leads each to the next, STRUM as a harp.

ARP MODES

OFF UP DN UPDN RND ORD REPEAT DNUP UP+8 CONV DIVG PINKY THUMB WALK CHORD TRNS (the keys transpose the sequence)

SONGS

8 projects × 4 sections (A–D), a song of up to 16 rows by bars (SAVE › ARRANGE; END: STOP, x2–x8, LOOP), SLOOP style. Each row can hold a scene: mutes, DRUM-X group mutes, macros and MIDI punch-ins. SAVE held plays sections live on the next bar, stores them, records the song (SONG REC). Each section keeps its sounds, steps, motion, kit and its SLICER.

EFFECTS

PER TRACK

FX · SENDS

DSTCHODLYREV

DIST

DSTTYPETONE-

SOFT · HARD · FOLD · CRUSH · RECT.

AUTO PAN

DEPTHRATESYNCWAVE

The track's pan swung L–R around its PAN. SYNC BEAT: RATE 4 BARS … 1/32, in time with the bar; FREE: in Hz. SIN · TRI · SAW · SQR · S&H, never a click.

SLICER · ONE ON A BUS

SLCRPATRATEDEPTH

OFF · GATE · STUT, 16 patterns, 1/8 … 32T. SL BUS: T1–T6 and FX (the delay / reverb / chorus returns) ON / OFF: everything on = the whole mix chopped after the effects. SL PITCH: the repeats' 16-step pitch (±24 st, tape style, QNT SCL to the scale).

DELAY · CHORUS

DLY

TIMEFDBKTONEMIX

DLY 2

WIDEPITCHSPRYMOD

DLY 3

TYPEPING--

Synced or free (5 ms – 2.95 s; past 0.74 s darker); PITCH / SPRY: a grain delay.

CHORUS

RATEDEPTHSTER-

STER: 0 as always, down to mono, up to twice as wide.

REVERB · FIVE MODELS

TYPESIZEDAMPPRE
MODRATEFILTWIDE
TYPEWHAT IT ISSIZEDAMPMODRATEWIDE
ROOMClassic roomdecaydarkenschorus on the tailits speedstereo
SPRINGAmp spring tanklength · decaydarkenswobblewobble speedstereo
SHIMRUp an octave on every pass; PRE → AIR (±24 st: down darker and lower, up airier and higher)decaydarkenshow much shimmer——
RESO4 strings tuned to the scale; PRE → PITCH (0–14 steps up), DAMP → FOLW (OFF / T1–T6: the chord follows that track's notes)how long they ringFOLWpast half: the chord opens——
CLOUDGranular wash; SIZE max freezes it; PRE → AIR (±24 st: the cloud down / up, darker / airier)decay · freezedarkensgrains pitched + chorusgrain densitygrain spread

MASTER

CLIPPNCHDUCKREL

CLIP saturates without getting louder. PNCH drives the drums: denser body. DUCK: the kick pulls the rest down (REL its release). An always-on leveler (slow 2:1, −9…+6 dB) before the limiter keeps patches at a steady volume.

PUNCH-IN FX (FX HELD)

REPEAT 1/8 · 1/16 · 1/32, LPF, HPF; on the notes: OCT−/+, ½ TEMPO, DEC−/+, STUTTER, ATK+, ARP, RANDOM. Knobs: FILTER CRUSH THROW DEPTH. Recordable per section.

GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP JIANT FM v0.8.4
\ No newline at end of file diff --git a/firmware/src/core.h b/firmware/src/core.h index 8ec1e496..423f81c3 100644 --- a/firmware/src/core.h +++ b/firmware/src/core.h @@ -410,7 +410,12 @@ static const uint8_t CT_DIVS[CT_NDIV] = {0, 2, 3, 4, 6, 8}; * x2..x4; 0.6.82: .. x8); PULSE: its notes again on the empty steps after it (carg 0..3: every 1..4); JUMP: then step carg + 1; * REV: back from here to step 1 (ping-pong); FILL: only while FX is held; KILL: what the track sounds cut first */ enum { CP_NONE, CP_ARPN, CP_ARPQ, CP_ARPS, CP_TRIG, CP_RAND, CP_OCT, CP_TONAL, CP_BEND, CP_ECHO, CP_PULSE, CP_JUMP, - CP_REV, CP_FILL, CP_KILL, CP_WALK, CP_CLIMB, CP_N }; + CP_REV, CP_FILL, CP_KILL, CP_WALK, CP_CLIMB, CP_TOUCH, CP_N }; +/* (0.8.5) TOUCH: on a DRUM track how the step's hits are struck (carg 0..2: SHORT, half the decay; GHOST, short, darker + * and softer; FLAM, a soft grace hit ~20 ms before the hit; eng_drum.c DXO_*): what a hit played in the octaves below + * the kit's records (OCT -1 .. -3, MIDI below 35: seq.c dxo_on). Other engines: nothing. ECHO's carg bit 7, EVEN + * (0.8.5): its repeats all at the step's level, a ratchet past RATCH's x4 (OCT +3 on a kit records x8 so) */ +#define CP_ECHO_EVEN 0x80u /* (0.6.98) WALK and CLIMB (after the OP-Z's and OP-XY's evolving components): the step's notes move one degree of the * scale (WALK) or one octave (CLIMB) every RATE loops of the pattern, over a RANGE of moves, then round again: UP, * DOWN, UP-DN (there and back) or RND (a random place a move, the same every time round). carg: bits 0-3 RATE @@ -425,9 +430,9 @@ enum { CP_NONE, CP_ARPN, CP_ARPQ, CP_ARPS, CP_TRIG, CP_RAND, CP_OCT, CP_TONAL, C static const uint8_t CP_WRATES[CP_NWRATE] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 16}; static const uint8_t CP_WDEGS[4] = {3, 5, 7, 12}; /* the range of carg each component's KNOB 3 turns (ARP: KNOB 3 / 4 their own; WALK CLIMB: theirs) */ -static const uint8_t CP_AMAX[CP_N] = {0, 0, 0, 0, 11, 7, 5, 14, 24, 6, 3, 63, 0, 0, 0, 0, 0}; -static const uint8_t CP_ADEF[CP_N] = {0, 0, 0, 0, 0, 2, 0, 9, 7, 1, 0, 0, 0, 0, 0, 0x40, 0x00}; -static const uint8_t CP_AMIN[CP_N] = {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; +static const uint8_t CP_AMAX[CP_N] = {0, 0, 0, 0, 11, 7, 5, 14, 24, 6, 3, 63, 0, 0, 0, 0, 0, 2}; +static const uint8_t CP_ADEF[CP_N] = {0, 0, 0, 0, 0, 2, 0, 9, 7, 1, 0, 0, 0, 0, 0, 0x40, 0x00, 0}; +static const uint8_t CP_AMIN[CP_N] = {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int cp_iswalk(uint32_t c) { return c == CP_WALK || c == CP_CLIMB; } #define CP_ORD(a) ((uint32_t)(a) & 3u) /* UP DOWN UP-DN RND */ /* (0.6.62) JUMP: its step (bits 0-5) and TIMES (bits 6-7); REV: TIMES (bits 0-1). TIMES: ALWAYS, x1 (once a pass of @@ -579,6 +584,8 @@ typedef struct track { uint16_t dbt; uint8_t ss_n, ss_i; /* (0.6.84) STRUM on the sequencer's chords: the step's notes still to come in, in */ uint8_t ss_nn[4 + NLANE], ss_vv[4 + NLANE]; /* order low to high (seq.c seq_step, seq_tick), ss_due samples to the next */ + uint8_t dtch, ss_tch; /* (0.8.5) a step's TOUCH (1..3, 0 none) on the sequencer's next drum hits; .. on the + * queued ones (HUMAN TIME: seq_tick) */ uint32_t ss_due, ss_gap; /* (.. and the gap between them; 0.6.88: 32 bits, a long TIMING) */ uint16_t ext; /* (0.6.88) TIMING: samples the playing step began before its place (it is early) */ int8_t mic; /* .. the playing step's own TIMING (ST_MICRO), late: seq_step queues its notes */ diff --git a/firmware/src/eng_drum.c b/firmware/src/eng_drum.c index a4b28e64..59ff80dc 100644 --- a/firmware/src/eng_drum.c +++ b/firmware/src/eng_drum.c @@ -7,7 +7,7 @@ * Before Felucca 1.0 this engine was PHYS's MODEL DRUM; those sounds load as it (drum_from_phys in core.h). * * Keys and notes: the keys play the General MIDI drum map with the kick on the first C (C KICK, C# RIM, - * D SNARE, D# CLAP, F# HAT CL, A# HAT OP, F G A B C D TOMS, C# CYM, G# BELL; OCT -/+ move it), and a note + * D SNARE, D# CLAP, F# HAT CL, A# HAT OP, F G A B C D TOMS, C# CYM, G# BELL; at every OCT: above it ratcheted, below it damped, 0.8.5), and a note * plays its GM drum on its lane (35..81: kicks, snares, toms, hats, cymbals and bells on BELL, congas on TOM, claves * on RIM, each at its pitch from the lane's; other notes as their octave of 36..47), so GM patterns and MIDI parts * play as drums. @@ -39,6 +39,8 @@ typedef struct { uint8_t age; /* blocks since the hit (255: and more): PUNCH's shape */ int8_t rm, rt; /* (0.5.1) X-MOD RAND: this hit's MORPH offset, its tune (1/16 semitones) */ int16_t bc, bd, bs; /* (0.6.82) a step's BEND on the hit: now, where to, a block's step (1/16 semitones) */ + uint8_t dm, fl, fv; /* (0.8.5) its TOUCH 0..3 (DXO_*: SHORT GHOST FLAM, 0 as the kit has it); FLAM: blocks + * to the hit itself (0 none), its velocity */ } drum_lane_t; /* (JIANT 0.5.1) X-MOD (EDIT > X-MOD on a DRUM track): the kit's own modulator, saved with the kit (project.c, in its * reserved bytes): RATE (OFF, 4BAR 2BAR 1BAR 1/2 1/4 1/8 1/16 1/32: a tempo-synced LFO), DPTH (how far it moves @@ -93,6 +95,49 @@ static const int8_t DRUM_GM[47][2] = { }; static uint32_t drum_gm_ix(uint32_t note) { return (note >= 35u && note <= 81u ? note : 36u + (note + 120u - 36u) % 12u) - 35u; } +/* (JIANT 0.8.5) the octaves of the kit. OCT 0, where the keys play the GM map (key 7 the kick, 36), is the kit as it + * always was. The other octaves play the same sounds on the same keys (drum_keys: OCT no longer moves the notes). + * Above, ratcheted in time while held (seq.c dxo_tick): x2 at OCT +1, x4 at +2, x8 at +3; recorded as the hit and the + * step's RATCH x2 / x4, at +3 its ECHO x8 EVEN (core.h CP_ECHO_EVEN: the eight at one level). Below, each hit with a + * TOUCH (drum_lane_t.dm; the step's TOUCH component, core.h CP_TOUCH, when recorded): OCT -1 SHORT (half the decay), + * -2 GHOST (short, darker, at ~45 % of its level: a ghost note), -3 FLAM (a soft grace hit, then the hit itself + * DXO_FLAM later, ~20 ms whatever the tempo). MIDI keeps the GM map on 35..81, as ever; the notes around it, which + * played their octave of 36..47 plain, are those octaves' bands: 23..34 -1, 11..22 -2, 0..10 -3, 82..93 +1, 94..105 + * +2, 106..127 +3, each by its pitch class (84 the kick x2, 24 the kick SHORT). dx_in_tch: a live hit's TOUCH, + * track_t.dtch: a step's */ +static const uint8_t DXO_RAT[4] = {1, 2, 4, 8}; /* OCT 0 +1 +2 +3: hits a step */ +static const int8_t DXO_DEC[4] = {0, -14, -14, 0}; /* TOUCH 0..3: on DECAY (14: half the decay time, dx_tau) */ +static const int8_t DXO_TON[4] = {0, 0, -24, 0}; /* .. on TONE (COLOR: the lane's filter, its drive) */ +static const uint8_t DXO_VEL[4] = {128, 128, 58, 58}; /* .. on the velocity, /128 (FLAM: its grace hit's) */ +#define DXO_FLAM ((FS * 20u / 1000u + CTL / 2u) / CTL) /* FLAM: blocks from the grace hit to the hit (~20 ms) */ +static uint8_t dx_in_tch, dx_in_rat; /* the live note's TOUCH / RATCH (seq.c dxo_on; 0 none) */ +static int32_t drum_oct_of(uint32_t note) /* a MIDI note's octave of the kit */ +{ + if (note >= 35u && note <= 81u) + return 0; + if (note < 35u) + return -(int32_t)((35u - note + 11u) / 12u); + return note >= 106u ? 3 : note >= 94u ? 2 : 1; +} +static uint32_t drum_oct_base(uint32_t note) { return 36u + (note + 120u - 36u) % 12u; } /* .. its sound (36..47) */ +/* the MIDI note of key note at octave o (MIDI OUT): its band's note of the same pitch class (DRUM_GM's 48..55 are + * their pitch class there) */ +static uint32_t drum_oct_note(uint32_t note, int32_t o) +{ + int32_t lo, hi, n; + if (!o) + return note; + lo = o > 0 ? 82 + 12 * (o > 3 ? 2 : o - 1) : o == -1 ? 23 : o == -2 ? 11 : 0; + hi = o > 2 ? 127 : o == -3 ? 10 : lo + 11; + n = lo + (((int32_t)drum_oct_base(note) - lo) % 12 + 12) % 12; + return (uint32_t)(n > hi ? n - 12 >= 0 ? n - 12 : 11 : n); +} +static const char *drum_oct_name(int32_t o) /* what OCT does on a DRUM track (ui_input.c) */ +{ + static const char *const N[7] = {"FLAM", "GHOST", "SHORT", "DRUM-X KIT", "RATCHET x2", "RATCHET x4", "RATCHET x8"}; + return N[clamp(o, -3, 3) + 3]; +} + /* ----------------------------------------------------- the grid's lanes --- */ /* A step's lane hits (step_t.hit / acc, the DRUM grid: SEQ > STEP on a DRUM track) play these GM notes, on any * engine: DRUM strikes its lanes, a synth plays the pitches. Each is the designed pitch of @@ -204,6 +249,14 @@ static void drum_note_on(track_t *t, voice_t *v) L->bd = t->dbend; L->bs = (int16_t)(t->dbend ? ((t->dbend < 0 ? -t->dbend : t->dbend) + t->dbt) / (t->dbt ? t->dbt : 1u) : 0); L->owner = (uint8_t)(i + 1u); /* (its last voice, if another, ends: drum_amp) */ + L->dm = (uint8_t)((dx_in_tch ? dx_in_tch : t->dtch) & 3u); /* (0.8.5) TOUCH: a key below the kit's octave, a step */ + L->fl = 0; + if (L->dm) { + L->fv = v->vel; + v->vel = (uint8_t)((v->vel * DXO_VEL[L->dm] + 64u) >> 7 ? (v->vel * DXO_VEL[L->dm] + 64u) >> 7 : 1u); + if (L->dm == 3u) + L->fl = (uint8_t)(DXO_FLAM + 1u); /* (FLAM: the grace hit now, the hit DXO_FLAM blocks on, drum_render) */ + } v->s[0] = (int32_t)lane; v->env_out = v->vel * 258; /* the hit starts at its level (no ramp from 0) */ v->env = 1 << 24; /* the ADSR held at full from here, not from drum_amp: @@ -235,7 +288,7 @@ static int32_t drum_amp(track_t *t, voice_t *v, int32_t adsr) return 0; if (v->stage == 4u) /* (0.6.74) given up: env_tick's fade, not held at full */ return adsr; - if (!L || (!L->x.live && !L->x.trig)) { + if (!L || (!L->x.live && !L->x.trig && !L->fl)) { /* (0.8.5: a FLAM's hit to come keeps it) */ v->active = v->gate = 0; v->stage = 0; v->env = 0; @@ -390,6 +443,7 @@ static void drum_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const uint32_t g0 = L->mg; if (!g0) { L->x.live = L->x.trig = 0; /* (drum_amp ends the voice) */ + L->fl = 0; L->x.hl = 0; /* (0.6.19: the next hit starts its upsampling from 0) */ return; } @@ -398,6 +452,15 @@ static void drum_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const ml.amp1 = m->amp1 * (int32_t)(g0 - 1u) / (int32_t)DXG_FADE; m = &ml; } + if (L->fl == 2u) /* (0.8.5) FLAM: its velocity back a block before the hit + * (voice.c takes the level before the render) */ + v->vel = L->fv; + if (L->fl && !--L->fl) { /* .. the hit itself */ + dx_trigger(&L->x); + L->age = 0; + if (((uint32_t)v->s[0] & (DV_NLANE - 1u)) == DV_HATC) + dx_choke(&drum_kit_of(t)[DV_HATO].x); + } if (lv < 127) { /* the lane's LEVEL (square law) on the block's amplitude * ramp, not per sample; 100 %: the ramp as it was */ int32_t gl = lv * lv * 2 + (lv * lv >> 6); /* Q15, 127: 32508 (not used), 64: 8256 */ @@ -419,7 +482,7 @@ static void drum_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const } dx_run(&dx_kit[(uint32_t)v->s[0] & (DV_NLANE - 1u)], &L->x, p[P_E0] + dx_mot_v + L->rm + lfo_shp, L->st * 16 + L->rt + L->bc + (p[P_E1] - 64) * 3 + t->pfx_pit + lfo_pit, - p[P_E3] - 64, p[P_E2] - 64, p[P_E4] - 64, p[P_E6], p[P_E5], y, n); + p[P_E3] - 64 + DXO_DEC[L->dm & 3u], p[P_E2] - 64 + DXO_TON[L->dm & 3u], p[P_E4] - 64, p[P_E6], p[P_E5], y, n); { /* PUNCH: the boost before the knee (driven into it, as * Drum Buss), the tail's cut on the amplitude ramp */ int32_t pu = pnch_eff; @@ -493,11 +556,11 @@ static __attribute__((noinline)) void drum_bus(const track_t *t, int32_t *out, u } } -/* the GM drum map, the first C (key 7) is the kick (C2, 36) */ +/* the GM drum map, the first C (key 7) is the kick (C2, 36), at every OCT (0.8.5: the octaves, above) */ static int32_t drum_keys(const track_t *t, uint32_t k) { (void)t; - return clamp(29 + 12 * song.octave + (int32_t)k, 0, 127); + return clamp(29 + (int32_t)k, 0, 127); /* (0.8.5: every octave; OCT ratchets / damps, seq.c dxo_on) */ } /* {MRPH, TUNE, TONE, DECY, NOIS, FM, FOLD, DRV}; the kit suggests the BEAT pattern (GM notes) */ diff --git a/firmware/src/midi_control.c b/firmware/src/midi_control.c index 48448e6a..b693faef 100644 --- a/firmware/src/midi_control.c +++ b/firmware/src/midi_control.c @@ -90,14 +90,22 @@ static void midi_release(uint32_t ch, uint32_t note) if (!--midi_ch[ch].owned[id - 1u]) midi_ch[ch].targets &= (uint8_t)~(1u << (id - 1u)); } - if (id && !midi_local_held(&trk[id - 1u], note)) + if (id && drum_track(&trk[id - 1u]) && drum_oct_of(note)) { /* (0.8.5) a band of the kit's octaves */ + dxo_off(&trk[id - 1u], DXO_MIDI + (ch << 7) + note); + if (!midi_local_held(&trk[id - 1u], drum_oct_base(note))) + input_off(&trk[id - 1u], drum_oct_base(note)); + } else if (id && !midi_local_held(&trk[id - 1u], note)) input_off(&trk[id - 1u], note); /* input_off also checks other MIDI owners */ } /* a MIDI note-on (ch, note) of track t. A note another key or MIDI note holds already sounds: not started again */ static void midi_play(track_t *t, uint32_t ch, uint32_t note, uint32_t vel) { - (void)ch; + if (drum_track(t) && drum_oct_of(note)) { /* (0.8.5) the kit in another octave: its sound, ratcheted / + * damped (seq.c dxo_on) */ + dxo_on(t, drum_oct_base(note), drum_oct_of(note), vel, DXO_MIDI + (ch << 7) + note); + return; + } if (!midi_note_held(t, note) && !midi_local_held(t, note)) input_on(t, note, vel); } @@ -159,6 +167,8 @@ static void midi_silence_track(uint32_t track) track_t *t = &trk[track]; uint32_t i; trk_all_off(t); + if (track < NPART) + dxo_n[track] = 0; /* (0.8.5) a held ratchet stops */ t->nheld = t->arp_phys = t->rh_n = 0; arp_forget(t); t->seq_n = t->seq_hold = t->slide_glide = 0; diff --git a/firmware/src/seq.c b/firmware/src/seq.c index 2405c27f..5802fb94 100644 --- a/firmware/src/seq.c +++ b/firmware/src/seq.c @@ -37,6 +37,7 @@ static uint32_t kb_prev; static volatile uint8_t kb_boot_hold; /* #137: set from power-on to the end of the splash (main.c): the keys sound nothing, * and one held across its end stays silent until it is let go and pressed again */ static uint8_t kb_note[27], kb_trk[27]; /* per key: the note it started and on which track */ +static int8_t kb_oct[27]; /* (0.8.5) .. on a DRUM track, the kit's octave it plays (OCT then: seq.c dxo_on) */ static volatile uint8_t kb_asleep; /* MENU > SCREEN OFF (ui.c): the screen dark or waking, a key pressed now only * wakes it (silent, no layer, its release nothing) */ static uint8_t last_note = 60; @@ -494,6 +495,7 @@ static volatile uint8_t cin_left, cin_total; /* the count-in's beats still to static volatile uint32_t cin_pos; /* samples into its beat playing */ static uint8_t cin_flush; /* the count-in ended in this block: record what was kept */ static uint8_t cin_note[NTRK][4], cin_vel[NTRK][4], cin_n[NTRK], cin_up[NTRK]; /* kept notes; cin_up bit k: let go */ +static uint8_t cin_oct[NTRK][4]; /* (0.8.5) .. a kit's octave: its hits a step (bits 0-3), TOUCH (4-5) */ static int seq_counting(void) { return cin_left != 0u; } static uint32_t click_beat_len(void) { return 4u * div_samples(2); } /* DIV 2: 1/16 */ static int click_wanted(void) /* CLICK REC: while a track is armed (not in a song: no recording) */ @@ -571,6 +573,73 @@ static uint32_t seq_src(const track_t *t, uint32_t idx) return (uint32_t)(((int32_t)(idx % (uint32_t)len) - o + len) % len); } +/* (0.8.5) a recorded hit's octave (dx_in_rat / dx_in_tch: the key's or MIDI note's, eng_drum.c) onto its step: above + * the kit's octave the step's RATCH x2 / x4 (x8: an ECHO x8 EVEN), below it its TOUCH component (into COMP, else COMP 2; + * both taken by others: not written). The step's own: everything it plays has it (the last one recorded sets it; a hit + * of the kit's octave leaves it) */ +static void rec_drum_comp(step_t *s, uint32_t c, uint32_t a) +{ + if (!s->comp || s->comp == c) { + s->comp = (uint8_t)c; + s->carg = (uint8_t)a; + } else if (!s->comp2 || s->comp2 == c) { + s->comp2 = (uint8_t)c; + s->carg2 = (uint8_t)a; + } +} +static void rec_drum_oct(step_t *s) +{ + if (dx_in_rat > 4u) { + step_set_ratchet(s, 1); + rec_drum_comp(s, CP_ECHO, CP_ECHO_EVEN | 6u); /* (x8: 2 + 6) */ + s->ctime &= (uint8_t)~7u; /* (DIV FIT: the step shared out) */ + } else if (dx_in_rat > 1u) { + step_set_ratchet(s, dx_in_rat); + if (s->comp == CP_ECHO && (s->carg & CP_ECHO_EVEN)) /* (an x8 recorded there before: this one now) */ + s->comp = s->carg = 0; + if (s->comp2 == CP_ECHO && (s->carg2 & CP_ECHO_EVEN)) + s->comp2 = s->carg2 = 0; + } + if (dx_in_tch) + rec_drum_comp(s, CP_TOUCH, dx_in_tch - 1u); +} +/* a hit (a GM note) into step s of a DRUM track (rec_note, a held ratchet's next step: dxo_rec_hold) */ +static void rec_drum(track_t *t, step_t *s, uint32_t note, uint32_t vel, int32_t mic) +{ + uint32_t l = drum_lane(note), k; + if (s->time != ST_NOTE || (!s->n && !s->hit)) { + s->n = s->hit = s->acc = 0; + s->flags = 0; + s->vel = 0; + ST_MICRO_SET(s, mic); /* (0.6.88) its place off the grid (REC Q) */ + if (s->comp == CP_TOUCH) /* (0.8.5: an empty step's TOUCH left over: not this hit's) */ + s->comp = s->carg = 0; + if (s->comp2 == CP_TOUCH) + s->comp2 = s->carg2 = 0; + } + s->time = ST_NOTE; + if (note == DRUM_LANE_NOTE[l]) { /* a lane's note: its hit */ + s->hit |= (uint8_t)(1u << l); + if (vel > 110) + s->acc |= (uint8_t)(1u << l); + } else { /* another GM drum (a low tom, a crash): a note */ + for (k = 0; k < s->n && s->note[k] != note; k++) + ; + if (k == s->n) { + if (s->n < 4u) + s->n++; + s->note[s->n - 1u] = (uint8_t)note; + } + if (vel > 110) + s->flags |= SF_ACCENT; + } + if (vel > s->vel) + s->vel = (uint8_t)vel; + rec_drum_oct(s); + t->seq_active = 1; +} +static uint8_t rec_at, rec_late; /* (0.8.5) the step (play index + 1) the last hit went into; + * 1: the next one (it was played late in the one before) */ /* live recording: the note goes into the nearest step, as swung (the one playing, or * the next one when it is past the middle of the playing one). Overdub: a step that * holds notes gets this one added (a chord of up to 4; when full, the last note is @@ -597,32 +666,9 @@ static void rec_note(track_t *t, uint32_t note, uint32_t vel) mic = clamp(mic * (127 - clamp(t->p[P_HRQ], 0, 127)) / 127, -8, 7); } if (drum_track(t)) { /* DRUM: into the grid, no holds (hits) */ - uint32_t l = drum_lane(note); - if (s->time != ST_NOTE || (!s->n && !s->hit)) { - s->n = s->hit = s->acc = 0; - s->flags = 0; - s->vel = 0; - ST_MICRO_SET(s, mic); /* (0.6.88) its place off the grid (REC Q) */ - } - s->time = ST_NOTE; - if (note == DRUM_LANE_NOTE[l]) { /* a lane's note: its hit */ - s->hit |= (uint8_t)(1u << l); - if (vel > 110) - s->acc |= (uint8_t)(1u << l); - } else { /* another GM drum (a low tom, a crash): a note */ - for (k = 0; k < s->n && s->note[k] != note; k++) - ; - if (k == s->n) { - if (s->n < 4u) - s->n++; - s->note[s->n - 1u] = (uint8_t)note; - } - if (vel > 110) - s->flags |= SF_ACCENT; - } - if (vel > s->vel) - s->vel = (uint8_t)vel; - t->seq_active = 1; + rec_drum(t, s, note, vel, mic); + rec_at = (uint8_t)(idx + 1u); + rec_late = (uint8_t)next; if (next) { if (t->rskip_idx != idx) t->rskip_n = 0; @@ -724,6 +770,7 @@ static __attribute__((noinline)) void cin_keep(track_t *t, uint32_t note, uint32 } cin_note[i][k] = (uint8_t)note; cin_vel[i][k] = (uint8_t)vel; + cin_oct[i][k] = (uint8_t)((dx_in_rat & 15u) | (dx_in_tch & 3u) << 4); cin_up[i] &= (uint8_t)~(1u << k); } @@ -763,6 +810,160 @@ static void input_off(track_t *t, uint32_t note) trk_note_off(t, note); /* other mode (ARP switched while held) */ } +/* ------------------------------------------- (0.8.5) the kit's octaves --- */ +/* A DRUM track's note in another octave than the kit's (eng_drum.c DXO_*): a key at OCT +-n (kb_oct), a MIDI note of a + * band around the GM map (drum_oct_of). Below: the hit with TOUCH n (dx_in_tch on its note-on: SHORT GHOST FLAM; + * recorded as the step's TOUCH). Above: the hit, then again x2 / x4 / x8 a step while held (dxo_tick): playing, on the step's RATCH grid (a + * part every step / n from each step's start, swung as the steps are), stopped, every step / n from the press. + * Recording, playing (rec_on), the step it goes into gets the hit and the RATCH (rec_drum_oct); every step entered + * while it is held too, before it plays (dxo_rec_hold: the sequencer plays those, the held note is silent there), so + * the pass after plays what was heard; let go before the middle of such a step, that step is put back (dxo_bak), as a + * held synth note's TIE. The ARP on: the notes go to it plain. Each held one: its key or MIDI note (id), up to DXO_N a + * track (one more replaces the last) */ +#define DXO_N 4u +#define DXO_KEY 0x100u /* id: a key (+ k), a MIDI note (+ ch << 7 + note) */ +#define DXO_MIDI 0x1000u +typedef struct { + uint16_t id, idx; /* who holds it; the step (play index) part counts in */ + uint8_t note, vel, r, part; /* the hit, its hits a step, the part struck last (255 none) */ + uint8_t quiet, rec; /* a step (+ 1) it is silent in (the sequencer plays it); the + * step (+ 1) its press was recorded into */ + uint32_t cnt; /* stopped: samples since its last hit */ +} dxo_t; +static dxo_t dxo[NPART][DXO_N]; +static uint8_t dxo_n[NPART]; +static step_t dxo_bak[NPART]; /* the step a held one was last recorded into, as it was */ +static uint8_t dxo_bak_at[NPART]; /* .. which (its source step + 1; 0 none), entered at play idx */ +static uint16_t dxo_bak_idx[NPART]; +static uint32_t dxo_part(const track_t *t, uint32_t r) /* the part of the playing step it is in */ +{ + uint32_t sl = step_samples(t, div_samples((uint32_t)t->p[P_SDIV]), t->seq_idx) / (r ? r : 1u), p; + p = t->seq_pos / (sl ? sl : 1u); + return p < r ? p : r - 1u; +} +static void dxo_on(track_t *t, uint32_t note, int32_t o, uint32_t vel, uint32_t id) +{ + uint32_t ti = trk_index(t), k; + dxo_t *e; + if (!o || t->p[P_AMODE] || ti >= NPART || !drum_track(t)) { + input_on(t, note, vel); + return; + } + if (o < 0) { + dx_in_tch = (uint8_t)(o < -3 ? 3 : -o); + input_on(t, note, vel); + dx_in_tch = 0; + return; + } + dx_in_rat = DXO_RAT[o > 3 ? 3 : o]; + rec_at = 0; + input_on(t, note, vel); /* (its first hit; recorded with the RATCH) */ + for (k = 0; k < dxo_n[ti] && dxo[ti][k].id != id; k++) + ; + if (k == dxo_n[ti] && dxo_n[ti] < DXO_N) + dxo_n[ti]++; + e = &dxo[ti][k < DXO_N ? k : DXO_N - 1u]; + e->id = (uint16_t)id; + e->note = (uint8_t)note; + e->vel = (uint8_t)vel; + e->r = dx_in_rat; + e->cnt = 0; + e->idx = t->seq_idx; + e->part = song.playing && t->seq_pos < 0x7FFFFFFFu ? (uint8_t)dxo_part(t, e->r) : 255u; + e->quiet = e->rec = 0; + if (cin_left) /* (the count-in keeps it for step 1) */ + e->rec = 1; + else if (rec_at && rec_on(t)) { + e->rec = rec_at; + if (rec_late) /* into the next step: silent to its end, as it plays back */ + e->quiet = (uint8_t)(t->seq_idx + 1u); + } + dx_in_rat = 0; +} +static void dxo_off(track_t *t, uint32_t id) +{ + uint32_t ti = trk_index(t), k, j = 0; + if (ti >= NPART || !dxo_n[ti]) + return; + for (k = 0; k < dxo_n[ti]; k++) + if (dxo[ti][k].id != id) + dxo[ti][j++] = dxo[ti][k]; + if (j == dxo_n[ti]) + return; + dxo_n[ti] = (uint8_t)j; + if (!j && dxo_bak_at[ti]) { /* let go early in a step it was held into: that step back */ + if (rec_on(t) && dxo_bak_idx[ti] == t->seq_idx && seq_src(t, t->seq_idx) == dxo_bak_at[ti] - 1u && + t->seq_pos < step_samples(t, div_samples((uint32_t)t->p[P_SDIV]), t->seq_idx) / 2u) + t->step[dxo_bak_at[ti] - 1u] = dxo_bak[ti]; + dxo_bak_at[ti] = 0; + } +} +/* the sequencer enters step idx of track t (before it plays it): recording, the held ones go into it */ +static __attribute__((noinline)) void dxo_rec_hold(track_t *t, uint32_t idx) +{ + uint32_t ti = trk_index(t), k, src = seq_src(t, idx), bak = 0; + for (k = 0; k < dxo_n[ti]; k++) { + dxo_t *e = &dxo[ti][k]; + if (e->rec == idx + 1u) { /* (its press went into this one: it plays it) */ + e->quiet = (uint8_t)(idx + 1u); + continue; + } + if (!rec_on(t) || !drum_track(t)) + continue; + if (!bak) { + dxo_bak[ti] = t->step[src]; + dxo_bak_at[ti] = (uint8_t)(src + 1u); + dxo_bak_idx[ti] = (uint16_t)idx; + bak = 1; + } + dx_in_rat = e->r; + rec_drum(t, &t->step[src], e->note, e->vel, 0); + dx_in_rat = 0; + e->quiet = (uint8_t)(idx + 1u); + } +} +static void dxo_hit(track_t *t, const dxo_t *e) { trk_note_on(t, e->note, e->vel); } +/* a block on (events_block, after the sequencer): the held ones' next hits */ +static __attribute__((noinline)) void dxo_tick(track_t *t, uint32_t n) +{ + uint32_t ti = trk_index(t), k; + if (!drum_track(t) || t->p[P_AMODE]) { + dxo_n[ti] = 0; + return; + } + for (k = 0; k < dxo_n[ti]; k++) { + dxo_t *e = &dxo[ti][k]; + uint32_t r = e->r ? e->r : 1u, part; + if (!song.playing || t->seq_pos >= 0x7FFFFFFFu) { /* stopped: from the press */ + uint32_t per = div_samples((uint32_t)t->p[P_SDIV]) / r; + e->part = 255u; + e->idx = 0xFFFFu; + e->cnt += n; + if (per && e->cnt >= per) { + e->cnt -= per; + if (e->cnt >= per) + e->cnt = 0; + dxo_hit(t, e); + } + continue; + } + e->cnt = 0; + part = dxo_part(t, r); + if (t->seq_idx != e->idx) { + e->idx = t->seq_idx; + e->part = 255u; + } + if (e->quiet == t->seq_idx + 1u) { + e->part = (uint8_t)part; + continue; + } + if (part != e->part) { + e->part = (uint8_t)part; + dxo_hit(t, e); + } + } +} + /* the effect of key k in the FX layer (PF_N none): the first PF_M1 white keys (F3 .. A4) in order, black keys * 1..4 (F#3 G#3 A#3 C#4) the track mutes */ static uint32_t perf_key(uint32_t k) @@ -807,9 +1008,9 @@ static void key_next(uint32_t k, track_t *t) uint32_t x = kb_snd[k][kb_on[k]], mc = trk_midi_ch(trk_index(t)); if (!midi_local_held(t, x)) { in_norec = kb_sn[k] > 1u; /* (0.6.84: the chord's notes recorded at once, key_on) */ - input_on(t, x, 100); + dxo_on(t, x, kb_oct[k], 100, DXO_KEY + k); /* (0.8.5: a kit's octave; else input_on) */ in_norec = 0; - mo_key(t, 0x09u | (0x90u | mc) << 8 | x << 16 | 100u << 24); + mo_key(t, 0x09u | (0x90u | mc) << 8 | drum_oct_note(x, kb_oct[k]) << 16 | 100u << 24); } kb_on[k]++; } @@ -862,6 +1063,8 @@ static void key_off(uint32_t k, track_t *t) uint32_t n = kb_on[k], i, mc = trk_midi_ch(trk_index(t)); if (!n) return; + if (kb_oct[k] > 0) + dxo_off(t, DXO_KEY + k); /* (0.8.5) its ratchet ends (LATCH too) */ kb_on[k] = 0; /* (the strum's notes not in yet: never) */ kb_sn[k] = 0; if (key_latch(t)) { /* LATCH: it keeps sounding (recorded as let go) */ @@ -876,7 +1079,7 @@ static void key_off(uint32_t k, track_t *t) if (midi_local_held(t, x)) continue; input_off(t, x); - mo_key(t, 0x08u | (0x80u | mc) << 8 | x << 16); + mo_key(t, 0x08u | (0x80u | mc) << 8 | drum_oct_note(x, kb_oct[k]) << 16); } } @@ -937,6 +1140,7 @@ static void keyboard_block(void) kb_note[k] = key_black(k) && key_place(k) < NLANE ? DRUM_LANE_NOTE[key_place(k)] : KB_SILENT; else kb_note[k] = (uint8_t)kb_map(&trk[kb_trk[k]], k); + kb_oct[k] = (int8_t)(!song.grid && drum_track(&trk[kb_trk[k]]) ? song.octave : 0); /* (0.8.5) */ if (kb_note[k] == KB_SILENT) continue; key_on(k, &trk[kb_trk[k]]); @@ -1147,7 +1351,7 @@ static uint32_t step_parts(const track_t *t, const step_t *s, uint32_t *div) cp_get(t, o, CP_ARPN, CP_ARPS, &a); return *div = CP_RATES[CP_RATE(a) % CP_NRATE]; } - h = s->time == ST_NOTE && CP_HAS(t, s, CP_ECHO, &a) ? 2u + a % 7u : step_ratchet(s); + h = s->time == ST_NOTE && CP_HAS(t, s, CP_ECHO, &a) ? 2u + (a & ~CP_ECHO_EVEN) % 7u : step_ratchet(s); d = CT_DIVS[CT_DIV(s) % CT_NDIV]; if (h < 2u || !d) return *div = h; @@ -1506,7 +1710,9 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint gate = step_samples(t, period, t->seq_idx) / div * (CT_LEN(s) ? CT_LEN(s) * 8u : (uint32_t)t->p[P_SGATE]) / 128u; if (!(skip & SEQ_REP)) t->rat_left = (uint8_t)(hits - 1u); - if (!arp && CP_HAS(t, s, CP_ECHO, 0)) { /* (0.6.42) ECHO: each repeat softer */ + uint8_t ea = 0; + if (!arp && CP_HAS(t, s, CP_ECHO, &ea) && !(ea & CP_ECHO_EVEN)) { /* (0.6.42) ECHO: each repeat softer + * (0.8.5: EVEN, a ratchet: all at one level) */ uint32_t part = (skip & SEQ_REP) ? hits - 1u - t->rat_left : 0u; vel = vel * (hits - part) / hits; if (vel < 8u) vel = 8u; @@ -1568,6 +1774,10 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint } if (oct) dp += cp_oct(t, oa); t->dpit = (int8_t)clamp(dp, -48, 48); + { /* (0.8.5) TOUCH: SHORT GHOST FLAM on the hits (eng_drum.c) */ + uint8_t da = 0; + t->dtch = (uint8_t)(CP_HAS(t, s, CP_TOUCH, &da) ? 1u + da % 3u : 0u); + } t->dbend = (int16_t)(bend ? ((int32_t)(ba % 25u) - 12) * 16 : 0); t->dbt = (uint16_t)clamp((int32_t)(step_samples(t, period, t->seq_idx) / CTL), 1, 65535); } @@ -1632,6 +1842,7 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint } t->ss_gap = gap; t->ss_due = hdel ? hdel : 1u; + t->ss_tch = t->dtch; /* (0.8.5: the queued hits keep their TOUCH) */ gate += hdel; } for (i = 0; i < m; i++) @@ -1653,6 +1864,7 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint } t->dpit = 0; /* (0.6.82: the keys' hits as they are) */ t->dbend = 0; + t->dtch = 0; if (slide_in) /* release what is not held over */ for (i = 0; i < t->seq_n; i++) { for (j = 0; j < m && nn[j] != t->seq_notes[i]; j++) @@ -1722,7 +1934,9 @@ static void seq_tick(track_t *t, uint32_t n) t->ss_due -= n; } else { do { /* (0.6.87: HUMAN TIME without a strum: the chord together) */ + t->dtch = t->ss_tch; seq_note_on(t, t->ss_nn[t->ss_i], t->ss_vv[t->ss_i]); + t->dtch = 0; t->ss_i++; } while (!t->ss_gap && t->ss_i < t->ss_n); t->ss_due = t->ss_gap; @@ -1768,6 +1982,8 @@ static void seq_tick(track_t *t, uint32_t n) if (!t->seq_idx && !start && t->loops < 0xFFFFu) t->loops++; /* (0.6.39) one more loop of the pattern (TRIG) */ rec_hold(t, t->seq_idx, len ? len : 1u); + if (trk_index(t) < NPART && dxo_n[trk_index(t)]) + dxo_rec_hold(t, t->seq_idx); /* (0.8.5) a held ratchet records into it */ { const step_t *s = &seq_steps(t)[(t->pfx & PFX_RND) && !(rng() & 1u) /* (JIANT) RANDOM held: half the */ ? rng() % (len ? len : 1u) : seq_src(t, t->seq_idx)]; /* steps, any */ @@ -1844,7 +2060,10 @@ static __attribute__((noinline)) void cin_record(void) track_t *t = &trk[i]; for (k = 0; k < cin_n[i]; k++) if (rec_on(t)) { + dx_in_rat = (uint8_t)(cin_oct[i][k] & 15u); + dx_in_tch = (uint8_t)(cin_oct[i][k] >> 4); rec_note(t, cin_note[i][k], cin_vel[i][k]); + dx_in_rat = dx_in_tch = 0; if ((cin_up[i] >> k) & 1u) rec_release(t, cin_note[i][k]); } @@ -1952,6 +2171,8 @@ static void events_block(uint32_t n) } latch_was = (uint8_t)(key_latch(t) ? latch_was | 1u << i : latch_was & ~(1u << i)); if ((pr >> i) & 1u) { + if (i < NPART) + dxo_n[i] = 0; /* (0.8.5) the held ratchets stop */ if ((latch_was >> i) & 1u) latch_release(t); /* (0.6.19: MIDI OUT's latched notes end too) */ midi_forget_track(i); @@ -2013,6 +2234,9 @@ static void events_block(uint32_t n) chain_tick(seq_n); for (i = 0; i < NTRK; i++) seq_tick(&trk[i], seq_n); + for (i = 0; i < NPART; i++) /* (0.8.5) the kit's octaves held: their ratchets */ + if (dxo_n[i]) + dxo_tick(&trk[i], clock_mode ? seq_n : n); if (cin_flush) cin_record(); if (song.playing) diff --git a/firmware/src/ui.c b/firmware/src/ui.c index 03355331..f8ba746d 100644 --- a/firmware/src/ui.c +++ b/firmware/src/ui.c @@ -627,7 +627,7 @@ static uint32_t note_len(const track_t *t, uint32_t c, uint32_t len) } enum { COMP_OFF, COMP_CHANCE, COMP_RATCH, COMP_ARPN, COMP_ARPQ, COMP_ARPS, COMP_TRIG, COMP_RAND, COMP_OCT, COMP_TONAL, - COMP_BEND, COMP_ECHO, COMP_PULSE, COMP_JUMP, COMP_REV, COMP_FILL, COMP_KILL, COMP_WALK, COMP_CLIMB, COMP_N }; /* (CP_* in order) */ + COMP_BEND, COMP_ECHO, COMP_PULSE, COMP_JUMP, COMP_REV, COMP_FILL, COMP_KILL, COMP_WALK, COMP_CLIMB, COMP_TOUCH, COMP_N }; /* (CP_* in order) */ static const char *const EV_NAMES[EV_N] = {"ALWAYS", "1:2", "2:2", "SKIP", "1:3", "2:3", "3:3", "1:4", "2:4", "3:4", "4:4", "1:8", "FIRST", "!FIRST"}; /* (0.6.92) EVERY */ /* (0.6.92) a part of the step as a note value: n parts a step of the track's DIV (1/16: x2 1/32, x3 1/32T, x4 1/64 ..; @@ -644,7 +644,8 @@ static void rate_name(const track_t *t, uint32_t n, char *b) b[0] = '1'; b[1] = '/'; fmt_int(b + 2, (int32_t)v); str_cpy(b + str_len(b), tr, 2); } static const char *const COMP_NAMES[COMP_N] = {"OFF", "CHANCE", "RATCH", "NOTES", "SEQ", "SCALE", "TRIG", "RAND", "OCT", - "TONAL", "BEND", "ECHO", "PULSE", "JUMP", "REV", "FILL", "KILL", "WALK", "CLIMB"}; + "TONAL", "BEND", "ECHO", "PULSE", "JUMP", "REV", "FILL", "KILL", "WALK", "CLIMB", + "TOUCH"}; /* (0.6.82) the COMP pages one after another: COMP (the step's first component), COMP 2 (its second), WHEN (theirs, and * the step's LEN): which this is (0..2) */ static uint32_t comp_slot(void) diff --git a/firmware/src/ui_draw.c b/firmware/src/ui_draw.c index 7d24ab65..a1a97411 100644 --- a/firmware/src/ui_draw.c +++ b/firmware/src/ui_draw.c @@ -973,7 +973,8 @@ static void draw_columns(void) case COMP_OCT: lb = "MODE"; str_cpy(val, OCTN[a % 6], sizeof val); un = "OCT"; break; case COMP_TONAL: lb = "SHIFT"; a -= 7; val[0] = a < 0 ? '-' : '+'; fmt_int(val + 1, a < 0 ? -a : a); un = "DEG"; break; case COMP_BEND: lb = "BEND"; a -= 12; val[0] = a < 0 ? '-' : '+'; fmt_int(val + 1, a < 0 ? -a : a); un = "ST"; break; - case COMP_ECHO: lb = "REPEAT"; val[0] = 'x'; fmt_int(val + 1, 2 + a % 7); break; + case COMP_ECHO: lb = "REPEAT"; val[0] = 'x'; fmt_int(val + 1, 2 + (a & 127) % 7); un = a & 128 ? "EVEN" : ""; break; + case COMP_TOUCH: { static const char *const TN[3] = {"SHORT", "GHOST", "FLAM"}; lb = "HIT"; str_cpy(val, TN[a % 3], sizeof val); break; } /* (0.8.5) */ case COMP_PULSE: lb = "EVERY"; fmt_int(val, 1 + a % 4); un = a ? "STEPS" : "STEP"; break; case COMP_JUMP: lb = "TO STEP"; fmt_int(val, (int32_t)CP_JTO(a) + 1); break; case COMP_WALK: case COMP_CLIMB: { /* (0.6.98) MODE and RANGE in one: the range as the unit */ diff --git a/firmware/src/ui_input.c b/firmware/src/ui_input.c index bd449182..61d88c61 100644 --- a/firmware/src/ui_input.c +++ b/firmware/src/ui_input.c @@ -904,8 +904,10 @@ static void comp_knob(uint32_t slot, int32_t steps) step_set_ratchet(st, (uint32_t)clamp((int32_t)step_ratchet(st) + d, 1, 4)); else if (*cp == CP_JUMP && slot == 2u) /* (0.6.62) TO STEP (0.6.92: TIMES is EVERY, KNOB 4) */ *ap = (uint8_t)((*ap & 0xC0u) | (uint32_t)clamp((int32_t)CP_JTO(*ap) + steps, 0, 63)); - else if (v >= COMP_TRIG && slot == 2u && *cp > CP_ARPS && CP_AMAX[*cp]) /* TRIG .. PULSE: their value */ - *ap = (uint8_t)clamp((int32_t)*ap + d, CP_AMIN[*cp], CP_AMAX[*cp]); + else if (v >= COMP_TRIG && slot == 2u && *cp > CP_ARPS && CP_AMAX[*cp]) /* TRIG .. PULSE: their value (0.8.5: ECHO's + * EVEN kept) */ + *ap = (uint8_t)((*cp == CP_ECHO ? *ap & CP_ECHO_EVEN : 0u) | + (uint32_t)clamp((int32_t)(*cp == CP_ECHO ? *ap & ~CP_ECHO_EVEN : *ap) + d, CP_AMIN[*cp], CP_AMAX[*cp])); else if ((v == COMP_WALK || v == COMP_CLIMB) && slot == 2u) { /* (0.6.98) MODE x RANGE: one list, a range after another */ int32_t i = clamp((int32_t)(CP_WMODE(*ap) * 4u + CP_WRNG(*ap)) + d, 0, 15); *ap = CP_WARG(CP_WRATE(*ap), (uint32_t)i / 4u, (uint32_t)i % 4u); @@ -2250,6 +2252,8 @@ static void ui_input_frame(void) song.octave = 0; else song.octave += b == B_OCTDN ? (song.octave > -3 ? -1 : 0) : (song.octave < 3 ? 1 : 0); + if (drum_track(TSEL) && !song.grid) /* (0.8.5) the kit's octaves: what this one does */ + ui_message(drum_oct_name(song.octave)); break; } default: /* page buttons (GLO SCL ENV LFO EDIT ARP): when let go */ diff --git a/tests/drumx_oct_test.c b/tests/drumx_oct_test.c new file mode 100644 index 00000000..4d5d70b5 --- /dev/null +++ b/tests/drumx_oct_test.c @@ -0,0 +1,605 @@ +/* SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2026 Leo Kuroshita (@kurogedelic), Hügelton Instruments */ +/* (JIANT 0.8.5) DRUM-X OCTAVES (eng_drum.c DXO_*, seq.c dxo_*): the kit in every octave of the keys, on the real + * sequencer, MIDI, project and UI sources (with the stubs of tests/ui_test.c): + * CENTRE OCT 0: the keys' notes and hits as before (key 7 the kick, 36), no ratchet, no TOUCH, a hit bit for bit + * the one a plain note-on renders; recorded: the hit alone. + * UP OCT +1 / +2 / +3: the same sound ratcheted x2 / x4 / x8 a step while held, stopped (from the press, a + * step / n apart) and playing (on the sequencer's RATCH grid); the release ends it. + * DOWN OCT -1 SHORT (half the length, its level), -2 GHOST (short, darker, under 55 % of the level), -3 FLAM (a + * soft grace hit, the hit itself ~20 ms later at its level): measured on the engine's output. + * REC real-time recording, playing: an upper octave writes the hit and the step's RATCH x2 / x4 (x8: ECHO x8 + * EVEN), in each step it is held into (an early release puts the last one back); the pass after plays the + * very hits that were heard (each at the same sample, to the block); a lower one writes the hit and the + * step's TOUCH, played back with it (the same length and level as live); MIDI the same; FUNC round trip. + * MIDI 35..81 the GM map as before; 82.. ratchet bands, ..34 TOUCH bands (by pitch class), note-offs end them. + * UI OCT on a DRUM track says what the octave does; SEQ > COMP shows a recorded TOUCH step, ECHO's EVEN kept + * by its knob. + * Built and run by tests/run_tests.sh. */ +#define UI_TEST_NO_MAIN 1 +#include "ui_test.c" + +#define KICK_KEY 7u /* the first C: the kick (36) at OCT 0 */ +static track_t *dt; + +static track_t *drum_setup(void) +{ + uint32_t i; + ui_power_on(); + for (i = 0; i < NTRK; i++) { + track_defaults_steps(&trk[i]); + if (i != 3u) + trk[i].p[P_MUTE] = 1; + } + dt = &trk[3]; + set_engine_of(dt, ENGI_DRUM); + dt->engine = dt->eng_req; + song.sel = 3; + song.octave = 0; + song.rec = 0; + song.playing = 0; + dt->p[P_SLEN] = 16; + dt->p[P_SSWING] = 0; + song.g[G_SWING] = 0; + song.g[G_ROUTE] = 0; + memset(dxo_n, 0, sizeof dxo_n); + kb_prev = fm1_in.notes = 0; + events_block(CTL); /* (the sound load's panic, as the ISR takes it) */ + return dt; +} +static uint32_t step_len(uint32_t idx) { return step_samples(dt, div_samples((uint32_t)dt->p[P_SDIV]), idx); } +static uint32_t now_s; /* samples since the test's clock started */ +/* nb blocks of the ISR's events (keys, MIDI, the sequencer, the held octaves); at[]: the sample of each hit */ +static uint32_t run_b(uint32_t nb, uint32_t *at, uint32_t nat, uint32_t *nh) +{ + uint32_t b, v0; + for (b = 0; b < nb; b++) { + v0 = vage; + events_block(CTL); + for (; v0 < vage; v0++) { + if (at && *nh < nat) + at[*nh] = now_s; + (*nh)++; + } + now_s += CTL; + } + return *nh; +} +static void key_dn(uint32_t k) { fm1_in.notes |= 1u << k; } +static void key_upk(uint32_t k) { fm1_in.notes &= ~(1u << k); } +static const drum_lane_t *lane(uint32_t l) { return &drum_kit[3][l]; } + +/* ---------------------------------------------------------------- audio --- */ +/* the engine's own output of the hit on lane l (drum_render at full amplitude: no mix, no sends, no tails) */ +#define AN (FS * 2u) +static int32_t abuf[AN]; +static void eng_render(uint32_t l, uint32_t n) +{ + voice_t *v = 0; + vmod_t m; + uint32_t i, k; + memset(&m, 0, sizeof m); + for (i = 0; i < NVOICE; i++) + if (dt->v[i].active && drum_lane_of(dt, &dt->v[i]) == &drum_kit[3][l]) + v = &dt->v[i]; + memset(abuf, 0, sizeof abuf); + if (v) + m.amp1 = v->vel * 258; /* (the voice's level: voice.c, the ADSR held at full) */ + for (k = 0; v && k + CTL <= n; k += CTL) { + int32_t o[CTL]; + memset(o, 0, sizeof o); + m.amp0 = m.amp1; + m.amp1 = v->vel * 258; + drum_render(dt, v, o, CTL, &m); + for (i = 0; i < CTL; i++) + abuf[k + i] = o[i]; + } +} +static void quiet_kit(void) /* every hit ended, the lanes from rest */ +{ + uint32_t i; + for (i = 0; i < NVOICE; i++) + dt->v[i].active = 0; + memset(drum_kit, 0, sizeof drum_kit); +} +/* the hit's length: the last 5 ms window above -40 dB of the loudest one */ +static uint32_t hit_len(uint32_t n) +{ + double pk = 0, w; + uint32_t i, j, last = 0, win = FS / 200u; + for (i = 0; i + win <= n; i += win) { + for (w = 0, j = 0; j < win; j++) + w += (double)abuf[i + j] * abuf[i + j]; + w = sqrt(w / win); + if (w > pk) pk = w; + } + for (i = 0; i + win <= n; i += win) { + for (w = 0, j = 0; j < win; j++) + w += (double)abuf[i + j] * abuf[i + j]; + if (sqrt(w / win) > pk * 0.01) + last = i + win; + } + return last; +} +/* brightness of its first 30 ms: the first difference's energy over the signal's */ +static double bright(void) +{ + double a = 0, d = 0; + uint32_t i; + for (i = 1; i < FS * 30u / 1000u; i++) { + double x = abuf[i], y = (double)abuf[i] - abuf[i - 1]; + a += x * x; + d += y * y; + } + return a > 0 ? d / a : 0; +} +static void strike_dmp(uint32_t note, uint32_t dmp) +{ + quiet_kit(); + dx_in_tch = (uint8_t)dmp; + trk_note_on(dt, note, 100); + dx_in_tch = 0; + trk_note_off(dt, note); + eng_render(drum_lane(note), AN); +} + +static int centre(void) +{ + int bad = 0, ok = 1; + uint32_t nh = 0, k; + static int32_t a[FS / 2]; + drum_setup(); + for (k = 0; k < 27u; k++) + for (song.octave = -3; song.octave <= 3; song.octave++) + ok &= kb_map(dt, k) == 29u + k; + song.octave = 0; + bad += check("DRUM keys: every octave the same notes (key 7 the kick, 36)", ok); + key_dn(KICK_KEY); + run_b(FS / CTL, 0, 0, &nh); + key_upk(KICK_KEY); + run_b(4, 0, 0, &nh); + bad += check("OCT 0: one hit for a held key, nothing held over (no ratchet), no TOUCH", + nh == 1u && !dxo_n[3] && lane(DV_KICK)->dm == 0u); + /* the same hit through the keys and through a plain note-on: bit for bit */ + quiet_kit(); + key_dn(KICK_KEY); + events_block(CTL); + key_upk(KICK_KEY); + eng_render(DV_KICK, FS / 2u); + memcpy(a, abuf, sizeof a); + events_block(CTL); + quiet_kit(); + trk_note_on(dt, 36, 100); + trk_note_off(dt, 36); + eng_render(DV_KICK, FS / 2u); + bad += check("OCT 0: a key's kick renders bit for bit as a plain note-on 36", !memcmp(a, abuf, sizeof a)); + /* recording at OCT 0: the hit, nothing else */ + drum_setup(); + song.rec = 1u << 3; + seq_start(); + nh = 0; + run_b(1, 0, 0, &nh); + key_dn(KICK_KEY); + run_b(2, 0, 0, &nh); + key_upk(KICK_KEY); + run_b(2, 0, 0, &nh); + ok = dt->step[0].hit == 1u << DV_KICK && step_ratchet(&dt->step[0]) == 1u && !dt->step[0].comp && !dt->step[0].comp2; + seq_stop(); + bad += check("REC at OCT 0: the hit alone (x1, no component), as before", ok); + return bad; +} + +/* hits in about `steps` steps of the track's DIV with the key held at OCT o, transport stopped */ +static uint32_t held_stopped(int32_t o, uint32_t steps, uint32_t *at) +{ + uint32_t nh = 0, nb = steps * div_samples((uint32_t)dt->p[P_SDIV]) / CTL - 1u; + drum_setup(); + song.octave = o; + now_s = 0; + key_dn(KICK_KEY); + run_b(nb, at, 64, &nh); + key_upk(KICK_KEY); + return nh; +} +static int up(void) +{ + int bad = 0, ok = 1; + uint32_t at[64], nh, k, per, o; + static const uint8_t R[4] = {1, 2, 4, 8}; + for (o = 1; o <= 3u; o++) { + nh = held_stopped((int32_t)o, 4, at); + per = div_samples((uint32_t)dt->p[P_SDIV]) / R[o]; + ok &= nh == 4u * R[o] && dxo_n[3] == 1u; + for (k = 1; k < nh && k < 64u; k++) { + int32_t d = (int32_t)(at[k] - at[0]) - (int32_t)(k * per); /* (in the block holding its sample) */ + ok &= d > -(int32_t)CTL && d <= 0; + } + for (k = 0; k < NVOICE; k++) + ok &= !dt->v[k].active || dt->v[k].note == 36u; + nh = 0; + run_b(div_samples((uint32_t)dt->p[P_SDIV]) * 2u / CTL, 0, 0, &nh); + ok &= nh == 0u && !dxo_n[3]; + if (!ok) printf("ui: OCT +%u stopped: %u hits in 4 steps\n", o, held_stopped((int32_t)o, 4, at)); + } + bad += check("OCT +1 / +2 / +3 stopped: x2 / x4 / x8 a step from the press, the kick; the release ends it", ok); + /* playing: on the sequencer's grid (a part every step / n from each step's start) */ + ok = 1; + for (o = 1; o <= 3u; o++) { + uint32_t s0, i; + drum_setup(); + song.octave = (int32_t)o; + seq_start(); + now_s = 0; + nh = 0; + run_b(1, 0, 0, &nh); /* (step 1 begins) */ + s0 = now_s - CTL; + key_dn(KICK_KEY); + nh = 0; + run_b((step_len(0) * 4u) / CTL - 1u, at, 64, &nh); + key_upk(KICK_KEY); + ok &= nh == 4u * R[o]; + for (i = 1; i < nh && i < 64u; i++) { /* hit i: part i % n of step i / n */ + uint32_t want = s0 + (i / R[o]) * step_len(0) + (i % R[o]) * (step_len(0) / R[o]); + int32_t d = (int32_t)at[i] - (int32_t)want; + ok &= d >= 0 && d < (int32_t)CTL; + } + seq_stop(); + } + bad += check("OCT +1 / +2 / +3 playing: n hits a step, each on the RATCH grid of the step (to the block)", ok); + return bad; +} + +static double rms_of(uint32_t a, uint32_t b) +{ + double w = 0; + uint32_t i; + for (i = a; i < b; i++) + w += (double)abuf[i] * abuf[i]; + return sqrt(w / (b - a)); +} +static int32_t peak(uint32_t a, uint32_t b) +{ + int32_t p = 0; + uint32_t i; + for (i = a; i < b; i++) + p = abs(abuf[i]) > p ? abs(abuf[i]) : p; + return p; +} +static int down(void) +{ + int bad = 0, ok = 1, okg = 1, okf = 1; + uint32_t len[4], d, l, nh; + int32_t pk[4]; + uint32_t ms = FS / 1000u, at = DXO_FLAM * CTL; + double br[4], r0 = 0, g0, g1; + static const uint8_t NOTE[3] = {36, 38, 42}; /* kick, snare, closed hat */ + drum_setup(); + for (l = 0; l < 3u; l++) { + for (d = 0; d < 4u; d++) { + strike_dmp(NOTE[l], d); + len[d] = hit_len(AN); + br[d] = bright(); + pk[d] = peak(0, AN); + if (!d) + r0 = rms_of(0, 5u * ms); + } + ok &= len[1] < len[0] * 3u / 4u && len[1] > len[0] / 5u && pk[1] * 10 > pk[0] * 8; + okg &= len[2] < len[0] * 3u / 4u && pk[2] * 100 < pk[0] * 55 && br[2] < br[1] * 0.97; + strike_dmp(NOTE[l], 3); /* FLAM: the grace hit, the hit ~20 ms on */ + g0 = rms_of(0, 5u * ms); /* (the first 5 ms of each, RMS) */ + g1 = rms_of(at, at + 5u * ms); + okf &= g0 < g1 * 0.65 && g1 > r0 * 0.65 && hit_len(AN) > len[0] && at > 18u * ms && at < 23u * ms; + printf("ui: note %u: length %u %u %u %u samples, peak %d %d %d, brightness %.4f %.4f %.4f; FLAM grace %.0f, hit %.0f (plain %.0f)\n", + NOTE[l], len[0], len[1], len[2], len[3], pk[0], pk[1], pk[2], br[0], br[1], br[2], g0, g1, r0); + } + bad += check("TOUCH SHORT: under 3/4 of the length, the same level, every lane", ok); + bad += check("TOUCH GHOST: short, under 55 % of the level, darker", okg); + bad += check("TOUCH FLAM: a grace hit under 65 % of the hit, the hit ~20 ms later (a retrigger)", okf); + /* the keys: OCT -1 / -2 / -3 strike with TOUCH 1 / 2 / 3, nothing held over */ + ok = 1; + for (d = 1; d <= 3u; d++) { + drum_setup(); + song.octave = -(int32_t)d; + nh = 0; + key_dn(KICK_KEY); + run_b(FS / 2u / CTL, 0, 0, &nh); + key_upk(KICK_KEY); + run_b(2, 0, 0, &nh); + ok &= nh == 1u && lane(DV_KICK)->dm == d && !dxo_n[3] && !dx_in_tch; + } + bad += check("OCT -1 / -2 / -3: one hit, TOUCH SHORT / GHOST / FLAM on it", ok); + return bad; +} + +/* real-time recording, upper octave: held over steps 2..4, what plays back the pass after is what was heard */ +static int rec_up(void) +{ + int bad = 0, ok = 1; + uint32_t live[32], back[32], nl = 0, nb = 0, k, s2, loop, o; + static const uint8_t R[4] = {1, 2, 4, 8}; + for (o = 1; o <= 3u; o++) { + drum_setup(); + song.octave = (int32_t)o; + song.rec = 1u << 3; + seq_start(); + now_s = 0; + nl = nb = 0; + while (!(dt->seq_idx == 2u && dt->seq_pos < CTL)) /* to step 3's first block (index 2) */ + run_b(1, 0, 0, &nb); + s2 = now_s - CTL; + nb = 0; + key_dn(KICK_KEY); + while (!(dt->seq_idx == 4u && dt->seq_pos + 2u * CTL > step_len(4))) /* held to the end of step 5 */ + run_b(1, live, 32, &nl); + key_upk(KICK_KEY); + while (dt->seq_idx != 1u) /* the rest of the pass */ + run_b(1, 0, 0, &nb); + loop = 0; + for (k = 0; k < 16u; k++) + loop += step_len(k); + for (k = 0; k < 16u; k++) { + const step_t *s = &dt->step[k]; + int has = k >= 2u && k <= 4u; + uint32_t dv; + ok &= has ? s->time == ST_NOTE && s->hit == 1u << DV_KICK && step_parts(dt, s, &dv) == R[o] && + (o < 3u ? !s->comp && step_ratchet(s) == R[o] + : s->comp == CP_ECHO && s->carg == (CP_ECHO_EVEN | 6u) && step_ratchet(s) == 1u) + : s->time != ST_NOTE || (!s->hit && !s->n); + } + nb = 0; + while (!(dt->seq_idx == 5u)) /* the next pass, steps 3..5 */ + run_b(1, back, 32, &nb); + ok &= nl == 3u * R[o] && nb == nl; + for (k = 0; k < nl && k < nb && k < 32u; k++) { + int32_t d = (int32_t)(back[k] - loop) - (int32_t)live[k]; /* (the press: a block late, as heard) */ + ok &= d >= -(int32_t)CTL && d <= (int32_t)CTL; + } + (void)s2; + if (!ok) printf("ui: REC OCT +%u: %u hits live, %u played back\n", o, nl, nb); + seq_stop(); + } + bad += check("REC OCT +1 / +2 / +3: the kick and RATCH x2 / x4 (x8: ECHO EVEN) in each step held; played back as heard", ok); + /* an early release in a step it was held into puts that step back */ + drum_setup(); + song.octave = 1; + song.rec = 1u << 3; + seq_start(); + nb = 0; + while (!(dt->seq_idx == 2u && dt->seq_pos < CTL)) + run_b(1, 0, 0, &nb); + key_dn(KICK_KEY); + while (!(dt->seq_idx == 3u && dt->seq_pos >= CTL)) + run_b(1, 0, 0, &nb); + key_upk(KICK_KEY); + run_b(2, 0, 0, &nb); + ok = step_ratchet(&dt->step[2]) == 2u && dt->step[2].hit == 1u << DV_KICK && !dt->step[3].hit && + step_ratchet(&dt->step[3]) == 1u && !dxo_n[3]; + seq_stop(); + bad += check(" let go early in the next step: that step back as it was (one step recorded)", ok); + /* late in a step: into the next one (the sequencer plays its later parts, the live ones stop) */ + drum_setup(); + song.octave = 1; + song.rec = 1u << 3; + seq_start(); + nb = 0; + while (!(dt->seq_idx == 6u && dt->seq_pos > step_len(6) * 3u / 4u)) + run_b(1, 0, 0, &nb); + nl = 0; + key_dn(KICK_KEY); + while (!(dt->seq_idx == 7u && dt->seq_pos + 2u * CTL > step_len(7))) + run_b(1, 0, 0, &nl); + key_upk(KICK_KEY); + run_b(4, 0, 0, &nl); + ok = dt->step[7].hit == 1u << DV_KICK && step_ratchet(&dt->step[7]) == 2u && !dt->step[6].hit && !dt->step[8].hit && + nl == 2u; + seq_stop(); + bad += check(" pressed late in a step: into the next (x2), 2 hits heard, as it plays back", ok); + return bad; +} + +static int rec_down(void) +{ + int bad = 0, ok = 1; + uint32_t d, nb, len0, len1; + int32_t pk0; + for (d = 1; d <= 3u; d++) { + drum_setup(); + song.octave = -(int32_t)d; + song.rec = 1u << 3; + seq_start(); + nb = 0; + while (!(dt->seq_idx == 6u && dt->seq_pos < CTL)) + run_b(1, 0, 0, &nb); + key_dn(KICK_KEY - 2u); /* A#: 34, the open hat's octave below (GM 46) */ + run_b(3, 0, 0, &nb); + key_upk(KICK_KEY - 2u); + key_dn(KICK_KEY); + run_b(2, 0, 0, &nb); + key_upk(KICK_KEY); + run_b(2, 0, 0, &nb); + ok &= lane(DV_KICK)->dm == d; + { + const step_t *s = &dt->step[6]; + ok &= s->hit == 1u << DV_KICK && s->n == 1u && s->note[0] == 34u && s->comp == CP_TOUCH && s->carg == d - 1u && + step_ratchet(s) == 1u; + } + song.octave = 0; + drum_kit[3][DV_KICK].dm = drum_kit[3][DV_HATO].dm = 0; + while (dt->seq_idx != 7u) /* step 7 again, the next pass: TOUCH d on its hits */ + run_b(1, 0, 0, &nb); + while (dt->seq_idx != 6u) + run_b(1, 0, 0, &nb); + ok &= lane(DV_KICK)->dm == d && lane(DV_HATO)->dm == d && dt->dtch == 0u; + seq_stop(); + } + bad += check("REC OCT -1 / -2 / -3: the hits and the step's TOUCH SHORT / GHOST / FLAM, played back with it", ok); + /* played back, the same sound: the live hit and the sequenced one, the same length */ + drum_setup(); + strike_dmp(38, 2); + len0 = hit_len(AN); + pk0 = peak(0, AN); + quiet_kit(); + dt->step[0] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_SNARE}; + dt->step[0].comp = CP_TOUCH; + dt->step[0].carg = 1; + dt->p[P_SLEN] = 64; + seq_start(); + nb = 0; + run_b(2, 0, 0, &nb); + eng_render(DV_SNARE, AN); + seq_stop(); + len1 = hit_len(AN); + ok = nb == 1u && len1 + FS / 100u > len0 && len1 < len0 + FS / 100u && lane(DV_SNARE)->dm == 2u && + peak(0, AN) * 10 > pk0 * 9 && peak(0, AN) * 10 < pk0 * 11; + bad += check(" a GHOST step plays the snare as the live OCT -2 hit (its length within 10 ms, its level 10 %)", ok); + return bad; +} + +static uint32_t mev(uint32_t st, uint32_t note, uint32_t vel) /* a MIDI event on channel 4 (track 4): its hits */ +{ + uint32_t v0 = vage; + midi_event(st, 3, note, vel); + return vage - v0; +} +static int midi(void) +{ + int bad = 0, ok = 1; + uint32_t nb, i; + static const uint8_t GM[6] = {35, 36, 42, 49, 56, 81}; + drum_setup(); + for (i = 0; i < 6u; i++) { + nb = mev(0x90, GM[i], 100); + run_b(FS / 4u / CTL, 0, 0, &nb); + ok &= nb == 1u && !dxo_n[3] && lane(drum_lane(GM[i]))->dm == 0u; + mev(0x80, GM[i], 0); + run_b(1, 0, 0, &nb); + } + bad += check("MIDI 35..81: the GM map as before, one hit, no ratchet, no TOUCH", ok); + ok = drum_oct_of(34) == -1 && drum_oct_of(23) == -1 && drum_oct_of(22) == -2 && drum_oct_of(11) == -2 && + drum_oct_of(10) == -3 && drum_oct_of(0) == -3 && drum_oct_of(82) == 1 && drum_oct_of(93) == 1 && + drum_oct_of(94) == 2 && drum_oct_of(105) == 2 && drum_oct_of(106) == 3 && drum_oct_of(127) == 3; + for (i = 35; i <= 81u; i++) + ok &= drum_oct_of(i) == 0; + ok &= drum_oct_base(84) == 36u && drum_oct_base(24) == 36u && drum_oct_base(90) == 42u && drum_oct_base(0) == 36u; + for (i = 0; i < 128u; i++) /* MIDI OUT's band note comes back as the same sound and octave */ + if (i >= 36u && i <= 47u) + ok &= drum_oct_of(drum_oct_note(i, 1)) == 1 && drum_oct_base(drum_oct_note(i, 1)) == i && + drum_oct_of(drum_oct_note(i, 3)) == 3 && drum_oct_base(drum_oct_note(i, -1)) == i && + drum_oct_of(drum_oct_note(i, -1)) == -1 && drum_oct_of(drum_oct_note(i, -2)) == -2; + bad += check("MIDI bands: ..10 -3, 11..22 -2, 23..34 -1, 35..81 the GM map, 82..93 +1, 94..105 +2, 106.. +3", ok); + ok = 1; + { + static const uint8_t UPN[3] = {84, 96, 108}, R[3] = {2, 4, 8}, DN[3] = {24, 12, 0}; + for (i = 0; i < 3u; i++) { + drum_setup(); + now_s = 0; + nb = mev(0x90, UPN[i], 100); + run_b(4u * div_samples((uint32_t)dt->p[P_SDIV]) / CTL - 1u, 0, 0, &nb); + ok &= nb == 4u * R[i] && dxo_n[3] == 1u; + mev(0x80, UPN[i], 0); + nb = 0; + run_b(div_samples((uint32_t)dt->p[P_SDIV]) * 2u / CTL, 0, 0, &nb); + ok &= nb == 0u && !dxo_n[3]; + nb += mev(0x90, DN[i], 100); + run_b(2, 0, 0, &nb); + mev(0x80, DN[i], 0); + run_b(2, 0, 0, &nb); + ok &= nb == 1u && lane(DV_KICK)->dm == i + 1u; + } + } + bad += check("MIDI 84 / 96 / 108: the kick x2 / x4 / x8 while held; 24 / 12 / 0: the kick SHORT / GHOST / FLAM", ok); + /* MIDI recording */ + drum_setup(); + song.rec = 1u << 3; + seq_start(); + nb = 0; + while (!(dt->seq_idx == 3u && dt->seq_pos < CTL)) + run_b(1, 0, 0, &nb); + mev(0x90, 90, 100); /* F#: the closed hat, +1 */ + run_b(4, 0, 0, &nb); + mev(0x80, 90, 0); + while (!(dt->seq_idx == 5u && dt->seq_pos < CTL)) + run_b(1, 0, 0, &nb); + mev(0x90, 26, 100); /* D: the snare, -1 */ + run_b(2, 0, 0, &nb); + mev(0x80, 26, 0); + run_b(2, 0, 0, &nb); + seq_stop(); + ok = dt->step[3].hit == 1u << DV_HATC && step_ratchet(&dt->step[3]) == 2u && !dt->step[4].hit && + dt->step[5].hit == 1u << DV_SNARE && dt->step[5].comp == CP_TOUCH && dt->step[5].carg == 0u; + bad += check("MIDI REC: 90 the closed hat x2, 26 the snare SHORT, each into its step", ok); + { /* FUNC round trip */ + project_t before, after; + project_store_t packed; + project_capture(&before); + ok = proj_pack(&packed, &before) && proj_import(&after, &packed, sizeof packed) && + step_ratchet(&after.t[3].step[3]) == 2u && after.t[3].step[5].comp == CP_TOUCH && after.t[3].step[5].carg == 0u && + after.t[3].step[5].hit == 1u << DV_SNARE; + bad += check(" the recorded steps (RATCH x2, TOUCH SHORT) through a project save and load", ok); + } + return bad; +} + +static int ui_part(void) +{ + int bad = 0, ok; + drum_setup(); + frame(); + press(B_OCTUP); + ok = song.octave == 1 && msg_is("RATCHET x2"); + press(B_OCTUP); + ok &= song.octave == 2 && msg_is("RATCHET x4"); + press(B_OCTDN); + press(B_OCTDN); + press(B_OCTDN); + ok &= song.octave == -1 && msg_is("SHORT"); + press(B_OCTDN); + ok &= song.octave == -2 && msg_is("GHOST"); + press(B_OCTDN); + ok &= song.octave == -3 && msg_is("FLAM"); + song.octave = 2; + press(B_OCTUP); + ok &= song.octave == 3 && msg_is("RATCHET x8"); + bad += check("OCT on a DRUM track: RATCHET x2 / x4 / x8, SHORT, GHOST, FLAM", ok); + song.octave = 0; + dt->step[2] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_KICK}; + dt->step[2].comp = CP_TOUCH; + dt->step[2].carg = 2; + go_page(GR_COMP); + cursor_set(2); + frame(); + ok = comp_view() == COMP_TOUCH; + bad += check("SEQ > COMP: a TOUCH step shows TOUCH", ok); + dt->step[3] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_KICK}; + dt->step[3].comp = CP_ECHO; + dt->step[3].carg = CP_ECHO_EVEN | 6u; + cursor_set(3); + frame(); + comp_knob(2, -1); + ok = comp_view() == COMP_ECHO && dt->step[3].carg == (CP_ECHO_EVEN | 5u); + { + uint32_t dv; + comp_knob(2, 1); + ok &= dt->step[3].carg == (CP_ECHO_EVEN | 6u) && step_parts(dt, &dt->step[3], &dv) == 8u; + } + bad += check("SEQ > COMP: a recorded x8 shows ECHO x8 EVEN; KNOB 3 keeps EVEN", ok); + return bad; +} + +int main(void) +{ + int bad = 0; + bad += centre(); + bad += up(); + bad += down(); + bad += rec_up(); + bad += rec_down(); + bad += midi(); + bad += ui_part(); + if (bad) { + printf("drumx octaves: %d FAILED\n", bad); + return 1; + } + printf("drumx octaves: all ok\n"); + return 0; +} diff --git a/tests/run_tests.sh b/tests/run_tests.sh index bbabc6df..68a175a3 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -75,6 +75,10 @@ # Browser emulator (web/emu, when emcc is there): the firmware in WebAssembly (build/emu) boots, plays keys and MIDI, # draws, lights its LEDs, keeps a save across instances, plays a song bit for bit as the same file # built with cc (web/emu/native_check.c); the cost of 1 s of a heavy song against real time. +# DRUM-X OCTAVES (tests/drumx_oct_test.c, 0.8.5): OCT 0 the kit as before (bit for bit); OCT +1 / +2 / +3 ratchets x2 / x4 / +# x8 in time while held (stopped and playing), -1 / -2 / -3 SHORT / GHOST / FLAM (length, level, tone, +# the grace hit measured); real-time REC: the step's RATCH / ECHO x8 EVEN / TOUCH, the pass after the +# very hits heard; MIDI's bands around 35..81, MIDI REC, a project round trip, the OCT message, COMP. # DRUM-X (tests/drumx_test.c): the DRUM engine (src/drumx_voice.c): every lane sounds, stays under full scale and ends, # MORPH A <-> B (also while a hit rings), PITCH, the hat choke, MRPH on the knob; demos in build/drumx_demo/. # NOISE (tests/noise_test.c): the engine (src/eng_noise.c): COLR's slope (white, pink, brown), the filter and the @@ -173,6 +177,8 @@ if [ -f build/gen/felucca_tables.h ]; then run "GEN (0.6.91): the song generator, every genre: deterministic, one scale, the kick anchored, the bass's roots, chord tones, forms, the screen" "$OUT/gen_test" $CC -O1 -w -Ibuild/gen -Ifirmware/src -o "$OUT/ratchet_test" tests/ratchet_test.c -lm run "RATCH: x1..x4 in a step (notes, chords, drum hits), gates, chance, swing, projects, user presets, CHANCE page" "$OUT/ratchet_test" + $CC -O1 -w -Ibuild/gen -Ifirmware/src -o "$OUT/drumx_oct_test" tests/drumx_oct_test.c -lm + run "DRUM-X OCTAVES (0.8.5): ratchets above the kit, SHORT GHOST FLAM below, live, recorded and played back as heard, MIDI bands" "$OUT/drumx_oct_test" $CC -O1 -w -Ibuild/gen -Ifirmware/src -o "$OUT/midi_control_test" tests/midi_control_test.c -lm run "USB/TRS clock, bend, sustain, ownership and panic recovery" "$OUT/midi_control_test" $CC -O1 -w -DFELUCCA_FM4=1 -Ibuild/gen -Ifirmware/src -o "$OUT/digital_test" tests/digital_test.c -lm diff --git a/tools/gen_cheatsheets.py b/tools/gen_cheatsheets.py index caafe0a3..82f0752e 100644 --- a/tools/gen_cheatsheets.py +++ b/tools/gen_cheatsheets.py @@ -133,7 +133,7 @@ def controls(): ('ALGORITHM', 'Selects the track from any page: T1–T4, or T1–T6 with TRACKS 6.'), ('KNOB 1–4', 'The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: ' 'the layer\'s.'), - ('OCT− · OCT+', 'The keyboard\'s octave (both together: back to 0). On action pages and dialogs: back / confirm.'), + ('OCT− · OCT+', 'The keyboard\'s octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM. On action pages and dialogs: back / confirm.'), ('PLAY', 'Start / stop. GLO + PLAY: restart from the top.'), ('REC', 'Arms live recording on the selected track (notes and knob moves, overdub).'), ('HOME', 'Tap: the ecosystem. Hold: the MENU.'), @@ -340,7 +340,7 @@ def sound(): b.append('
') b.append(card('SEQUENCER', HEAT[4], '

64 steps a track, up to 4 notes a step, piano roll and drum grid. LENTE: SELECT zooms PATTERN (the bars; PRESETS the bar) · BAR (the roll / grid) · STEP (one step large, its chips); SEQ taps round the level\'s sets and comes back to the track\'s last. Hold a step + turn a knob: ' - 'a parameter lock. Step recording: hold a chord + KNOB 1 its length; + ARP: arpeggiated (K1 rate, K2 order, K3 oct). COMP / COMP 2: two components a step (CHANCE, RATCH, ARP NOTES / SEQ / SCALE, TRIG, RAND, OCT, TONAL, BEND, ECHO, PULSE, JUMP, REV, FILL, KILL, WALK, CLIMB); a TRIG or FILL wins; WALK / CLIMB: a degree / an octave further every N loops (K4), UP DOWN UP-DN RND over a range (K3), stackable; ARP: ORDER × range, RATE in note values (x1 1/32 1/32T 1/64 1/64T 1/128); RATCH / ECHO: DIV; EVERY (KNOB 4): the loops the step\'s components play on (ALWAYS 1:2 2:2 1:3 .. 4:4 1:8 FIRST !FIRST SKIP). TRACK: PITCH, CHANCE thins the whole track, HUMAN one amount (velocity, timing, gate, decay / release), REC Q. STRETCH / REPEAT act as the knob turns; ROTATE reads the sequence from another step; NOTE\'s MICRO moves a step off the grid. REC + knobs while playing: ' + 'a parameter lock. Step recording: hold a chord + KNOB 1 its length; + ARP: arpeggiated (K1 rate, K2 order, K3 oct). COMP / COMP 2: two components a step (CHANCE, RATCH, ARP NOTES / SEQ / SCALE, TRIG, RAND, OCT, TONAL, BEND, ECHO, PULSE, JUMP, REV, FILL, KILL, WALK, CLIMB, TOUCH: a kit\'s SHORT / GHOST / FLAM); a TRIG or FILL wins; WALK / CLIMB: a degree / an octave further every N loops (K4), UP DOWN UP-DN RND over a range (K3), stackable; ARP: ORDER × range, RATE in note values (x1 1/32 1/32T 1/64 1/64T 1/128); RATCH / ECHO: DIV; EVERY (KNOB 4): the loops the step\'s components play on (ALWAYS 1:2 2:2 1:3 .. 4:4 1:8 FIRST !FIRST SKIP). TRACK: PITCH, CHANCE thins the whole track, HUMAN one amount (velocity, timing, gate, decay / release), REC Q. STRETCH / REPEAT act as the knob turns; ROTATE reads the sequence from another step; NOTE\'s MICRO moves a step off the grid. REC + knobs while playing: ' 'automation (64 records a section, MOTION page plays / clears them, AUTO LIST edits them).

' '

PATTERN · TRACK

' + knobs('LEN', 'DIV', 'SWG', 'GATE') + knobs('PIT', 'CHN', 'HUM', 'RECQ'))) b.append(card('SCALE · ARP', HEAT[0], diff --git a/web/index_pkg.html b/web/index_pkg.html index 51198d43..a7762a5f 100644 --- a/web/index_pkg.html +++ b/web/index_pkg.html @@ -46,6 +46,19 @@


+ +

@@ -114,6 +127,11 @@ const TEXT = { badpkg: "インストールするファイルが壊れています。ページを再読み込みしてください。", leave: "書き込み中です。ページを閉じないでください。", license: "GPL-3.0、無保証。ソース:", + n085Title: "0.8.5 をインストールする前に(プレビュー版)", + n085What: "0.8.5 の新機能 DRUM-X のオクターブ: 中央のオクターブ (OCT 0) ではキットはこれまでどおり鳴ります。上のオクターブでは同じ音がテンポに合わせたラチェットに(+1 x2、+2 x4、+3 x8)、下では別のタッチに: −1 SHORT(ディケイ半分)、−2 GHOST(短く、弱く、暗く: ゴーストノート)、−3 FLAM(約 20 ms 前に弱い装飾音)。", + n085Risk: "既存の曲の鳴り方が変わることがあります: DRUM トラックに GM マップ (35–81) の外の MIDI ノート(例えば 24 や 84 以上)を送る設定では、これまでそのオクターブとして鳴っていた音が、これらのバリエーションで鳴ります。OCT を動かした鍵盤は音が変わる代わりにラチェット / SHORT / GHOST / FLAM になります。ステップに保存されたノートはこれまでどおり鳴ります。", + n085Keep: "以前の音を保つには、それらのノートを DAW やシーケンサーで中央のオクターブ (36–47、または GM マップ 35–81) に移してください。インストールの前に、エディターのバックアップ(または下の「公式 V15 に戻す」)でプロジェクトの完全バックアップを保存してください。", + n085Confirm: "0.8.5 では DRUM-X のオクターブが加わり、中央以外のオクターブのドラムノートはラチェット / SHORT / GHOST / FLAM で鳴ります(既存の曲が変わることがあります)。プロジェクトのバックアップは保存しましたか? OK でインストールします。", }, en: { intro: "Connect the FM-1 by USB. (Works in Chrome or Edge.)", @@ -155,6 +173,11 @@ const TEXT = { badpkg: "The file to install is damaged. Reload the page.", leave: "Writing. Do not close the page.", license: "GPL-3.0, no warranty. Source:", + n085Title: "Before you install 0.8.5 (preview)", + n085What: "New in 0.8.5, DRUM-X octaves: in the centre octave (OCT 0) the kit plays as it always did. In the octaves above, the same sounds ratchet in time (+1 x2, +2 x4, +3 x8); below, they play with another touch: −1 SHORT (half the decay), −2 GHOST (short, softer, darker: ghost notes), −3 FLAM (a soft grace hit ~20 ms before the hit).", + n085Risk: "Existing songs may sound different: MIDI notes outside the GM map (35–81) sent to a DRUM track, which played as their octave until now (for example 24, or 84 and up), now trigger those variations; keys with OCT moved no longer change the sound, they ratchet / play SHORT / GHOST / FLAM. Notes stored in the steps play as before.", + n085Keep: "To keep the old sound, move those notes to the centre octave (36–47, or the GM map 35–81) in your DAW or sequencer. Before installing, save a complete backup of your projects with the editor (Backup) or with Return to official V15 below.", + n085Confirm: "0.8.5 adds the DRUM-X octaves: drum notes outside the centre octave now play as ratchets / SHORT / GHOST / FLAM (existing songs may change). Have you saved a backup of your projects? OK installs it.", }, }; let lang = (navigator.language || "en").toLowerCase().startsWith("ja") ? "ja" : "en"; @@ -202,9 +225,17 @@ async function loadVersion(i) { $("go").disabled = writing; } catch (e) { if (epoch === loadEpoch) sayK("loadfail", e.message); } } +/* (0.8.5) a release's notice before it is written: 0.8.5 (the DRUM-X octaves change how some drum notes sound), on the + * preview installer only (its version ends -preview, make_site.py; the public one, web/STABLE's, never shows it) */ +function releaseNotice(version, site) { + return /-preview$/.test(String(site)) && /^v?0\.8\.5(?![0-9])/.test(String(version)) ? "n085" : ""; +} +const noticeOf = () => releaseNotice((versions[+$("ver").value] || versions[0]).version, meta.version); +const showNotice = () => { $("notice").hidden = !noticeOf(); }; fillVersions(); +showNotice(); $("lang").addEventListener("click", fillVersions); -$("ver").addEventListener("change", () => { if (!writing) loadVersion(+$("ver").value); }); +$("ver").addEventListener("change", () => { showNotice(); if (!writing) loadVersion(+$("ver").value); }); (async () => { if (!navigator.requestMIDIAccess) { sayK("nomidi"); return; } await loadVersion(0); @@ -245,6 +276,8 @@ $("first-stock").addEventListener("click", () => { $("stock").open = true; $("st $("go").addEventListener("click", async () => { if (writing) return; + const nk = noticeOf(); + if (nk && !confirm(t(nk + "Confirm"))) { $("notice").scrollIntoView({ behavior: "smooth" }); return; } lockInstaller(true); let midi; try { midi = await navigator.requestMIDIAccess({ sysex: true }); } diff --git a/web/test_web.mjs b/web/test_web.mjs index 2f6ccfbe..18bdc4f6 100644 --- a/web/test_web.mjs +++ b/web/test_web.mjs @@ -38,6 +38,16 @@ function installerCheck() { ok(isJiantInfo(info("FELUCCA v0.6.40", 6, [0x56, 1, 32])), "installer: an older JIANT (six tracks, v0.x) too"); ok(!isJiantInfo(info("FELUCCA 1.5.1", 4, [0x56, 1, 32])), "installer: Felucca 1.x (four tracks) is not"); ok(!isJiantInfo(info("BAUDGIRL 2.0", 4, [])), "installer: another firmware is not"); + /* (0.8.5) the release notice: before 0.8.5 is written, on the preview installer only, in every language it has */ + const ns = html.slice(html.indexOf("function releaseNotice"), html.indexOf("const noticeOf")); + const releaseNotice = vm.runInNewContext(`(${ns.trim()})`); + ok(releaseNotice("v0.8.5-abc1234-preview", "v0.8.5-abc1234-preview") === "n085", "installer: 0.8.5 on the preview: the notice"); + ok(releaseNotice("v0.8.5-abc1234", "v0.7.4-0123abc") === "", "installer: the public installer: never"); + ok(releaseNotice("v0.8.4-abc1234-preview", "v0.8.4-abc1234-preview") === "" && + releaseNotice("v0.8.50-abc-preview", "v0.8.50-abc-preview") === "", "installer: another version: none"); + for (const k of ["n085Title", "n085What", "n085Risk", "n085Keep", "n085Confirm"]) + ok((html.match(new RegExp(`\\b${k}: "`, "g")) || []).length === 2, `installer: ${k} in English and Japanese`); + ok(/
]*>[\s\S]*Aviso antes de instalar 0\.8\.5[\s\S]*backup completo/.test(html), "installer: the notice in Spanish"); } /* ------------------------------------------------------------ editor protocol --- */ From c3435e48ebe57d8d6b0dcc8eb9d016042bfab1b1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 17 Oct 2026 02:01:15 +0000 Subject: [PATCH 2/2] 0.8.5: DRUM-X octaves per sound: each lane's own x2 / x4 / x8 / SHORT / GHOST / FLAM on a step The octave variations are now per drum sound, not per step (the owner's option b). step_t gets lm[3]: 3 bits for each of the 8 lanes (core.h LM_*: none, x2, x4, x8, SHORT, GHOST, FLAM). No zero-RAM room existed: on a DRUM track note[] / n hold the step's other GM drums (a low tom, a crash, any note recorded below / above the lanes), every other byte is in use, and the few free bits (slide, LEN on a kit) are 4 or fewer. Playback (seq.c): a lane's SHORT / GHOST / FLAM goes on that lane's note-ons only (t->dtch per note, the HUMAN TIME queue too); a lane's x2 / x4 / x8 retriggers that lane's hit and its notes at every step / n (seq_lane_rat, the grid the held keys' live ratchets already use), nothing else on the step. The step's own RATCH / ECHO (EVEN) / TOUCH work on the whole step exactly as before (synth tracks, old projects, a kit). Live REC (rec_drum, the held ratchets' steps, the count-in) writes the lane's mode, the rest of the step untouched; a centre-octave hit sets its lane back to none. Tested: kick plain + closed hat x4 + snare GHOST on one step (1 + 4 + 1 a pass, the kick never damped); recorded live (kick OCT 0, hat OCT +2, snare OCT -2 into one step) and played back so; every earlier REC test now on lane modes; the step's RATCH x2 unchanged. Edit: the DRUM grid's KNOB 3 HIT of the selected lane is one list: --, ON, x2, x4, x8, SHORT, GHOST, FLAM (left back to -- takes the hit and its mode away; the white keys' off clears it too). ui.c GRID_HIT / grid_hit_of / grid_hit_set, one card string in ui_draw.c, one knob call in ui_input.c. Format: FUNC unchanged for every step without modes (a 0.8.4 project loads and saves byte for byte); a step with them sets bit 6 of its extension byte and adds 3 bytes (a 7 reads as none). Firmware before 0.8.5 refuses such a project (it rejects that bit), so it fails as with any newer project. Older formats load with no modes (tested with FUNB). User presets' patterns have no room for them. Protocol: INFO 4F 01 07; STEP_SET 22 / TRACK_STEP 23 bytes carry the 8 lane modes after the ratchet (each 0..6, a 7 refused); STEP_GET with a flag byte 1 (TRACK_STEP get with 1) replies them; every older request replies byte for byte as before (editor_test's INFO offsets moved by the new tag). web/editor.html reads them when the device has the tag and writes a step back whole; the mock device does the same (web/test_web.mjs). EDITOR_PROTOCOL.md updated. FELUCCA_VERSION is now "v0.8.5" (cheat sheets' version too), so the installer notice shows. The notice now shows for 0.8.5 in both installers (preview and the official one once web/STABLE is bumped; web/STABLE untouched), never on the landing page (tested); its text says each sound keeps its own variation. RAM (on a05a190): step_t 17 -> 20 B. .data+.bss 85600 -> 87456 B (+1856: the tracks' 384 steps and 24 working copies +1224, the dice / shape / GEN copies dk, shp_base, gen_keep +576, dxo_bak +18, lr_on); the project scratch (project_t, 384 steps) moved LOWBUF -> pool (main loop only, as before 0.6.78): LOWBUF 28064 -> 19780 B (the section stage's +1152 stays there), pool 247584 -> 258364 B (spare 62144 B; tl_src +192); the stack +192 in one tool. Flash image 498260 -> 499320 B, RAM code 21768 -> 21964 B. With voice-words merged: about 88.2 KB of 96 KB .data+.bss. CPU: callgrind song/cputest 3082 -> 3081, eng/DRUM 1581 -> 1582, every entry within 0.1 %; target loops unchanged. All host tests pass; the 149 golden renders unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh --- README.md | 44 +++++---- docs/MANUAL.es.md | 43 +++++---- docs/MANUAL.md | 41 ++++---- docs/cheatsheet/controls.html | 6 +- docs/cheatsheet/sound.html | 4 +- firmware/src/core.h | 20 ++++ firmware/src/editor.c | 33 +++++-- firmware/src/felucca.c | 2 +- firmware/src/project.c | 23 ++++- firmware/src/seq.c | 104 +++++++++++++------- firmware/src/ui.c | 18 ++++ firmware/src/ui_draw.c | 2 +- firmware/src/ui_input.c | 6 +- tests/drumx_oct_test.c | 175 ++++++++++++++++++++++++++++++---- tests/editor_test.c | 51 +++++++--- tools/gen_cheatsheets.py | 4 +- web/EDITOR_PROTOCOL.md | 27 +++++- web/editor.html | 29 ++++-- web/index_pkg.html | 24 ++--- web/test_web.mjs | 38 +++++++- 20 files changed, 517 insertions(+), 177 deletions(-) diff --git a/README.md b/README.md index 7d522c53..9b7a4432 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ editor update themselves with every change merged into `main`. > **Status: in development (v0.8.5).** It builds and passes every test (Felucca's and its own), Back up the flash before installing it. **DRUM-X octaves** (0.8.5): the kit stays on its keys at every OCT; above the centre it ratchets in time (x2, x4, x8), - below it plays SHORT, GHOST or FLAM, and live recording keeps exactly what you played. MIDI drum notes outside 35–81 - now trigger these variations: see the changelog before installing. + below it plays SHORT, GHOST or FLAM, each sound its own on each step, and live recording keeps exactly what you + played. MIDI drum notes outside 35–81 now trigger these variations: see the changelog before installing. > ⚡ **New in 0.6.85 – 0.6.92: a song generator you steer, a compact sequencer that breathes, a delay that feeds back.** > - **GEN (HOME + SELECT)**: a screen of three pages — GENRE (43 genres or RANDOM), SEED, ENERGY, FORM (loop, parts, @@ -548,28 +548,36 @@ Every update is listed here, newest first. (Since 0.6.80 at the end of the page: RATCH grid, swing included, stopped every step/n from the press); **−1 SHORT** (half the decay), **−2 GHOST** (short, ~45 % of the level, darker: a ghost note), **−3 FLAM** (a soft grace hit, the hit ~20 ms later whatever the tempo). OCT 0 is the kit as it was, bit for bit (every golden render unchanged). -- **Recorded as played** ("y que se graben así en record en la secuencia"): live REC writes the hit and the step's own - components, so the pass after sounds as you heard it (tested to the block): **RATCH x2 / x4**, **ECHO x8 EVEN** for - x8 (RATCH stops at x4; ECHO's new **EVEN** keeps every repeat at one level), and the new component **TOUCH** (SHORT / - GHOST / FLAM) below. A ratchet held over several steps writes each of them (an early release in the last one puts - it back, as a held note's TIE). They show and edit on SEQ > COMP like any step. They are the step's: a kick already - on the step ratchets along; a centre-octave hit leaves a step's RATCH / TOUCH alone. +- **Per sound** (the owner chose it): every step holds a **mode for each of the 8 sounds** (none, x2, x4, x8, SHORT, + GHOST, FLAM), on that sound's hit and its notes only. A hi-hat roll recorded onto a step with a kick ratchets the + hi-hat alone; a ghost snare leaves the kick as it is. On the DRUM grid (SEQ > STEP) **KNOB 3 HIT** of the selected + sound goes --, ON, x2, x4, x8, SHORT, GHOST, FLAM. The step's own RATCH / ECHO / TOUCH (SEQ > COMP; ECHO's new + **EVEN** keeps its repeats at one level, TOUCH a whole step's SHORT / GHOST / FLAM) work on the whole step as before. +- **Recorded as played** ("y que se graben así en record en la secuencia"): live REC writes the hit and its sound's mode, + so the pass after sounds as you heard it (tested to the block); a ratchet held over several steps writes each of them + (an early release in the last one puts it back, as a held note's TIE). The last hit recorded on a sound sets it. - **MIDI**: 35–81 play the GM drum map exactly as before. The notes around it, which played their octave of 36–47 plain, are now the octaves' bands by pitch class: 23–34 SHORT, 11–22 GHOST, 0–10 FLAM, 82–93 x2, 94–105 x4, 106–127 x8 (MIDI OUT sends the keys' notes the same way). **A song or setup that sent drum notes below 35 or above 81 sounds different now**: move them into 35–81 to keep the old sound. Notes stored in steps play as before, whatever their number; the keys with OCT moved no longer reach GM 56–81 (MIDI still does). -- **Projects**: no new format. TOUCH is a component (the comp byte), EVEN bit 7 of ECHO's argument. Firmware before 0.8.5 - refuses a project holding a TOUCH (as it would any component it does not know: back up first) and plays an ECHO - EVEN as an ordinary, fading ECHO. -- **Cost**: CPU callgrind every entry within 0.3 % of 0.8.4 (song/cputest 3079 → 3082, eng/DRUM 1579 → 1581: a table - look-up a hit, a byte test a block when nothing is held); target loops unchanged (drum_render 33, dx_run 419). Flash - image 498108 → 498260 B; .data+.bss 84848 → 85600 B (the held ratchets, 4 a track, and their recording; three bytes a - lane); RAM code 21676 → 21768 B; LOWBUF and the pool unchanged (28064 B, 247584 B). +- **Projects**: the same FUNC format; a step with lane modes sets bit 6 of its extension byte and adds 3 bytes (3 bits + a sound). Every 0.8.4 project loads unchanged (no modes) and saves byte for byte as before until a mode is set. + Firmware before 0.8.5 refuses a project holding a lane mode or a TOUCH (back up first) and plays an ECHO EVEN as an + ordinary, fading ECHO. User presets' patterns have no room for the modes. The editor protocol: INFO `4F 01 07`, 8 + mode bytes after a step's ratchet (written with them, read with STEP_GET's flag 1); every older reply unchanged. +- **Cost**: CPU callgrind every entry within 0.3 % of 0.8.4 (song/cputest 3079 → 3081, eng/DRUM 1579 → 1582: a table + look-up a hit, a byte test a block when nothing is held or ratchets); target loops unchanged (drum_render 33, dx_run + 419). A step is 3 bytes longer (17 → 20 B, every copy): .data+.bss 84848 → 87456 B (the tracks' 408 steps +1224, the + dice / shape / GEN copies +576, the held ratchets and three bytes a lane); the project scratch moved LOWBUF → pool + (LOWBUF 28064 → 19780 B, the section stage +1152 in it; pool 247584 → 258364 B, spare 62144); flash image 498108 → + 499320 B; RAM code 21676 → 21964 B. - Tests: tests/drumx_oct_test.c (centre bit for bit, the ratchets stopped and playing on the grid, SHORT / GHOST / FLAM - measured, live REC played back as heard both ways, MIDI bands and MIDI REC, a project round trip, the OCT message, COMP); - web/test_web.mjs: the installer's 0.8.5 notice. The preview installer shows a notice (EN / JA / ES) before writing - 0.8.5 and asks to confirm a backup; the public one (web/STABLE) does not. + measured, live REC played back as heard both ways, per sound: kick plain + hat x4 + snare GHOST on one step, recorded + and played back; the grid's HIT list; MIDI bands and MIDI REC; FUNC round trip, a 0.8.4-style step packed as before, + an older FUNB project with none; the OCT message, COMP); editor_test and web/test_web.mjs: the lane modes over the + protocol and the installer's notice. The installer (preview and official) shows a notice (EN / JA / ES) whenever + 0.8.5 is the version picked and asks to confirm a backup; the landing page does not. FELUCCA_VERSION is v0.8.5. ### v0.8.4 - **RAM freed for what comes next** (the owner: room for assignable FX buses). The sound is the same (every golden diff --git a/docs/MANUAL.es.md b/docs/MANUAL.es.md index 3248aa0e..b77a3769 100644 --- a/docs/MANUAL.es.md +++ b/docs/MANUAL.es.md @@ -571,25 +571,28 @@ DRUM-X es un kit sintetizado de ocho sonidos, **BD SD CP CH OH TM RS CB**, gener Las teclas tocan el kit en las mismas teclas en **cualquier OCT** (C el bombo, D la caja, F# el hi-hat cerrado …); OCT ahora cambia **cómo** suenan, no qué sonido. La pantalla lo dice cuando apretás OCT en una pista DRUM: -| OCT | Qué hace una tecla | Se graba (REC) como | +| OCT | Qué hace una tecla | Se graba (REC) como el golpe y el modo de su sonido | |---|---|---| -| **+3** | **RATCHET x8**: el golpe ocho veces por paso mientras la mantenés | el golpe + el **ECHO x8 EVEN** del paso (todas al mismo nivel) | -| **+2** | **RATCHET x4** | el golpe + el **RATCH x4** del paso | -| **+1** | **RATCHET x2** | el golpe + el **RATCH x2** del paso | -| **0** | el kit como siempre | el golpe | -| **−1** | **SHORT**: la mitad del decay | el golpe + el **TOUCH SHORT** del paso | -| **−2** | **GHOST**: corto, más suave (~45 %), más oscuro: una nota fantasma | el golpe + **TOUCH GHOST** | -| **−3** | **FLAM**: un golpe de adorno suave y el golpe ~20 ms después (sea cual sea el tempo) | el golpe + **TOUCH FLAM** | +| **+3** | **RATCHET x8**: el golpe ocho veces por paso mientras la mantenés | **x8** | +| **+2** | **RATCHET x4** | **x4** | +| **+1** | **RATCHET x2** | **x2** | +| **0** | el kit como siempre | ninguno (**ON**) | +| **−1** | **SHORT**: la mitad del decay | **SHORT** | +| **−2** | **GHOST**: corto, más suave (~45 %), más oscuro: una nota fantasma | **GHOST** | +| **−3** | **FLAM**: un golpe de adorno suave y el golpe ~20 ms después (sea cual sea el tempo) | **FLAM** | - Los ratchets van **a tempo**: con PLAY caen en la grilla del RATCH del paso (el comienzo de cada paso y cada paso/n, con swing); parado, cada paso/n del DIV de la pista desde que tocás. Al soltar se detienen. -- **La grabación en vivo guarda lo que tocaste**: el paso donde cae el golpe recibe el golpe y el RATCH (o ECHO x8 EVEN, o - TOUCH); si mantenés un ratchet varios pasos, cada paso en el que sigue apretado también se escribe (y lo toca el - secuenciador, así la vuelta siguiente suena exactamente como lo escuchaste). Si soltás antes de la mitad del último, - ese paso vuelve a como estaba, igual que con una nota sostenida de un sinte. Se ven y se editan como cualquier paso: - SEQ > COMP muestra RATCH / ECHO / **TOUCH** (KNOB 3: SHORT, GHOST, FLAM); la página CHANCE el RATCH. -- RATCH, ECHO y TOUCH son **del paso**: todo lo que hay en ese paso suena con ellos. Grabar un ratchet en un paso que ya - tiene un bombo hace ratchet también del bombo; un golpe de la octava central deja el RATCH / TOUCH del paso como está. +- **Cada sonido tiene su propio modo en cada paso** (0.8.5): un redoble de hi-hat grabado sobre un paso con bombo hace + ratchet solo del hi-hat, una caja fantasma deja el bombo como está. El modo vale para el golpe de ese sonido y para + sus notas en el paso (un tom grave en TM); el último golpe que grabás en un sonido lo define. +- **La grabación en vivo guarda lo que tocaste**: el paso donde cae el golpe recibe el golpe y el modo de su sonido; si + mantenés un ratchet varios pasos, cada paso en el que sigue apretado también se escribe (y lo toca el secuenciador, + así la vuelta siguiente suena exactamente como lo escuchaste). Si soltás antes de la mitad del último, ese paso + vuelve a como estaba, igual que con una nota sostenida de un sinte. +- **Verlo y editarlo** en SEQ > STEP (la grilla DRUM): KNOB 2 elige el sonido, **KNOB 3 HIT** recorre **--, ON, x2, x4, + x8, SHORT, GHOST, FLAM** para él en el paso del cursor (volver a -- saca el golpe y su modo). El RATCH, ECHO y TOUCH + propios del paso (SEQ > COMP) siguen valiendo para todo el paso, como antes. - **MIDI** (0.8.5): las notas 35–81 siguen tocando el mapa GM de batería exactamente como antes. Las notas alrededor, que antes sonaban como su octava de 36–47 sin más, ahora son estas octavas, por clase de altura: **23–34 SHORT, 11–22 GHOST, 0–10 FLAM, 82–93 x2, 94–105 x4, 106–127 x8** (84 el bombo x2, 24 el bombo SHORT, 90 el hi-hat cerrado x2). Las @@ -699,11 +702,11 @@ seleccionada se graban como **automatización**. MENU > AUDIO tiene el **CLICK** FIRST solo la primera vez (una intro), !FIRST todas menos la primera (0.6.92; antes era TIMES). - **FILL**: el paso suena solo mientras mantenés **FX**. - **KILL**: el paso primero corta todo lo que suena en la pista (releases largos, notas sostenidas) y después toca. - - **TOUCH** (0.8.5, una pista DRUM): cómo se golpean sus sonidos, KNOB 3 **SHORT** (la mitad del decay), **GHOST** - (corto, más suave, más oscuro), **FLAM** (un golpe de adorno suave ~20 ms antes). Lo que graban OCT −1 / −2 / −3 - (ver [5](#5-drum-x)). En otros motores no hace nada. - - **EVEN** del ECHO (0.8.5): un ECHO grabado desde OCT +3 en un kit mantiene cada repetición al nivel del paso (un - ratchet más allá del x4 de RATCH); la tarjeta muestra "x8 EVEN", KNOB 3 lo conserva. + - **TOUCH** (0.8.5, una pista DRUM): cómo se golpean todos sus sonidos, KNOB 3 **SHORT** (la mitad del decay), + **GHOST** (corto, más suave, más oscuro), **FLAM** (un golpe de adorno suave ~20 ms antes); un solo sonido: su modo + en la grilla (ver [5](#5-drum-x)). En otros motores no hace nada. + - **EVEN** del ECHO (0.8.5): un ECHO que mantiene cada repetición al nivel del paso (un ratchet más allá del x4 de + RATCH, puesto desde el editor o una versión de desarrollo de 0.8.5); la tarjeta muestra "x8 EVEN", KNOB 3 lo conserva. - **WALK** y **CLIMB** (0.6.98, a la manera de los componentes evolutivos del OP-Z y el OP-XY): las notas del paso se mueven un grado de la escala (WALK) o una octava (CLIMB) **cada tantas vueltas** del patrón (KNOB 4: 1 … 10, 12, 16 vueltas por movimiento), dentro de un **rango** (WALK 3, 5, 7 o 12 grados; CLIMB 1 … 4 octavas), y vuelven a diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 0b892bcb..afd9c272 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -548,25 +548,28 @@ DRUM-X is a synthesized kit of eight sounds, **BD SD CP CH OH TM RS CB**, genera The keys play the kit on the same keys at **every OCT** (C the kick, D the snare, F# the closed hat …); OCT now changes **how** they play, not which sound. The screen says it when you press OCT on a DRUM track: -| OCT | What a key does | Recorded (REC) as | +| OCT | What a key does | Recorded (REC) as the hit and its sound's mode | |---|---|---| -| **+3** | **RATCHET x8**: the hit eight times a step while held | the hit + the step's **ECHO x8 EVEN** (all at one level) | -| **+2** | **RATCHET x4** | the hit + the step's **RATCH x4** | -| **+1** | **RATCHET x2** | the hit + the step's **RATCH x2** | -| **0** | the kit as it always was | the hit | -| **−1** | **SHORT**: half the decay | the hit + the step's **TOUCH SHORT** | -| **−2** | **GHOST**: short, softer (~45 %), darker: a ghost note | the hit + **TOUCH GHOST** | -| **−3** | **FLAM**: a soft grace hit, then the hit ~20 ms later (whatever the tempo) | the hit + **TOUCH FLAM** | +| **+3** | **RATCHET x8**: the hit eight times a step while held | **x8** | +| **+2** | **RATCHET x4** | **x4** | +| **+1** | **RATCHET x2** | **x2** | +| **0** | the kit as it always was | none (**ON**) | +| **−1** | **SHORT**: half the decay | **SHORT** | +| **−2** | **GHOST**: short, softer (~45 %), darker: a ghost note | **GHOST** | +| **−3** | **FLAM**: a soft grace hit, then the hit ~20 ms later (whatever the tempo) | **FLAM** | - The ratchets are **in time**: playing, the hits fall on the step's RATCH grid (each step's start, then every step/n, swing included); stopped, every step/n of the track's DIV from the press. Letting go stops them. -- **Live recording keeps what you played**: the step you hit gets the hit and the RATCH (or ECHO x8 EVEN, or TOUCH); - hold a ratchet over several steps and every step it is held into is written too (and plays from the sequencer, so - the next pass sounds exactly as you heard it). Let go before the middle of the last one and that step is put back, - as with a held synth note. They show and edit like any step: SEQ > COMP shows RATCH / ECHO / **TOUCH** (KNOB 3: - SHORT, GHOST, FLAM); the CHANCE page the RATCH. -- RATCH, ECHO and TOUCH are **the step's**: everything on that step plays with them. Recording a ratchet onto a step that - already has a kick ratchets the kick too; a hit of the centre octave leaves a step's RATCH / TOUCH as they are. +- **Each sound has its own mode on each step** (0.8.5): a hi-hat roll recorded onto a step that has a kick ratchets + the hi-hat only, a ghost snare leaves the kick as it is. The mode applies to that sound's hit and to its notes on the + step (a low tom on TM); the last hit you record on a sound sets it. +- **Live recording keeps what you played**: the step you hit gets the hit and its sound's mode; hold a ratchet over + several steps and every step it is held into is written too (and plays from the sequencer, so the next pass sounds + exactly as you heard it). Let go before the middle of the last one and that step is put back, as with a held synth + note. +- **See and edit it** on SEQ > STEP (the DRUM grid): KNOB 2 picks the sound, **KNOB 3 HIT** goes **--, ON, x2, x4, x8, + SHORT, GHOST, FLAM** for it on the cursor step (left back to -- takes the hit and its mode away). The step's own + RATCH, ECHO and TOUCH (SEQ > COMP) still work on the whole step, as before. - **MIDI** (0.8.5): notes 35–81 still play the GM drum map exactly as before. The notes around it, which used to play their octave of 36–47 plain, are now these octaves, by pitch class: **23–34 SHORT, 11–22 GHOST, 0–10 FLAM, 82–93 x2, 94–105 x4, 106–127 x8** (84 the kick x2, 24 the kick SHORT, 90 the closed hat x2). The keys send those notes to @@ -671,11 +674,11 @@ recorded into the pattern, quantized to its steps, overdubbing. Knob moves on th the first time (an intro), !FIRST every loop but the first (0.6.92; it was TIMES). - **FILL**: the step plays only while **FX** is held. - **KILL**: the step first cuts everything the track is sounding (long releases, held notes), then plays. - - **TOUCH** (0.8.5, a DRUM track): how its hits are struck, KNOB 3 **SHORT** (half the decay), **GHOST** (short, - softer, darker), **FLAM** (a soft grace hit ~20 ms before). What OCT −1 / −2 / −3 record (see + - **TOUCH** (0.8.5, a DRUM track): how all its hits are struck, KNOB 3 **SHORT** (half the decay), **GHOST** (short, + softer, darker), **FLAM** (a soft grace hit ~20 ms before); one sound alone: its mode on the grid (see [5](#5-drum-x)). On other engines it does nothing. - - ECHO's **EVEN** (0.8.5): an ECHO recorded from OCT +3 on a kit keeps every repeat at the step's level (a ratchet - past RATCH's x4); the card shows "x8 EVEN", KNOB 3 keeps it. + - ECHO's **EVEN** (0.8.5): an ECHO that keeps every repeat at the step's level (a ratchet past RATCH's x4, set from + the editor or a 0.8.5 development build); the card shows "x8 EVEN", KNOB 3 keeps it. - **WALK** and **CLIMB** (0.6.98, after the OP-Z's and OP-XY's evolving components): the step's notes move one degree of the scale (WALK) or one octave (CLIMB) **every so many loops** of the pattern (KNOB 4: 1 … 10, 12, 16 loops a move), over a **range** (WALK 3, 5, 7 or 12 degrees; CLIMB 1 … 4 octaves), then round again. KNOB 3 the diff --git a/docs/cheatsheet/controls.html b/docs/cheatsheet/controls.html index dd3e9982..d3263cd3 100644 --- a/docs/cheatsheet/controls.html +++ b/docs/cheatsheet/controls.html @@ -51,9 +51,9 @@ ul { padding-left: 18px; } li { margin: 2px 0; }
JIANT FM signature

JIANT FM · CONTROLS

every button, knob, layer, combo and page

-
firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
+
firmware v0.8.5 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
-
THE PANEL

KNOBS AND TRANSPORT

MASTERMaster volume.
SELECTScrolls the section's pages (SEQ: zooms PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its dice (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.
PRESETSBrowses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. Hold a page button + PRESETS: jump through its pages.
ALGORITHMSelects the track from any page: T1–T4, or T1–T6 with TRACKS 6.
KNOB 1–4The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.
OCT− · OCT+The keyboard's octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM. On action pages and dialogs: back / confirm.
PLAYStart / stop. GLO + PLAY: restart from the top.
RECArms live recording on the selected track (notes and knob moves, overdub).
HOMETap: the ecosystem. Hold: the MENU.
KEYS27 keys play the selected track in its scale; with a layer held they become that layer's.

PAGE BUTTONS

BUTTONTAP: ITS PAGES, ONE PER TAPHOLD
ENVENV · ENV DEST—
LFOLFO · LFO DEST · MOD · MSEQ · MSEQ 2MACROS M1–M4 (stay latched)
FXFX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)PUNCH-IN FX
SCLSCL · CHORDROOT by key
EDITEDIT 1 · EDIT 2 · FILTER · VOICE (FM6: OPERATOR · OP ENV · OPERATOR 2; DRUM: KIT · KIT 2 · KIT 3 · X-MOD · FILTER · SOUND 1–4 · LEVELS 1–2 · STEREO)INIT · RECALL · sound mutes
GLOMIXER · GLOBAL · SYSTEMMUTE · SOLO · LEVEL · TAP
SAVEPRESETS · USER · PROJECT · ARRANGE · TOOLSSONG layer
ARPARP · ARP 2—
SEQthe zoom level's sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2SEQ TOOLS
REC(transport)CLEAR · CLICK

BUTTON + PRESETS jumps through its pages (no wrap). SELECT alone scrolls the section's pages.

LAYERS · HOLD A BUTTON

FX · PUNCH-IN EFFECTS

F3REP 1/8
G3REP 1/16
A3REP 1/32
B3LPF
C4HPF
D4OCT−
E4OCT+
F4½ TEMPO
G4DEC−
A4DEC+
B4STUT 1/8
C5STUT 1/16
D5ATK+
E5ARP
F5RAND
G5ERASE
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#
A#TGT
C#
D#
F#

A key plays its effect while held (MENU FX LATCH ON: toggles); hold FX and let go untouched: LOCKED open, FX again unlocks; OCT- all off. In on the next 1/16. Black 1–6 mute T1–T6, A#4 picks which tracks the MIDI ones touch (all · synths · drums). With REC armed and playing they record into the section's lane; G5 erases it.

KNOBS

FILTERCRUSHTHROWDEPTH

GLO · MIX

F3SOLO 1
G3SOLO 2
A3SOLO 3
B3SOLO 4
C4SOLO 5
D4SOLO 6
E4ALL
F4TAP
G4UNDO
A4
B4
C5
D5
E5
F5
G5
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#KICK
A#SNR
C#HAT
D#PERC
F#

Black 1–6 mute T1–T6 (latched), 7–10 the DRUM-X groups. White: solo while held, E4 unmutes all, F4 tap tempo, G4 UNDO the last big change (again: redo), A4 FREEZE MUTATE. SELECT: the tempo. PLAY: restart.

KNOBS

LEVEL T1LEVEL T2LEVEL T3LEVEL T4

T5 or T6 selected: the knobs are T3–T6.

SAVE · SONG

F3PLAY A
G3PLAY B
A3PLAY C
B3PLAY D
C4STORE A
D4STORE B
E4STORE C
F4STORE D
G4
A4
B4
C5
D5LOOP/ SONG
E5SONG REC
F5
G5SONG
F#
G#
A#
C#
D#
F#
G#
A#
C#
D#
F#

PLAY A–D on the next bar (several in one hold: a quick chain), STORE the section into A–D. OCT+ stores the playing section, OCT− recalls it. On the SONG page KNOB 4 stores a scene.

KNOBS

SONG 1–8---

EDIT · SOUND

F3INIT
G3RECALL
A3
B3
C4
D4
E4
F4
G4
A4
B4
C5
D5
E5
F5
G5
F#BD
G#SD
A#CP
C#CH
D#OH
F#TM
G#RS
A#CB
C#
D#
F#

INIT: the factory sound (DRUM: the kit too). RECALL: the sound stored in the section. On a DRUM track black 1–8 mute each DRUM-X sound.

KNOBS

EDIT 1EDIT 2EDIT 3EDIT 4

LFO · MACROS

Knobs M1–M4; they stay latched when let go (LFO again: off). F3 rolls new routes, G3 clears them (only tracks that sound). LFO + SELECT: the track's LFO diced.

KNOBS

M1M2M3M4

SCL · SCALE

Any key sets the ROOT. ROOT and SCALE are every melodic track's (and RESO's).

KNOBS

ROOTSCLOFSPIT

SEQ · TOOLS

On the SEQ pages: F3 CLEAR · G3 REVERSE · A3 B3 SHIFT · C4 RANDOM · D4 COOK · E4 BEAT · F4 CLR AUTO (the automation).

KNOBS

LENDIVSWINGGATE

REC · RECORD

F3 CLEAR the track (at once; GLO + G4 undoes it), G3 the metronome CLICK.

KNOBS

CLICK---
COMBOS

BUTTONS TOGETHER

HOME · EDIT · SEQ · LFO · FX + SELECTTheir dice: everything · sound · sequence · LFO · effects (KEEP? OK / CANCEL).
PAGE BUTTON + PRESETSJump through that button's pages.
REC + FXEDITENVLFOSCLARPGLOClear that part's automation on the selected track (FX: the punch-in lane too).
SEQ + RECCLEAR ALL SEQUENCES? (OCT+ confirms).
SAVE + OCT+ / OCT−Store / recall the playing section.
GLO + PLAYRestart from the top.
GLO + SELECTTempo (from any page).
STEP HELD + KNOBA parameter lock on that step (roll, grid).
HOME heldMENU: knob accel, FX latch, hold time, USB level, palettes, animation…
EVERY PAGE · KNOB 1 – 4

ENV

ENV
ATKDECSUSREL
ENV DEST
FILTERPITCHSHAPELOOP

LFO

LFO
RATEWAVEPHASEFADE
LFO DEST
PITCHFILTERSHAPEAMP
MOD
SLOTSRCDESTAMT
MSEQ
STEPLEVELLENSLEW
MSEQ 2
DIV---

SCL · ARP

SCLROOT SCALE QUANT ALL TR
CHORD
CHORDVOICINGSTRUM-
ARP
MODERATEOCTGATE
ARP 2
SWINGPROBHOLDORDER

FX

FX
DISTCHORUSDLYREV
DIST
DISTTYPETONE-
AUTO PAN
DEPTHRATESYNCWAVE
SLICER
MODEPATRATEDEPTH
SL BUS
T1T2T3T4
SL BUS 2
T5T6FX-
SL PITCH
STEPPITCHLENQUANT
DLY
TIMEFEEDBKTONEMIX
DLY 2
WIDEPITCHSPRAYMOD
DLY 3
TYPEPING--
REVERB
TYPESIZEDAMPPRE/AIR
REVERB 2
MODRATEFILTWIDE
CHORUS
RATEDEPTHSTEREO-
MASTER
CLIPPUNCHDUCKREL
PUNCH
LENRESRECCLEAR

EDIT

EDIT 1
E1E2E3E4
EDIT 2
E5E6E7E8
RETRIG
RTRG---
OPERATOR
OPRATIOFINELEVEL
OP ENV
OPSTAGERATELEVEL
OPERATOR 2
OPMODEDETUNEVEL
FILTER
TYPECUTRESDRIVE
VOICE
VOICEGLIDEMODEPRIO
KIT 3
BPFEEDBK--
X-MOD
RATEDEPTHSHAPERAND
LEVELS
KICKSNARECLAPHATCL
LEVELS 2
HATOPTOMRIMBELL
SOUND
SOUNDSIDEPITCHPMOD
SOUND 2
SOUNDDECAYNOISECOLOR
SOUND 3
SOUNDMODEPM.TYPEDRIVE
SOUND 4
SOUNDLAYERFEEDBKSEND
STEREO
IMAGE---

SEQ

PATTERN
LENDIVSWINGGATE
STRETCH
x/÷REPEATNUDGEROTATE
PLAYHEADS
HEADRATEDIRINTVL
TRACKPITCH CHANCE HUMAN REC Q
MUTATE
SOUNDPATTERNAMOUNTMODE
STEP
STEPNOTETIMEFLAG
STEP · DRUM
STEPLANEHITACC
NOTE
FOCUSPITCHMOVEMICRO
AUTOMATION
PLAYEVENTLOCKCLEAR
AUTO LIST
ROWSTEPPARAMVALUE
COMP
STEPTYPEVALEVERY
COMP 2
STEPTYPEVALEVERY

GLO · SAVE

MIXER
LEVELPANREVMUTE
GLOBAL
BPMSWINGCLOCKTUNE
SYSTEM
TRACKSLOADROUTECPU
PRESETS
No.ENGFAVLIST
USER
SLOTLOADERASESAVE
PROJECT
PROJSECTLOADSAVE
ARRANGE
ROWSECTBARSSCENE
TOOLSCLEAR SEQ · INIT SOUND · DEL ROW · CLEAR SONG · NEW PROJECT · CPU TEST: K1 picks, OCT+
+
THE PANEL

KNOBS AND TRANSPORT

MASTERMaster volume.
SELECTScrolls the section's pages (SEQ: zooms PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its dice (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.
PRESETSBrowses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. Hold a page button + PRESETS: jump through its pages.
ALGORITHMSelects the track from any page: T1–T4, or T1–T6 with TRACKS 6.
KNOB 1–4The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.
OCT− · OCT+The keyboard's octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM, each sound its own (grid KNOB 3 HIT). On action pages and dialogs: back / confirm.
PLAYStart / stop. GLO + PLAY: restart from the top.
RECArms live recording on the selected track (notes and knob moves, overdub).
HOMETap: the ecosystem. Hold: the MENU.
KEYS27 keys play the selected track in its scale; with a layer held they become that layer's.

PAGE BUTTONS

BUTTONTAP: ITS PAGES, ONE PER TAPHOLD
ENVENV · ENV DEST—
LFOLFO · LFO DEST · MOD · MSEQ · MSEQ 2MACROS M1–M4 (stay latched)
FXFX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)PUNCH-IN FX
SCLSCL · CHORDROOT by key
EDITEDIT 1 · EDIT 2 · FILTER · VOICE (FM6: OPERATOR · OP ENV · OPERATOR 2; DRUM: KIT · KIT 2 · KIT 3 · X-MOD · FILTER · SOUND 1–4 · LEVELS 1–2 · STEREO)INIT · RECALL · sound mutes
GLOMIXER · GLOBAL · SYSTEMMUTE · SOLO · LEVEL · TAP
SAVEPRESETS · USER · PROJECT · ARRANGE · TOOLSSONG layer
ARPARP · ARP 2—
SEQthe zoom level's sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2SEQ TOOLS
REC(transport)CLEAR · CLICK

BUTTON + PRESETS jumps through its pages (no wrap). SELECT alone scrolls the section's pages.

LAYERS · HOLD A BUTTON

FX · PUNCH-IN EFFECTS

F3REP 1/8
G3REP 1/16
A3REP 1/32
B3LPF
C4HPF
D4OCT−
E4OCT+
F4½ TEMPO
G4DEC−
A4DEC+
B4STUT 1/8
C5STUT 1/16
D5ATK+
E5ARP
F5RAND
G5ERASE
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#
A#TGT
C#
D#
F#

A key plays its effect while held (MENU FX LATCH ON: toggles); hold FX and let go untouched: LOCKED open, FX again unlocks; OCT- all off. In on the next 1/16. Black 1–6 mute T1–T6, A#4 picks which tracks the MIDI ones touch (all · synths · drums). With REC armed and playing they record into the section's lane; G5 erases it.

KNOBS

FILTERCRUSHTHROWDEPTH

GLO · MIX

F3SOLO 1
G3SOLO 2
A3SOLO 3
B3SOLO 4
C4SOLO 5
D4SOLO 6
E4ALL
F4TAP
G4UNDO
A4
B4
C5
D5
E5
F5
G5
F#M1
G#M2
A#M3
C#M4
D#M5
F#M6
G#KICK
A#SNR
C#HAT
D#PERC
F#

Black 1–6 mute T1–T6 (latched), 7–10 the DRUM-X groups. White: solo while held, E4 unmutes all, F4 tap tempo, G4 UNDO the last big change (again: redo), A4 FREEZE MUTATE. SELECT: the tempo. PLAY: restart.

KNOBS

LEVEL T1LEVEL T2LEVEL T3LEVEL T4

T5 or T6 selected: the knobs are T3–T6.

SAVE · SONG

F3PLAY A
G3PLAY B
A3PLAY C
B3PLAY D
C4STORE A
D4STORE B
E4STORE C
F4STORE D
G4
A4
B4
C5
D5LOOP/ SONG
E5SONG REC
F5
G5SONG
F#
G#
A#
C#
D#
F#
G#
A#
C#
D#
F#

PLAY A–D on the next bar (several in one hold: a quick chain), STORE the section into A–D. OCT+ stores the playing section, OCT− recalls it. On the SONG page KNOB 4 stores a scene.

KNOBS

SONG 1–8---

EDIT · SOUND

F3INIT
G3RECALL
A3
B3
C4
D4
E4
F4
G4
A4
B4
C5
D5
E5
F5
G5
F#BD
G#SD
A#CP
C#CH
D#OH
F#TM
G#RS
A#CB
C#
D#
F#

INIT: the factory sound (DRUM: the kit too). RECALL: the sound stored in the section. On a DRUM track black 1–8 mute each DRUM-X sound.

KNOBS

EDIT 1EDIT 2EDIT 3EDIT 4

LFO · MACROS

Knobs M1–M4; they stay latched when let go (LFO again: off). F3 rolls new routes, G3 clears them (only tracks that sound). LFO + SELECT: the track's LFO diced.

KNOBS

M1M2M3M4

SCL · SCALE

Any key sets the ROOT. ROOT and SCALE are every melodic track's (and RESO's).

KNOBS

ROOTSCLOFSPIT

SEQ · TOOLS

On the SEQ pages: F3 CLEAR · G3 REVERSE · A3 B3 SHIFT · C4 RANDOM · D4 COOK · E4 BEAT · F4 CLR AUTO (the automation).

KNOBS

LENDIVSWINGGATE

REC · RECORD

F3 CLEAR the track (at once; GLO + G4 undoes it), G3 the metronome CLICK.

KNOBS

CLICK---
COMBOS

BUTTONS TOGETHER

HOME · EDIT · SEQ · LFO · FX + SELECTTheir dice: everything · sound · sequence · LFO · effects (KEEP? OK / CANCEL).
PAGE BUTTON + PRESETSJump through that button's pages.
REC + FXEDITENVLFOSCLARPGLOClear that part's automation on the selected track (FX: the punch-in lane too).
SEQ + RECCLEAR ALL SEQUENCES? (OCT+ confirms).
SAVE + OCT+ / OCT−Store / recall the playing section.
GLO + PLAYRestart from the top.
GLO + SELECTTempo (from any page).
STEP HELD + KNOBA parameter lock on that step (roll, grid).
HOME heldMENU: knob accel, FX latch, hold time, USB level, palettes, animation…
EVERY PAGE · KNOB 1 – 4

ENV

ENV
ATKDECSUSREL
ENV DEST
FILTERPITCHSHAPELOOP

LFO

LFO
RATEWAVEPHASEFADE
LFO DEST
PITCHFILTERSHAPEAMP
MOD
SLOTSRCDESTAMT
MSEQ
STEPLEVELLENSLEW
MSEQ 2
DIV---

SCL · ARP

SCLROOT SCALE QUANT ALL TR
CHORD
CHORDVOICINGSTRUM-
ARP
MODERATEOCTGATE
ARP 2
SWINGPROBHOLDORDER

FX

FX
DISTCHORUSDLYREV
DIST
DISTTYPETONE-
AUTO PAN
DEPTHRATESYNCWAVE
SLICER
MODEPATRATEDEPTH
SL BUS
T1T2T3T4
SL BUS 2
T5T6FX-
SL PITCH
STEPPITCHLENQUANT
DLY
TIMEFEEDBKTONEMIX
DLY 2
WIDEPITCHSPRAYMOD
DLY 3
TYPEPING--
REVERB
TYPESIZEDAMPPRE/AIR
REVERB 2
MODRATEFILTWIDE
CHORUS
RATEDEPTHSTEREO-
MASTER
CLIPPUNCHDUCKREL
PUNCH
LENRESRECCLEAR

EDIT

EDIT 1
E1E2E3E4
EDIT 2
E5E6E7E8
RETRIG
RTRG---
OPERATOR
OPRATIOFINELEVEL
OP ENV
OPSTAGERATELEVEL
OPERATOR 2
OPMODEDETUNEVEL
FILTER
TYPECUTRESDRIVE
VOICE
VOICEGLIDEMODEPRIO
KIT 3
BPFEEDBK--
X-MOD
RATEDEPTHSHAPERAND
LEVELS
KICKSNARECLAPHATCL
LEVELS 2
HATOPTOMRIMBELL
SOUND
SOUNDSIDEPITCHPMOD
SOUND 2
SOUNDDECAYNOISECOLOR
SOUND 3
SOUNDMODEPM.TYPEDRIVE
SOUND 4
SOUNDLAYERFEEDBKSEND
STEREO
IMAGE---

SEQ

PATTERN
LENDIVSWINGGATE
STRETCH
x/÷REPEATNUDGEROTATE
PLAYHEADS
HEADRATEDIRINTVL
TRACKPITCH CHANCE HUMAN REC Q
MUTATE
SOUNDPATTERNAMOUNTMODE
STEP
STEPNOTETIMEFLAG
STEP · DRUM
STEPLANEHITACC
NOTE
FOCUSPITCHMOVEMICRO
AUTOMATION
PLAYEVENTLOCKCLEAR
AUTO LIST
ROWSTEPPARAMVALUE
COMP
STEPTYPEVALEVERY
COMP 2
STEPTYPEVALEVERY

GLO · SAVE

MIXER
LEVELPANREVMUTE
GLOBAL
BPMSWINGCLOCKTUNE
SYSTEM
TRACKSLOADROUTECPU
PRESETS
No.ENGFAVLIST
USER
SLOTLOADERASESAVE
PROJECT
PROJSECTLOADSAVE
ARRANGE
ROWSECTBARSSCENE
TOOLSCLEAR SEQ · INIT SOUND · DEL ROW · CLEAR SONG · NEW PROJECT · CPU TEST: K1 picks, OCT+
GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP -JIANT FM v0.8.4
+JIANT FM v0.8.5 \ No newline at end of file diff --git a/docs/cheatsheet/sound.html b/docs/cheatsheet/sound.html index 7d39a0b7..681ccfc7 100644 --- a/docs/cheatsheet/sound.html +++ b/docs/cheatsheet/sound.html @@ -51,9 +51,9 @@ ul { padding-left: 18px; } li { margin: 2px 0; }
JIANT FM signature

JIANT FM · SOUND · FX · MOD

engines, effects, modulation, sequencer and songs

-
firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
+
firmware v0.8.5 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT
ENGINES · EDIT 1 / EDIT 2

NINE ENGINES, ALL SYNTHESIS

ENGINEEDIT 1EDIT 2WHAT TO KNOW
ANALOG
WAVEDETUNEMIXNOISE
CUTRESDRIVEINT
SAW SQR TRI SIN PWM SYNC RING SAW3; INT: osc 2 ±24 st. Its filter is per voice.
FM6
ALGFBMODRATIO
MEGVMODDETUNESLOT
Dexed's 6 operators, 32 algorithms drawn, .syx patches (SLOT), MOD / RATIO move the modulators. OPERATOR · OP ENV · OPERATOR 2: each operator on the device (ratio / fixed, fine, level, its envelope, mode, detune, velocity). SLOT B1–B32: a 32-voice .syx sent from the web editor.
PHASE
WAVEWAVE2DCWENV
DETUNELINESUBFB
Phase distortion (CZ); FB feeds the output back into the phase: hard edge to growl.
LOFI
CHIPWAVEDUTYCRUSH
-VIBBENDMASK
Chip: PLS TRI SAW NOIS WRAM. BYTE: ALGO VAR · MOTN GRIT BEND LOOP. FLOAT (floatbeat): ALGO VAR · MOTN FBK BEND LOOP; CHIP sets FULL / 4BIT / 1BIT.
VOICE
VOWELVOWEL2TALKSHIFT
BUZZBREATHQRAND
Formant voice (after klattsch): vowels, talk, breath.
WHEEL
REGSUBBODYTOP
PERCCLICKDRIVEROTOR
Drawbar organ: registrations, percussion, rotary.
NOISE
MODECOLORFREQPEAK
TRKDENSEDRIFTCRUSH
Coloured and metallic noise, tracked or free.
DRUM-X
MORPHTUNETONEDECAY
NOISEFMENVFOLDDRIVE
8 sounds BD SD CP CH OH TM RS CB, sides A / B: MORPH morphs the kit. The kit first: KIT 3 BP FEEDBK, X-MOD RATE DEPTH SHAPE RAND. Then a sound (KNOB 1 the sound): SIDE PITCH PMOD · DECAY NOISE COLOR · MODE PM.TYPE DRIVE · LAYER (no note) FEEDBK SEND (CHO / DLY / REV). Last LEVELS and STEREO IMAGE (a knob through the kit's stereo placings).
ANIMAL
MODEPRESSCHAOSSIZE
SWEEPRATEGROUPTEMP
Animal calls (0.8.3), MODE the source: CMOS the 40106 / 4093 bird circuit (TOUCH COUPLE CAP · HYST RATE GROUP FM) · PULSE crickets, cicadas, frogs (CLICK Q · DETUNE) · WHSTL birds, a Hopf whistle · WING mosquito, bee, fly (BUZZ DRIFT · DOPPLR) · GLOTT wolf, bark, roar, purr (MOUTH ROUGH · AIR). GROUP: syllables + gaps; TEMP °C speeds a cricket up (Dolbear). A note is a call.

FILTER · EVERY ENGINE

TYPECUTRESDRV

LP · HP · BP · COMB. COMB rings tuned to the note: CUT moves it ±32 st, RES how much it rings. ANALOG and LOFI: per voice; the others: on the track, following LFO / ENV DEST FLT (DRV = the track's DIST).

VOICE · PLAYING

VCEGLDGLMODPRIO

POLY · MONO · LEG · UNI; glide and its mode; LAST / LOW / HIGH priority. 8 voices shared by the six tracks (MONO and LEGATO keep their note).

DICE

EDIT + SELECT: a random factory preset of the engine, every parameter moved up to a quarter of its range. DRUM-X: both sides of every sound around the factory kit. Heard at once: OCT+ OK keeps it, OCT- CANCEL brings the sound back. SEQ / LFO / FX + SELECT: the sequence, the LFO, the effects, the same way. HOME + SELECT: GEN, the song generator: GENRE (43 or RANDOM) · SEED · ENERGY · FORM; DRUMS · BASS · CHORDS · ARP · LEAD amounts; COMPLEX · SWING · HUMAN. OCT+ makes the piece (again: a new seed), HOME done. GLO + G4 undoes.

MODULATION

ENV · LFO

ENV

ATKDECSUSREL

ENV DEST

FLTPITSHPLOOP

LOOP: held, the envelope cycles from the sustain: an ADSR-shaped LFO.

LFO

RATEWAVEPHSFADE

SIN TRI SAW SQR S&H

LFO DEST

PITFLTSHPAMP

MOD MATRIX · 4 SLOTS A TRACK

SLOTSRCDSTAMT

SOURCES

LFOENVVELKEYRANDMODWATEXPRM1M2M3M4STEP

DESTINATIONS

PITCHCUTSHPAMPPANDISTCHODLYREVRATEVIBE1…E8CLIPPNCHD.TIMD.FBD.TOND.MIXR.SIZR.DMPC.RATC.DEP

E1…E8: the engine's own EDIT knobs. CLIP / PNCH: the master. D. R. C.: the DELAY, REVERB and CHORUS buses (a STEP source on D.TIM sequences the delay time).

MSEQ · MACROS

MSEQ · A CV SEQUENCER PER TRACK

STEPLVLLENSLEW

16 levels, DIV on MSEQ 2, in time with the transport. Use it from MOD, SRC STEP.

MACROS M1–M4

Hold LFO: the knobs are M1–M4, latched until LFO again. Each session starts with 2 random routes a track; F3 rolls new ones, G3 clears. By hand: MOD, SRC M1…M4. Saved with the project.

SEQUENCER

64 steps a track, up to 4 notes a step, piano roll and drum grid. LENTE: SELECT zooms PATTERN (the bars; PRESETS the bar) · BAR (the roll / grid) · STEP (one step large, its chips); SEQ taps round the level's sets and comes back to the track's last. Hold a step + turn a knob: a parameter lock. Step recording: hold a chord + KNOB 1 its length; + ARP: arpeggiated (K1 rate, K2 order, K3 oct). COMP / COMP 2: two components a step (CHANCE, RATCH, ARP NOTES / SEQ / SCALE, TRIG, RAND, OCT, TONAL, BEND, ECHO, PULSE, JUMP, REV, FILL, KILL, WALK, CLIMB, TOUCH: a kit's SHORT / GHOST / FLAM); a TRIG or FILL wins; WALK / CLIMB: a degree / an octave further every N loops (K4), UP DOWN UP-DN RND over a range (K3), stackable; ARP: ORDER × range, RATE in note values (x1 1/32 1/32T 1/64 1/64T 1/128); RATCH / ECHO: DIV; EVERY (KNOB 4): the loops the step's components play on (ALWAYS 1:2 2:2 1:3 .. 4:4 1:8 FIRST !FIRST SKIP). TRACK: PITCH, CHANCE thins the whole track, HUMAN one amount (velocity, timing, gate, decay / release), REC Q. STRETCH / REPEAT act as the knob turns; ROTATE reads the sequence from another step; NOTE's MICRO moves a step off the grid. REC + knobs while playing: automation (64 records a section, MOTION page plays / clears them, AUTO LIST edits them).

PATTERN · TRACK

LENDIVSWGGATE
PITCHNHUMRECQ

SCALE · ARP

ROOT and SCALE are every melodic track's: CHR MAJ MIN DOR MIX PEN MPEN HARM PHRY LYD LOC MEL BLUES WHOLE DIMHW DIMWH. QNT snaps keys or the sequence, ALL TR (SCL KNOB 4) moves every sequence along the scale. CHORD: a key plays a chord (TRIAD 7TH ADD9 SUS2 SUS4 in key, MAJ MIN 7 MAJ7 MIN7 POWER), VOICING LEAD leads each to the next, STRUM as a harp.

ARP MODES

OFF UP DN UPDN RND ORD REPEAT DNUP UP+8 CONV DIVG PINKY THUMB WALK CHORD TRNS (the keys transpose the sequence)

SONGS

8 projects × 4 sections (A–D), a song of up to 16 rows by bars (SAVE › ARRANGE; END: STOP, x2–x8, LOOP), SLOOP style. Each row can hold a scene: mutes, DRUM-X group mutes, macros and MIDI punch-ins. SAVE held plays sections live on the next bar, stores them, records the song (SONG REC). Each section keeps its sounds, steps, motion, kit and its SLICER.

EFFECTS

PER TRACK

FX · SENDS

DSTCHODLYREV

DIST

DSTTYPETONE-

SOFT · HARD · FOLD · CRUSH · RECT.

AUTO PAN

DEPTHRATESYNCWAVE

The track's pan swung L–R around its PAN. SYNC BEAT: RATE 4 BARS … 1/32, in time with the bar; FREE: in Hz. SIN · TRI · SAW · SQR · S&H, never a click.

SLICER · ONE ON A BUS

SLCRPATRATEDEPTH

OFF · GATE · STUT, 16 patterns, 1/8 … 32T. SL BUS: T1–T6 and FX (the delay / reverb / chorus returns) ON / OFF: everything on = the whole mix chopped after the effects. SL PITCH: the repeats' 16-step pitch (±24 st, tape style, QNT SCL to the scale).

DELAY · CHORUS

DLY

TIMEFDBKTONEMIX

DLY 2

WIDEPITCHSPRYMOD

DLY 3

TYPEPING--

Synced or free (5 ms – 2.95 s; past 0.74 s darker); PITCH / SPRY: a grain delay.

CHORUS

RATEDEPTHSTER-

STER: 0 as always, down to mono, up to twice as wide.

REVERB · FIVE MODELS

TYPESIZEDAMPPRE
MODRATEFILTWIDE
TYPEWHAT IT ISSIZEDAMPMODRATEWIDE
ROOMClassic roomdecaydarkenschorus on the tailits speedstereo
SPRINGAmp spring tanklength · decaydarkenswobblewobble speedstereo
SHIMRUp an octave on every pass; PRE → AIR (±24 st: down darker and lower, up airier and higher)decaydarkenshow much shimmer——
RESO4 strings tuned to the scale; PRE → PITCH (0–14 steps up), DAMP → FOLW (OFF / T1–T6: the chord follows that track's notes)how long they ringFOLWpast half: the chord opens——
CLOUDGranular wash; SIZE max freezes it; PRE → AIR (±24 st: the cloud down / up, darker / airier)decay · freezedarkensgrains pitched + chorusgrain densitygrain spread

MASTER

CLIPPNCHDUCKREL

CLIP saturates without getting louder. PNCH drives the drums: denser body. DUCK: the kick pulls the rest down (REL its release). An always-on leveler (slow 2:1, −9…+6 dB) before the limiter keeps patches at a steady volume.

PUNCH-IN FX (FX HELD)

REPEAT 1/8 · 1/16 · 1/32, LPF, HPF; on the notes: OCT−/+, ½ TEMPO, DEC−/+, STUTTER, ATK+, ARP, RANDOM. Knobs: FILTER CRUSH THROW DEPTH. Recordable per section.

GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP -JIANT FM v0.8.4
+JIANT FM v0.8.5 \ No newline at end of file diff --git a/firmware/src/core.h b/firmware/src/core.h index 423f81c3..99f9d876 100644 --- a/firmware/src/core.h +++ b/firmware/src/core.h @@ -376,7 +376,26 @@ typedef struct { /* acid-style step: up to 4 notes (POLY), time, uint8_t cwhen; /* (0.6.82) WHEN each plays: bits 0-1 comp's, 2-3 comp2's (CW_*) */ uint8_t ctime; /* (0.6.82) bits 0-2 DIV: RATCH's and ECHO's parts a step/2 .. /8 apart (0: the step * shared out, as before); bits 3-6 LEN: a part's gate n/16 (0: the track's GATE) */ + uint8_t lm[3]; /* (0.8.5) each drum lane's own way of playing on this step (a DRUM track: its hit and + * its notes on the lane): 3 bits a lane, lane l at bits 3l..3l+2 of the 24, LM_* */ } step_t; +/* (0.8.5) a lane's mode (eng_drum.c, the DRUM-X octaves): its hit ratcheted x2 / x4 / x8 over the step, or struck SHORT, + * GHOST, FLAM; that lane only. 0: as ever (every step before 0.8.5) */ +enum { LM_NONE, LM_X2, LM_X4, LM_X8, LM_SHORT, LM_GHOST, LM_FLAM, LM_N }; +static uint32_t step_lmode(const step_t *s, uint32_t l) +{ + uint32_t v = (uint32_t)s->lm[0] | (uint32_t)s->lm[1] << 8 | (uint32_t)s->lm[2] << 16, m = (v >> (3u * (l & 7u))) & 7u; + return m < LM_N ? m : LM_NONE; +} +static void step_set_lmode(step_t *s, uint32_t l, uint32_t m) +{ + uint32_t v = (uint32_t)s->lm[0] | (uint32_t)s->lm[1] << 8 | (uint32_t)s->lm[2] << 16, sh = 3u * (l & 7u); + v = (v & ~(7u << sh)) | ((m < LM_N ? m : 0u) << sh); + s->lm[0] = (uint8_t)v; s->lm[1] = (uint8_t)(v >> 8); s->lm[2] = (uint8_t)(v >> 16); +} +static int step_lm_any(const step_t *s) { return s->lm[0] | s->lm[1] | s->lm[2]; } +static uint32_t lm_hits(uint32_t m) { return m == LM_X2 ? 2u : m == LM_X4 ? 4u : m == LM_X8 ? 8u : 1u; } /* a step */ +static uint32_t lm_touch(uint32_t m) { return m >= LM_SHORT && m <= LM_FLAM ? m - LM_SHORT + 1u : 0u; } /* TOUCH 1..3 */ /* (0.6.92) EVERY: on which loops of the pattern the step's components play (both of them; seq.c every_on), in cwhen's * bits 0-3: ALWAYS, 1:2 (the odd loops), 2:2, SKIP (kept, never), 1:3 2:3 3:3, 1:4 2:4 3:4 4:4, 1:8, FIRST, NOT FIRST. * (0.6.82 WHEN: bits 0-1 the first component's ALWAYS / 1:2 / 2:2 / SKIP, the same codes; bits 2-3 the second's, now @@ -586,6 +605,7 @@ typedef struct track { uint8_t ss_nn[4 + NLANE], ss_vv[4 + NLANE]; /* order low to high (seq.c seq_step, seq_tick), ss_due samples to the next */ uint8_t dtch, ss_tch; /* (0.8.5) a step's TOUCH (1..3, 0 none) on the sequencer's next drum hits; .. on the * queued ones (HUMAN TIME: seq_tick) */ + uint8_t lr_on; /* (0.8.5) the playing step has a lane ratcheting (seq.c seq_lane_rat) */ uint32_t ss_due, ss_gap; /* (.. and the gap between them; 0.6.88: 32 bits, a long TIMING) */ uint16_t ext; /* (0.6.88) TIMING: samples the playing step began before its place (it is early) */ int8_t mic; /* .. the playing step's own TIMING (ST_MICRO), late: seq_step queues its notes */ diff --git a/firmware/src/editor.c b/firmware/src/editor.c index e0390c94..e40362ce 100644 --- a/firmware/src/editor.c +++ b/firmware/src/editor.c @@ -260,9 +260,14 @@ static void ed_step_put(step_t *st, const uint8_t *a, uint32_t na) } if (na >= 12u) step_set_chance(st, a[11] <= 100u ? a[11] : 100u); if (na >= 13u) step_set_ratchet(st, a[12]); + if (na >= 21u) /* (0.8.5, INFO 4F 01 07) each lane's mode, 0..6 (core.h LM_*) */ + for (i = 0; i < NLANE; i++) + step_set_lmode(st, i, a[13 + i] < LM_N ? a[13 + i] : LM_NONE); ui.force = 1; } -static void ed_step_reply(const step_t *st) /* the same 13 bytes */ +static void ed_step_reply(const step_t *st, int lanes) /* the same 13 bytes; (0.8.5) then the 8 lanes' modes, when the + * request asked for them (a write with them, a read with its + * flag 1): every reply of before as it was */ { uint32_t i; ed_b(st->n); @@ -276,6 +281,8 @@ static void ed_step_reply(const step_t *st) /* the same 13 bytes */ ed_b((uint32_t)(st->hit >> 7) | (uint32_t)(st->acc >> 7) << 1); ed_b(step_chance(st)); ed_b(step_ratchet(st)); + for (i = 0; lanes && i < NLANE; i++) + ed_b(step_lmode(st, i)); } /* a flash write from the editor while the transport runs: stop it first (the erase silences the audio and @@ -313,6 +320,13 @@ static void ed_motion_reply(uint32_t k, uint32_t rc, uint32_t kinds) if (MOTION_TRK(&motion.event[i]) == k) ed_b((motion.event[i].param & MOTION_LOCK) != 0u); } +static int ed_lm_ok(const uint8_t *a) /* (0.8.5) eight lane modes, each 0..6 */ +{ + uint32_t i; + for (i = 0; i < NLANE; i++) + if (a[i] >= LM_N) return 0; + return 1; +} static int ed_args_ok(uint32_t cmd, const uint8_t *a, uint32_t n) { switch (cmd) { @@ -324,21 +338,25 @@ static int ed_args_ok(uint32_t cmd, const uint8_t *a, uint32_t n) return n == 2u || (cmd == ED_TRACK_PARAM && n == 4u); case ED_SET: return n == 4u; - case ED_STEP_GET: case ED_NAMES: + case ED_STEP_GET: + return n == 1u || (n == 2u && a[1] == 1u); /* (0.8.5: 1, the lanes' modes too) */ + case ED_NAMES: case ED_UP_GET: case ED_UP_LOAD: case ED_UP_ERASE: case ED_WATCH: case ED_TRACK_DUMP: case ED_MENU_DESC: return n == 1u; case ED_MENU_SET: return n == 3u; case ED_STEP_SET: return n == 9u || n == 12u || (n == 13u && a[12] <= 100u) || /* notes only, or the complete grid extension, */ - (n == 14u && a[12] <= 100u && a[13] >= 1u && a[13] <= 4u); /* its chance, its ratchet */ + (n == 14u && a[12] <= 100u && a[13] >= 1u && a[13] <= 4u) || /* its chance, its ratchet, */ + (n == 22u && a[12] <= 100u && a[13] >= 1u && a[13] <= 4u && ed_lm_ok(a + 14)); /* (0.8.5) the lanes' modes */ case ED_TRACK: return n <= 1u; case ED_TRACK_MIX: return n == 1u || n == 4u; case ED_TRACK_STEP: - return n == 2u || n == 10u || n == 13u || (n == 14u && a[13] <= 100u) || - (n == 15u && a[13] <= 100u && a[14] >= 1u && a[14] <= 4u); + return n == 2u || (n == 3u && a[2] == 1u) || n == 10u || n == 13u || (n == 14u && a[13] <= 100u) || + (n == 15u && a[13] <= 100u && a[14] >= 1u && a[14] <= 4u) || + (n == 23u && a[13] <= 100u && a[14] >= 1u && a[14] <= 4u && ed_lm_ok(a + 15)); case ED_MOTION: return (n == 1u || (n == 2u && (a[1] == 2u || a[1] == 7u)) || (n == 3u && a[1] == 1u && a[2] <= 1u) || (n == 6u && (a[1] == 3u || a[1] == 5u)) || (n == 4u && a[1] == 4u) || (n == 3u && a[1] == 6u)) && @@ -410,6 +428,7 @@ static void ed_handle(const uint8_t *f, uint32_t n) /* f: the bytes between F0 ed_b(0x4C); ed_b(1); ed_b(1); /* 1.1 parameter locks: MOTION ops 5..7, the kinds after the records */ ed_b(0x56); ed_b(1); ed_b(FM6_NBANK); /* (JIANT 0.6.11, Felucca 1.4.1) FM6's voice bank: cmds 74..77, SLOT 9..40 */ ed_b(0x4A); ed_b(1); ed_b(1); /* (JIANT 0.6.62) 'J': this is JIANT (the web installer writes over it, web/index_pkg.html) */ + ed_b(0x4F); ed_b(1); ed_b(LM_N); /* (0.8.5) 'O': the DRUM-X octaves, a step's lane modes 0..6 after its ratchet */ break; case ED_GET: case ED_SET: @@ -470,7 +489,7 @@ static void ed_handle(const uint8_t *f, uint32_t n) /* f: the bytes between F0 } ed_w.st[a[0]] = ed_step_sig(&seq_steps(TSEL)[a[0]]); ed_b(a[0]); - ed_step_reply(&seq_steps(TSEL)[a[0]]); + ed_step_reply(&seq_steps(TSEL)[a[0]], na == 22u || (cmd == ED_STEP_GET && na == 2u)); break; } case ED_PRESET: { /* engine, preset */ @@ -694,7 +713,7 @@ static void ed_handle(const uint8_t *f, uint32_t n) /* f: the bytes between F0 ed_w.st[a[1]] = ed_step_sig(&seq_steps(&trk[a[0]])[a[1]]); ed_b(a[0]); ed_b(a[1]); - ed_step_reply(&seq_steps(&trk[a[0]])[a[1]]); + ed_step_reply(&seq_steps(&trk[a[0]])[a[1]], na == 23u || na == 3u); break; } case ED_TRACK_PARAM: { /* track, id [, v14] -> track, id, v14 */ diff --git a/firmware/src/felucca.c b/firmware/src/felucca.c index 7a0df3fa..9e41ea55 100644 --- a/firmware/src/felucca.c +++ b/firmware/src/felucca.c @@ -38,7 +38,7 @@ #define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */ #endif #ifndef FELUCCA_VERSION -#define FELUCCA_VERSION "v0.8.4" /* JIANT's (based on Felucca 1.1.5.1): the splash, the menu, the console, the editor */ +#define FELUCCA_VERSION "v0.8.5" /* JIANT's (based on Felucca 1.1.5.1): the splash, the menu, the console, the editor */ #endif #if FELUCCA_OTA && !FELUCCA_FLASH #error "FELUCCA_OTA needs FELUCCA_FLASH" diff --git a/firmware/src/project.c b/firmware/src/project.c index 611746d1..62dd5f7f 100644 --- a/firmware/src/project.c +++ b/firmware/src/project.c @@ -270,6 +270,7 @@ static void proj_trk_from(proj_trk_t *d, const int16_t *p, uint32_t np, uint8_t s->flags = step[k].flags & 3u; /* accent, slide: x1 (no RATCH then) */ s->vel = step[k].vel; s->hit = s->acc = 0; + s->lm[0] = s->lm[1] = s->lm[2] = 0; } } @@ -728,7 +729,7 @@ static uint8_t proj_full; /* the last proj_pack fa static int proj_step_empty(const step_t *s) { return !s->n && s->time == ST_REST && !s->flags && !s->vel && !s->hit && !s->acc && !s->probability && !s->comp && - !s->comp2 && !s->cwhen && !s->ctime; + !s->comp2 && !s->cwhen && !s->ctime && !step_lm_any(s); } static uint32_t proj_step_x(const step_t *s, uint32_t *nn) /* its x byte (0: none), *nn the notes stored */ { @@ -738,12 +739,14 @@ static uint32_t proj_step_x(const step_t *s, uint32_t *nn) /* its x byte (0: n *nn = all ? 4u : s->n; return (s->hit || s->acc ? 1u : 0u) | (s->probability ? 2u : 0u) | (r & 2u ? 4u : 0u) | (all ? 8u : 0u) | (s->comp ? 16u : 0u) | /* (0.6.39) a component: two bytes, its type and arguments */ - (s->comp2 || s->cwhen || s->ctime ? 32u : 0u); /* (0.6.82) the second, WHEN, DIV / LEN: four more */ + (s->comp2 || s->cwhen || s->ctime ? 32u : 0u) | /* (0.6.82) the second, WHEN, DIV / LEN: four more */ + (step_lm_any(s) ? 64u : 0u); /* (0.8.5) the lanes' modes: three more (firmware before refuses) */ } static uint32_t proj_step_size(const step_t *s) { uint32_t nn, x = proj_step_x(s, &nn); - return 2u + nn + (x ? 1u + (x & 1u ? 2u : 0u) + (x & 2u ? 1u : 0u) + (x & 16u ? 2u : 0u) + (x & 32u ? 4u : 0u) : 0u); + return 2u + nn + (x ? 1u + (x & 1u ? 2u : 0u) + (x & 2u ? 1u : 0u) + (x & 16u ? 2u : 0u) + (x & 32u ? 4u : 0u) + + (x & 64u ? 3u : 0u) : 0u); } static int proj_fm_kept(const project_t *q, uint32_t t) { @@ -837,6 +840,7 @@ static int proj_pack(project_store_t *out, const project_t *q) if (x & 2u) b[pos++] = s->probability; if (x & 16u) { b[pos++] = s->comp; b[pos++] = s->carg; } if (x & 32u) { b[pos++] = s->comp2; b[pos++] = s->carg2; b[pos++] = s->cwhen; b[pos++] = s->ctime; } + if (x & 64u) { b[pos++] = s->lm[0]; b[pos++] = s->lm[1]; b[pos++] = s->lm[2]; } } } memcpy(b + pos, &q->chain, sizeof q->chain); pos += sizeof q->chain; @@ -1012,7 +1016,7 @@ static int proj_unpack_c(project_t *q, const uint8_t *b) if (meta & 128u) { if (pos + 1u > room) return 0; x = b[pos++]; - if (!x || (x & ~63u)) return 0; + if (!x || (x & ~127u)) return 0; if (x & 8u) nn = 4u; } if (pos + nn + 1u > room) return 0; @@ -1038,6 +1042,14 @@ static int proj_unpack_c(project_t *q, const uint8_t *b) s->carg2 = b[pos++]; s->cwhen = b[pos++]; s->ctime = b[pos++]; if (CT_DIV(s) >= CT_NDIV || s->ctime > 127u) return 0; } + s->lm[0] = s->lm[1] = s->lm[2] = 0; + if (x & 64u) { /* (0.8.5) the lanes' modes (a 7: none) */ + uint32_t l; + if (pos + 3u > room) return 0; + s->lm[0] = b[pos++]; s->lm[1] = b[pos++]; s->lm[2] = b[pos++]; + for (l = 0; l < NLANE; l++) + step_set_lmode(s, l, step_lmode(s, l)); + } r |= (x >> 1) & 2u; step_set_ratchet(s, r + 1u); } @@ -1267,7 +1279,8 @@ static void proj_legacy_drums(track_t *t) t->p[P_DIST + i] = (int16_t)(pr->fx[i] ? pr->fx[i] - 1 : FX_DEF[i]); } -static project_t proj_scratch __attribute__((section(".lowbuf"))); /* (0.6.78: below the RAM code, app.ld) */ /* decoded main-loop work, never audio ISR (0.6: pool) */ +static project_t proj_scratch __attribute__((section(".pool"))); /* (0.8.5: the pool again, LOWBUF full with the steps' + * lane modes; 0.6.78 .. 0.8.4 LOWBUF) */ /* decoded main-loop work, never audio ISR (0.6: pool) */ static char proj_name[PROJ_NAME_LEN + 1u] /* the name of the music as it is now (loaded, saved, the editor's */ __attribute__((section(".pool"))); /* runtime restore); "" = none. A save takes it unless one is given */ #define PROJ_NO_SLOT 0xFFu diff --git a/firmware/src/seq.c b/firmware/src/seq.c index 5802fb94..e4c76324 100644 --- a/firmware/src/seq.c +++ b/firmware/src/seq.c @@ -573,35 +573,14 @@ static uint32_t seq_src(const track_t *t, uint32_t idx) return (uint32_t)(((int32_t)(idx % (uint32_t)len) - o + len) % len); } -/* (0.8.5) a recorded hit's octave (dx_in_rat / dx_in_tch: the key's or MIDI note's, eng_drum.c) onto its step: above - * the kit's octave the step's RATCH x2 / x4 (x8: an ECHO x8 EVEN), below it its TOUCH component (into COMP, else COMP 2; - * both taken by others: not written). The step's own: everything it plays has it (the last one recorded sets it; a hit - * of the kit's octave leaves it) */ -static void rec_drum_comp(step_t *s, uint32_t c, uint32_t a) +/* (0.8.5) a recorded hit's octave (dx_in_rat / dx_in_tch: the key's or MIDI note's, eng_drum.c) as its lane's mode on + * the step (core.h LM_*): x2 / x4 / x8 above the kit's octave, SHORT / GHOST / FLAM below, none in it; that lane only + * (its hit and its notes), the rest of the step as it was. The last hit recorded on a lane sets it */ +static uint32_t rec_lmode(void) { - if (!s->comp || s->comp == c) { - s->comp = (uint8_t)c; - s->carg = (uint8_t)a; - } else if (!s->comp2 || s->comp2 == c) { - s->comp2 = (uint8_t)c; - s->carg2 = (uint8_t)a; - } -} -static void rec_drum_oct(step_t *s) -{ - if (dx_in_rat > 4u) { - step_set_ratchet(s, 1); - rec_drum_comp(s, CP_ECHO, CP_ECHO_EVEN | 6u); /* (x8: 2 + 6) */ - s->ctime &= (uint8_t)~7u; /* (DIV FIT: the step shared out) */ - } else if (dx_in_rat > 1u) { - step_set_ratchet(s, dx_in_rat); - if (s->comp == CP_ECHO && (s->carg & CP_ECHO_EVEN)) /* (an x8 recorded there before: this one now) */ - s->comp = s->carg = 0; - if (s->comp2 == CP_ECHO && (s->carg2 & CP_ECHO_EVEN)) - s->comp2 = s->carg2 = 0; - } if (dx_in_tch) - rec_drum_comp(s, CP_TOUCH, dx_in_tch - 1u); + return LM_SHORT + (dx_in_tch - 1u) % 3u; + return dx_in_rat >= 8u ? LM_X8 : dx_in_rat >= 4u ? LM_X4 : dx_in_rat >= 2u ? LM_X2 : LM_NONE; } /* a hit (a GM note) into step s of a DRUM track (rec_note, a held ratchet's next step: dxo_rec_hold) */ static void rec_drum(track_t *t, step_t *s, uint32_t note, uint32_t vel, int32_t mic) @@ -616,6 +595,7 @@ static void rec_drum(track_t *t, step_t *s, uint32_t note, uint32_t vel, int32_t s->comp = s->carg = 0; if (s->comp2 == CP_TOUCH) s->comp2 = s->carg2 = 0; + s->lm[0] = s->lm[1] = s->lm[2] = 0; } s->time = ST_NOTE; if (note == DRUM_LANE_NOTE[l]) { /* a lane's note: its hit */ @@ -635,7 +615,7 @@ static void rec_drum(track_t *t, step_t *s, uint32_t note, uint32_t vel, int32_t } if (vel > s->vel) s->vel = (uint8_t)vel; - rec_drum_oct(s); + step_set_lmode(s, l, rec_lmode()); t->seq_active = 1; } static uint8_t rec_at, rec_late; /* (0.8.5) the step (play index + 1) the last hit went into; @@ -739,6 +719,7 @@ static void rec_hold(track_t *t, uint32_t idx, uint32_t len) s->flags = 0; s->vel = 0; s->hit = s->acc = 0; + s->lm[0] = s->lm[1] = s->lm[2] = 0; } /* a key of a recorded note is up: the hold ends with the last one */ @@ -812,14 +793,14 @@ static void input_off(track_t *t, uint32_t note) /* ------------------------------------------- (0.8.5) the kit's octaves --- */ /* A DRUM track's note in another octave than the kit's (eng_drum.c DXO_*): a key at OCT +-n (kb_oct), a MIDI note of a - * band around the GM map (drum_oct_of). Below: the hit with TOUCH n (dx_in_tch on its note-on: SHORT GHOST FLAM; - * recorded as the step's TOUCH). Above: the hit, then again x2 / x4 / x8 a step while held (dxo_tick): playing, on the step's RATCH grid (a - * part every step / n from each step's start, swung as the steps are), stopped, every step / n from the press. - * Recording, playing (rec_on), the step it goes into gets the hit and the RATCH (rec_drum_oct); every step entered - * while it is held too, before it plays (dxo_rec_hold: the sequencer plays those, the held note is silent there), so - * the pass after plays what was heard; let go before the middle of such a step, that step is put back (dxo_bak), as a - * held synth note's TIE. The ARP on: the notes go to it plain. Each held one: its key or MIDI note (id), up to DXO_N a - * track (one more replaces the last) */ + * band around the GM map (drum_oct_of). Below: the hit with TOUCH n (dx_in_tch on its note-on: SHORT GHOST FLAM). + * Above: the hit, then again x2 / x4 / x8 a step while held (dxo_tick): playing, on the grid the sequencer's lane + * ratchets use (a part every step / n from each step's start, swung as the steps are: seq_lane_rat), stopped, every + * step / n from the press. Recording, playing (rec_on), the step it goes into gets the hit and its lane's mode + * (rec_lmode: that lane only); every step entered while it is held too, before it plays (dxo_rec_hold: the sequencer + * plays those, the held note is silent there), so the pass after plays what was heard; let go before the middle of + * such a step, that step is put back (dxo_bak), as a held synth note's TIE. The ARP on: the notes go to it plain. Each + * held one: its key or MIDI note (id), up to DXO_N a track (one more replaces the last) */ #define DXO_N 4u #define DXO_KEY 0x100u /* id: a key (+ k), a MIDI note (+ ch << 7 + note) */ #define DXO_MIDI 0x1000u @@ -1637,6 +1618,7 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint (t->p[P_AMODE] == AM_TRNS ? t->trn : 0); /* ARP TRNS: the keys' interval */ if (!(skip & SEQ_REP)) { t->rat_left = 0; + t->lr_on = 0; if ((skip & SEQ_MISS) || (!(skip & SEQ_ROLLED) && !step_rolls(t, s))) { seq_release(t); @@ -1845,10 +1827,19 @@ static __attribute__((noinline)) void seq_step(track_t *t, const step_t *s, uint t->ss_tch = t->dtch; /* (0.8.5: the queued hits keep their TOUCH) */ gate += hdel; } + { /* (0.8.5) a kit: each lane's own mode on its hits (TOUCH now, the ratchets after: seq_lane_rat) */ + uint32_t l; + for (l = 0; kit && !(skip & SEQ_REP) && l < NLANE; l++) + if (lm_hits(step_lmode(s, l)) > 1u) + t->lr_on = 1; + } for (i = 0; i < m; i++) if (!((sk >> i) & 1u)) { - uint32_t a0 = vage; + uint32_t a0 = vage, dt0 = t->dtch, lt = kit ? lm_touch(step_lmode(s, drum_lane(nn[i]))) : 0u; + if (lt) + t->dtch = (uint8_t)lt; seq_note_on(t, nn[i], vv[i]); + t->dtch = (uint8_t)dt0; if (bend && !kit && vage != a0) { /* (0.6.42) BEND: its voice glides over the step */ uint32_t k2, ticks = step_samples(t, period, t->seq_idx) / CTL; int32_t d = ((int32_t)(ba % 25u) - 12) * 16; @@ -1897,6 +1888,37 @@ static __attribute__((noinline)) void seq_ratchet(track_t *t, uint32_t period) seq_step(t, s, period, SEQ_REP); } +/* (0.8.5) the lanes ratcheting on the playing step (LM_X2 / X4 / X8, seq_step struck their first part): each again at + * every step / n (the grid RATCH's parts and the held keys' ratchets keep, dxo_tick), that lane's hit and notes alone, + * the step read again (an edit ends it); n: the samples the step moved on in this block */ +static __attribute__((noinline)) void seq_lane_rat(track_t *t, uint32_t period, uint32_t n) +{ + const step_t *s = t->cv_on ? &t->cvs : &seq_steps(t)[seq_src(t, t->seq_idx)]; + uint32_t sl = step_samples(t, period, t->seq_idx), pos = t->seq_pos, prev, l, k, any = 0; + uint32_t vel = (s->flags & SF_ACCENT) ? 127u : (s->vel ? s->vel : 96u); + if (pos >= 0x7FFFFFFFu || s->time != ST_NOTE) { + t->lr_on = 0; + return; + } + prev = pos > n ? pos - n : 0u; + for (l = 0; l < NLANE; l++) { + uint32_t r = lm_hits(step_lmode(s, l)), q, pn; + if (r < 2u) + continue; + any = 1; + q = sl / r; + pn = pos / (q ? q : 1u); + if (pn <= prev / (q ? q : 1u) || pn >= r) + continue; + if ((s->hit >> l) & 1u) + seq_note_on(t, DRUM_LANE_NOTE[l], (s->acc >> l) & 1u ? 127u : vel); + for (k = 0; k < s->n && k < 4u; k++) + if (drum_lane(s->note[k]) == l) + seq_note_on(t, s->note[k], vel); + } + t->lr_on = (uint8_t)any; +} + /* 1/2 TEMPO let go (pfx.c): the track back where it would be had it run on, from where it was pressed */ static __attribute__((noinline)) void pfx_resync(track_t *t, uint32_t period, uint32_t len) { @@ -1935,6 +1957,12 @@ static void seq_tick(track_t *t, uint32_t n) } else { do { /* (0.6.87: HUMAN TIME without a strum: the chord together) */ t->dtch = t->ss_tch; + if (trk_kit(t)) { /* (0.8.5) its lane's TOUCH, from the step playing */ + const step_t *ps = t->cv_on ? &t->cvs : &seq_steps(t)[seq_src(t, t->seq_idx)]; + uint32_t lt = lm_touch(step_lmode(ps, drum_lane(t->ss_nn[t->ss_i]))); + if (lt) + t->dtch = (uint8_t)lt; + } seq_note_on(t, t->ss_nn[t->ss_i], t->ss_vv[t->ss_i]); t->dtch = 0; t->ss_i++; @@ -2016,6 +2044,8 @@ static void seq_tick(track_t *t, uint32_t n) } if (t->rat_left) seq_ratchet(t, period); + if (t->lr_on) + seq_lane_rat(t, period, n); fugue_tick(t, n, period, len); /* (0.6.52) */ } diff --git a/firmware/src/ui.c b/firmware/src/ui.c index f8ba746d..e9ea8529 100644 --- a/firmware/src/ui.c +++ b/firmware/src/ui.c @@ -688,6 +688,7 @@ static void step_clear(step_t *st) st->comp = st->carg = 0; st->comp2 = st->carg2 = st->cwhen = st->ctime = 0; st->probability = 0; + st->lm[0] = st->lm[1] = st->lm[2] = 0; /* (0.8.5) */ } /* ------------------------------------------------------- the DRUM grid --- */ @@ -744,10 +745,26 @@ static void grid_hit(track_t *t, uint32_t i, uint32_t l, uint32_t on) } else { s->hit &= (uint8_t)~b; s->acc &= (uint8_t)~b; + step_set_lmode(s, l % NLANE, LM_NONE); /* (0.8.5) its mode goes with it */ if (!s->n && !s->hit) step_clear(s); } } +/* (0.8.5) the grid's HIT of lane l at step i as one list: --, ON, then its modes x2 x4 x8 SHORT GHOST FLAM (0..7) */ +static const char *const GRID_HIT[LM_N + 1] = {"--", "ON", "x2", "x4", "x8", "SHORT", "GHOST", "FLAM"}; +static uint32_t grid_hit_of(const step_t *s, uint32_t l) +{ + return (step_lanes(s) >> (l % NLANE)) & 1u ? 1u + step_lmode(s, l) : 0u; +} +static void grid_hit_set(track_t *t, uint32_t i, uint32_t l, uint32_t v) +{ + if (!v) { + grid_hit(t, i, l, 0); + return; + } + grid_hit(t, i, l, 1); + step_set_lmode(&t->step[i % NSTEP], l, v - 1u); +} /* the accent of lane l at step i (on 1, off 0, toggled 2); an accent on an empty lane adds the hit */ static void grid_acc(track_t *t, uint32_t i, uint32_t l, uint32_t on) @@ -1006,6 +1023,7 @@ static void load_pat16(track_t *t, const uint8_t *note, const uint8_t *flags) s->vel = n ? 96 : 0; s->hit = s->acc = 0; s->probability = 0; + s->lm[0] = s->lm[1] = s->lm[2] = 0; /* (0.8.5) */ if (drum_track(t)) /* a DRUM track: the lanes' notes as its grid */ step_to_grid(s); } diff --git a/firmware/src/ui_draw.c b/firmware/src/ui_draw.c index a1a97411..2e2a7393 100644 --- a/firmware/src/ui_draw.c +++ b/firmware/src/ui_draw.c @@ -1240,7 +1240,7 @@ static void draw_columns(void) fmt_int(sl + 1, TSEL->p[P_SLEN]); draw_column(0, "STEP", sn, sl, VAL(0u), -1, ICON_AUTO); draw_column(1, "LANE", drum_lane_name(TSEL, ui.lane), "", VAL(1u), -1, ICON_AUTO); - draw_column(2, "HIT", on ? "ON" : "--", "", on ? VAL(2u) : T_DIM, -1, ICON_AUTO); + draw_column(2, "HIT", GRID_HIT[grid_hit_of(st, ui.lane)], "", on ? VAL(2u) : T_DIM, -1, ICON_AUTO); /* (0.8.5: its mode) */ draw_column(3, "ACC", ac ? "ON" : "--", "", ac ? VAL(3u) : T_DIM, -1, ICON_AUTO); return; } diff --git a/firmware/src/ui_input.c b/firmware/src/ui_input.c index 61d88c61..cef70905 100644 --- a/firmware/src/ui_input.c +++ b/firmware/src/ui_input.c @@ -564,7 +564,8 @@ static void page_go(int32_t d) cursor_set((int32_t)(b * 16u + ui.cursor % 16u < len ? b * 16u + ui.cursor % 16u : len - 1u)); } -/* the grid's knobs: 1 STEP (the cursor), 2 LANE, 3 HIT and 4 ACC of the lane at the cursor (right on, left off) */ +/* the grid's knobs: 1 STEP (the cursor), 2 LANE, 3 HIT and 4 ACC of the lane at the cursor (right on, left off; 0.8.5: + * HIT on along its modes, ui.c GRID_HIT) */ static void grid_edit(uint32_t slot, int32_t steps) { if (slot == 0u) @@ -572,7 +573,8 @@ static void grid_edit(uint32_t slot, int32_t steps) else if (slot == 1u) ui.lane = (uint8_t)clamp((int32_t)ui.lane + (steps > 0 ? 1 : -1), 0, NLANE - 1); else if (slot == 2u) - grid_hit(TSEL, ui.cursor, ui.lane, steps > 0); + grid_hit_set(TSEL, ui.cursor, ui.lane, + (uint32_t)clamp((int32_t)grid_hit_of(&TSEL->step[ui.cursor], ui.lane) + (steps > 0 ? 1 : -1), 0, LM_N)); else grid_acc(TSEL, ui.cursor, ui.lane, steps > 0); } diff --git a/tests/drumx_oct_test.c b/tests/drumx_oct_test.c index 4d5d70b5..ccd18bb8 100644 --- a/tests/drumx_oct_test.c +++ b/tests/drumx_oct_test.c @@ -17,6 +17,7 @@ * by its knob. * Built and run by tests/run_tests.sh. */ #define UI_TEST_NO_MAIN 1 +#define PROJ_FUNB_WRITER 1 /* (an older format to load: FUNB, as JIANT 0.2 .. 0.5 wrote it) */ #include "ui_test.c" #define KICK_KEY 7u /* the first C: the kick (36) at OCT 0 */ @@ -68,6 +69,14 @@ static uint32_t run_b(uint32_t nb, uint32_t *at, uint32_t nat, uint32_t *nh) static void key_dn(uint32_t k) { fm1_in.notes |= 1u << k; } static void key_upk(uint32_t k) { fm1_in.notes &= ~(1u << k); } static const drum_lane_t *lane(uint32_t l) { return &drum_kit[3][l]; } +static uint32_t lane_modes_but(const step_t *s, uint32_t l) /* the lanes other than l with a mode (a mask) */ +{ + uint32_t m = 0, k; + for (k = 0; k < NLANE; k++) + if (k != l && step_lmode(s, k)) + m |= 1u << k; + return m; +} /* ---------------------------------------------------------------- audio --- */ /* the engine's own output of the hit on lane l (drum_render at full amplitude: no mix, no sends, no tails) */ @@ -340,10 +349,8 @@ static int rec_up(void) for (k = 0; k < 16u; k++) { const step_t *s = &dt->step[k]; int has = k >= 2u && k <= 4u; - uint32_t dv; - ok &= has ? s->time == ST_NOTE && s->hit == 1u << DV_KICK && step_parts(dt, s, &dv) == R[o] && - (o < 3u ? !s->comp && step_ratchet(s) == R[o] - : s->comp == CP_ECHO && s->carg == (CP_ECHO_EVEN | 6u) && step_ratchet(s) == 1u) + ok &= has ? s->time == ST_NOTE && s->hit == 1u << DV_KICK && lm_hits(step_lmode(s, DV_KICK)) == R[o] && + !s->comp && step_ratchet(s) == 1u && lane_modes_but(s, DV_KICK) == 0u : s->time != ST_NOTE || (!s->hit && !s->n); } nb = 0; @@ -358,7 +365,7 @@ static int rec_up(void) if (!ok) printf("ui: REC OCT +%u: %u hits live, %u played back\n", o, nl, nb); seq_stop(); } - bad += check("REC OCT +1 / +2 / +3: the kick and RATCH x2 / x4 (x8: ECHO EVEN) in each step held; played back as heard", ok); + bad += check("REC OCT +1 / +2 / +3: the kick and the KICK lane's x2 / x4 / x8 in each step held (the step x1); played back as heard", ok); /* an early release in a step it was held into puts that step back */ drum_setup(); song.octave = 1; @@ -372,8 +379,8 @@ static int rec_up(void) run_b(1, 0, 0, &nb); key_upk(KICK_KEY); run_b(2, 0, 0, &nb); - ok = step_ratchet(&dt->step[2]) == 2u && dt->step[2].hit == 1u << DV_KICK && !dt->step[3].hit && - step_ratchet(&dt->step[3]) == 1u && !dxo_n[3]; + ok = step_lmode(&dt->step[2], DV_KICK) == LM_X2 && dt->step[2].hit == 1u << DV_KICK && !dt->step[3].hit && + !step_lm_any(&dt->step[3]) && !dxo_n[3]; seq_stop(); bad += check(" let go early in the next step: that step back as it was (one step recorded)", ok); /* late in a step: into the next one (the sequencer plays its later parts, the live ones stop) */ @@ -390,7 +397,7 @@ static int rec_up(void) run_b(1, 0, 0, &nl); key_upk(KICK_KEY); run_b(4, 0, 0, &nl); - ok = dt->step[7].hit == 1u << DV_KICK && step_ratchet(&dt->step[7]) == 2u && !dt->step[6].hit && !dt->step[8].hit && + ok = dt->step[7].hit == 1u << DV_KICK && step_lmode(&dt->step[7], DV_KICK) == LM_X2 && !dt->step[6].hit && !dt->step[8].hit && nl == 2u; seq_stop(); bad += check(" pressed late in a step: into the next (x2), 2 hits heard, as it plays back", ok); @@ -420,8 +427,9 @@ static int rec_down(void) ok &= lane(DV_KICK)->dm == d; { const step_t *s = &dt->step[6]; - ok &= s->hit == 1u << DV_KICK && s->n == 1u && s->note[0] == 34u && s->comp == CP_TOUCH && s->carg == d - 1u && - step_ratchet(s) == 1u; + ok &= s->hit == 1u << DV_KICK && s->n == 1u && s->note[0] == 34u && !s->comp && step_ratchet(s) == 1u && + step_lmode(s, DV_KICK) == LM_SHORT + d - 1u && step_lmode(s, DV_HATO) == LM_SHORT + d - 1u && + lane_modes_but(s, DV_KICK) == (1u << DV_HATO); } song.octave = 0; drum_kit[3][DV_KICK].dm = drum_kit[3][DV_HATO].dm = 0; @@ -432,7 +440,7 @@ static int rec_down(void) ok &= lane(DV_KICK)->dm == d && lane(DV_HATO)->dm == d && dt->dtch == 0u; seq_stop(); } - bad += check("REC OCT -1 / -2 / -3: the hits and the step's TOUCH SHORT / GHOST / FLAM, played back with it", ok); + bad += check("REC OCT -1 / -2 / -3: each lane's SHORT / GHOST / FLAM (a note on its lane too), played back with it", ok); /* played back, the same sound: the live hit and the sequenced one, the same length */ drum_setup(); strike_dmp(38, 2); @@ -440,8 +448,7 @@ static int rec_down(void) pk0 = peak(0, AN); quiet_kit(); dt->step[0] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_SNARE}; - dt->step[0].comp = CP_TOUCH; - dt->step[0].carg = 1; + step_set_lmode(&dt->step[0], DV_SNARE, LM_GHOST); dt->p[P_SLEN] = 64; seq_start(); nb = 0; @@ -461,6 +468,137 @@ static uint32_t mev(uint32_t st, uint32_t note, uint32_t vel) /* a MIDI event midi_event(st, 3, note, vel); return vage - v0; } +static uint32_t cnt[128]; /* note-ons by note over run_c */ +static void run_c(uint32_t nb) +{ + uint32_t b, i, a0; + for (b = 0; b < nb; b++) { + a0 = vage; + events_block(CTL); + for (i = 0; i < NVOICE; i++) + if (dt->v[i].active && dt->v[i].age > a0) + cnt[dt->v[i].note & 127u]++; + now_s += CTL; + } +} +/* (0.8.5) per sound: each lane's mode on its own hit only */ +static int per_lane(void) +{ + int bad = 0, ok; + uint32_t nb; + drum_setup(); + dt->p[P_SLEN] = 1; /* a one-step loop: the kick plain, the closed hat x4, the snare GHOST */ + dt->step[0] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_KICK | 1u << DV_HATC | 1u << DV_SNARE}; + step_set_lmode(&dt->step[0], DV_HATC, LM_X4); + step_set_lmode(&dt->step[0], DV_SNARE, LM_GHOST); + seq_start(); + memset(cnt, 0, sizeof cnt); + run_c(1); + ok = lane(DV_KICK)->dm == 0u && lane(DV_SNARE)->dm == 2u && lane(DV_HATC)->dm == 0u; + run_c(step_len(0) / CTL - 1u); /* (the rest of the pass) */ + ok &= cnt[36] == 1u && cnt[38] == 1u && cnt[42] == 4u; + run_c(step_len(0) * 3u / CTL); /* three more passes */ + ok &= cnt[36] == 4u && cnt[38] == 4u && cnt[42] == 16u && lane(DV_KICK)->dm == 0u && lane(DV_SNARE)->dm == 2u; + if (!ok) printf("ui: per lane: kick %u snare %u hat %u\n", cnt[36], cnt[38], cnt[42]); + seq_stop(); + bad += check("per sound: kick plain + closed hat x4 + snare GHOST on one step: 1 + 4 + 1 a pass, the kick not damped", ok); + /* the step's own RATCH x2 still repeats it all, the hat's x4 on top of the first part */ + drum_setup(); + dt->p[P_SLEN] = 1; + dt->step[0] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_KICK}; + step_set_ratchet(&dt->step[0], 2); + seq_start(); + memset(cnt, 0, sizeof cnt); + run_c(step_len(0) / CTL); + seq_stop(); + bad += check(" a step's RATCH x2 as before (lanes without a mode)", cnt[36] == 2u); + /* recorded live: the kick at OCT 0 and the closed hat at OCT +2 into the same step, then the snare at OCT -2 */ + drum_setup(); + song.rec = 1u << 3; + seq_start(); + nb = 0; + while (!(dt->seq_idx == 4u && dt->seq_pos < CTL)) + run_b(1, 0, 0, &nb); + key_dn(KICK_KEY); + run_b(2, 0, 0, &nb); + key_upk(KICK_KEY); + song.octave = 2; + key_dn(KICK_KEY + 6u); /* F#: the closed hat */ + run_b(2, 0, 0, &nb); + key_upk(KICK_KEY + 6u); + song.octave = -2; + key_dn(KICK_KEY + 2u); /* D: the snare */ + run_b(2, 0, 0, &nb); + key_upk(KICK_KEY + 2u); + song.octave = 0; + run_b(2, 0, 0, &nb); + { + const step_t *s = &dt->step[4]; + ok = s->hit == (1u << DV_KICK | 1u << DV_HATC | 1u << DV_SNARE) && step_lmode(s, DV_KICK) == LM_NONE && + step_lmode(s, DV_HATC) == LM_X4 && step_lmode(s, DV_SNARE) == LM_GHOST && step_ratchet(s) == 1u && !s->comp; + } + while (dt->seq_idx != 3u) /* the next pass: step 5 plays them each its own way */ + run_b(1, 0, 0, &nb); + memset(cnt, 0, sizeof cnt); + while (dt->seq_idx != 5u) + run_c(1); + ok &= cnt[36] == 1u && cnt[42] == 4u && cnt[38] == 1u && lane(DV_KICK)->dm == 0u && lane(DV_SNARE)->dm == 2u; + seq_stop(); + bad += check("REC per sound: kick OCT 0, hat OCT +2, snare OCT -2 on one step: the kick 1, the hat x4, the snare GHOST", ok); + /* the grid: KNOB 3 HIT goes -- ON x2 x4 x8 SHORT GHOST FLAM on the selected lane */ + drum_setup(); + go_page(GR_ROLL); + frame(); + ui.lane = DV_HATC; + cursor_set(2); + { + uint32_t k; + ok = grid_on() && grid_hit_of(&dt->step[2], DV_HATC) == 0u; + for (k = 1; k <= LM_N; k++) { + grid_edit(2, 1); + ok &= grid_hit_of(&dt->step[2], DV_HATC) == k && ((dt->step[2].hit >> DV_HATC) & 1u) && + step_lmode(&dt->step[2], DV_HATC) == k - 1u; + } + grid_edit(2, 1); + ok &= step_lmode(&dt->step[2], DV_HATC) == LM_FLAM; + frame(); + ui.lane = DV_KICK; + grid_edit(2, 1); + ok &= step_lmode(&dt->step[2], DV_KICK) == LM_NONE && step_lmode(&dt->step[2], DV_HATC) == LM_FLAM; + ui.lane = DV_HATC; + for (k = 0; k < LM_N; k++) + grid_edit(2, -1); + ok &= !((dt->step[2].hit >> DV_HATC) & 1u) && step_lmode(&dt->step[2], DV_HATC) == LM_NONE && + ((dt->step[2].hit >> DV_KICK) & 1u); + } + bad += check("grid KNOB 3 HIT: -- ON x2 x4 x8 SHORT GHOST FLAM, that lane only; off clears its mode", ok); + /* projects: none of these: the steps packed as 0.8.4 packed them (x bit 6 unset); with one, bit 6 and three bytes */ + { + project_t before, after; + project_store_t a, b; + drum_setup(); + dt->step[1] = (step_t){{0}, 0, ST_NOTE, 0, 100, 1u << DV_KICK}; + project_capture(&before); + ok = proj_pack(&a, &before) && proj_step_x(&dt->step[1], &nb) == 1u; + step_set_lmode(&dt->step[1], DV_KICK, LM_FLAM); + project_capture(&before); + ok &= proj_pack(&b, &before) && (proj_step_x(&dt->step[1], &nb) & 64u) && proj_step_size(&dt->step[1]) == 2u + 1u + 2u + 3u && + proj_import(&after, &b, sizeof b) && step_lmode(&after.t[3].step[1], DV_KICK) == LM_FLAM; + dt->step[1].lm[0] = 7u; /* (a 7 reads as none) */ + project_capture(&before); + ok &= proj_pack(&b, &before) && proj_import(&after, &b, sizeof b) && step_lmode(&after.t[3].step[1], DV_KICK) == LM_NONE; + bad += check("FUNC: a step without lane modes as before; with them x bit 6 + 3 bytes, round trip; a 7 none", ok); + dt = &trk[3]; + trk[0].step[3] = (step_t){{36}, 1, ST_NOTE, 0, 100, 1u << DV_SNARE}; + project_capture(&before); + proj_pack_vb(&a, &before); + ok = proj_import(&after, &a, sizeof a) && after.t[0].step[3].hit == 1u << DV_SNARE && !step_lm_any(&after.t[0].step[3]); + for (nb = 0; nb < NSTEP; nb++) + ok &= !step_lm_any(&after.t[0].step[nb]) && !step_lm_any(&after.t[3].step[nb]); + bad += check(" an older project (FUNB) loads with no lane modes, its hits as they were", ok); + } + return bad; +} static int midi(void) { int bad = 0, ok = 1; @@ -525,17 +663,17 @@ static int midi(void) mev(0x80, 26, 0); run_b(2, 0, 0, &nb); seq_stop(); - ok = dt->step[3].hit == 1u << DV_HATC && step_ratchet(&dt->step[3]) == 2u && !dt->step[4].hit && - dt->step[5].hit == 1u << DV_SNARE && dt->step[5].comp == CP_TOUCH && dt->step[5].carg == 0u; + ok = dt->step[3].hit == 1u << DV_HATC && step_lmode(&dt->step[3], DV_HATC) == LM_X2 && !dt->step[4].hit && + dt->step[5].hit == 1u << DV_SNARE && step_lmode(&dt->step[5], DV_SNARE) == LM_SHORT && !dt->step[5].comp; bad += check("MIDI REC: 90 the closed hat x2, 26 the snare SHORT, each into its step", ok); { /* FUNC round trip */ project_t before, after; project_store_t packed; project_capture(&before); ok = proj_pack(&packed, &before) && proj_import(&after, &packed, sizeof packed) && - step_ratchet(&after.t[3].step[3]) == 2u && after.t[3].step[5].comp == CP_TOUCH && after.t[3].step[5].carg == 0u && - after.t[3].step[5].hit == 1u << DV_SNARE; - bad += check(" the recorded steps (RATCH x2, TOUCH SHORT) through a project save and load", ok); + step_lmode(&after.t[3].step[3], DV_HATC) == LM_X2 && step_lmode(&after.t[3].step[5], DV_SNARE) == LM_SHORT && + after.t[3].step[5].hit == 1u << DV_SNARE && !memcmp(&before, &after, sizeof before); + bad += check(" the recorded steps (the hat x2, the snare SHORT) through a project save and load, every byte", ok); } return bad; } @@ -595,6 +733,7 @@ int main(void) bad += rec_up(); bad += rec_down(); bad += midi(); + bad += per_lane(); bad += ui_part(); if (bad) { printf("drumx octaves: %d FAILED\n", bad); diff --git a/tests/editor_test.c b/tests/editor_test.c index ede8e898..0239f083 100644 --- a/tests/editor_test.c +++ b/tests/editor_test.c @@ -148,20 +148,21 @@ static int preferences(void) uint32_t n = request(ED_INFO, a, 0); bad += check("INFO explicitly tags display capabilities after SONG without changing command 33", ED_SONG == 33 && ED_UI_STATE == 34 && ED_FAV_SET == 38 && - host_wire[n - 37] == CHAIN_ROWS && host_wire[n - 36] == 0x55 && - host_wire[n - 35] == 1 && host_wire[n - 34] == 9 && - host_wire[n - 33] == 0x4d && host_wire[n - 32] == 1 && - host_wire[n - 31] == MOTION_MAX && host_wire[n - 30] == 1 && - host_wire[n - 29] == 0x42 && host_wire[n - 28] == 1 && host_wire[n - 27] == 3 && - host_wire[n - 26] == 0x46 && host_wire[n - 25] == 1 && host_wire[n - 24] == FM6_NFACTORY && - host_wire[n - 23] == 0 && /* (no bank since 1.0.3) */ - host_wire[n - 22] == 0x53 && host_wire[n - 21] == 1 && host_wire[n - 20] == 3 && - host_wire[n - 19] == 0x50 && host_wire[n - 18] == 1 && host_wire[n - 17] == 3 && /* FM6 v2: no bank, preset patches */ - host_wire[n - 16] == 0x4E && host_wire[n - 15] == 1 && host_wire[n - 14] == 21 && /* MENU settings: 21 items (0.6.72: MIDI OUT) */ - host_wire[n - 13] == 0x52 && host_wire[n - 12] == 1 && host_wire[n - 11] == 4 && /* RATCH */ - host_wire[n - 10] == 0x4C && host_wire[n - 9] == 1 && host_wire[n - 8] == 1 && /* 1.1 parameter locks */ - host_wire[n - 7] == 0x56 && host_wire[n - 6] == 1 && host_wire[n - 5] == 32 && /* (0.6.11) FM6 voice bank */ - host_wire[n - 4] == 0x4A && host_wire[n - 3] == 1 && host_wire[n - 2] == 1); /* (0.6.62) JIANT: the installer */ + host_wire[n - 40] == CHAIN_ROWS && host_wire[n - 39] == 0x55 && + host_wire[n - 38] == 1 && host_wire[n - 37] == 9 && + host_wire[n - 36] == 0x4d && host_wire[n - 35] == 1 && + host_wire[n - 34] == MOTION_MAX && host_wire[n - 33] == 1 && + host_wire[n - 32] == 0x42 && host_wire[n - 31] == 1 && host_wire[n - 30] == 3 && + host_wire[n - 29] == 0x46 && host_wire[n - 28] == 1 && host_wire[n - 27] == FM6_NFACTORY && + host_wire[n - 26] == 0 && /* (no bank since 1.0.3) */ + host_wire[n - 25] == 0x53 && host_wire[n - 24] == 1 && host_wire[n - 23] == 3 && + host_wire[n - 22] == 0x50 && host_wire[n - 21] == 1 && host_wire[n - 20] == 3 && /* FM6 v2: no bank, preset patches */ + host_wire[n - 19] == 0x4E && host_wire[n - 18] == 1 && host_wire[n - 17] == 21 && /* MENU settings: 21 items (0.6.72: MIDI OUT) */ + host_wire[n - 16] == 0x52 && host_wire[n - 15] == 1 && host_wire[n - 14] == 4 && /* RATCH */ + host_wire[n - 13] == 0x4C && host_wire[n - 12] == 1 && host_wire[n - 11] == 1 && /* 1.1 parameter locks */ + host_wire[n - 10] == 0x56 && host_wire[n - 9] == 1 && host_wire[n - 8] == 32 && /* (0.6.11) FM6 voice bank */ + host_wire[n - 7] == 0x4A && host_wire[n - 6] == 1 && host_wire[n - 5] == 1 && /* (0.6.62) JIANT: the installer */ + host_wire[n - 4] == 0x4F && host_wire[n - 3] == 1 && host_wire[n - 2] == LM_N); /* (0.8.5) DRUM lane modes */ request(ED_UI_SET, a, 2); bad += check("UI_SET updates the actual palette and reports RAM-only saving", host_wire[5] == 3 && settings.palette == 7 && T_BG == UI_PALETTES[7].bg); @@ -314,6 +315,28 @@ static int steps(void) a[14] = 1; n = request(ED_TRACK_STEP, a, 15); bad += check("TRACK_STEP sets the ratchet of any track (x4, then back to x1)", ok && n == 21u && step_ratchet(&trk[1].step[2]) == 1u && !(trk[1].step[2].flags & SF_RATCH)); + /* (0.8.5, INFO 4F 01 07) the lanes' modes: 8 bytes after the ratchet, in a reply only when asked for */ + memcpy(a, (const uint8_t[]){0, 0, 0, 0, 0, 0, ST_NOTE, 0, 100, 0x09, 0, 0, 100, 1, 0, 0, 0, 2, 0, 0, 0, 0}, 22); + n = request(ED_STEP_SET, a, 22); + ok = n == 28u && step_lmode(&TSEL->step[0], DV_HATC) == LM_X4 && host_wire[n - 9 + DV_HATC] == LM_X4 && + TSEL->step[0].hit == 0x09 && step_ratchet(&TSEL->step[0]) == 1u; + n = request(ED_STEP_SET, a, 14); + ok &= n == 20u && step_lmode(&TSEL->step[0], DV_HATC) == LM_X4; + a[1] = 1; n = request(ED_STEP_GET, a, 2); + ok &= n == 28u && host_wire[n - 9 + DV_HATC] == LM_X4; + n = request(ED_STEP_GET, a, 1); + ok &= n == 20u; + bad += check("STEP_SET / STEP_GET the lanes' modes (8 after the ratchet); without them kept, replies as before", ok); + before = TSEL->step[0]; + memcpy(a, (const uint8_t[]){0, 0, 0, 0, 0, 0, ST_NOTE, 0, 100, 0x09, 0, 0, 100, 1, 0, 0, 0, 7, 0, 0, 0, 0}, 22); + bad += check("STEP_SET refuses a lane mode past 6 and leaves the step", + !request(ED_STEP_SET, a, 22) && !memcmp(&before, &TSEL->step[0], sizeof before)); + memcpy(a, (const uint8_t[]){3, 5, 0, 0, 0, 0, 0, ST_NOTE, 0, 100, 1, 0, 0, 100, 1, 6, 0, 0, 0, 0, 0, 0, 0}, 23); + n = request(ED_TRACK_STEP, a, 23); + ok = n == 29u && step_lmode(&trk[3].step[5], DV_KICK) == LM_FLAM; + a[2] = 1; n = request(ED_TRACK_STEP, a, 3); + bad += check("TRACK_STEP the lanes' modes of any track (FLAM on the kick; a read with 1 replies them)", + ok && n == 29u && host_wire[n - 9 + DV_KICK] == LM_FLAM); return bad; } diff --git a/tools/gen_cheatsheets.py b/tools/gen_cheatsheets.py index 82f0752e..a3feea0b 100644 --- a/tools/gen_cheatsheets.py +++ b/tools/gen_cheatsheets.py @@ -7,7 +7,7 @@ import html, os R = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) OUT = os.path.join(R, 'docs', 'cheatsheet') -VERSION = 'v0.8.4' +VERSION = 'v0.8.5' HEAT = ['#22d3ee', '#3b82f6', '#8b5cf6', '#d946ef', '#ef4444', '#ff7a00', '#facc15', '#f4f1ea'] @@ -133,7 +133,7 @@ def controls(): ('ALGORITHM', 'Selects the track from any page: T1–T4, or T1–T6 with TRACKS 6.'), ('KNOB 1–4', 'The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: ' 'the layer\'s.'), - ('OCT− · OCT+', 'The keyboard\'s octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM. On action pages and dialogs: back / confirm.'), + ('OCT− · OCT+', 'The keyboard\'s octave (both together: back to 0); on DRUM the kit stays put: +1/+2/+3 ratchet x2/x4/x8, −1 SHORT, −2 GHOST, −3 FLAM, each sound its own (grid KNOB 3 HIT). On action pages and dialogs: back / confirm.'), ('PLAY', 'Start / stop. GLO + PLAY: restart from the top.'), ('REC', 'Arms live recording on the selected track (notes and knob moves, overdub).'), ('HOME', 'Tap: the ecosystem. Hold: the MENU.'), diff --git a/web/EDITOR_PROTOCOL.md b/web/EDITOR_PROTOCOL.md index 6c508910..987027ed 100644 --- a/web/EDITOR_PROTOCOL.md +++ b/web/EDITOR_PROTOCOL.md @@ -35,6 +35,9 @@ ends with the item's tab on the device (index and name), after the bytes 1.0.4 s **Ratchet (1.0.5, INFO `52 01 04`):** a step gets a ratchet byte (its hits, 1..4) after its chance: one more byte at the end of the step replies, and an optional last byte of a step write (see "Ratchet" below). Nothing else changed. +**DRUM lane modes (JIANT 0.8.5, INFO `4F 01 07`):** a step gets 8 more bytes after its ratchet, each DRUM lane's mode +0..6 (see "DRUM lane modes" below). Nothing else changed. + **Parameter locks (1.1, INFO `4C 01 01`):** a motion record can be a lock: its value sounds on its step only and goes back after it. `MOTION` (64) gets ops 5..7 (set a lock, clear a step's locks, the query with the kinds); the query and ops 1..4 reply byte for byte as before (see "Parameter locks" below). A lock takes no new bytes in a @@ -208,13 +211,13 @@ at 1..3 and hides 6 5 8: what it sets still plays the right kit, and the device | cmd | Request args | Reply args | | --- | --- | --- | -| 1 INFO | — | version string, NENGINES, P_COUNT, G_COUNT, NSTEP, P_E0, then NENGINES engine-name strings, then (v3) NTRK (6 since JIANT 0.6, 4 before), then (v6) CHAIN_ROWS (16), then the tagged blocks `55 01 uiCaps`, `4D 01 64 01`, `42 01 3`, `46 01 nfactory nbank`, `53 01 3`, (1.0.3) `50 01 3` and (1.0.4) `4E 01 count` (MENU settings; 12, 1.1: 15, 1.2: 17, 1.1.5: 18) and (1.0.5) `52 01 4` (ratchet) and (1.1) `4C 01 1` (parameter locks) and (JIANT 0.6.11) `56 01 32` (FM6's voice bank) (below); older firmware ends earlier | +| 1 INFO | — | version string, NENGINES, P_COUNT, G_COUNT, NSTEP, P_E0, then NENGINES engine-name strings, then (v3) NTRK (6 since JIANT 0.6, 4 before), then (v6) CHAIN_ROWS (16), then the tagged blocks `55 01 uiCaps`, `4D 01 64 01`, `42 01 3`, `46 01 nfactory nbank`, `53 01 3`, (1.0.3) `50 01 3` and (1.0.4) `4E 01 count` (MENU settings; 12, 1.1: 15, 1.2: 17, 1.1.5: 18) and (1.0.5) `52 01 4` (ratchet) and (1.1) `4C 01 1` (parameter locks) and (JIANT 0.6.11) `56 01 32` (FM6's voice bank) and (JIANT 0.6.62) `4A 01 1` (JIANT) and (JIANT 0.8.5) `4F 01 7` (DRUM lane modes) (below); older firmware ends earlier | | 2 GET | scope, id | scope, id, v14 | | 3 SET | scope, id, v14 | scope, id, v14 (the value after clamping). Setting global `G_ENGSEL` (id from DESC label "ENG") changes the engine: its defaults, then its first preset (as on the device) | | 4 DUMP | — | engine, preset, then P_COUNT × v14 (the selected track), then G_COUNT × v14 (globals) | | 5 DESC | scope, id | scope, id, fmt, min v14, max v14, def v14, label string, unit string, then for an enum (fmt 8) one name string per value (at most 32 since 0.7.0; 24 before it, 16 before the matrix) | -| 6 STEP_GET | index 0..NSTEP−1 | index, n (0..4 notes), note0..note3, time (0 NOTE, 1 TIE, 2 REST), flags (1 accent, 2 slide), vel, then (v5) hits (3 bytes, below), then (v7) chance 0..100, then (`52 01`) ratchet 1..4 | -| 7 STEP_SET | index, n, note0..3, time, flags, vel [, hits (3 bytes, v5) [, chance 0..100 (v7) [, ratchet 1..4]]] | same as STEP_GET (after the write). Without the hits the step keeps its own; without the chance or the ratchet it keeps its own. The chance can only follow the hits, the ratchet the chance | +| 6 STEP_GET | index 0..NSTEP−1 | index, n (0..4 notes), note0..note3, time (0 NOTE, 1 TIE, 2 REST), flags (1 accent, 2 slide), vel, then (v5) hits (3 bytes, below), then (v7) chance 0..100, then (`52 01`) ratchet 1..4, then (`4F 01`) 8 lane modes 0..6 | +| 7 STEP_SET | index, n, note0..3, time, flags, vel [, hits (3 bytes, v5) [, chance 0..100 (v7) [, ratchet 1..4 [, 8 lane modes 0..6 (`4F 01`)]]]] | same as STEP_GET (after the write). Without the hits the step keeps its own; without the chance, the ratchet or the lane modes it keeps its own. The chance can only follow the hits, the ratchet the chance, the lane modes the ratchet | | 8 PRESET | engine, preset | engine, preset (applies the preset's sound to the selected track and sends; the steps and the track's own parameters stay, see "Sound loads and undo"). For another track, select it with `TRACK` first | | 9 PROJECT | op (0 load, 1 save, 2 query), slot 0..3 | op, slot, used (1/0). Save writes flash: allow ~2 s; it stops the transport first (see "Saves while playing") | | 10 NAMES | engine | engine, count, count preset-name strings, then the two edit-page titles | @@ -236,7 +239,7 @@ at 1..3 and hides 6 5 8: what it sets still plays the right kit, and the device | 27 TRACK | — (query), or track (select it) | selected track, NTRK, then per track: engine byte, preset, level v14, mute (0/1), armed (0/1, live recording) | | 28 TRACK_MIX | track (get), or track, level v14 (0..127), mute (set) | track, level v14, mute: the track's `P_LEVEL` and `P_MUTE` | | 29 TRACK_DUMP | track | track, engine byte, preset, P_COUNT × v14 (that track's parameters; no globals) | -| 30 TRACK_STEP | track, index (get), or track, index, n, note0..3, time, flags, vel [, hits (v5) [, chance (v7) [, ratchet]]] (set) | track, index, n, note0..3, time, flags, vel, then (v5) hits, then (v7) chance, then (`52 01`) ratchet | +| 30 TRACK_STEP | track, index (get), or track, index, n, note0..3, time, flags, vel [, hits (v5) [, chance (v7) [, ratchet [, 8 lane modes]]]] (set) | track, index, n, note0..3, time, flags, vel, then (v5) hits, then (v7) chance, then (`52 01`) ratchet, then (`4F 01`) 8 lane modes | | cmd (v4) | Request args | Reply args | | --- | --- | --- | @@ -607,6 +610,22 @@ ratchet byte (read every step as 1). before the ratchet refuses a project that holds one. A user preset's note pattern keeps it in its flags (8 | 16); a drum grid record has no room for it and loads x1. +## DRUM lane modes + +INFO advertises `4F 01 7` at the end of its tags (JIANT 0.8.5): each step holds a mode for each of the 8 DRUM lanes +(BD SD CP CH OH TM RS CB), 0 none, 1 x2, 2 x4, 3 x8 (that lane's hit and its notes ratcheted over the step), 4 SHORT, +5 GHOST, 6 FLAM (how it is struck). That lane only: the rest of the step plays as it is. Firmware without the tag has +none (read every lane as 0). + +- `STEP_GET` / `STEP_SET` / `TRACK_STEP`: 8 bytes after the ratchet, lane 0 first. A write without them (an older + editor) keeps the step's; a write with them must carry the chance and the ratchet before. An editor that does not + know them reads the 13 bytes it knows and ignores the rest. +- On the device: what the keys record at OCT ≠ 0 on a DRUM track (and MIDI notes outside 35..81); SEQ > STEP's grid, + KNOB 3 HIT of the selected lane: --, ON, x2, x4, x8, SHORT, GHOST, FLAM. +- Saved in projects (FUNC: bit 6 of a step's extension byte, then 3 bytes, 3 bits a lane; every older project has + none), so in backups and song rows too. Firmware before 0.8.5 refuses a project that holds one (an extension bit it + does not know). User presets' patterns have no room for them. + ## Parameter locks INFO advertises `4C 01 1` after the ratchet tag (`52 01 4`). Firmware without it has no locks. diff --git a/web/editor.html b/web/editor.html index 7ddfac5a..8c1fc0c2 100644 --- a/web/editor.html +++ b/web/editor.html @@ -397,6 +397,10 @@ function readHits(r, o) { if (o.chance > 100) throw new Error("Invalid step chance"); o.ratchet = r.i < r.a.length ? r.b() : 1; /* RATCH (INFO 52 01): the step's hits 1..4; older firmware: 1 */ if (o.ratchet < 1 || o.ratchet > 4) throw new Error("Invalid step ratchet"); + if (r.i + 8 <= r.a.length) { /* (0.8.5, INFO 4F 01 07) each DRUM lane's mode 0..6; older firmware: none */ + o.lanes = []; + for (let l = 0; l < 8; l++) { const m = r.b(); if (m > 6) throw new Error("Invalid step lane mode"); o.lanes.push(m); } + } return o; } @@ -428,6 +432,7 @@ const parse = { o.syncCaps = 0; /* live sync: bit 0 WATCH while on keeps pending pushes, bit 1 no RELOAD */ o.ratchet = 0; /* a step's ratchet (STEP_SET's byte after the chance), 0 = none */ o.fm6Bank = 0; /* (JIANT 0.6.11) FM6's voice bank: its voices (cmds 74..77), 0 = none */ + o.laneModes = 0; /* (JIANT 0.8.5) a step's DRUM lane modes (7: none x2 x4 x8 SHORT GHOST FLAM) */ for (const p of [8, 11]) if (o.motionMax && trailer[p] === 0x46 && trailer[p + 1] === 1) { /* for the editor's */ o.fm6 = { factory: trailer[p + 2], bank: trailer[p + 3], caps: 0 }; /* PRESET / G_ENGSEL */ if (trailer[p + 4] === 0x53 && trailer[p + 5] === 1) o.syncCaps = trailer[p + 6] & 3; @@ -438,6 +443,8 @@ const parse = { if (o.syncCaps && trailer[r] === 0x52 && trailer[r + 1] === 1) { o.ratchet = trailer[r + 2]; r += 3; } /* RATCH: max hits */ if (trailer[r] === 0x4C && trailer[r + 1] === 1) r += 3; /* parameter locks (1.1) */ if (trailer[r] === 0x56 && trailer[r + 1] === 1) o.fm6Bank = trailer[r + 2]; /* (0.6.11) the voice bank's size */ + for (let k = r; k + 2 < trailer.length; k += 3) /* (0.8.5) 'O': the steps' lane modes */ + if (trailer[k] === 0x4F && trailer[k + 1] === 1) { o.laneModes = trailer[k + 2]; break; } } return o; }, @@ -586,14 +593,16 @@ const req = { set: (scope, id, v) => [CMD.SET, [scope, id, ...v14enc(v)]], dump: () => [CMD.DUMP, []], desc: (scope, id) => [CMD.DESC, [scope, id]], - stepGet: (i) => [CMD.STEP_GET, [i]], + stepGet: (i, lanes) => [CMD.STEP_GET, lanes ? [i, 1] : [i]], /* (0.8.5: lanes, INFO 4F 01: the lanes' modes too) */ stepSet: (i, st) => { const n = Math.max(0, Math.min(4, st.n | 0)); const notes = [0, 1, 2, 3].map((k) => (st.notes[k] | 0) & 0x7F); return [CMD.STEP_SET, [i, n, ...notes, Math.max(0, Math.min(2, st.time | 0)), st.flags & 3, (st.vel | 0) & 0x7F, ...(st.hit == null && st.chance == null ? [] : hitsEnc(st.hit | 0, st.acc | 0)), ...(st.chance == null ? [] : [Math.max(0, Math.min(100, st.chance | 0))]), - ...(st.chance == null || st.ratchet == null ? [] : [Math.max(1, Math.min(4, st.ratchet | 0))])]]; /* (only after the chance) */ + ...(st.chance == null || st.ratchet == null ? [] : [Math.max(1, Math.min(4, st.ratchet | 0))]), /* (only after the chance) */ + ...(st.chance == null || st.ratchet == null || !st.lanes ? [] : /* (0.8.5) the lanes' modes: only after the ratchet, */ + Array.from({ length: 8 }, (_, l) => Math.max(0, Math.min(6, st.lanes[l] | 0))))]]; /* read from a device that has them */ }, preset: (e, p) => [CMD.PRESET, [e & 0x7F, p & 0x7F]], project: (op, slot) => { if (![0, 1, 2].includes(op)) throw new Error("bad PROJECT op"); return [CMD.PROJECT, [op, slot & 3]]; }, /* 0 load, 1 save, 2 query */ @@ -625,7 +634,7 @@ const req = { track: (sel) => [CMD.TRACK, sel == null ? [] : [sel & 0x7F]], trackMix: (tr, level, mute) => [CMD.TRACK_MIX, level == null ? [tr & 0x7F] : [tr & 0x7F, ...v14enc(level), mute ? 1 : 0]], trackDump: (tr) => [CMD.TRACK_DUMP, [tr & 0x7F]], - trackStep: (tr, i, st) => [CMD.TRACK_STEP, st ? [tr & 0x7F, ...req.stepSet(i, st)[1]] : [tr & 0x7F, i & 0x7F]], + trackStep: (tr, i, st, lanes) => [CMD.TRACK_STEP, st ? [tr & 0x7F, ...req.stepSet(i, st)[1]] : lanes ? [tr & 0x7F, i & 0x7F, 1] : [tr & 0x7F, i & 0x7F]], /* v4: get (v == null) or set parameter id (P_*) of track tr, clamped as SET */ trackParam: (tr, id, v) => [CMD.TRACK_PARAM, v == null ? [tr & 0x7F, id & 0x7F] : [tr & 0x7F, id & 0x7F, ...v14enc(v)]], /* FM6 patches (firmware with info.fm6) */ @@ -1785,12 +1794,15 @@ function makeMockDevice(opt = {}) { : { engine: st.engine, name, p: st.p.slice(), pattern: patternFromSteps(st.step), grid: null, fm6 }; }; const ratchetOn = () => !!syncCaps() && !opt.noRatchet; /* (INFO 52 01 04, after the sync tag) */ - const stepOut = (x, b) => { b(x.n); x.notes.forEach(b); b(x.time); b(x.flags); b(x.vel); hitsEnc(x.hit, x.acc).forEach(b); if (!opt.legacy && !opt.v3 && !opt.v5) b(x.chance ?? 100); if (ratchetOn()) b(x.ratchet ?? 1); }; + const lanesOn = () => ratchetOn() && !opt.noLanes; /* (0.8.5, INFO 4F 01 07, after the voice bank) */ + const stepOut = (x, b, lanes) => { b(x.n); x.notes.forEach(b); b(x.time); b(x.flags); b(x.vel); hitsEnc(x.hit, x.acc).forEach(b); if (!opt.legacy && !opt.v3 && !opt.v5) b(x.chance ?? 100); if (ratchetOn()) b(x.ratchet ?? 1); + if (lanes && lanesOn()) for (let l = 0; l < 8; l++) b(x.lanes ? x.lanes[l] : 0); }; /* (0.8.5: asked for, editor.c) */ function stepIn(x, a) { /* editor.c ed_step_put: n, 4 notes, time, flags, vel [, hits (3) [, chance [, ratchet]]] */ x.n = Math.min(4, a[0]); x.notes = a.slice(1, 5); x.time = Math.min(2, a[5]); x.flags = a[6] & 3; x.vel = a[7]; if (a.length >= 11) { x.hit = a[8] | (a[10] & 1) << 7; x.acc = (a[9] | (a[10] & 2) << 6) & x.hit; } if (a.length >= 12) x.chance = Math.min(100, a[11]); if (a.length >= 13 && ratchetOn()) x.ratchet = Math.max(1, Math.min(4, a[12])); + if (a.length >= 21 && lanesOn()) x.lanes = a.slice(13, 21).map((m) => (m > 6 ? 0 : m)); } /* a few user presets to start with, each with its preset's suggested pattern stored (as UP_STORE would) */ [[0, 0, 0, "MY LEAD"], [1, FM6_E, 1, "GLASS BELL"], [2, 2, 3, "PHASE RESO"], [5, 3, 2, "8BIT ARP"]].forEach(([slot, e, p, name]) => { @@ -1955,7 +1967,8 @@ function makeMockDevice(opt = {}) { b(16); if (st.uiCaps) { b(0x55); b(1); b(st.uiCaps); b(0x4d); b(1); b(64); b(1); if (!opt.noFm6) { b(0x46); b(1); b(FM6.FACTORY_PK.length); b(0); } if (syncCaps()) { b(0x53); b(1); b(syncCaps()); if (!opt.noFm6) { b(0x50); b(1); b(3); } if (ratchetOn()) { b(0x52); b(1); b(4); } - if (!opt.noFm6 && !opt.noVbank && ratchetOn()) { b(0x56); b(1); b(32); } } } /* (FM6 v2: no bank, preset patches; 0.6.11: the voice bank) */ + if (!opt.noFm6 && !opt.noVbank && ratchetOn()) { b(0x56); b(1); b(32); } + if (lanesOn()) { b(0x4F); b(1); b(7); } } } /* (FM6 v2: no bank, preset patches; 0.6.11: the voice bank; 0.8.5: the lanes' modes) */ } break; case CMD.GET: case CMD.SET: { @@ -2006,7 +2019,7 @@ function makeMockDevice(opt = {}) { if (a.length < 2 || a[0] >= NTRK || a[1] >= NSTEP) return null; const x = st.tracks[a[0]].step[a[1]]; if (a.length >= 10) stepIn(x, a.slice(2)); - b(a[0]); b(a[1]); stepOut(x, b); + b(a[0]); b(a[1]); stepOut(x, b, a.length === 23 || (a.length === 3 && a[2] === 1)); break; } case CMD.DESC: { @@ -2021,7 +2034,7 @@ function makeMockDevice(opt = {}) { if (a.length < 1 || a[0] >= NSTEP) return null; const x = st.step[a[0]]; if (cmd === CMD.STEP_SET && a.length >= 9) stepIn(x, a.slice(1)); - b(a[0]); stepOut(x, b); + b(a[0]); stepOut(x, b, a.length === 22 || (cmd === CMD.STEP_GET && a.length === 2 && a[1] === 1)); break; } case CMD.FM6B_BEGIN: case CMD.FM6B_WRITE: case CMD.FM6B_END: case CMD.FM6B_LIST: { /* (0.6.11) fm6_vbank.c */ @@ -2817,7 +2830,7 @@ async function sessionRequest(d, r, opt) { const rq = (r, opt) => sessionRequest(dev, r, opt); async function getDesc(scope, id, d = dev) { return parse[CMD.DESC](await sessionRequest(d, req.desc(scope, id))); } async function getDump(d = dev) { const reply = await sessionRequest(d, req.dump()); lastDump = Date.now(); return parse[CMD.DUMP](reply, d.info); } -async function getStep(i, d = dev) { return parse[CMD.STEP_GET](await sessionRequest(d, req.stepGet(i))); } +async function getStep(i, d = dev) { return parse[CMD.STEP_GET](await sessionRequest(d, req.stepGet(i, !!(d && d.info && d.info.laneModes)))); } /* the whole connect sequence */ async function load(d) { diff --git a/web/index_pkg.html b/web/index_pkg.html index a7762a5f..6f59c875 100644 --- a/web/index_pkg.html +++ b/web/index_pkg.html @@ -46,15 +46,15 @@


- +