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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
This commit is contained in:
Claude committed 2026-10-17 01:17:17 +00:00
1 parent 34bdd4f652
commit a05a1909ba
17 files changed
+1129 -55

No files matched your search

+35 -1
View File
@@ -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.
+39 -1
View File
@@ -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
+39 -1
View File
@@ -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
+1 -1
View File
@@ -53,7 +53,7 @@ ul { padding-left: 18px; } li { margin: 2px 0; }
<h1>JIANT FM · CONTROLS</h1><h2>every button, knob, layer, combo and page</h2>
<div class="ver">firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT</div></div></header>
<div class="rule"></div>
<div class="sec">THE PANEL<span></span></div><div class="grid g2"><div class="card" style="--c:#22d3ee" ><h3>KNOBS AND TRANSPORT</h3><table><tr><td class="n">MASTER</td><td>Master volume.</td></tr><tr><td class="n">SELECT</td><td><b>Scrolls the section's pages</b> (SEQ: <b>zooms</b> PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its <b>dice</b> (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.</td></tr><tr><td class="n">PRESETS</td><td>Browses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. <b>Hold a page button + PRESETS: jump through its pages.</b></td></tr><tr><td class="n">ALGORITHM</td><td>Selects the track from any page: T1–T4, or T1–T6 with TRACKS 6.</td></tr><tr><td class="n">KNOB 1–4</td><td>The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.</td></tr><tr><td class="n">OCT− · OCT+</td><td>The keyboard's octave (both together: back to 0). On action pages and dialogs: back / confirm.</td></tr><tr><td class="n">PLAY</td><td>Start / stop. GLO + PLAY: restart from the top.</td></tr><tr><td class="n">REC</td><td>Arms live recording on the selected track (notes and knob moves, overdub).</td></tr><tr><td class="n">HOME</td><td>Tap: the ecosystem. <b>Hold: the MENU.</b></td></tr><tr><td class="n">KEYS</td><td>27 keys play the selected track in its scale; with a layer held they become that layer's.</td></tr></table></div><div class="card" style="--c:#8b5cf6" ><h3>PAGE BUTTONS</h3><table class="pages"><tr><th>BUTTON</th><th>TAP: ITS PAGES, ONE PER TAP</th><th>HOLD</th></tr><tr><td class="n">ENV</td><td>ENV · ENV DEST</td><td class="dim">—</td></tr><tr><td class="n">LFO</td><td>LFO · LFO DEST · MOD · MSEQ · MSEQ 2</td><td class="dim">MACROS M1–M4 (stay latched)</td></tr><tr><td class="n">FX</td><td>FX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)</td><td class="dim">PUNCH-IN FX</td></tr><tr><td class="n">SCL</td><td>SCL · CHORD</td><td class="dim">ROOT by key</td></tr><tr><td class="n">EDIT</td><td>EDIT 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)</td><td class="dim">INIT · RECALL · sound mutes</td></tr><tr><td class="n">GLO</td><td>MIXER · GLOBAL · SYSTEM</td><td class="dim">MUTE · SOLO · LEVEL · TAP</td></tr><tr><td class="n">SAVE</td><td>PRESETS · USER · PROJECT · ARRANGE · TOOLS</td><td class="dim">SONG layer</td></tr><tr><td class="n">ARP</td><td>ARP · ARP 2</td><td class="dim">—</td></tr><tr><td class="n">SEQ</td><td>the zoom level&#x27;s sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2</td><td class="dim">SEQ TOOLS</td></tr><tr><td class="n">REC</td><td>(transport)</td><td class="dim">CLEAR · CLICK</td></tr></table><p style="margin-top:10px"><span class="k v">BUTTON</span> + <span class="k v">PRESETS</span> jumps through its pages (no wrap). <span class="k v">SELECT</span> alone scrolls the section's pages.</p></div></div><div class="sec">LAYERS · HOLD A BUTTON<span></span></div><div class="grid g2"><div class="card" style="--c:#ff7a00" ><h3>FX · PUNCH-IN EFFECTS</h3><div class="kb"><div class="w on" style="left:0.0px;width:40.2px"><b>F3</b>REP 1/8</div><div class="w on" style="left:43.2px;width:40.2px"><b>G3</b>REP 1/16</div><div class="w on" style="left:86.5px;width:40.2px"><b>A3</b>REP 1/32</div><div class="w on" style="left:129.8px;width:40.2px"><b>B3</b>LPF</div><div class="w on" style="left:173.0px;width:40.2px"><b>C4</b>HPF</div><div class="w on" style="left:216.2px;width:40.2px"><b>D4</b>OCT−</div><div class="w on" style="left:259.5px;width:40.2px"><b>E4</b>OCT+</div><div class="w on" style="left:302.8px;width:40.2px"><b>F4</b>½ TEMPO</div><div class="w on" style="left:346.0px;width:40.2px"><b>G4</b>DEC−</div><div class="w on" style="left:389.2px;width:40.2px"><b>A4</b>DEC+</div><div class="w on" style="left:432.5px;width:40.2px"><b>B4</b>STUT 1/8</div><div class="w on" style="left:475.8px;width:40.2px"><b>C5</b>STUT 1/16</div><div class="w on" style="left:519.0px;width:40.2px"><b>D5</b>ATK+</div><div class="w on" style="left:562.2px;width:40.2px"><b>E5</b>ARP</div><div class="w on" style="left:605.5px;width:40.2px"><b>F5</b>RAND</div><div class="w on" style="left:648.8px;width:40.2px"><b>G5</b>ERASE</div><div class="b on" style="left:27.7px;width:31.1px"><b>F#</b>M1</div><div class="b on" style="left:70.9px;width:31.1px"><b>G#</b>M2</div><div class="b on" style="left:114.2px;width:31.1px"><b>A#</b>M3</div><div class="b on" style="left:200.7px;width:31.1px"><b>C#</b>M4</div><div class="b on" style="left:243.9px;width:31.1px"><b>D#</b>M5</div><div class="b on"Line truncated
<div class="sec">THE PANEL<span></span></div><div class="grid g2"><div class="card" style="--c:#22d3ee" ><h3>KNOBS AND TRANSPORT</h3><table><tr><td class="n">MASTER</td><td>Master volume.</td></tr><tr><td class="n">SELECT</td><td><b>Scrolls the section's pages</b> (SEQ: <b>zooms</b> PATTERN · BAR · STEP; HOME: GEN, the song generator). Held with a button, its <b>dice</b> (OK keeps, CANCEL back): HOME everything, EDIT the sound, SEQ the sequence, LFO the LFO, FX the effects. GLO + SELECT: the tempo.</td></tr><tr><td class="n">PRESETS</td><td>Browses the sounds (factory and user). On step, list and song pages: the cursor / the row; SEQ at PATTERN: the bar. <b>Hold a page button + PRESETS: jump through its pages.</b></td></tr><tr><td class="n">ALGORITHM</td><td>Selects the track from any page: T1–T4, or T1–T6 with TRACKS 6.</td></tr><tr><td class="n">KNOB 1–4</td><td>The four columns on screen. Fast sweeps the whole range, slow fine-tunes. With a layer held: the layer's.</td></tr><tr><td class="n">OCT− · OCT+</td><td>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.</td></tr><tr><td class="n">PLAY</td><td>Start / stop. GLO + PLAY: restart from the top.</td></tr><tr><td class="n">REC</td><td>Arms live recording on the selected track (notes and knob moves, overdub).</td></tr><tr><td class="n">HOME</td><td>Tap: the ecosystem. <b>Hold: the MENU.</b></td></tr><tr><td class="n">KEYS</td><td>27 keys play the selected track in its scale; with a layer held they become that layer's.</td></tr></table></div><div class="card" style="--c:#8b5cf6" ><h3>PAGE BUTTONS</h3><table class="pages"><tr><th>BUTTON</th><th>TAP: ITS PAGES, ONE PER TAP</th><th>HOLD</th></tr><tr><td class="n">ENV</td><td>ENV · ENV DEST</td><td class="dim">—</td></tr><tr><td class="n">LFO</td><td>LFO · LFO DEST · MOD · MSEQ · MSEQ 2</td><td class="dim">MACROS M1–M4 (stay latched)</td></tr><tr><td class="n">FX</td><td>FX · MASTER · TRACK · DELAY · REVERB · CHORUS · SLICER · PUNCH (two quick taps: next section)</td><td class="dim">PUNCH-IN FX</td></tr><tr><td class="n">SCL</td><td>SCL · CHORD</td><td class="dim">ROOT by key</td></tr><tr><td class="n">EDIT</td><td>EDIT 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)</td><td class="dim">INIT · RECALL · sound mutes</td></tr><tr><td class="n">GLO</td><td>MIXER · GLOBAL · SYSTEM</td><td class="dim">MUTE · SOLO · LEVEL · TAP</td></tr><tr><td class="n">SAVE</td><td>PRESETS · USER · PROJECT · ARRANGE · TOOLS</td><td class="dim">SONG layer</td></tr><tr><td class="n">ARP</td><td>ARP · ARP 2</td><td class="dim">—</td></tr><tr><td class="n">SEQ</td><td>the zoom level&#x27;s sets (SELECT zooms): PATTERN: PATTERN · STRETCH · PLAYHEADS · TRACK · MUTATE | BAR: STEP · NOTE · AUTOMATION · AUTO LIST | STEP: NOTE · COMP · COMP 2</td><td class="dim">SEQ TOOLS</td></tr><tr><td class="n">REC</td><td>(transport)</td><td class="dim">CLEAR · CLICK</td></tr></table><p style="margin-top:10px"><span class="k v">BUTTON</span> + <span class="k v">PRESETS</span> jumps through its pages (no wrap). <span class="k v">SELECT</span> alone scrolls the section's pages.</p></div></div><div class="sec">LAYERS · HOLD A BUTTON<span></span></div><div class="grid g2"><div class="card" style="--c:#ff7a00" ><h3>FX · PUNCH-IN EFFECTS</h3><div class="kb"><div class="w on" style="left:0.0px;width:40.2px"><b>F3</b>REP 1/8</div><div class="w on" style="left:43.2px;width:40.2px"><b>G3</b>REP 1/16</div><div class="w on" style="left:86.5px;width:40.2px"><b>A3</b>REP 1/32</div><div class="w on" style="left:129.8px;width:40.2px"><b>B3</b>LPF</div><div class="w on" style="left:173.0px;width:40.2px"><b>C4</b>HPF</div><div class="w on" style="left:216.2px;width:40.2px"><b>D4</b>OCT−</div><div class="w on" style="left:259.5px;width:40.2px"><b>E4</b>OCT+</div><div class="w on" style="left:302.8px;width:40.2px"><b>F4</b>½ TEMPO</div><div class="w on" style="left:346.0px;width:40.2px"><b>G4</b>DEC−</div><div class="w on" style="left:389.2px;width:40.2px"><b>A4</b>DEC+</div><div class="w on" style="left:432.5px;width:40.2px"><b>B4</b>STUT 1/8</div><div class="w on" style="left:475.8px;width:40.2px"><b>C5</b>STUT 1/16</div><div class="w on" style="left:519.0px;width:40.2px"><b>D5</b>ATK+</div><div class="w on" style="left:562.2px;width:40.2px"><b>E5</b>ARP</div><div class="w on" style="left:605.5px;width:40.2px"><b>F5</b>RAND</div><div class="w on" style="left:648.8px;width:40.2px"><b>G5</b>ERASE</div><div class="b on" style="left:27.7px;width:31.1px"><b>F#</b>M1</div><div class="b on" style="left:70.9px;width:31.1px"><b>G#</b>M2</div><div class="b on" style="left:114.2px;width:31.1px"><b>A#</b>M3</div><div class="b on" style="left:200.7px;width:31.1px"><b>C#</b>M4</dLine truncated
<footer><span>GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP</span>
<span>JIANT FM v0.8.4</span></footer>
</body></html>
+1 -1
View File
@@ -53,7 +53,7 @@ ul { padding-left: 18px; } li { margin: 2px 0; }
<h1>JIANT FM · SOUND · FX · MOD</h1><h2>engines, effects, modulation, sequencer and songs</h2>
<div class="ver">firmware v0.8.4 · M-VAVE FM-1 · juanjiant-bit.github.io/JIANT</div></div></header>
<div class="rule"></div>
<div class="sec">ENGINES · EDIT 1 / EDIT 2<span></span></div><div class="card" style="--c:#f4f1ea" ><h3>NINE ENGINES, ALL SYNTHESIS</h3><table><tr><th>ENGINE</th><th>EDIT 1</th><th>EDIT 2</th><th>WHAT TO KNOW</th></tr><tr><td class="n" style="--c:#3b82f6">ANALOG</td><td style="width:22%"><div class="knobs"><span class="">WAVE</span><span class="">DETUNE</span><span class="">MIX</span><span class="">NOISE</span></div></td><td style="width:22%"><div class="knobs"><span class="">CUT</span><span class="">RES</span><span class="">DRIVE</span><span class="">INT</span></div></td><td>SAW SQR TRI SIN PWM <b>SYNC RING SAW3</b>; INT: osc 2 ±24 st. Its filter is per voice.</td></tr><tr><td class="n" style="--c:#d946ef">FM6</td><td style="width:22%"><div class="knobs"><span class="">ALG</span><span class="">FB</span><span class="">MOD</span><span class="">RATIO</span></div></td><td style="width:22%"><div class="knobs"><span class="">MEG</span><span class="">VMOD</span><span class="">DETUNE</span><span class="">SLOT</span></div></td><td>Dexed's 6 operators, 32 algorithms drawn, .syx patches (SLOT), MOD / RATIO move the modulators. <b>OPERATOR · OP ENV · OPERATOR 2</b>: each operator on the device (ratio / fixed, fine, level, its envelope, mode, detune, velocity). <b>SLOT B1–B32</b>: a 32-voice .syx sent from the web editor.</td></tr><tr><td class="n" style="--c:#8b5cf6">PHASE</td><td style="width:22%"><div class="knobs"><span class="">WAVE</span><span class="">WAVE2</span><span class="">DCW</span><span class="">ENV</span></div></td><td style="width:22%"><div class="knobs"><span class="">DETUNE</span><span class="">LINE</span><span class="">SUB</span><span class="">FB</span></div></td><td>Phase distortion (CZ); <b>FB</b> feeds the output back into the phase: hard edge to growl.</td></tr><tr><td class="n" style="--c:#22d3ee">LOFI</td><td style="width:22%"><div class="knobs"><span class="">CHIP</span><span class="">WAVE</span><span class="">DUTY</span><span class="">CRUSH</span></div></td><td style="width:22%"><div class="knobs"><span class="e">-</span><span class="">VIB</span><span class="">BEND</span><span class="">MASK</span></div></td><td>Chip: PLS TRI SAW NOIS WRAM. <b>BYTE</b>: ALGO VAR · MOTN GRIT BEND LOOP. <b>FLOAT</b> (floatbeat): ALGO VAR · MOTN FBK BEND LOOP; CHIP sets FULL / 4BIT / 1BIT.</td></tr><tr><td class="n" style="--c:#facc15">VOICE</td><td style="width:22%"><div class="knobs"><span class="">VOWEL</span><span class="">VOWEL2</span><span class="">TALK</span><span class="">SHIFT</span></div></td><td style="width:22%"><div class="knobs"><span class="">BUZZ</span><span class="">BREATH</span><span class="">Q</span><span class="">RAND</span></div></td><td>Formant voice (after klattsch): vowels, talk, breath.</td></tr><tr><td class="n" style="--c:#ff7a00">WHEEL</td><td style="width:22%"><div class="knobs"><span class="">REG</span><span class="">SUB</span><span class="">BODY</span><span class="">TOP</span></div></td><td style="width:22%"><div class="knobs"><span class="">PERC</span><span class="">CLICK</span><span class="">DRIVE</span><span class="">ROTOR</span></div></td><td>Drawbar organ: registrations, percussion, rotary.</td></tr><tr><td class="n" style="--c:#ef4444">NOISE</td><td style="width:22%"><div class="knobs"><span class="">MODE</span><span class="">COLOR</span><span class="">FREQ</span><span class="">PEAK</span></div></td><td style="width:22%"><div class="knobs"><span class="">TRK</span><span class="">DENSE</span><span class="">DRIFT</span><span class="">CRUSH</span></div></td><td>Coloured and metallic noise, tracked or free.</td></tr><tr><td class="n" style="--c:#ff7a00">DRUM-X</td><td style="width:22%"><div class="knobs"><span class="">MORPH</span><span class="">TUNE</span><span class="">TONE</span><span class="">DECAY</span></div></td><td style="width:22%"><div class="knobs"><span class="">NOISE</span><span class="">FM</span><span class="">ENV</span><span class="">FOLD</span><span class="">DRIVE</span></div></td><td>8 sounds BD SD CP CH OH TM RS CB, sides A / B: <b>MORPH</b> morphs the kit. The kit first: <b>KIT 3</b> BP FEEDBK, <b>X-MOD</b> RATE DEPTH SHAPE RAND. Then a sound (KNOB 1 the sound): SIDE PITCH PMOD · DECAY NOISE COLOR · MODE PM.TYPE DRIVE · <b>LAYER</b> (no note) FEEDBK <b>SEND</b> (CHO / DLY / REV). Last LEVELS and <b>STEREO</b> IMAGE (a knob through the kit's stereo placings).</td></tr><tr><td class="n" style="--c:#4ade80">ANIMAL</td><td style="width:22%"><div class="knobs"><span class="">MODE</span><span class="">PRESS</span><span class="">CHAOS</span><span class="">SIZE</span></div></td><td style="width:22%"><div class="knobs"><span class="">SWEEP</span><span class="">RATE</span><span class="">GROUP</span><span class="">TEMP</span></div></td><td>Animal calls (0.8.3), MODE the source: <b>CMOS</b> the 40106 / 4093 bird circuit (TOUCH COUPLE CAP · HYST RATE GROUP FM) · <b>PULSE</b> crickets, cicadas, frogs (CLICK Q · DETUNE) · <b>WHSTL</b> birds, a Hopf whistle · <Line truncated
<div class="sec">ENGINES · EDIT 1 / EDIT 2<span></span></div><div class="card" style="--c:#f4f1ea" ><h3>NINE ENGINES, ALL SYNTHESIS</h3><table><tr><th>ENGINE</th><th>EDIT 1</th><th>EDIT 2</th><th>WHAT TO KNOW</th></tr><tr><td class="n" style="--c:#3b82f6">ANALOG</td><td style="width:22%"><div class="knobs"><span class="">WAVE</span><span class="">DETUNE</span><span class="">MIX</span><span class="">NOISE</span></div></td><td style="width:22%"><div class="knobs"><span class="">CUT</span><span class="">RES</span><span class="">DRIVE</span><span class="">INT</span></div></td><td>SAW SQR TRI SIN PWM <b>SYNC RING SAW3</b>; INT: osc 2 ±24 st. Its filter is per voice.</td></tr><tr><td class="n" style="--c:#d946ef">FM6</td><td style="width:22%"><div class="knobs"><span class="">ALG</span><span class="">FB</span><span class="">MOD</span><span class="">RATIO</span></div></td><td style="width:22%"><div class="knobs"><span class="">MEG</span><span class="">VMOD</span><span class="">DETUNE</span><span class="">SLOT</span></div></td><td>Dexed's 6 operators, 32 algorithms drawn, .syx patches (SLOT), MOD / RATIO move the modulators. <b>OPERATOR · OP ENV · OPERATOR 2</b>: each operator on the device (ratio / fixed, fine, level, its envelope, mode, detune, velocity). <b>SLOT B1–B32</b>: a 32-voice .syx sent from the web editor.</td></tr><tr><td class="n" style="--c:#8b5cf6">PHASE</td><td style="width:22%"><div class="knobs"><span class="">WAVE</span><span class="">WAVE2</span><span class="">DCW</span><span class="">ENV</span></div></td><td style="width:22%"><div class="knobs"><span class="">DETUNE</span><span class="">LINE</span><span class="">SUB</span><span class="">FB</span></div></td><td>Phase distortion (CZ); <b>FB</b> feeds the output back into the phase: hard edge to growl.</td></tr><tr><td class="n" style="--c:#22d3ee">LOFI</td><td style="width:22%"><div class="knobs"><span class="">CHIP</span><span class="">WAVE</span><span class="">DUTY</span><span class="">CRUSH</span></div></td><td style="width:22%"><div class="knobs"><span class="e">-</span><span class="">VIB</span><span class="">BEND</span><span class="">MASK</span></div></td><td>Chip: PLS TRI SAW NOIS WRAM. <b>BYTE</b>: ALGO VAR · MOTN GRIT BEND LOOP. <b>FLOAT</b> (floatbeat): ALGO VAR · MOTN FBK BEND LOOP; CHIP sets FULL / 4BIT / 1BIT.</td></tr><tr><td class="n" style="--c:#facc15">VOICE</td><td style="width:22%"><div class="knobs"><span class="">VOWEL</span><span class="">VOWEL2</span><span class="">TALK</span><span class="">SHIFT</span></div></td><td style="width:22%"><div class="knobs"><span class="">BUZZ</span><span class="">BREATH</span><span class="">Q</span><span class="">RAND</span></div></td><td>Formant voice (after klattsch): vowels, talk, breath.</td></tr><tr><td class="n" style="--c:#ff7a00">WHEEL</td><td style="width:22%"><div class="knobs"><span class="">REG</span><span class="">SUB</span><span class="">BODY</span><span class="">TOP</span></div></td><td style="width:22%"><div class="knobs"><span class="">PERC</span><span class="">CLICK</span><span class="">DRIVE</span><span class="">ROTOR</span></div></td><td>Drawbar organ: registrations, percussion, rotary.</td></tr><tr><td class="n" style="--c:#ef4444">NOISE</td><td style="width:22%"><div class="knobs"><span class="">MODE</span><span class="">COLOR</span><span class="">FREQ</span><span class="">PEAK</span></div></td><td style="width:22%"><div class="knobs"><span class="">TRK</span><span class="">DENSE</span><span class="">DRIFT</span><span class="">CRUSH</span></div></td><td>Coloured and metallic noise, tracked or free.</td></tr><tr><td class="n" style="--c:#ff7a00">DRUM-X</td><td style="width:22%"><div class="knobs"><span class="">MORPH</span><span class="">TUNE</span><span class="">TONE</span><span class="">DECAY</span></div></td><td style="width:22%"><div class="knobs"><span class="">NOISE</span><span class="">FM</span><span class="">ENV</span><span class="">FOLD</span><span class="">DRIVE</span></div></td><td>8 sounds BD SD CP CH OH TM RS CB, sides A / B: <b>MORPH</b> morphs the kit. The kit first: <b>KIT 3</b> BP FEEDBK, <b>X-MOD</b> RATE DEPTH SHAPE RAND. Then a sound (KNOB 1 the sound): SIDE PITCH PMOD · DECAY NOISE COLOR · MODE PM.TYPE DRIVE · <b>LAYER</b> (no note) FEEDBK <b>SEND</b> (CHO / DLY / REV). Last LEVELS and <b>STEREO</b> IMAGE (a knob through the kit's stereo placings).</td></tr><tr><td class="n" style="--c:#4ade80">ANIMAL</td><td style="width:22%"><div class="knobs"><span class="">MODE</span><span class="">PRESS</span><span class="">CHAOS</span><span class="">SIZE</span></div></td><td style="width:22%"><div class="knobs"><span class="">SWEEP</span><span class="">RATE</span><span class="">GROUP</span><span class="">TEMP</span></div></td><td>Animal calls (0.8.3), MODE the source: <b>CMOS</b> the 40106 / 4093 bird circuit (TOUCH COUPLE CAP · HYST RATE GROUP FM) · <b>PULSE</b> crickets, cicadas, frogs (CLICK Q · DETUNE) · <b>WHSTL</b> birds, a Hopf whistle · <Line truncated
<footer><span>GPL-3.0 · fork of Felucca (Hügelton Instruments) · song mode from SLOOP</span>
<span>JIANT FM v0.8.4</span></footer>
</body></html>
+11 -4
View File
@@ -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 */
+68 -5
View File
@@ -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) */
+12 -2
View File
@@ -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;
+255 -31
View File
@@ -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)
+3 -2
View File
@@ -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)
+2 -1
View File
@@ -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 */
+6 -2
View File
@@ -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 */
+605
View File
@@ -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;
}
+6
View File
@@ -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
+2 -2
View File
@@ -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. <b>Hold: the MENU.</b>'),
@@ -340,7 +340,7 @@ def sound():
b.append('<div class="grid g3" style="margin-top:22px">')
b.append(card('SEQUENCER', HEAT[4],
'<p>64 steps a track, up to 4 notes a step, piano roll and drum grid. <b>LENTE</b>: 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. <b>Hold a step + turn a knob</b>: '
'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).</p>'
'<h4>PATTERN · TRACK</h4>' + knobs('LEN', 'DIV', 'SWG', 'GATE') + knobs('PIT', 'CHN', 'HUM', 'RECQ')))
b.append(card('SCALE · ARP', HEAT[0],
+34 -1
View File
@@ -46,6 +46,19 @@
</div>
<p class="small"><label><span data-t="verLabel"></span> <select id="ver" style="font:inherit"></select></label>
<br><span data-t="verOld"></span></p>
<!-- (0.8.5) the release's notice: the preview installer only, before 0.8.5 is written (releaseNotice) -->
<div id="notice" hidden style="border:2px solid #ec6e50;padding:12px 14px;margin:0 0 16px">
<p style="margin:0 0 8px;font-weight:600" data-t="n085Title"></p>
<p class="small" style="margin:0 0 8px" data-t="n085What"></p>
<p class="small" style="margin:0 0 8px" data-t="n085Risk"></p>
<p class="small" style="margin:0 0 8px" data-t="n085Keep"></p>
<div lang="es" style="border-top:1px solid var(--dim);padding-top:8px">
<p style="margin:0 0 8px;font-weight:600">Aviso antes de instalar 0.8.5 (versión de prueba)</p>
<p class="small" style="margin:0 0 8px">Nuevo en 0.8.5, las octavas de DRUM-X: en la octava central (OCT 0) el kit suena como siempre. Una octava más arriba los mismos sonidos suenan en ratchet a tempo (+1 x2, +2 x4, +3 x8); más abajo, con otro toque: −1 SHORT (la mitad del decay), −2 GHOST (corto, más suave y oscuro: notas fantasma), −3 FLAM (un golpe suave ~20 ms antes del golpe).</p>
<p class="small" style="margin:0 0 8px">Puede cambiar canciones existentes: las notas MIDI fuera del mapa GM (35–81) que hoy una pista DRUM toca como su octava (por ejemplo 24, o 84 y más) ahora suenan como esas variantes; las teclas con OCT movido ya no cambian de sonido sino que hacen ratchet / SHORT / GHOST / FLAM. Las notas guardadas en los pasos suenan igual que antes.</p>
<p class="small" style="margin:0">Para conservar el sonido de antes, mové esas notas a la octava central (36–47, o el mapa GM 35–81) en tu DAW o secuenciador. Antes de instalar, guardá un backup completo de tus proyectos con el editor (Backup) o con «Volver al V15 oficial» abajo.</p>
</div>
</div>
<p><button id="go" disabled data-t="install"></button></p>
<details id="stock" style="margin-top:24px">
<summary data-t="stockTitle"></summary>
@@ -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 }); }
+10
View File
@@ -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(/<div lang="es"[^>]*>[\s\S]*Aviso antes de instalar 0\.8\.5[\s\S]*backup completo/.test(html), "installer: the notice in Spanish");
}
/* ------------------------------------------------------------ editor protocol --- */