mirror of
https://github.com/isod89/clipper-fm1.git
synced 2026-12-05 12:24:32 +01:00
Clipper 0.9: filter models, VINTAGE, TUNING (Scala), TURNG arp, a click-free mix
- FILTER MODL: SVF MOOG MS20 DIODE SEM NOTCH BP HP (ANALOG, WAVE, VECTOR); a model changed under a held note ducks on an S-curve (no click) - VINTAGE (VOICE 2): per-voice card, slow drift, per-note offset; 0 is bit-exact - TUNING (GLO): 14 systems incl. maqams, gamelan, 19/24/31-EDO and a USER Scala scale; editor protocol 14 (TUNE_GET / TUNE_PUT), kept with the settings - ARP TURNG (Turing machine: MUTAT, SEED, LOOP); LOOP also sets SPICE's cycle - Audio cleanliness: limiter S-curve gain, send / DIST glides, delay TIME cross-fade, chorus DEPTH glide, master FILT LP<->HP, FLANG / CHOR line fill, WAVE TABL / FMX PTCH ducks; tests/clean_test.c (46 cases) - 3 new sounds (395, 23 engines); projects, user presets keep the new values - Fixed: a SLOOP 2.6 project read MOD SEQ / SPICE values past its INSERT's - Goldens updated (the limiter's S-curve: < 0.25% RMS where it limits) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RDUenQzjQ4Kk2jQVG85bwq
This commit is contained in:
32 files changed
+1866
-321
No files matched your search
+13
-2
@@ -1,4 +1,4 @@
|
||||
# Clipper — démarrage rapide (version de test 0.8)
|
||||
# Clipper — démarrage rapide (version de test 0.9)
|
||||
|
||||
**Clipper** est un firmware de **synthétiseur** pour le M-VAVE FM-1 : un seul instrument, comme le firmware d'origine, Felucca ou Baudgirl. Ce n'est plus une groovebox : pas de pistes, pas de boîte à rythmes, pas de mode song, pas de samples intégrés. Il garde de SLOOP les 12 moteurs, les effets, l'arpégiateur, le séquenceur de pas, l'audio USB et le MIDI. Il ajoute **HYBRID**, une voix à 3 oscillateurs, 2 filtres et une matrice de modulation de 16 slots, avec 24 sons d'usine. Il ajoute aussi le pitch bend, la molette, l'aftertouch et la pédale de sustain sur tous les moteurs.
|
||||
|
||||
@@ -15,7 +15,7 @@ Clipper vit dans son propre dossier, **`CLIPPER`**, à côté de celui de SLOOP.
|
||||
| Adresse | http://localhost:**8766** | http://localhost:**8767** |
|
||||
| Écran de démarrage | voilier, « sloop » | trois-mâts, « clipper » |
|
||||
|
||||
Sur la FM-1, Clipper se reconnaît à son écran de démarrage et à HOME (maintenu) → SYS → ABOUT, qui affiche **CLIPPER 0.8**.
|
||||
Sur la FM-1, Clipper se reconnaît à son écran de démarrage et à HOME (maintenu) → SYS → ABOUT, qui affiche **CLIPPER 0.9**.
|
||||
|
||||
## 1. Compiler et installer
|
||||
|
||||
@@ -24,6 +24,17 @@ Sur la FM-1, Clipper se reconnaît à son écran de démarrage et à HOME (maint
|
||||
3. La page d'installation s'ouvre sur http://localhost:8767/webapp/installer/ (Chrome ou Edge, FM-1 en USB). Clique sur **Install**.
|
||||
4. La FM-1 redémarre sur l'écran **clipper**. Tes projets, presets, samples et réglages de SLOOP sont toujours là.
|
||||
|
||||
## Nouveau dans la 0.9 : modèles de filtre, VINTAGE, micro-accordage, une machine de Turing, un son propre
|
||||
|
||||
- **Modèles de filtre** (FILTER → **MODL**, sur ANALOG, WAVE et VECTOR ; HYBRID garde ses deux filtres) : **SVF** (12 dB, comme avant), **MOOG** (le ladder 24 dB), **MS20** (2 pôles avec l'écrêtage à diodes dans la réinjection : il hurle à forte résonance sans décrocher), **DIODE** (le ladder à diodes 4 pôles, famille TB-303 / EMS : caoutchouteux, perd moins de basses), **SEM** (le state variable 12 dB d'Oberheim, résonance douce), **NOTCH**, **BP** et **HP**. Changer de modèle sur une note tenue fait un petit creux puis revient (pas de clic).
|
||||
- **VINTAGE** (VOICE 2 → **VINTG**, tous les moteurs) : chaque voix a sa propre petite erreur d'accord et de filtre (sa « carte de voix »), une lente dérive de hauteur, et chaque note un peu de la sienne. À 127 : carte ±6 cents, dérive ±5, note ±2, coupure ±1,5 pas. À 0 : identique à avant, au bit près.
|
||||
- **TUNING** (GLO → **TUNING**, pour tous les sons, gardé avec les réglages) : **EQUAL**, **JUST** (intonation juste), **PYTHA**gore, **MEANT**one (1/4 de comma), **WERCK**meister III, **KIRNB**erger III, les maqams **RAST** et **BAYAT**i (tierces neutres), **SLEND**ro et **PELOG** (gamelan), **19**, **24** et **31-EDO**, et **USER** : n'importe quelle gamme **Scala .scl** (jusqu'à 48 notes par période, n'importe quelle période, même la tritave de Bohlen-Pierce) envoyée depuis l'éditeur web. ROOT choisit la tonique.
|
||||
- **TURNG**, une machine de Turing dans l'arpégiateur (ARP MODE → TURNG, d'après la Turing Machine de Music Thing) : un registre à décalage en boucle choisit parmi les notes tenues. Sur la page SPICE : **MUTAT** (0 figé, 127 aléatoire), **SEED** (un autre motif), **LOOP** (longueur 1..16). LOOP fixe aussi sur combien de notes SPICE / DICE varient avant de se répéter.
|
||||
- **Un son propre, sans clics** (un nouveau test de 45 cas rend chaque changement et vérifie qu'aucun échantillon ne saute) : le limiteur de sortie bouge en courbe en S ; les envois (CHOR / DLY / REV) et la DIST de l'INSERT glissent au lieu de sauter ; le TIME du delay passe en fondu de l'ancienne à la nouvelle prise ; la DEPTH du chorus glisse ; le FILT du master passe par le milieu entre LP et HP ; FLANG / CHOR de l'INSERT attendent que leur ligne soit pleine ; une table WAVE, un patch FMX ou un modèle de filtre changés sur une note tenue font un creux et reviennent.
|
||||
- **3 nouveaux sons** (TURING JUNO, MS20 VECTOR, DIODE VS BASS). **395 sons, 23 moteurs.**
|
||||
- **Corrigé** : un projet SLOOP 2.6 chargé dans Clipper lisait ses valeurs MOD SEQ / SPICE au-delà de celles de son INSERT (maintenant leurs valeurs par défaut).
|
||||
- **L'éditeur web** (protocole 14) : une carte **Tuning** (système, tonique, charger un .scl) et les nouveaux réglages.
|
||||
|
||||
## Nouveau dans la 0.8 : JUNO et son chorus, VECTOR, un séquenceur de modulation, SPICE / DICE
|
||||
|
||||
- **JUNO**, le polyphonique des Roland Juno-6 / 60 / 106 (l'idée, aucun code de Roland) : un DCO par voix avec une **dent de scie**, une **impulsion** dont le LFO fait varier la largeur (PWM : LFO DEST SHP, la molette, SHAPE dans la matrice) ou **les deux** (**S+P**, les deux boutons du 106), un **sub** carré une octave en dessous et du **bruit** ; le **HPF** aux quatre positions du 106 (0 un peu de basses en plus, 1 neutre, 2 et 3 plus fin), le **filtre ladder 24 dB** résonant, et le **chorus** : **I** (0,5 Hz, large), **II** (0,8 Hz, plus profond), **I+II** (8 Hz, léger, les deux boutons du 60 ensemble) : un chorus BBD stéréo, deux prises d'une même ligne balayées en sens opposés, assombries comme un BBD, gauche = son sec + l'une, droite = son sec + l'autre. Changer de mode pendant un accord tenu se fait en fondu (pas de clic). EDIT : WAVE PW SUB NOIS / HPF CUT RES CHOR. 16 sons (nappes, cuivres, cordes, basses, claviers, lead synthwave, un hoover).
|
||||
|
||||
@@ -7,9 +7,20 @@ Free and open source (GPL-3.0). It grew out of <a href="https://github.com/isod8
|
||||
|
||||
---
|
||||
|
||||
> **Status: 0.8, test build.** Install it at your own risk, and keep a backup made with the editor. You can go back to SLOOP or to the official V15 from the installer page.
|
||||
> **Status: 0.9, test build.** Install it at your own risk, and keep a backup made with the editor. You can go back to SLOOP or to the official V15 from the installer page.
|
||||
|
||||
SLOOP is a groovebox. **Clipper is a synthesizer** with 23 engines and 392 sounds, one instrument (two in MULTI) like the original FM-1 firmware, Felucca and Baudgirl's FM-1+VA. It has no tracks, no drum machine, no song mode and no built-in samples. It keeps SLOOP's 12 sound engines, effects, arpeggiator, step sequencer, USB audio and MIDI, and adds **HYBRID**: one voice built from three oscillators, two filters and a modulation matrix, with the whole patch editable in the browser.
|
||||
SLOOP is a groovebox. **Clipper is a synthesizer** with 23 engines and 395 sounds, one instrument (two in MULTI) like the original FM-1 firmware, Felucca and Baudgirl's FM-1+VA. It has no tracks, no drum machine, no song mode and no built-in samples. It keeps SLOOP's 12 sound engines, effects, arpeggiator, step sequencer, USB audio and MIDI, and adds **HYBRID**: one voice built from three oscillators, two filters and a modulation matrix, with the whole patch editable in the browser.
|
||||
|
||||
## New in 0.9: filter models, VINTAGE, microtuning, a Turing machine, and a clean sound
|
||||
|
||||
- **Filter models** (FILTER → **MODL**, on ANALOG, WAVE and VECTOR; HYBRID keeps its own two filters): **SVF** (12 dB, as before), **MOOG** (the 24 dB ladder), **MS20** (2-pole Sallen-Key style with the diode clipping in the feedback: it screams at high RES and stays stable), **DIODE** (the 4-pole diode ladder of the TB-303 / EMS family: rubbery, less bass loss), **SEM** (Oberheim's 12 dB state variable, gentle resonance), **NOTCH**, **BP** and **HP**. Zero-delay-feedback models, integer DSP; each costs between 0.6 and 1.4 times the old filter. A model changed under a held note dips and comes back (no click).
|
||||
- **VINTAGE** (VOICE 2 → **VINTG**, every engine): the voices of an analog poly are never quite alike. Each voice gets its own small tuning error and filter offset (its "voice card", fixed), a slow random drift of its pitch, and each note a little of its own. At 127: the card ±6 cents, the drift ±5, the note ±2, the cutoff ±1.5 steps. 0: bit for bit as before.
|
||||
- **TUNING** (GLO → **TUNING**, for every sound, kept with the settings): **EQUAL**, **JUST** (5-limit), **PYTHA**gorean, **MEANT**one (1/4 comma), **WERCK**meister III, **KIRNB**erger III, the maqams **RAST** and **BAYAT**i (neutral thirds), the gamelan's **SLEND**ro and **PELOG**, **19**, **24** and **31-EDO**, and **USER**: any **Scala .scl** scale (up to 48 notes per period, any period: Bohlen-Pierce's tritave too) sent from the web editor. ROOT sets the tonic. A glide moves through the scale.
|
||||
- **TURNG**, a Turing machine in the arpeggiator (ARP MODE → TURNG, after Music Thing's Turing Machine): a looping shift register picks among the held notes. On the SPICE page, **MUTAT** is how often a bit flips (0 locked, 127 random), **SEED** another pattern, **LOOP** its length (1..16). **LOOP** also sets how many notes SPICE / DICE vary before repeating.
|
||||
- **A clean sound, no clicks** (a new test, 45 cases, renders every change and checks that no sample jumps): the master limiter's gain now moves on an S-curve; the sends (CHOR / DLY / REV) and the INSERT's DIST glide instead of jumping; the delay's TIME cross-fades the old and new tap; the chorus DEPTH glides; the master FILT goes through the middle when it crosses from LP to HP; FLANG / CHOR in the INSERT wait for their line to fill; a WAVE table, an FMX patch or a filter model changed under a held note dips and comes back.
|
||||
- **3 new sounds** (TURING JUNO, MS20 VECTOR, DIODE VS BASS), and VINTAGE on a few JUNO pads. **395 sounds, 23 engines.**
|
||||
- **Fixed**: a SLOOP 2.6 project loaded on Clipper read its MOD SEQ / SPICE values from past the end of its INSERT's (now their defaults).
|
||||
- **The web editor** (protocol 14): a **Tuning** card (system, root, load a .scl), and the new knobs (VINTG, LOOP, MODL's models, TURNG).
|
||||
|
||||
## New in 0.8: JUNO and its chorus, VECTOR, a modulation sequencer, SPICE / DICE
|
||||
|
||||
@@ -138,7 +149,7 @@ The voices are a build option: 8 (the default, as SLOOP), 12 or 16 (`INSTALL-CLI
|
||||
|
||||
## Tests
|
||||
|
||||
`HOST_ONLY=1 tests/run_tests.sh` runs everything that does not need the JieLi toolchain (0.8: JUNO and its chorus, VECTOR, the MOD SEQ, SPICE / DICE, their pages; 0.7: the voices on both cores in every mode of the host double of core 1, and under ThreadSanitizer; UNDO, COMPARE, FAV, KBD HOLD): the synth mode (HOME, presets, keys, pages, one instrument, MIDI omni), the HYBRID tests (the pitch of every oscillator, the filters, the matrix, the controllers, 300 random patches, the cost per voice), the editor's commands, golden renders of every sound, ASan and UBSan, a soak test, and the web pages.
|
||||
`HOST_ONLY=1 tests/run_tests.sh` runs everything that does not need the JieLi toolchain (0.9: the filter models, VINTAGE, the TUNING, TURNG, and the click test of 45 cases; 0.8: JUNO and its chorus, VECTOR, the MOD SEQ, SPICE / DICE, their pages; 0.7: the voices on both cores in every mode of the host double of core 1, and under ThreadSanitizer; UNDO, COMPARE, FAV, KBD HOLD): the synth mode (HOME, presets, keys, pages, one instrument, MIDI omni), the HYBRID tests (the pitch of every oscillator, the filters, the matrix, the controllers, 300 random patches, the cost per voice), the editor's commands, golden renders of every sound, ASan and UBSan, a soak test, and the web pages.
|
||||
|
||||
## Credits
|
||||
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
# Clipper 0.8: build the firmware, then open the browser installer.
|
||||
# Clipper 0.9: build the firmware, then open the browser installer.
|
||||
# Uses the same tools as SLOOP (WSL MinUI-Build, the JieLi toolchain) and the three AC79 SDK files in
|
||||
# build\deps\ac79 (copied from the SLOOP folder the first time if they are not here yet).
|
||||
# Port 8767 (SLOOP uses 8766): a SLOOP window left open does not get mixed up with this one.
|
||||
@@ -6,7 +6,7 @@ param([string]$Voices = "8")
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-Location $PSScriptRoot
|
||||
Write-Host ""
|
||||
Write-Host " C L I P P E R 0.8 ($Voices voices)" -ForegroundColor White
|
||||
Write-Host " C L I P P E R 0.9 ($Voices voices)" -ForegroundColor White
|
||||
Write-Host " ---- ---- ---- ----" -ForegroundColor DarkGray
|
||||
if ($Voices -notin @("8", "12", "16")) { throw "Voices: 8, 12 or 16" }
|
||||
$sdk = "build\deps\ac79"
|
||||
@@ -29,7 +29,7 @@ Remove-Item Env:FELUCCA_SLICE -ErrorAction SilentlyContinue
|
||||
python tools/build_windows.py --distro MinUI-Build --toolchain /root/fm1-codex-deps/jieli/toolchain --sdk $sdk --slice 0 --nvoice $Voices
|
||||
if ($LASTEXITCODE -ne 0) { throw "The build failed" }
|
||||
Write-Host "== Making the installer site" -ForegroundColor Cyan
|
||||
python web/make_site.py build/felucca.fwsc 0.8 build/clipper-site
|
||||
python web/make_site.py build/felucca.fwsc 0.9 build/clipper-site
|
||||
if ($LASTEXITCODE -ne 0) { throw "make_site failed" }
|
||||
Write-Host ""
|
||||
Write-Host "Installer: http://localhost:8767/webapp/installer/ (Chrome or Edge, FM-1 on USB)" -ForegroundColor Green
|
||||
|
||||
+13
-1
@@ -113,6 +113,9 @@ enum { /* per-track parameters */
|
||||
* SYNC (the song's grid) / KEY (from each first key) */
|
||||
P_SPICE, P_DICE, /* .. SPICE / DICE (seq.c spice_*): how much the arp's and the sequencer's
|
||||
* notes vary, and which variation */
|
||||
P_VINT, /* Clipper 0.9: VINTAGE, each voice a little its own (voice.c vintage) */
|
||||
P_SLOOP, /* .. LOOP: SPICE's variation comes round every LOOP notes; the arp's
|
||||
* TURNG mode: its register's length (seq.c turing_step) */
|
||||
#endif
|
||||
P_E0, P_E1, P_E2, P_E3, P_E4, P_E5, P_E6, P_E7,
|
||||
P_COUNT
|
||||
@@ -121,7 +124,7 @@ enum { /* per-track parameters */
|
||||
* their own (ANALOG): 1 SVF (12 dB, as before), 2 MOOG (the 24 dB ladder, dsp.c). The same slot: projects and user
|
||||
* presets keep it without a new format */
|
||||
#define P_FMODEL P_SLPAT
|
||||
enum { FM_SVF = 1, FM_MOOG = 2 };
|
||||
enum { FM_SVF = 1, FM_MOOG = 2, FM_MS20, FM_DIODE, FM_SEM, FM_NOTCH, FM_BP, FM_HP, FM_LAST = FM_HP }; /* (0.9: dsp.c fmod_*) */
|
||||
/* Clipper: two globals of the groovebox are free in the synth (no kick to duck to, no note repeat): the reverb's
|
||||
* TYPE (ROOM, PLATE: fx.c) and the plate's PRE-delay (ms) */
|
||||
#define G_RTYPE G_DUCK
|
||||
@@ -202,6 +205,7 @@ typedef struct {
|
||||
int32_t env2; /* ENV 2, Q24 */
|
||||
int16_t rnd, l2rnd; /* a random value per note; LFO 2's S&H value */
|
||||
uint8_t e2st; /* ENV 2: 0 off, 1 attack, 2 decay / sustain, 3 release */
|
||||
int16_t vdrift, vdtgt; /* (0.9) VINTAGE: the voice's slow pitch drift now, and where it goes (Q15) */
|
||||
uint8_t ch; /* the MIDI channel its note came on (MPE: its own bend, pressure, slide) */
|
||||
#endif
|
||||
} voice_t;
|
||||
@@ -331,11 +335,16 @@ typedef struct track {
|
||||
uint8_t arp_walk; /* (0.7) MODE WALK: the place in the note list it stands on */
|
||||
uint8_t arp_odd; /* (0.7) stopped: the next arp step is an odd one (its SWG: late) */
|
||||
uint32_t arp_off; /* units to its note-off */
|
||||
uint16_t tm_reg; /* (0.9) the arp's TURNG: its shift register */
|
||||
int16_t tm_seed; /* .. the DICE it was seeded with (+ 1; 0: not yet) */
|
||||
#if CLIPPER_SYNTH /* Clipper 0.8: the MOD SEQ (voice.c mseq_*), part of the sound */
|
||||
int8_t ms[MSEQ_LANES][MSEQ_STEPS]; /* the steps, -8..7 */
|
||||
uint8_t ms_step, ms_held; /* the step playing; keys held last block (KEY: the first one restarts it) */
|
||||
uint32_t ms_pos; /* units into the step (free running: stopped, or KEY) */
|
||||
int32_t ms_cur[MSEQ_LANES]; /* each lane's value now (Q15, glided: SMTH) */
|
||||
uint8_t fm_eff; /* (0.9) the filter model the engines play (P_FMODEL after the duck: fx.c part_duck) */
|
||||
uint8_t dk_phase, dk_pos; /* .. the part's duck: 0 none, 1 out, 2 held silent, 3 in; samples into its half */
|
||||
uint8_t dk_free, dk_hold; /* .. a change may land now (silent, or held); blocks held */
|
||||
#endif
|
||||
/* sequencer: synth parts step[], the drum track dstep[] (16 lanes) */
|
||||
union {
|
||||
@@ -387,6 +396,9 @@ typedef struct track {
|
||||
int32_t dist_hp, dist_lp1, dist_lp2; /* DIST insert state (fx.c) */
|
||||
int32_t att; /* mute / solo fade: attenuation, Q15 (0 = heard; fx.c mix_part, drums_mix) */
|
||||
uint8_t dist_on; /* DIST was on in the last block (its states restart when it comes on) */
|
||||
int16_t dist_last; /* (Clipper 0.9) DIST's amount while it fades out (turned to 0 under a sound) */
|
||||
int32_t dist_w; /* .. its wet share, Q15: DIST turned on or off under a sound fades (no click) */
|
||||
int32_t snd_c, snd_d, snd_r; /* .. the sends of the last block: a change glides as LEVEL's does */
|
||||
uint8_t tail; /* blocks to mix after the last voice (the DIST tail) */
|
||||
int16_t armp, aholdp; /* P_AMODE / P_AHOLD as last seen by the ISR */
|
||||
/* engine switch (voice.c engine_block): the old engine's voices fade out, then it switches */
|
||||
|
||||
@@ -190,6 +190,135 @@ static inline int32_t ladder_tick(const ladder_t *c, int32_t x, int32_t *s)
|
||||
return (uq + 2048) >> 12;
|
||||
}
|
||||
|
||||
/* Clipper 0.9: the filter MODELs of FX > FILTER > MODL (P_FMODEL), for the engines with a low-pass of their own
|
||||
* (ANALOG, WAVE, VECTOR): their cutoff and resonance, another circuit. SVF and MOOG as before, bit for bit; then
|
||||
* MS20 two one-pole low-passes (12 dB) with the feedback through a saturation, after the Korg MS-20's Sallen-Key
|
||||
* (Zavalishin's Korg-35 idea, ZDF as the ladder): bright, a screaming resonance that bites back on loud notes
|
||||
* DIODE four poles, the first at half the cutoff (the diode ladder's coupled first stage, the TB-303's idea): 18 dB
|
||||
* or so, a rubbery resonance, the input driven
|
||||
* SEM the state-variable low-pass driven softly, its resonance short of oscillating (the Oberheim SEM's)
|
||||
* NOTCH BP HP the same SVF's other outputs (the SEM's mode knob)
|
||||
* fmod_tick takes the engine's signal (full scale) and gives the filtered one at half scale, as tsvf_lp(x / 2) and
|
||||
* ladder_tick(x) / 2 did. State: sv[2] (the SVF family) and ls[4] (the ladder family), the engine's */
|
||||
typedef struct { int32_t G, H, G1, H1, PG, inv, k; } zdf_t; /* Q16; k Q12 */
|
||||
typedef struct {
|
||||
uint8_t model;
|
||||
tsvf_t sv;
|
||||
int32_t k; /* the SVF's damping (Q12) */
|
||||
ladder_t lad;
|
||||
zdf_t z;
|
||||
} fmod_t;
|
||||
static inline int64_t clamp64(int64_t x, int64_t lo, int64_t hi) { return x < lo ? lo : x > hi ? hi : x; }
|
||||
static inline int32_t zdf_sat(int64_t u) /* the ladder's tanh, at 65536 (Q12) */
|
||||
{
|
||||
int64_t h = u >> 13;
|
||||
if (h <= -65536 || h >= 65536)
|
||||
return softclip(h < 0 ? -65536 : 65536) << 13;
|
||||
return (softclip((int32_t)h) << 13) + (int32_t)(u - (h << 13));
|
||||
}
|
||||
static inline int32_t fmod_g(int32_t cut) /* the prewarped gain g (Q12), as the ladder's */
|
||||
{
|
||||
int32_t i, g;
|
||||
cut = clamp(cut, 0, 127 << 8);
|
||||
i = cut >> 8;
|
||||
g = SVF_G[i];
|
||||
if (i < 127)
|
||||
g += ((SVF_G[i + 1] - g) * (cut & 255)) >> 8;
|
||||
return clamp(g, 1, 3 * 4096);
|
||||
}
|
||||
static inline void fmod_coef(fmod_t *f, int32_t model, int32_t cut, int32_t res) /* cut 0..127 << 8, res 0..127 */
|
||||
{
|
||||
f->model = (uint8_t)model;
|
||||
res = clamp(res, 0, 127);
|
||||
if (model == FM_MOOG) {
|
||||
ladder_coef(&f->lad, cut, res);
|
||||
} else if (model == FM_MS20 || model == FM_DIODE) {
|
||||
zdf_t *z = &f->z;
|
||||
int32_t g = fmod_g(cut), G, G2;
|
||||
G = (int32_t)(((uint32_t)g << 16) / (uint32_t)(4096 + g));
|
||||
z->G = G, z->H = 65536 - G;
|
||||
G2 = mul_sh(G, G, 16);
|
||||
if (model == FM_MS20) {
|
||||
z->k = res * 9000 / 127; /* 0 .. 2.2: it sings from 2 */
|
||||
z->PG = G2;
|
||||
} else {
|
||||
int32_t g1 = g >> 1;
|
||||
z->G1 = (int32_t)(((uint32_t)g1 << 16) / (uint32_t)(4096 + g1));
|
||||
z->H1 = 65536 - z->G1;
|
||||
z->k = res * 19000 / 127; /* 0 .. 4.6 */
|
||||
z->PG = mul_sh(mul_sh(z->G1, G2, 16), G, 16);
|
||||
}
|
||||
z->inv = (int32_t)(0xFFFFFFFFu / (uint32_t)(65536 + mul_sh(z->k, z->PG, 12)));
|
||||
} else {
|
||||
int32_t r = model == FM_SEM ? res * 100 / 127 : res; /* (the SEM: short of oscillating) */
|
||||
tsvf_coef(&f->sv, cut, r);
|
||||
f->k = 8192 - r * 7600 / 127;
|
||||
}
|
||||
}
|
||||
static inline int32_t fmod_tick(const fmod_t *f, int32_t x, int32_t *sv, int32_t *ls)
|
||||
{
|
||||
switch (f->model) {
|
||||
case FM_MOOG:
|
||||
return ladder_tick(&f->lad, x, ls) >> 1;
|
||||
case FM_MS20: { /* two poles, the feedback saturated */
|
||||
const zdf_t *z = &f->z;
|
||||
int64_t in = (int64_t)clamp(x, -131072, 131072) << 12, S, y;
|
||||
int32_t u, v;
|
||||
in += (in * z->k) >> 14; /* (a little of the passband back) */
|
||||
S = ((((int64_t)z->G * ls[0]) >> 16) * z->H >> 16) + ((int64_t)z->H * ls[1] >> 16);
|
||||
y = ((((int64_t)z->PG * in) >> 16) + S) * z->inv >> 16;
|
||||
u = (int32_t)clamp64(in - (((int64_t)z->k * zdf_sat(y)) >> 12), -(int64_t)400000000, 400000000);
|
||||
v = (int32_t)(((int64_t)z->G * (u - ls[0]) + 32768) >> 16);
|
||||
u = v + ls[0], ls[0] = u + v;
|
||||
v = (int32_t)(((int64_t)z->G * (u - ls[1]) + 32768) >> 16);
|
||||
u = v + ls[1], ls[1] = u + v;
|
||||
return (u + 4096) >> 13;
|
||||
}
|
||||
case FM_DIODE: { /* four poles, the first at half the cutoff */
|
||||
const zdf_t *z = &f->z;
|
||||
int64_t in = (int64_t)clamp(x, -131072, 131072) << 12, S, T, y;
|
||||
int32_t u, v, j;
|
||||
in += (in * z->k) >> 13;
|
||||
T = (((int64_t)z->G * ls[1]) >> 16) + ls[2];
|
||||
T = ((z->G * T) >> 16) + ls[3];
|
||||
T = (z->H * T) >> 16;
|
||||
S = mul_sh(mul_sh(mul_sh(z->G, z->G, 16), z->G, 16), z->H1, 16);
|
||||
S = ((S * (int64_t)ls[0]) >> 16) + T;
|
||||
y = ((((int64_t)z->PG * in) >> 16) + S) * z->inv >> 16;
|
||||
u = zdf_sat(in - ((z->k * y) >> 12));
|
||||
v = (int32_t)(((int64_t)z->G1 * (u - ls[0]) + 32768) >> 16);
|
||||
u = v + ls[0], ls[0] = u + v;
|
||||
for (j = 1; j < 4; j++) {
|
||||
v = (int32_t)(((int64_t)z->G * (u - ls[j]) + 32768) >> 16);
|
||||
u = v + ls[j], ls[j] = u + v;
|
||||
}
|
||||
return (u + 4096) >> 13;
|
||||
}
|
||||
case FM_SVF:
|
||||
return tsvf_lp(&f->sv, x >> 1, &sv[0], &sv[1]);
|
||||
default: { /* SEM NOTCH BP HP: one SVF, its outputs */
|
||||
const tsvf_t *c = &f->sv;
|
||||
int32_t in = x >> 1, v1, v2, v3;
|
||||
if (f->model == FM_SEM) { /* (driven softly) */
|
||||
int32_t a = in < 0 ? -in : in;
|
||||
if (a > 12000)
|
||||
in = in < 0 ? -(12000 + (softclip((a - 12000) * 2) >> 1)) : 12000 + (softclip((a - 12000) * 2) >> 1);
|
||||
}
|
||||
v3 = in - sv[1];
|
||||
v1 = (c->a1 * sv[0] + c->a2 * v3) >> 13;
|
||||
v2 = sv[1] + ((c->a2 * sv[0] + c->a3 * v3) >> 13);
|
||||
sv[0] = clamp(2 * v1 - sv[0], -150000, 150000);
|
||||
sv[1] = clamp(2 * v2 - sv[1], -150000, 150000);
|
||||
switch (f->model) {
|
||||
case FM_NOTCH: return in - ((f->k * v1) >> 12);
|
||||
case FM_BP: return (f->k * v1) >> 12;
|
||||
case FM_HP: return in - ((f->k * v1) >> 12) - v2;
|
||||
default: return v2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* amplitude ramp over the block. Blocks are always CTL long, so x / CTL is a
|
||||
* shift rounded towards zero (-Os would keep a hardware divide per sample) */
|
||||
#define CTL_LOG2 5
|
||||
|
||||
@@ -30,8 +30,8 @@ enum { ED_INFO = 1, ED_GET, ED_SET, ED_DUMP, ED_DESC, ED_STEP_GET, ED_STEP_SET,
|
||||
ED_FM6_GET = 68, ED_FM6_PUT, ED_FM6_LIST, ED_FM6_ERASE }; /* v9: FM6 patches (Felucca's numbers) */
|
||||
/* v10 (SLOOP 2.5): DSYN_LIST .. DSYN_PLAY = 72..76, editor_dsyn.c; backup object 9 = the SYN kits */
|
||||
/* v11 (Clipper): HY_GET, HY_PUT = 77, 78, editor_hybrid.c */
|
||||
#define ED_PROTO (CLIPPER_SYNTH ? 13u : 11u) /* the protocol version INFO ends with (12: Clipper's FMX, 13: its
|
||||
* MOD SEQ, JUNO, VECTOR) */
|
||||
#define ED_PROTO (CLIPPER_SYNTH ? 14u : 11u) /* the protocol version INFO ends with (12: Clipper's FMX, 13: its
|
||||
* MOD SEQ, JUNO, VECTOR, 14: the TUNING) */
|
||||
|
||||
static uint8_t ed_out[600];
|
||||
static uint32_t ed_n;
|
||||
|
||||
@@ -72,7 +72,13 @@ static int ed_fmx_handle(uint32_t cmd, const uint8_t *a, uint32_t n)
|
||||
* MSEQ_GET part -> part, rc, 64 bytes (lane 1's 16 steps, then lane 2's ..: each value + 8, 0..15)
|
||||
* MSEQ_PUT part, 64 bytes -> part, rc the part's steps at once (each clamped to -8..7)
|
||||
* rc: 0 ok, 1 bad request */
|
||||
enum { ED_MSEQ_GET = 93, ED_MSEQ_PUT };
|
||||
enum { ED_MSEQ_GET = 93, ED_MSEQ_PUT, ED_TUNE_GET, ED_TUNE_PUT };
|
||||
/* v14 (Clipper 0.9): the TUNING (voice.c tune_cfg), kept with the settings
|
||||
* TUNE_GET -> rc, system, root, n, period (3 x 7 bits), n - 1 degrees (3 x 7 bits)
|
||||
* TUNE_PUT system, root, n, period, degrees -> rc (the USER scale: n 1..48 degrees of a period, 1/16 cent, each
|
||||
* above the one before; from a Scala .scl: the editor converts it)
|
||||
* rc: 0 ok, 1 bad request */
|
||||
static uint32_t ed_u21(const uint8_t *a) { return (uint32_t)(a[0] & 127u) | (uint32_t)(a[1] & 127u) << 7 | (uint32_t)(a[2] & 127u) << 14; }
|
||||
static int ed_mseq_handle(uint32_t cmd, const uint8_t *a, uint32_t n)
|
||||
{
|
||||
uint32_t i, rc;
|
||||
@@ -85,6 +91,42 @@ static int ed_mseq_handle(uint32_t cmd, const uint8_t *a, uint32_t n)
|
||||
for (i = 0; i < MSEQ_LANES * MSEQ_STEPS; i++)
|
||||
ed_b((uint32_t)(trk[a[0]].ms[i / MSEQ_STEPS][i % MSEQ_STEPS] + 8));
|
||||
return 1;
|
||||
case ED_TUNE_GET:
|
||||
ed_b(0);
|
||||
ed_b(tune_cfg.sys);
|
||||
ed_b(tune_cfg.root);
|
||||
ed_b(tune_cfg.n);
|
||||
for (i = 0; i < 3u; i++)
|
||||
ed_b((tune_cfg.period >> (7u * i)) & 127u);
|
||||
for (i = 1; i < tune_cfg.n && i < TU_MAXDEG; i++) {
|
||||
uint32_t k;
|
||||
for (k = 0; k < 3u; k++)
|
||||
ed_b((tune_cfg.deg[i] >> (7u * k)) & 127u);
|
||||
}
|
||||
return 1;
|
||||
case ED_TUNE_PUT: {
|
||||
tune_t c = tune_cfg;
|
||||
uint32_t nd = n >= 6u ? a[2] : 0u, prev = 0;
|
||||
rc = n < 6u || a[0] >= TU_N || a[1] > 11u || nd < 1u || nd > TU_MAXDEG || n != 6u + 3u * (nd - 1u);
|
||||
if (!rc) {
|
||||
c.sys = a[0], c.root = a[1], c.n = (uint8_t)nd;
|
||||
c.period = (uint16_t)clamp((int32_t)ed_u21(a + 3), 16, 65535);
|
||||
memset(c.deg, 0, sizeof c.deg);
|
||||
for (i = 1; i < nd && !rc; i++) {
|
||||
uint32_t d = ed_u21(a + 6u + 3u * (i - 1u));
|
||||
rc = d <= prev || d >= c.period; /* (each above the one before, inside the period) */
|
||||
c.deg[i] = (uint16_t)d, prev = d;
|
||||
}
|
||||
}
|
||||
if (!rc) {
|
||||
tune_cfg = c;
|
||||
tune_build();
|
||||
settings_later = 1;
|
||||
ui.force = 1;
|
||||
}
|
||||
ed_b(rc);
|
||||
return 1;
|
||||
}
|
||||
case ED_MSEQ_PUT:
|
||||
rc = n != 1u + MSEQ_LANES * MSEQ_STEPS || a[0] >= NPART;
|
||||
if (!rc) {
|
||||
|
||||
@@ -22,9 +22,8 @@ static void analog_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
uint32_t wave = (uint32_t)p[P_E0], i;
|
||||
int32_t det = p[P_E1], mix = p[P_E2], noise = p[P_E3];
|
||||
int32_t cut = (p[P_E4] << 8) + m->cutoff + (p[P_E7] * (v->pitch16 - 60 * 16) >> 4);
|
||||
tsvf_t flt;
|
||||
ladder_t lad;
|
||||
int moog = CLIPPER_SYNTH && t->p[P_FMODEL] == FM_MOOG; /* Clipper: the 24 dB ladder (P_FMODEL) */
|
||||
fmod_t fm; /* Clipper: the filter MODEL (P_FMODEL, dsp.c) */
|
||||
int32_t model = fm_model(t);
|
||||
int32_t drive = 32768 + p[P_E6] * 768; /* 1x .. 4x */
|
||||
int32_t dw = p[P_E6] * 258; /* DRV: dry -> driven (a clean range low) */
|
||||
uint32_t inc1 = m->inc;
|
||||
@@ -36,12 +35,9 @@ static void analog_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
int32_t m2 = mix * 258, m1 = 32767 - m2; /* osc mix Q15 */
|
||||
int32_t nz = noise * 200, drv = p[P_E6];
|
||||
uint32_t ph0 = v->ph[0], ph1 = v->ph[1]; /* state in locals: out[] may alias v->s[] */
|
||||
int32_t ic1 = v->s[0], ic2 = v->s[1], nst = v->s[2];
|
||||
int32_t sv[2] = {v->s[0], v->s[1]}, nst = v->s[2];
|
||||
int32_t ls[4] = {v->s[3], v->s[4], v->s[5], v->s[6]}; /* (MOOG's stages, in locals too) */
|
||||
if (moog)
|
||||
ladder_coef(&lad, cut, p[P_E5]);
|
||||
else
|
||||
tsvf_coef(&flt, cut, p[P_E5]);
|
||||
fmod_coef(&fm, model, cut, p[P_E5]);
|
||||
if (det == 0)
|
||||
inc2 = inc1;
|
||||
for (i = 0; i < n; i++) {
|
||||
@@ -81,7 +77,8 @@ static void analog_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
if (drv) /* pre-shifts: drive is up to 4x, no overflow */
|
||||
s += mulq15(softclip(((s >> 2) * (drive >> 2)) >> 11) - s, dw);
|
||||
{ /* filter: linear up to half scale, then a soft knee (only resonance peaks saturate) */
|
||||
int32_t y = moog ? ladder_tick(&lad, s, ls) >> 1 : tsvf_lp(&flt, s >> 1, &ic1, &ic2), a = y < 0 ? -y : y;
|
||||
int32_t y = model == FM_SVF ? tsvf_lp(&fm.sv, s >> 1, &sv[0], &sv[1]) : fmod_tick(&fm, s, sv, ls);
|
||||
int32_t a = y < 0 ? -y : y;
|
||||
if (a > 16000) {
|
||||
a = 16000 + (softclip((a - 16000) * 2) >> 1);
|
||||
y = y < 0 ? -a : a;
|
||||
@@ -92,8 +89,8 @@ static void analog_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
}
|
||||
v->ph[0] = ph0;
|
||||
v->ph[1] = ph1;
|
||||
v->s[0] = ic1;
|
||||
v->s[1] = ic2;
|
||||
v->s[0] = sv[0];
|
||||
v->s[1] = sv[1];
|
||||
v->s[3] = ls[0], v->s[4] = ls[1], v->s[5] = ls[2], v->s[6] = ls[3];
|
||||
v->s[2] = nst;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,8 @@ static void fmx_block(track_t *t)
|
||||
fmx_reload &= (uint8_t)~(1u << tr);
|
||||
fmx_slot_seen[tr] = 0;
|
||||
}
|
||||
if (fmx_slot_seen[tr] != s + 1) {
|
||||
if (fmx_slot_seen[tr] != s + 1 && (!fmx_slot_seen[tr] || t->dk_free)) { /* (0.9: PTCH turned under a sound:
|
||||
* when the part's duck holds it silent, fx.c part_duck) */
|
||||
fmx_slot_seen[tr] = (int16_t)(s + 1);
|
||||
fmx_slot_patch((uint32_t)s, &fmx_cur[tr]);
|
||||
fmx_dirty[tr] = 1;
|
||||
|
||||
@@ -86,7 +86,7 @@ static void juno_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
|
||||
static const preset_t JUNO_PRESETS[] = {
|
||||
/* {WAVE, PW, SUB, NOIS, HPF, CUT, RES, CHOR}, {A D S R}, ENV -> FILTER, mono; extras: the LFO on the PW */
|
||||
{"JUNO 106 PAD", {JW_SP, 40, 40, 0, 1, 88, 20, 1}, {70, 100, 115, 95}, 10, 0, FX(0, 0, 10, 40),
|
||||
XP(P_LRATE + 1, 28, P_LD_SHP + 1, 40)},
|
||||
XP(P_LRATE + 1, 28, P_LD_SHP + 1, 40, P_VINT + 1, 24)},
|
||||
{"JUNO BRASS", {JW_SAW, 0, 30, 0, 1, 62, 30, 0}, {14, 82, 100, 50}, 40, 0, FX(0, 0, 10, 30)},
|
||||
{"JUNO BASS", {JW_PLS, 50, 110, 0, 0, 58, 40, 0}, {0, 70, 70, 26}, 36, 1, FX(0, 0, 0, 8), XP(P_GLIDE + 1, 10)},
|
||||
{"JUNO STRINGS", {JW_SAW, 0, 0, 0, 2, 96, 10, 2}, {80, 100, 120, 96}, 0, 0, FX(0, 0, 10, 50),
|
||||
@@ -97,7 +97,7 @@ static const preset_t JUNO_PRESETS[] = {
|
||||
{"80S HITS", {JW_SP, 20, 50, 0, 1, 56, 50, 1}, {0, 64, 0, 40}, 50, 0, FX(0, 0, 20, 30)},
|
||||
{"JUNO PIANO", {JW_PLS, 60, 30, 0, 2, 50, 20, 1}, {0, 90, 0, 70}, 50, 0, FX(0, 0, 10, 30)},
|
||||
{"DREAM PAD", {JW_SP, 50, 30, 10, 2, 92, 30, 3}, {90, 100, 120, 110}, 0, 0, FX(0, 0, 20, 70),
|
||||
XP(P_LRATE + 1, 20, P_LD_SHP + 1, 50)},
|
||||
XP(P_LRATE + 1, 20, P_LD_SHP + 1, 50, P_VINT + 1, 40)},
|
||||
{"SUB BASS 106", {JW_PLS, 0, 127, 0, 0, 40, 10, 0}, {0, 80, 110, 20}, 10, 1, FX(0, 0, 0, 4)},
|
||||
{"SYNTH BRASS 2", {JW_SP, 10, 40, 0, 1, 54, 36, 2}, {20, 86, 96, 56}, 46, 0, FX(0, 0, 12, 34)},
|
||||
{"ARP PLUCK", {JW_SAW, 0, 40, 0, 2, 44, 50, 1}, {0, 60, 0, 40}, 56, 0, FX(0, 0, 30, 30),
|
||||
@@ -109,6 +109,9 @@ static const preset_t JUNO_PRESETS[] = {
|
||||
XP(P_GLIDE + 1, 20)},
|
||||
{"HOOVER JUNO", {JW_PLS, 80, 60, 0, 1, 76, 20, 3}, {0, 90, 110, 50}, 0, 1, FX(10, 0, 10, 30),
|
||||
XP(P_LRATE + 1, 60, P_LD_SHP + 1, 63, P_GLIDE + 1, 40)},
|
||||
/* 0.9: the arp's TURNG (a Turing machine over the held notes: hold a chord), VINTAGE */
|
||||
{"TURING JUNO", {JW_SAW, 0, 20, 0, 2, 64, 36, 1}, {0, 62, 24, 40}, 44, 0, FX(0, 0, 34, 40), ARP(15, 2, 2, 60),
|
||||
XP(P_SPICE + 1, 16, P_SLOOP + 1, 8, P_VINT + 1, 30)},
|
||||
};
|
||||
|
||||
static const engine_t ENG_JUNO = {
|
||||
|
||||
+25
-16
@@ -11,11 +11,15 @@
|
||||
* MOVE OFF; CIRC (a circle round the point); 8 (a figure eight); SWEEP (from A to the point, over the note: the
|
||||
* VS's mix envelope); LOOP (the square's edge, A B D C, round the point); RND (a smooth random walk). Each slow
|
||||
* and fast (+): 0.25 Hz / 2 Hz, a sweep of 4 s / 0.5 s
|
||||
* CUT a 12 dB low-pass (keyboard half), its envelope ENV DEST FLT
|
||||
* CUT a 12 dB low-pass (keyboard half), its envelope ENV DEST FLT; (0.9) FX > FILTER > MODL another (dsp.c fmod_*)
|
||||
* The waves: three band-limited copies each (512 points to the 96th harmonic, 128 to the 24th, 32 to the 6th), the
|
||||
* voice reading the copy that stays under ~20 kHz at its pitch.
|
||||
* Voice state: ph[0] the oscillator, ph[1] MOVE's phase (from the note's start), ph[2] RND's generator; s[0..1] the
|
||||
* SVF, s[2..3] RND's point now, s[4..5] its target, s[6..7] the point at the last block's end (Q15; s[6] < 0: none) */
|
||||
* Voice state: ph[0] the oscillator, ph[1] MOVE's phase (from the note's start), ph[2] RND's generator; s[0..3] the
|
||||
* filter (the SVF its first two), s[4] RND's point now, s[5] its target (x, y: two int16), s[6..7] the point at the last
|
||||
* block's end (Q15; s[6] < 0: none) */
|
||||
static inline int32_t vec_lo(int32_t w) { return (int32_t)(int16_t)(w & 0xFFFF); }
|
||||
static inline int32_t vec_hi(int32_t w) { return w >> 16; }
|
||||
static inline int32_t vec_pk(int32_t x, int32_t y) { return (int32_t)((uint32_t)(uint16_t)x | (uint32_t)y << 16); }
|
||||
#include "vector_tables.h"
|
||||
enum { VM_OFF, VM_CIRC, VM_CIRCF, VM_EIGHT, VM_EIGHTF, VM_SWEEP, VM_SWEEPF, VM_LOOP, VM_LOOPF, VM_RND, VM_RNDF, VM_N };
|
||||
static const char *const N_VMOVE[VM_N] = {"OFF", "CIRC", "CIRC+", "8", "8+", "SWEEP", "SWP+", "LOOP", "LOOP+", "RND",
|
||||
@@ -27,12 +31,12 @@ static void vector_note_on(track_t *t, voice_t *v)
|
||||
{
|
||||
(void)t;
|
||||
v->ph[1] = 0;
|
||||
v->s[2] = v->s[3] = v->s[4] = v->s[5] = 0;
|
||||
v->s[4] = v->s[5] = 0;
|
||||
v->s[6] = -1;
|
||||
if (!v->ph[2])
|
||||
v->ph[2] = 0x2545F491u ^ ((uint32_t)v->note * 2654435761u);
|
||||
if (!v->env && !v->env_out)
|
||||
v->s[0] = v->s[1] = 0;
|
||||
v->s[0] = v->s[1] = v->s[2] = v->s[3] = 0;
|
||||
}
|
||||
|
||||
/* the point (Q15, 0..32767 each) at this block's end: X Y, SHAPE, MOVE */
|
||||
@@ -67,12 +71,12 @@ static void vector_point(const track_t *t, voice_t *v, const vmod_t *m, uint32_t
|
||||
case VM_RND: case VM_RNDF:
|
||||
if (ph + inc < ph || v->s[6] < 0) { /* a new target each period */
|
||||
uint32_t r = v->ph[2] = v->ph[2] * 1664525u + 1013904223u;
|
||||
v->s[4] = mulq15((int32_t)(r >> 16) - 32768, VEC_RADIUS);
|
||||
v->s[5] = mulq15((int32_t)(r & 0xFFFFu) - 32768, VEC_RADIUS);
|
||||
v->s[5] = vec_pk(mulq15((int32_t)(r >> 16) - 32768, VEC_RADIUS), mulq15((int32_t)(r & 0xFFFFu) - 32768, VEC_RADIUS));
|
||||
}
|
||||
v->s[2] += (v->s[4] - v->s[2]) >> (fast ? 2 : 5);
|
||||
v->s[3] += (v->s[5] - v->s[3]) >> (fast ? 2 : 5);
|
||||
dx = v->s[2], dy = v->s[3];
|
||||
dx = vec_lo(v->s[4]), dy = vec_hi(v->s[4]);
|
||||
dx += (vec_lo(v->s[5]) - dx) >> (fast ? 2 : 5);
|
||||
dy += (vec_hi(v->s[5]) - dy) >> (fast ? 2 : 5);
|
||||
v->s[4] = vec_pk(dx, dy);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -91,9 +95,9 @@ static void vector_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
const int16_t *wb = VEC_WAVE[(uint32_t)clamp(p[P_E1], 0, VEC_NW - 1)] + VEC_OFF[lv];
|
||||
const int16_t *wc = VEC_WAVE[(uint32_t)clamp(p[P_E2], 0, VEC_NW - 1)] + VEC_OFF[lv];
|
||||
const int16_t *wd = VEC_WAVE[(uint32_t)clamp(p[P_E3], 0, VEC_NW - 1)] + VEC_OFF[lv];
|
||||
int32_t x1, y1, x0, y0, ic1 = v->s[0], ic2 = v->s[1];
|
||||
int32_t x1, y1, x0, y0, st[4] = {v->s[0], v->s[1], v->s[2], v->s[3]}, model = fm_model(t);
|
||||
int32_t a0, b0, c0, d0, a1, b1, c1, d1, da, db, dc, dd;
|
||||
tsvf_t flt;
|
||||
fmod_t fm;
|
||||
vector_point(t, v, m, n, &x1, &y1);
|
||||
x0 = v->s[6] < 0 ? x1 : v->s[6], y0 = v->s[6] < 0 ? y1 : v->s[7];
|
||||
/* the corners' weights at the block's start and end, Q14 (their sum 16384): ramped over the block */
|
||||
@@ -102,7 +106,7 @@ static void vector_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
a1 = ((32767 - x1) * (32767 - y1)) >> 16, b1 = (x1 * (32767 - y1)) >> 16, c1 = ((32767 - x1) * y1) >> 16;
|
||||
d1 = 16383 - a1 - b1 - c1;
|
||||
da = (a1 - a0) / (int32_t)n, db = (b1 - b0) / (int32_t)n, dc = (c1 - c0) / (int32_t)n, dd = (d1 - d0) / (int32_t)n;
|
||||
tsvf_coef(&flt, (p[P_E7] << 8) + m->cutoff + ((v->pitch16 - 60 * 16) << 3), 24);
|
||||
fmod_coef(&fm, model, (p[P_E7] << 8) + m->cutoff + ((v->pitch16 - 60 * 16) << 3), model == FM_SVF ? 24 : 64);
|
||||
for (i = 0; i < n; i++, ph += inc) {
|
||||
uint32_t k = ph >> sh, k1 = (k + 1u) & mask;
|
||||
int32_t fr = (int32_t)((ph >> fsh) & 0x7FFFu), s, y;
|
||||
@@ -111,14 +115,14 @@ static void vector_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, cons
|
||||
s += (wc[k] + (((wc[k1] - wc[k]) * fr) >> 15)) * c0;
|
||||
s += (wd[k] + (((wd[k1] - wd[k]) * fr) >> 15)) * d0;
|
||||
a0 += da, b0 += db, c0 += dc, d0 += dd;
|
||||
y = tsvf_lp(&flt, (s >> 14) * 3 >> 2, &ic1, &ic2);
|
||||
y = (s >> 14) * 3 >> 2;
|
||||
y = model == FM_SVF ? tsvf_lp(&fm.sv, y, &st[0], &st[1]) : fmod_tick(&fm, y << 1, st, st);
|
||||
if (y > 16000 || y < -16000)
|
||||
y = soft_knee(y, 16000);
|
||||
out[i] += mulq15(mulq15(y << 1, amp_at(m, i)), VOICE_FS) << 1;
|
||||
}
|
||||
v->ph[0] = ph;
|
||||
v->s[0] = ic1;
|
||||
v->s[1] = ic2;
|
||||
v->s[0] = st[0], v->s[1] = st[1], v->s[2] = st[2], v->s[3] = st[3];
|
||||
v->s[6] = x1;
|
||||
v->s[7] = y1;
|
||||
}
|
||||
@@ -144,6 +148,11 @@ static const preset_t VECTOR_PRESETS[] = {
|
||||
{"VS LEAD", {2, 11, 4, 12, -10, -40, VM_CIRCF, 104}, {0, 80, 110, 40}, 10, 1, FX(10, 0, 30, 30),
|
||||
XP(P_GLIDE + 1, 16)},
|
||||
{"CHOIR VS", {7, 8, 0, 10, 0, 20, VM_SWEEP, 100}, {90, 100, 120, 100}, 0, 0, FX(0, 40, 20, 80)},
|
||||
/* 0.9: the filter MODELs (FX > FILTER > MODL), VINTAGE */
|
||||
{"MS20 VECTOR", {2, 11, 3, 12, 20, -20, VM_EIGHTF, 66}, {0, 80, 100, 40}, 30, 1, FX(10, 0, 26, 24),
|
||||
XP(P_FMODEL + 1, FM_MS20, P_GLIDE + 1, 18, P_VINT + 1, 30)},
|
||||
{"DIODE VS BASS", {2, 3, 4, 0, -50, -50, VM_SWEEPF, 52}, {0, 70, 90, 24}, 40, 1, FX(6, 0, 0, 8),
|
||||
XP(P_FMODEL + 1, FM_DIODE, P_VINT + 1, 40)},
|
||||
};
|
||||
|
||||
static const engine_t ENG_VECTOR = {
|
||||
|
||||
+12
-12
@@ -24,6 +24,8 @@
|
||||
static const uint16_t WT_OFF[WT_LEVELS] = {0, 1024, 1536, 1792, 1920, 1984, 2016};
|
||||
static int16_t wt_mip[WT_NF][WT_PTS] __attribute__((section(".pool"))); /* 64 KB */
|
||||
static volatile int16_t wt_have = -1; /* the table in wt_mip, complete (-1: none, or being built) */
|
||||
static int16_t wt_tab_eff[NPART]; /* (0.9) the table each part plays (+ 1; 0: TABL itself): TABL turned
|
||||
* under a sound, the part ducks first (fx.c part_duck), then this */
|
||||
static int16_t wt_building = -1; /* the table being built, frame by frame */
|
||||
static uint8_t wt_next; /* its next frame */
|
||||
#define WT_NALL (WT_NFACTORY + SMP_USER_SLOTS) /* + USR1..USR4 */
|
||||
@@ -252,15 +254,15 @@ static void wave_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
|
||||
const int16_t *p = t->p;
|
||||
static int32_t acc_[2][CTL], pos_[2][CTL]; /* (static: the audio ISR's stack stays small; 0.7: one per core) */
|
||||
int32_t *acc = acc_[C1_IX(out)], *pos = pos_[C1_IX(out)];
|
||||
uint32_t want = (uint32_t)p[P_E0] % WT_NALL, i, inc1 = m->inc, inc2;
|
||||
uint32_t want = wt_tab_eff[(uint32_t)(t - trk) % NPART] ? (uint32_t)wt_tab_eff[(uint32_t)(t - trk) % NPART] - 1u
|
||||
: (uint32_t)p[P_E0] % WT_NALL, i, inc1 = m->inc, inc2;
|
||||
int32_t det = p[P_E2], sub = p[P_E3] * 258, drive = 32768 + p[P_E6] * 768, dw = p[P_E6] * 258, drv = p[P_E6];
|
||||
int32_t cut = (p[P_E4] << 8) + m->cutoff + (p[P_E7] * (v->pitch16 - 60 * 16) >> 4);
|
||||
int32_t p1 = clamp((p[P_E1] << 8) + m->shape - (64 << 8), 0, 127 << 8) * (int32_t)(WT_NF - 1u) / 127; /* Q8 */
|
||||
int32_t p0 = v->s[7] < 0 ? p1 : v->s[7];
|
||||
int32_t ic1 = v->s[0], ic2 = v->s[1], ls[4] = {v->s[3], v->s[4], v->s[5], v->s[6]};
|
||||
int moog = t->p[P_FMODEL] == FM_MOOG;
|
||||
tsvf_t flt;
|
||||
ladder_t lad;
|
||||
int32_t sv[2] = {v->s[0], v->s[1]}, ls[4] = {v->s[3], v->s[4], v->s[5], v->s[6]};
|
||||
int32_t model = fm_model(t); /* (0.9: the filter MODEL, dsp.c fmod_*) */
|
||||
fmod_t fm;
|
||||
if (n > CTL)
|
||||
return;
|
||||
if (wt_have != (int32_t)want) { /* not built yet (TABL just turned): silent, phases run on */
|
||||
@@ -289,16 +291,14 @@ static void wave_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
|
||||
} else {
|
||||
v->ph[2] += (inc1 >> 1) * n;
|
||||
}
|
||||
if (moog)
|
||||
ladder_coef(&lad, cut, p[P_E5]);
|
||||
else
|
||||
tsvf_coef(&flt, cut, p[P_E5]);
|
||||
fmod_coef(&fm, model, cut, p[P_E5]);
|
||||
for (i = 0; i < n; i++) {
|
||||
int32_t s = acc[i];
|
||||
if (drv) /* ANALOG's drive */
|
||||
s += mulq15(softclip(((s >> 2) * (drive >> 2)) >> 11) - s, dw);
|
||||
{
|
||||
int32_t y = moog ? ladder_tick(&lad, s, ls) >> 1 : tsvf_lp(&flt, s >> 1, &ic1, &ic2), a = y < 0 ? -y : y;
|
||||
int32_t y = model == FM_SVF ? tsvf_lp(&fm.sv, s >> 1, &sv[0], &sv[1]) : fmod_tick(&fm, s, sv, ls);
|
||||
int32_t a = y < 0 ? -y : y;
|
||||
if (a > 16000) {
|
||||
a = 16000 + (softclip((a - 16000) * 2) >> 1);
|
||||
y = y < 0 ? -a : a;
|
||||
@@ -307,8 +307,8 @@ static void wave_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const
|
||||
}
|
||||
out[i] += mulq15(mulq15(s, amp_at(m, i)), VOICE_FS) << 1;
|
||||
}
|
||||
v->s[0] = ic1;
|
||||
v->s[1] = ic2;
|
||||
v->s[0] = sv[0];
|
||||
v->s[1] = sv[1];
|
||||
v->s[3] = ls[0], v->s[4] = ls[1], v->s[5] = ls[2], v->s[6] = ls[3];
|
||||
v->s[7] = p1;
|
||||
}
|
||||
|
||||
+12
-1
@@ -19,6 +19,17 @@ static inline int32_t soft_knee(int32_t y, int32_t k) /* linear up to k, then
|
||||
* others: an engine's scratch that is not on the stack is one per core, picked by C1_IX(out) (1: the second core's) */
|
||||
static int32_t vs_buf[CTL] __attribute__((aligned(8)));
|
||||
#define C1_IX(out) ((out) == vs_buf ? 1u : 0u)
|
||||
/* (0.9) the filter MODEL the engines with a low-pass of their own play (dsp.c fmod_*): P_FMODEL after the short duck
|
||||
* a change of it brings (fx.c mix_part1: no click), SVF in the groovebox */
|
||||
static inline int32_t fm_model(const track_t *t)
|
||||
{
|
||||
#if CLIPPER_SYNTH
|
||||
return t->fm_eff ? t->fm_eff : clamp(t->p[P_FMODEL], FM_SVF, FM_LAST);
|
||||
#else
|
||||
(void)t;
|
||||
return FM_SVF;
|
||||
#endif
|
||||
}
|
||||
/* (pitch_inc: felucca_tables.h, SLOOP 2.5: from the top octave) */
|
||||
#include "eng_analog.c"
|
||||
#include "eng_digital.c"
|
||||
@@ -113,7 +124,7 @@ static int32_t wt_wanted(void)
|
||||
if (t->xf_on && ENGINES[t->engine % NENGINES] == &ENG_WAVE)
|
||||
return wt_have;
|
||||
if (ENGINES[t->eng_req % NENGINES] == &ENG_WAVE)
|
||||
return (int32_t)((uint32_t)t->p[P_E0] % WT_NALL);
|
||||
return wt_tab_eff[k] ? wt_tab_eff[k] - 1 : (int32_t)((uint32_t)t->p[P_E0] % WT_NALL); /* (0.9: after the duck) */
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
+171
-21
@@ -27,22 +27,35 @@ static struct {
|
||||
int32_t dly_lp, dly_acc;
|
||||
uint16_t line_i[4], ap_i[2];
|
||||
int32_t line_lp[4];
|
||||
uint32_t dl_cur, dl_old; /* (0.9) the delay's TIME now and the one it fades from (DL_XF samples) */
|
||||
uint32_t dl_x; /* .. samples into that fade (DL_XF: none) */
|
||||
int32_t cdep; /* (0.9) the chorus's DEPTH now (glides: a jump moved its taps at once) */
|
||||
} fx;
|
||||
#define DL_XF 1024u /* a new delay TIME: the old tap fades out as the new one fades in, 23 ms (a jump
|
||||
* of the read point was a crack) */
|
||||
|
||||
/* DIST: low cut -> drive (1x..8x, exponential) -> asymmetric soft clip
|
||||
* (a little bias = even harmonics) -> tone low-pass that closes with drive ->
|
||||
* make-up gain. State per part (track_t dist_*). */
|
||||
static void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
/* (Clipper 0.9) DIST turned on or off while the part sounds: the dry and the driven cross-fade over 2.9 ms (SL_SLOPE;
|
||||
* it switched at once: a crack on a held chord); a part starting from silence (fresh): at once, as before, bit for bit */
|
||||
static void track_dist(track_t *t, int32_t *b, uint32_t n, uint32_t fresh)
|
||||
{
|
||||
int32_t d = t->p[P_DIST], i, g, k, mk, bias = 2400, b0;
|
||||
if (!d) {
|
||||
int32_t d = t->p[P_DIST], i, g, k, mk, bias = 2400, b0, tw = d ? 32768 : 0, w = t->dist_w;
|
||||
if (!d && (!w || fresh)) {
|
||||
t->dist_on = 0;
|
||||
t->dist_w = 0;
|
||||
return;
|
||||
}
|
||||
if (d)
|
||||
t->dist_last = (int16_t)d;
|
||||
else
|
||||
d = t->dist_last; /* (fading out: the amount it had) */
|
||||
if (!t->dist_on) { /* coming on: no stale high-pass state (a thump) */
|
||||
t->dist_on = 1;
|
||||
t->dist_hp = b[0];
|
||||
t->dist_lp1 = t->dist_lp2 = 0;
|
||||
w = fresh ? 32768 : 0;
|
||||
}
|
||||
g = 4096 + d * d * 2; /* Q12: 1x .. ~9x, gentle at first */
|
||||
k = 32000 - d * 95; /* tone: transparent at low drive .. ~3 kHz, Q15 */
|
||||
@@ -55,8 +68,14 @@ static void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
y = softclip((((x >> 2) * g) >> 10) + bias) - b0; /* >> 2 first: no overflow for loud poly */
|
||||
t->dist_lp1 += mulq15(y - t->dist_lp1, k); /* two poles: tames the fizz */
|
||||
t->dist_lp2 += mulq15(t->dist_lp1 - t->dist_lp2, k);
|
||||
b[i] = mulq15(t->dist_lp2, mk);
|
||||
y = mulq15(t->dist_lp2, mk);
|
||||
if (w != tw)
|
||||
w += clamp(tw - w, -SL_SLOPE, SL_SLOPE);
|
||||
b[i] = w == 32768 ? y : b[i] + (int32_t)(((int64_t)(y - b[i]) * w) >> 15);
|
||||
}
|
||||
t->dist_w = w;
|
||||
if (!w)
|
||||
t->dist_on = 0; /* (faded out: off) */
|
||||
}
|
||||
|
||||
/* master: peak limiter in front of the soft clipper, a 35 ms hold then ~46 ms release (SLOOP 2.6), threshold where tanh is still nearly linear,
|
||||
@@ -78,6 +97,12 @@ typedef struct {
|
||||
#define LIM_HOLD 48u
|
||||
#define LIM_REL 11 /* the release after the hold: ~46 ms (12 before the hold: ~93 ms; the same loudness) */
|
||||
static lim_t lim_dac = {.env = LIM_T, .g = 32768}, lim_usb = {.env = LIM_T, .g = 32768};
|
||||
/* (Clipper 0.9) the gain's way over a block: an S curve (smoothstep at (i + 1) / 32), not a straight line: no corner in
|
||||
* the gain at the blocks' joints (a straight ramp put one at each, a tick on every loud attack). Each block still ends
|
||||
* at the gain its look-ahead asks for; the samples going out were in the last block's look-ahead (g0 fits them) */
|
||||
static const uint16_t LIM_S[CTL] = {94, 368, 810, 1408, 2150, 3024, 4018, 5120, 6318, 7600, 8954, 10368, 11830, 13328,
|
||||
14850, 16384, 17918, 19440, 20938, 22400, 23814, 25168, 26450, 27648, 28750, 29744,
|
||||
30618, 31360, 31958, 32400, 32674, 32768};
|
||||
/* l, r: n (<= CTL) samples in; out: the n samples of CTL before, limited (before the knee) */
|
||||
static void lim_block(lim_t *s, int32_t *l, int32_t *r, uint32_t n)
|
||||
{
|
||||
@@ -107,7 +132,8 @@ static void lim_block(lim_t *s, int32_t *l, int32_t *r, uint32_t n)
|
||||
s->g = g1;
|
||||
dg = (g1 - g0) / (int32_t)(n ? n : 1u); /* (towards 0: the gain never above both ends' bound) */
|
||||
for (i = 0; i < n; i++) {
|
||||
int32_t xl = s->dl[w], xr = s->dr[w], g = g0 + dg * (int32_t)(i + 1u);
|
||||
int32_t xl = s->dl[w], xr = s->dr[w], g = n == CTL ? g0 + (int32_t)(((int64_t)(g1 - g0) * LIM_S[i]) >> 15)
|
||||
: g0 + dg * (int32_t)(i + 1u);
|
||||
s->dl[w] = l[i], s->dr[w] = r[i];
|
||||
w = (w + 1u) & (CTL - 1u);
|
||||
if (i + 1u == n)
|
||||
@@ -329,11 +355,11 @@ static void plate_run(const int32_t *rev_in, int32_t *wet_l, int32_t *wet_r, uin
|
||||
static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t *rev_in, int32_t *wet_l,
|
||||
int32_t *wet_r, uint32_t n)
|
||||
{
|
||||
uint32_t i, k, dl = delay_samples();
|
||||
uint32_t i, k, dl = delay_samples(), dlo;
|
||||
int32_t fb = song.g[G_DFDBK] * 230, col = 2000 + song.g[G_DCOLOR] * 240;
|
||||
int32_t dmix = song.g[G_DMIX] * 258;
|
||||
int32_t g = 17000 + song.g[G_RSIZE] * 104, lpk = 32767 - song.g[G_RDAMP] * 200; /* loop gain (RT60 ~0.4..4 s), damping */
|
||||
int32_t cdepth = song.g[G_CDEPTH] * 6;
|
||||
int32_t cdepth = song.g[G_CDEPTH] * 6, cdep0;
|
||||
int32_t ca0, ca1, cb0, cb1, ma, mb, dca, dcb;
|
||||
int plate = CLIPPER_SYNTH && song.g[G_RTYPE] == RT_PLATE; /* Clipper: the plate instead of the room */
|
||||
const uint32_t L0 = REV_LINE[0] + REV_MOD + 2u, B1 = L0, B2 = B1 + REV_LINE[1], B3 = B2 + REV_LINE[2];
|
||||
@@ -350,14 +376,21 @@ static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!fx.dl_cur)
|
||||
fx.dl_cur = dl, fx.dl_x = DL_XF, fx.cdep = cdepth;
|
||||
if (dl != fx.dl_cur && fx.dl_x >= DL_XF) /* (0.9) a new TIME: the fade starts (one at a time) */
|
||||
fx.dl_old = fx.dl_cur, fx.dl_cur = dl, fx.dl_x = 0;
|
||||
dl = fx.dl_cur, dlo = fx.dl_old;
|
||||
cdep0 = fx.cdep; /* (0.9) DEPTH glides: ~60 ms over its range */
|
||||
fx.cdep += clamp(cdepth - fx.cdep, -10, 10);
|
||||
{ /* the chorus' two read points (Q8 samples back) and line 0's extra length, at both ends of the block */
|
||||
int32_t s0 = osc_sine(fx.cho_ph), s1, m0 = osc_sine(fx.rev_ph), m1;
|
||||
fx.cho_ph += LFO_INC[song.g[G_CRATE] & 127];
|
||||
fx.rev_ph += LFO_INC[30];
|
||||
s1 = osc_sine(fx.cho_ph);
|
||||
m1 = osc_sine(fx.rev_ph);
|
||||
ca0 = (400 << 8) + ((s0 + 32768) * cdepth >> 8), ca1 = (400 << 8) + ((s1 + 32768) * cdepth >> 8);
|
||||
cb0 = (400 << 8) + ((32767 - s0) * cdepth >> 8), cb1 = (400 << 8) + ((32767 - s1) * cdepth >> 8);
|
||||
ca0 = (400 << 8) + ((s0 + 32768) * cdep0 >> 8), ca1 = (400 << 8) + ((s1 + 32768) * fx.cdep >> 8);
|
||||
cb0 = (400 << 8) + ((32767 - s0) * cdep0 >> 8), cb1 = (400 << 8) + ((32767 - s1) * fx.cdep >> 8);
|
||||
ma = (REV_MOD << 8) + ((m0 * REV_MOD) >> 7), mb = (REV_MOD << 8) + ((m1 * REV_MOD) >> 7);
|
||||
dca = (ca1 - ca0) >> CTL_LOG2, dcb = (cb1 - cb0) >> CTL_LOG2;
|
||||
}
|
||||
@@ -381,6 +414,13 @@ static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t
|
||||
uint32_t p = fx.dly_w - dl, e = p >> 1;
|
||||
int32_t a = dly_buf[e & (DLY_LEN - 1u)], v;
|
||||
x = (p & 1u) ? (a + dly_buf[(e + 1u) & (DLY_LEN - 1u)]) >> 1 : a;
|
||||
if (fx.dl_x < DL_XF) { /* (0.9) the old TIME's tap fading out */
|
||||
int32_t xo;
|
||||
p = fx.dly_w - dlo, e = p >> 1, a = dly_buf[e & (DLY_LEN - 1u)];
|
||||
xo = (p & 1u) ? (a + dly_buf[(e + 1u) & (DLY_LEN - 1u)]) >> 1 : a;
|
||||
x = xo + (((x - xo) * (int32_t)fx.dl_x) >> 10);
|
||||
fx.dl_x++;
|
||||
}
|
||||
fx.dly_lp += mulq15(x - fx.dly_lp, col);
|
||||
v = (dly_in[i] >> 1) + mulq15(fx.dly_lp, fb);
|
||||
if (fx.dly_w & 1u)
|
||||
@@ -390,6 +430,11 @@ static void fx_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_t
|
||||
}
|
||||
#else
|
||||
x = dly_buf[(fx.dly_w - dl) & (DLY_LEN - 1u)];
|
||||
if (fx.dl_x < DL_XF) { /* (0.9) the old TIME's tap fading out */
|
||||
int32_t xo = dly_buf[(fx.dly_w - dlo) & (DLY_LEN - 1u)];
|
||||
x = xo + (((x - xo) * (int32_t)fx.dl_x) >> 10);
|
||||
fx.dl_x++;
|
||||
}
|
||||
fx.dly_lp += mulq15(x - fx.dly_lp, col);
|
||||
dly_buf[fx.dly_w & (DLY_LEN - 1u)] =
|
||||
(int16_t)clamp((dly_in[i] >> 1) + mulq15(fx.dly_lp, fb), -32768, 32767);
|
||||
@@ -507,6 +552,10 @@ static djf_t djf, tflt[NTRK];
|
||||
static int djf_block(djf_t *f, int32_t v, tsvf_t *c)
|
||||
{
|
||||
int32_t to;
|
||||
if ((v < 0 && f->mode > 0) || (v > 0 && f->mode < 0))
|
||||
v = 0; /* (Clipper 0.9) from one side to the other (a CC, the editor):
|
||||
* open this side first, then the other from open (a jump from
|
||||
* the low-pass to the high-pass was a crack) */
|
||||
if (v < 0 && f->mode >= 0) { /* (switching side: from open) */
|
||||
f->mode = -1;
|
||||
f->cut = 127 << 8;
|
||||
@@ -596,6 +645,7 @@ typedef struct {
|
||||
uint8_t type; /* the type running */
|
||||
uint8_t cnt; /* CRUSH: samples left of the held one */
|
||||
uint16_t wp; /* FLANG / CHOR: the line's next write */
|
||||
uint16_t fill; /* (0.9) FLANG / CHOR: samples before the wet comes in (the line full first) */
|
||||
uint32_t ph; /* the sweep's phase */
|
||||
int32_t hp, lp1, lp2, dc, hold; /* low cut (Q8), the two low-passes, DC blocker (Q8), CRUSH's held sample */
|
||||
int32_t px[PH_ST], py[PH_ST], fb; /* PHASR: each stage's last input and output, the fed back */
|
||||
@@ -729,7 +779,11 @@ static __attribute__((noinline)) void ins_swept(ins_t *s, const int16_t *p, int3
|
||||
for (i = 0; i < n; i++, ph += inc) {
|
||||
int32_t x = b[i], r0, r1, v, fr;
|
||||
uint32_t d; /* the delay, Q16 samples */
|
||||
w += clamp(tw - w, -SL_SLOPE, SL_SLOPE);
|
||||
if (s->fill)
|
||||
s->fill--; /* (0.9: an empty line read back: a step when the sound reaches
|
||||
* the delay; the wet waits for the line) */
|
||||
if (!s->fill)
|
||||
w += clamp(tw - w, -SL_SLOPE, SL_SLOPE);
|
||||
if (chorus) {
|
||||
d = (uint32_t)((140 << 16) + ((osc_sine(ph) * (int32_t)dep * 50) >> 5)); /* 3.2 +- 2.3 ms */
|
||||
} else {
|
||||
@@ -754,30 +808,32 @@ static __attribute__((noinline)) void ins_swept(ins_t *s, const int16_t *p, int3
|
||||
}
|
||||
|
||||
/* the INSERT of the settings p on one channel b through state s: 1 while it runs (or fades out); 0: dry, bit for bit */
|
||||
static __attribute__((noinline)) int ins_run(ins_t *s, const int16_t *p, int32_t *b, uint32_t n)
|
||||
static __attribute__((noinline)) int ins_run(ins_t *s, const int16_t *p, int32_t *b, uint32_t n, int fresh)
|
||||
{
|
||||
int32_t ty = clamp(p[P_ITYPE], 0, IT_N - 1), tw;
|
||||
if (ty >= IT_JUNO1)
|
||||
ty = IT_OFF; /* the JUNO chorus: not here (juno_chorus, after the FILTER) */
|
||||
if (s->type != ty && !s->w) /* faded out: the new type from rest */
|
||||
s->type = (uint8_t)ty;
|
||||
s->type = (uint8_t)ty, s->fill = 0;
|
||||
tw = s->type == ty && ty ? ins_mixq(p[P_IMIX]) : 0;
|
||||
if (!s->w) {
|
||||
if (!s->w && !s->fill) {
|
||||
if (!tw)
|
||||
return 0; /* dry: bit for bit */
|
||||
memset(s, 0, sizeof *s); /* starting: no stale line or filter */
|
||||
s->type = (uint8_t)ty;
|
||||
if ((ty == IT_FLANGER || ty == IT_CHORUS) && !fresh)
|
||||
s->fill = IL_LEN; /* (the part was silent: the empty line is its past, no wait) */
|
||||
}
|
||||
if (s->type >= IT_PHASER)
|
||||
ins_swept(s, p, b, n, tw);
|
||||
else
|
||||
ins_drive(s, p, b, n, tw);
|
||||
return s->w != 0;
|
||||
return s->w != 0 || s->fill != 0; /* (filling: running, the wet still out) */
|
||||
}
|
||||
/* a part's INSERT on its block b (mix_part): nothing while TYPE is OFF or MIX is 0 and faded */
|
||||
static void track_insert(track_t *t, int32_t *b, uint32_t n)
|
||||
static void track_insert(track_t *t, int32_t *b, uint32_t n, int fresh)
|
||||
{
|
||||
t->ins_run = (uint8_t)ins_run(&ins[(uint32_t)(t - trk) % NPART], t->p, b, n);
|
||||
t->ins_run = (uint8_t)ins_run(&ins[(uint32_t)(t - trk) % NPART], t->p, b, n, fresh);
|
||||
}
|
||||
/* the INSERT at rest at once (mix_part: TYPE turned OFF while the part was silent, its fade never ran) */
|
||||
static __attribute__((noinline)) void ins_rest(track_t *t)
|
||||
@@ -899,14 +955,91 @@ static int32_t mix_glide(int32_t from, int32_t to)
|
||||
return d <= 8 && d >= -8 ? to : from + d / 4;
|
||||
}
|
||||
|
||||
#if CLIPPER_SYNTH
|
||||
/* Clipper 0.9, the part's duck: what cannot change under a sounding part without a crack (another filter MODEL, another
|
||||
* WAVE table, which is built in the voices' own memory, another FMX patch: PTCH) waits for it: the part fades out over
|
||||
* 2.9 ms (an S curve), holds silent while the change lands (a table built: a few ms), fades in over 2.9 ms. A silent part:
|
||||
* at once; one fading out for a sound loaded: after its fade. part_pending: what waits; part_apply: lands it (FMX: fmx_block loads
|
||||
* its patch while dk_free) */
|
||||
static uint32_t part_pending(track_t *t, int32_t fmw)
|
||||
{
|
||||
uint32_t k = (uint32_t)(t - trk) % NPART, w = 0;
|
||||
if (!t->fm_eff)
|
||||
t->fm_eff = (uint8_t)fmw;
|
||||
w |= fmw != t->fm_eff;
|
||||
if (ENGINES[t->engine % NENGINES] == &ENG_WAVE) {
|
||||
int16_t tab = (int16_t)((uint32_t)t->p[P_E0] % WT_NALL + 1u);
|
||||
if (!wt_tab_eff[k])
|
||||
wt_tab_eff[k] = tab;
|
||||
w |= (uint32_t)(wt_tab_eff[k] != tab) << 1;
|
||||
}
|
||||
if (ENGINES[t->engine % NENGINES] == &ENG_FMX && fmx_slot_seen[k] &&
|
||||
fmx_slot_seen[k] != clamp(t->p[P_E0], 0, (int32_t)FMX_NSLOT - 1) + 1 && !((fmx_reload >> k) & 1u))
|
||||
w |= 4u;
|
||||
return w;
|
||||
}
|
||||
static void part_apply(track_t *t, int32_t fmw)
|
||||
{
|
||||
uint32_t k = (uint32_t)(t - trk) % NPART;
|
||||
t->fm_eff = (uint8_t)fmw;
|
||||
if (ENGINES[t->engine % NENGINES] == &ENG_WAVE)
|
||||
wt_tab_eff[k] = (int16_t)((uint32_t)t->p[P_E0] % WT_NALL + 1u);
|
||||
else
|
||||
wt_tab_eff[k] = 0;
|
||||
}
|
||||
static void part_duck(track_t *t, int32_t *b, uint32_t n, int32_t fmw)
|
||||
{
|
||||
uint32_t k;
|
||||
if (t->dk_phase == 2u) { /* held silent until the change has landed (50 ms at most) */
|
||||
uint32_t p = (uint32_t)(t - trk) % NPART;
|
||||
int ready = !part_pending(t, fmw) && (ENGINES[t->engine % NENGINES] != &ENG_WAVE || wt_have == wt_tab_eff[p] - 1);
|
||||
for (k = 0; k < n; k++)
|
||||
b[k] = 0;
|
||||
if (ready || ++t->dk_hold > 68u)
|
||||
t->dk_phase = 3, t->dk_pos = 0, t->dk_hold = 0;
|
||||
return;
|
||||
}
|
||||
for (k = 0; k < n; k++) {
|
||||
int32_t x = t->dk_phase == 1u ? 32768 - t->dk_pos * 256 : t->dk_pos * 256, x2 = (x * x) >> 15;
|
||||
int32_t g = 3 * x2 - 2 * ((x2 * x) >> 15); /* smoothstep, Q15 */
|
||||
if (t->dk_pos >= 128u) {
|
||||
if (t->dk_phase == 1u)
|
||||
b[k] = 0;
|
||||
continue;
|
||||
}
|
||||
b[k] = (int32_t)(((int64_t)b[k] * g) >> 15);
|
||||
t->dk_pos++;
|
||||
}
|
||||
if (t->dk_pos >= 128u) {
|
||||
t->dk_phase = t->dk_phase == 1u ? 2u : 0u; /* (out: held from the next block, the change lands there) */
|
||||
t->dk_pos = 0, t->dk_hold = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* one synth part into the dry mix and the sends; a part with no voice sounding costs
|
||||
* the LFO tick and a cleared buffer only (after the DIST tail has run out) */
|
||||
static void mix_part1(track_t *t, uint32_t n)
|
||||
{
|
||||
int32_t *b = part_buf;
|
||||
uint32_t i;
|
||||
uint32_t i, fresh = !t->tail; /* (0.9) the part was silent: a change takes effect at once */
|
||||
int32_t g0 = 32767 - t->att, g1 = gain_next(t);
|
||||
#if CLIPPER_SYNTH
|
||||
int32_t fmw = clamp(t->p[P_FMODEL], FM_SVF, FM_LAST);
|
||||
if (part_pending(t, fmw)) { /* (0.9) a change that would crack the sound: the duck first */
|
||||
if (fresh)
|
||||
part_apply(t, fmw); /* (silent: at once) */
|
||||
else if (t->xf_on)
|
||||
; /* (a sound loaded: the old one fades out as it was, the change
|
||||
* lands after, the part silent) */
|
||||
else if (!t->dk_phase)
|
||||
t->dk_phase = 1, t->dk_pos = 0;
|
||||
else if (t->dk_phase == 3u)
|
||||
t->dk_phase = 1, t->dk_pos = (uint8_t)(128u - t->dk_pos); /* (from where the fade-in got to) */
|
||||
}
|
||||
t->dk_free = (uint8_t)(fresh || t->dk_phase == 2u);
|
||||
if (t->dk_phase == 2u)
|
||||
part_apply(t, fmw);
|
||||
if (track_render(t, b, n))
|
||||
t->tail = t->p[P_ITYPE] ? 64 : 16, t->ins_xt = 0; /* blocks of DIST / INSERT state to run out after the last
|
||||
* voice (the INSERT's: 46 ms, a flanger's feedback) */
|
||||
@@ -917,6 +1050,8 @@ static void mix_part1(track_t *t, uint32_t n)
|
||||
if (t->ins_run && !t->p[P_ITYPE])
|
||||
ins_rest(t); /* TYPE OFF while silent: no fade-out left for the next note */
|
||||
jc_idle(t); /* (0.8: the JUNO chorus the same) */
|
||||
part_apply(t, fmw); /* (0.9: silent: every change at once) */
|
||||
t->dk_phase = 0, t->dk_pos = 0;
|
||||
slicer_track(t, 0, n);
|
||||
return;
|
||||
}
|
||||
@@ -927,6 +1062,10 @@ static void mix_part1(track_t *t, uint32_t n)
|
||||
slicer_track(t, 0, n); /* (the SLICER's step clock runs on) */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if CLIPPER_SYNTH
|
||||
if (t->dk_phase)
|
||||
part_duck(t, b, n, fmw);
|
||||
#endif
|
||||
if (!g0 && !g1) { /* silent (MUTE / SOLO): the voices run, nothing is heard */
|
||||
slicer_track(t, 0, n);
|
||||
@@ -939,13 +1078,22 @@ static void mix_part1(track_t *t, uint32_t n)
|
||||
#endif
|
||||
int32_t gl = 4096 - (pan > 0 ? pan * 64 : 0), gr = 4096 + (pan < 0 ? pan * 64 : 0);
|
||||
int32_t c = t->p[P_CHOR] * 258, d = t->p[P_DLY] * 258, r = t->p[P_REV] * 258, pk = t->peak;
|
||||
int32_t xmax = c > d ? c : d;
|
||||
int32_t xmax, c0, d0, r0, dsc, dsd, dsr;
|
||||
int32_t ga = mulq15(g0, duck.g0), gb = mulq15(g1, duck.g1); /* mute x duck, ramped over the block */
|
||||
xmax = 0x7FFFFFFF / ((xmax > r ? xmax : r) | 1); /* sends: loud chords at a high LEVEL */
|
||||
track_dist(t, b, n);
|
||||
if (!t->mix_on || fresh) /* (0.9) the sends glide as LEVEL does (a jump: a crack in the
|
||||
* chorus's and the delay's wet) */
|
||||
t->snd_c = c, t->snd_d = d, t->snd_r = r;
|
||||
c0 = t->snd_c, d0 = t->snd_d, r0 = t->snd_r;
|
||||
t->snd_c = mix_glide(c0, c), t->snd_d = mix_glide(d0, d), t->snd_r = mix_glide(r0, r);
|
||||
dsc = t->snd_c - c0, dsd = t->snd_d - d0, dsr = t->snd_r - r0;
|
||||
xmax = c0 > d0 ? c0 : d0;
|
||||
xmax = xmax > r0 ? xmax : r0;
|
||||
xmax = xmax > c ? xmax : c, xmax = xmax > d ? xmax : d, xmax = xmax > r ? xmax : r;
|
||||
xmax = 0x7FFFFFFF / (xmax | 1); /* sends: loud chords at a high LEVEL */
|
||||
track_dist(t, b, n, fresh);
|
||||
#if CLIPPER_SYNTH
|
||||
if (t->p[P_ITYPE] | t->ins_run) {
|
||||
track_insert(t, b, n); /* the INSERT (0.6): off, nothing */
|
||||
track_insert(t, b, n, fresh); /* the INSERT (0.6): off, nothing */
|
||||
t->ins_res = (uint16_t)(b[n - 1u] < 0 ? (-b[n - 1u] > 65535 ? 65535 : -b[n - 1u])
|
||||
: (b[n - 1u] > 65535 ? 65535 : b[n - 1u])); /* (its tail's end) */
|
||||
}
|
||||
@@ -980,6 +1128,8 @@ static void mix_part1(track_t *t, uint32_t n)
|
||||
xs = clamp(x, -xmax, xmax); /* sends: mulq15 would overflow */
|
||||
if (a > pk)
|
||||
pk = a;
|
||||
c = c0 + ((dsc * (int32_t)i) >> CTL_LOG2), d = d0 + ((dsd * (int32_t)i) >> CTL_LOG2);
|
||||
r = r0 + ((dsr * (int32_t)i) >> CTL_LOG2);
|
||||
if (c)
|
||||
send_c[i] += mulq15(xs, c);
|
||||
if (d)
|
||||
|
||||
+16
-5
@@ -3,7 +3,8 @@
|
||||
/* Parameter descriptors, formatting and the page table. */
|
||||
static const char *const N_LWAVE[] = {"SIN", "TRI", "SAW", "SQR", "S&H"};
|
||||
static const char *const N_AMODE[] = {"OFF", "UP", "DN", "UPDN", "RND", "ORD", /* (append-only: seq.c AM_*) */
|
||||
"REPEAT", "DNUP", "UP+8", "CONV", "DIVG", "PINKY", "THUMB", "WALK", "CHORD"};
|
||||
"REPEAT", "DNUP", "UP+8", "CONV", "DIVG", "PINKY", "THUMB", "WALK", "CHORD",
|
||||
"TURNG"}; /* (0.9: a Turing machine over the held notes) */
|
||||
static const char *const N_MOUT[] = {"KEYS", "SEQ"};
|
||||
static const char *const N_MIN[] = {"NOTES", "CLOCK"}; /* G_ROUTE: MIDI in, notes and clock, or the clock only (seq.c) */ /* G_MIDI: what goes to MIDI OUT (seq.c seq_out_on) */
|
||||
static const char *const N_DIV[] = {"1/4", "1/8", "1/16", "1/32", "8T", "16T"};
|
||||
@@ -28,7 +29,7 @@ static const char *const N_DASH[] = {"--"};
|
||||
static const char *const N_SYNC[] = {"INT", "USB", "TRS"}; /* G_SYNC: the tempo and PLAY / STOP from (seq.c mclk) */
|
||||
static const char *const N_GO[] = {"--", "GO"};
|
||||
static const char *const N_SLCR[] = {"OFF", "GATE", "STUT"}; /* SL_OFF .. SL_STUT (slicer.c) */
|
||||
static const char *const N_FMODEL[] = {"SVF", "MOOG"}; /* P_FMODEL: FM_SVF, FM_MOOG */
|
||||
static const char *const N_FMODEL[] = {"SVF", "MOOG", "MS20", "DIODE", "SEM", "NOTCH", "BP", "HP"}; /* P_FMODEL: FM_* */
|
||||
static const char *const N_SLDIV[] = {"1/8", "1/16", "1/32", "8T", "16T", "32T"}; /* SL_DEN */
|
||||
static const char *const N_CHORD[] = {"OFF", "TRIAD", "7TH", "9TH", "SUS4", "POWER"}; /* seq.c CHORD_DEG */
|
||||
static const char *const N_RTYPE[] = {"ROOM", "PLATE"};
|
||||
@@ -115,7 +116,7 @@ static const param_desc_t TP[P_COUNT] = {
|
||||
[P_MUTE] = PE("MUTE", N_ONOFF, 0),
|
||||
#if CLIPPER_SYNTH /* the sound's modulation (core.h P_VELF ..: voice.c) */
|
||||
[P_SLCR] = PD("VEL>F", F_BIPCT, -64, 63, 0),
|
||||
[P_SLPAT] = {"MODL", F_ENUM, FM_SVF, FM_MOOG, FM_SVF, N_FMODEL, 0}, /* P_FMODEL (core.h) */
|
||||
[P_SLPAT] = {"MODL", F_ENUM, FM_SVF, FM_LAST, FM_SVF, N_FMODEL, 0}, /* P_FMODEL (core.h; 0.9: + MS20 DIODE SEM NOTCH BP HP) */
|
||||
[P_SLRATE] = PE("MW>", N_MODDST, MD_VIB),
|
||||
[P_SLDEPTH] = PE("AT>", N_MODDST, MD_CUT),
|
||||
#else
|
||||
@@ -154,6 +155,8 @@ static const param_desc_t TP[P_COUNT] = {
|
||||
[P_MSKEY] = PE("START", N_MSKEY, 1),
|
||||
[P_SPICE] = PD("SPICE", F_PCT, 0, 127, 0),
|
||||
[P_DICE] = PD("DICE", F_INT, 0, 127, 0),
|
||||
[P_VINT] = PD("VINTG", F_PCT, 0, 127, 0), /* 0.9 */
|
||||
[P_SLOOP] = PD("LOOP", F_INT, 1, 16, 16),
|
||||
#endif
|
||||
};
|
||||
#if CLIPPER_SYNTH
|
||||
@@ -264,6 +267,12 @@ static const param_desc_t *track_desc(const track_t *t, uint32_t id)
|
||||
{
|
||||
if(is_drum(t) && id==P_E0) return &DRUM_KIT_DESC;
|
||||
#if CLIPPER_SYNTH
|
||||
if ((id == P_SPICE || id == P_DICE) && t->p[P_AMODE] == 15) { /* (0.9) the arp's TURNG (seq.c AM_TURING) */
|
||||
static param_desc_t d;
|
||||
d = TP[id];
|
||||
d.label = id == P_SPICE ? "MUTAT" : "SEED";
|
||||
return &d;
|
||||
}
|
||||
if (id >= P_IA && id <= P_IC) /* the INSERT's values as its TYPE names them */
|
||||
return ins_desc(t->p[P_ITYPE], id - P_IA);
|
||||
if (id >= P_M1SRC && id <= P_M6AMT && (id - P_M1SRC) % 3u == 1u) { /* a matrix DST: the engine's own names */
|
||||
@@ -506,7 +515,7 @@ static const page_t PAGES[] = {
|
||||
#endif
|
||||
{"VOICE", FAM_EDIT, SC_TRACK, GR_NONE, {P_VOICE, P_GLIDE, P_GLMODE, P_PRIO}},
|
||||
#if CLIPPER_SYNTH /* (one instrument: nothing to mute) */
|
||||
{"VOICE 2", FAM_EDIT, SC_TRACK, GR_NONE, {P_ALLOC, P_DETUNE, P_PAN, 0xFF}},
|
||||
{"VOICE 2", FAM_EDIT, SC_TRACK, GR_NONE, {P_ALLOC, P_DETUNE, P_PAN, P_VINT}}, /* (0.9: VINTAGE) */
|
||||
{"LAYER", FAM_EDIT, SC_SYN, GR_LAYER, {0, 1, 2, 3}}, /* X_LYMODE X_LYSOUND X_LYSPLIT X_LYLEVEL */
|
||||
{"LAYER 2", FAM_EDIT, SC_SYN, GR_LAYER, {4, 5, 6, 7}}, /* X_LYOCT X_LYPAN X_LYFILT X_LYSWAP */
|
||||
{"MORPH", FAM_EDIT, SC_SYN, GR_MORPH, {8, 9, 10, 0xFF}}, /* X_MORPH X_SETA X_SETB */
|
||||
@@ -518,6 +527,7 @@ static const page_t PAGES[] = {
|
||||
{"GLOBAL", FAM_GLO, SC_GLOBAL, GR_NONE, {G_BPM, G_SWING, G_CLOCK, G_TUNE}},
|
||||
#if CLIPPER_SYNTH /* (no kick to duck to, no note repeat) */
|
||||
{"MASTER", FAM_GLO, SC_GLOBAL, GR_NONE, {G_DUST, G_FILT, 0xFF, 0xFF}},
|
||||
{"TUNING", FAM_GLO, SC_SYN, GR_NONE, {47, 48, 0xFF, 0xFF}}, /* (0.9) X_TSYS X_TROOT: voice.c tune_cfg */
|
||||
{"SYSTEM", FAM_GLO, SC_GLOBAL, GR_NONE, {G_MIDI, G_SYNC, G_ROUTE, G_INFO}},
|
||||
#else
|
||||
{"MASTER", FAM_GLO, SC_GLOBAL, GR_NONE, {G_DUST, G_DUCK, G_FILT, G_ROLL}},
|
||||
@@ -531,7 +541,8 @@ static const page_t PAGES[] = {
|
||||
{"ARP", FAM_ARP, SC_TRACK, GR_ARP, {P_AMODE, P_ARATE, P_AOCT, P_AGATE}},
|
||||
{"ARP 2", FAM_ARP, SC_TRACK, GR_NONE, {P_ASWING, P_APROB, P_AHOLD, P_AORDER}},
|
||||
#if CLIPPER_SYNTH
|
||||
{"SPICE", FAM_ARP, SC_TRACK, GR_NONE, {P_SPICE, P_DICE, 0xFF, 0xFF}}, /* (0.8) the arp's and the steps' notes vary */
|
||||
{"SPICE", FAM_ARP, SC_TRACK, GR_NONE, {P_SPICE, P_DICE, P_SLOOP, 0xFF}}, /* (0.8) the arp's and the steps' notes
|
||||
* vary; (0.9) TURNG: MUTAT SEED LOOP */
|
||||
#endif
|
||||
{"STEP", FAM_SEQ, SC_STEP, GR_ROLL, {0, 1, 2, 3}},
|
||||
{"PATTERN", FAM_SEQ, SC_TRACK, GR_STEPS, {P_SLEN, P_SDIV, P_SSWING, P_SGATE}},
|
||||
|
||||
@@ -25,6 +25,6 @@ static const int8_t PRESET_TRIM_CL[PTC_ENGINES][PTC_MAX] = {
|
||||
{/* 18.0 TERRAIN */ -10, /* 18.1 RIPPLE PAD */ -10, /* 18.2 CRYSTAL */ 9, /* 18.3 BUMPY BASS */ 19, /* 18.4 SADDLE LEAD */ -10, /* 18.5 FOLD DRONE */ -5, /* 18.6 TWISTER */ -18, /* 18.7 CHAOS FX */ -8, /* 18.8 ORBIT KEYS */ 23, /* 18.9 TERRA PLUCK */ 19},
|
||||
{/* 19.0 FMX EP */ 3, /* 19.1 FMX BELL */ -2, /* 19.2 SAW FM BASS */ 16, /* 19.3 FMX BRASS */ 2, /* 19.4 FMX ORGAN */ -6, /* 19.5 RING BELLS */ 18, /* 19.6 TRUE FM GRWL */ 4, /* 19.7 CHIP FM LEAD */ 1, /* 19.8 OPL KEYS */ 11, /* 19.9 FMX PAD */ -2, /* 19.10 FM KICK */ 10, /* 19.11 METAL HIT */ 11, /* 19.12 FM SYNC LEAD */ 10, /* 19.13 FMX PLUCK */ 15, /* 19.14 FM WOBBLE */ 8, /* 19.15 CASCADE */ -4},
|
||||
{/* 20.0 WAVE STEPS */ -6, /* 20.1 RHYTHM SEQ */ -4, /* 20.2 SWEEP PAD */ -2, /* 20.3 FIFTH STAB */ -1, /* 20.4 MINOR SEQ */ -4, /* 20.5 MAJOR SEQ */ -6, /* 20.6 OCTAVE BASS */ -3, /* 20.7 TRANCE GATE */ 0, /* 20.8 BELL STEPS */ -4, /* 20.9 8BIT SEQ */ -9, /* 20.10 MORPH PAD */ -2, /* 20.11 VOX STEPS */ -1, /* 20.12 NOISY SEQ */ -3, /* 20.13 DUB STEPS */ -8, /* 20.14 DORIAN RUN */ -4, /* 20.15 PING PONG */ -2},
|
||||
{/* 21.0 JUNO 106 PAD */ 1, /* 21.1 JUNO BRASS */ 5, /* 21.2 JUNO BASS */ 11, /* 21.3 JUNO STRINGS */ 2, /* 21.4 POLY KEYS */ 7, /* 21.5 SYNTHWAVE LD */ 3, /* 21.6 80S HITS */ 23, /* 21.7 JUNO PIANO */ 16, /* 21.8 DREAM PAD */ 1, /* 21.9 SUB BASS 106 */ 3, /* 21.10 SYNTH BRASS 2 */ 7, /* 21.11 ARP PLUCK */ 23, /* 21.12 NOISE SWEEP */ 3, /* 21.13 JUNO ORGAN */ 3, /* 21.14 SAW LEAD 106 */ 5, /* 21.15 HOOVER JUNO */ 17},
|
||||
{/* 22.0 VS PAD */ -3, /* 22.1 VECTOR SWEEP */ -17, /* 22.2 VS BRASS */ 9, /* 22.3 GLASS VS */ -11, /* 22.4 VOX MORPH */ 0, /* 22.5 DIGI BELLS */ -8, /* 22.6 VS BASS */ -1, /* 22.7 WAVE LOOP */ -8, /* 22.8 ORGAN DRIFT */ -9, /* 22.9 STRING VS */ -3, /* 22.10 METAL HIT */ 23, /* 22.11 HOLLOW KEYS */ 8, /* 22.12 RESO VECTOR */ -3, /* 22.13 SPACE DRONE */ 3, /* 22.14 VS LEAD */ -6, /* 22.15 CHOIR VS */ -3},
|
||||
{/* 21.0 JUNO 106 PAD */ 1, /* 21.1 JUNO BRASS */ 5, /* 21.2 JUNO BASS */ 11, /* 21.3 JUNO STRINGS */ 2, /* 21.4 POLY KEYS */ 7, /* 21.5 SYNTHWAVE LD */ 3, /* 21.6 80S HITS */ 23, /* 21.7 JUNO PIANO */ 16, /* 21.8 DREAM PAD */ 1, /* 21.9 SUB BASS 106 */ 3, /* 21.10 SYNTH BRASS 2 */ 7, /* 21.11 ARP PLUCK */ 23, /* 21.12 NOISE SWEEP */ 3, /* 21.13 JUNO ORGAN */ 3, /* 21.14 SAW LEAD 106 */ 5, /* 21.15 HOOVER JUNO */ 17, /* 21.16 TURING JUNO */ 23},
|
||||
{/* 22.0 VS PAD */ -3, /* 22.1 VECTOR SWEEP */ -17, /* 22.2 VS BRASS */ 9, /* 22.3 GLASS VS */ -11, /* 22.4 VOX MORPH */ 0, /* 22.5 DIGI BELLS */ -8, /* 22.6 VS BASS */ -1, /* 22.7 WAVE LOOP */ -8, /* 22.8 ORGAN DRIFT */ -9, /* 22.9 STRING VS */ -3, /* 22.10 METAL HIT */ 23, /* 22.11 HOLLOW KEYS */ 8, /* 22.12 RESO VECTOR */ -3, /* 22.13 SPACE DRONE */ 3, /* 22.14 VS LEAD */ -6, /* 22.15 CHOIR VS */ -3, /* 22.16 MS20 VECTOR */ 2, /* 22.17 DIODE VS BASS */ 7},
|
||||
};
|
||||
+68
-16
@@ -54,12 +54,18 @@ _Static_assert(P_COUNT == PROJ_NP || (CLIPPER_SYNTH && P_COUNT == PROJ_NP + PROJ
|
||||
#define PROJ_XM2 (PROJ_XM1 + 1u + 2u * PROJ_XI) /* the byte of CLIPPER_PROJ_MARK_06 */
|
||||
/* 0.8: the MOD SEQ's RATE LEN SMTH START, SPICE, DICE (PROJ_XS) of both, 4 bytes each (proj_xs_word), after 0.6's,
|
||||
* then CLIPPER_PROJ_MARK_08; their steps in track 4's free lock slots (two a byte, + 8; then the mark) */
|
||||
#define PROJ_XS ((uint32_t)(P_E0 - P_MSRATE))
|
||||
#define PROJ_XS ((uint32_t)(P_VINT - P_MSRATE))
|
||||
/* 0.9: VINTAGE and LOOP of both (PROJ_X9 each, value - its minimum) in track 4, after the steps' mark, then
|
||||
* CLIPPER_PROJ_MARK_09 */
|
||||
#define PROJ_X9 ((uint32_t)(P_E0 - P_VINT))
|
||||
#define PROJ_X9_AT (PROJ_MS_MARK + 1u)
|
||||
#define PROJ_X9_MARK (PROJ_X9_AT + 2u * PROJ_X9)
|
||||
#define CLIPPER_PROJ_MARK_09 0xC9u
|
||||
#define PROJ_XM3 (PROJ_XM2 + 1u + 8u) /* the byte of CLIPPER_PROJ_MARK_08 */
|
||||
#define CLIPPER_PROJ_MARK_08 0xC8u
|
||||
#define PROJ_MS_MARK 64u /* track 4: the byte after the steps */
|
||||
_Static_assert(PROJ_XA == 25u && PROJ_XI == 5u && PROJ_XS == 6u && P_MSRATE == P_IMIX + 1 && PROJ_XM3 < 3u * NLOCK &&
|
||||
PROJ_MS_MARK < 3u * NLOCK, "the project's Clipper bytes in tracks 3 and 4's lock slots");
|
||||
_Static_assert(PROJ_XA == 25u && PROJ_XI == 5u && PROJ_XS == 6u && PROJ_X9 == 2u && P_MSRATE == P_IMIX + 1 &&
|
||||
PROJ_XM3 < 3u * NLOCK && PROJ_X9_MARK < 3u * NLOCK, "the project's Clipper bytes in tracks 3 and 4's lock slots");
|
||||
static uint32_t proj_xs_word(const int16_t *p) /* RATE (4 bits) START (1) LEN - 1 (4) SMTH (7) SPICE (7) DICE (7) */
|
||||
{
|
||||
return (uint32_t)clamp(p[P_MSRATE], 0, 15) | (uint32_t)clamp(p[P_MSKEY], 0, 1) << 4 |
|
||||
@@ -100,6 +106,10 @@ static void proj_ms_put(plock_t *lk) /* track 4's lock slots: b
|
||||
(uint32_t)clamp(trk[j].ms[c / MSEQ_STEPS][c % MSEQ_STEPS] + 8, 0, 15) << 4);
|
||||
}
|
||||
b[PROJ_MS_MARK] = CLIPPER_PROJ_MARK_08;
|
||||
for (j = 0; j < 2u; j++) /* (0.9) VINTAGE, LOOP */
|
||||
for (n = 0; n < PROJ_X9; n++)
|
||||
b[PROJ_X9_AT + PROJ_X9 * j + n] = (uint8_t)clamp(trk[j].p[P_VINT + n] - TP[P_VINT + n].min, 0, 255);
|
||||
b[PROJ_X9_MARK] = CLIPPER_PROJ_MARK_09;
|
||||
proj_bytes_put(lk, b);
|
||||
}
|
||||
static uint32_t proj_ext_at(uint32_t j, uint32_t k) /* the byte of track j's value k (P_E0 - PROJ_E0 of them) */
|
||||
@@ -147,6 +157,16 @@ static int proj_ext_get(const plock_t *lk, uint32_t j, uint32_t k) /* track j'
|
||||
}
|
||||
return (int)proj_ext_byte(lk, proj_ext_at(j, k));
|
||||
}
|
||||
static int proj_x9_get(const plock_t *lk, uint32_t j, uint32_t k) /* (0.9) track j's VINTAGE / LOOP, or -1 */
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < NLOCK; i++)
|
||||
if (lk[i].step != LOCK_FREE)
|
||||
return -1;
|
||||
if (proj_ext_byte(lk, PROJ_X9_MARK) != CLIPPER_PROJ_MARK_09)
|
||||
return -1;
|
||||
return (int)proj_ext_byte(lk, PROJ_X9_AT + PROJ_X9 * j + k);
|
||||
}
|
||||
static int proj_ms_get(const plock_t *lk, uint32_t j, track_t *t) /* track j's steps from track 4's: 0, -1 none */
|
||||
{
|
||||
uint32_t i, n;
|
||||
@@ -579,12 +599,15 @@ static void proj_apply(const project_t *p, int all)
|
||||
i >= P_E0 && i <= P_E7 ? &ENGINES[e]->edit[i - P_E0] : &TP[i];
|
||||
int32_t v = i < PROJ_E0 ? s->p[i] : i >= P_E0 ? s->p[PROJ_E0 + i - P_E0] : d->def;
|
||||
#if CLIPPER_SYNTH
|
||||
if (i >= PROJ_E0 && i < P_E0 && k < 2u && p->rsv[0] == CLIPPER_PROJ_MARK) {
|
||||
if (i >= P_VINT && i < P_E0 && k < 2u && p->rsv[0] == CLIPPER_PROJ_MARK) {
|
||||
int x = proj_x9_get(p->t[3].lock, k, i - P_VINT); /* (0.9: in track 4) */
|
||||
v = x < 0 ? d->def : x + d->min;
|
||||
} else if (i >= PROJ_E0 && i < P_E0 && k < 2u && p->rsv[0] == CLIPPER_PROJ_MARK) {
|
||||
int x = proj_ext_get(p->t[2].lock, k, i - PROJ_E0); /* Clipper: tracks 1 and 2's, in track 3 */
|
||||
v = x < 0 ? d->def : x + d->min;
|
||||
} else if (i >= PROJ_E0 && i < P_ITYPE && k < 2u && p->rsv[0] == CLIPPER_PROJ_MARK_04) {
|
||||
v = p->t[k + 2u].p[i - PROJ_E0]; /* (0.4's first build: in tracks 3 and 4's p[]) */
|
||||
} else if (i >= P_ITYPE && i < P_E0 && k == 0u && p->rsv[0] != CLIPPER_PROJ_MARK && proj_v6_ins_ok[proj_v6_at(p)]) {
|
||||
} else if (i >= P_ITYPE && i <= P_IMIX && k == 0u && p->rsv[0] != CLIPPER_PROJ_MARK && proj_v6_ins_ok[proj_v6_at(p)]) {
|
||||
v = proj_v6_ins[proj_v6_at(p)][i - P_ITYPE]; /* (a SLOOP 2.6 project: its track 1's INSERT) */
|
||||
} else if (i < PROJ_XA + PROJ_XI && k >= 2u && p->rsv[0] == CLIPPER_PROJ_MARK_04) {
|
||||
v = d->def; /* (there, theirs were not stored) */
|
||||
@@ -788,24 +811,53 @@ typedef struct {
|
||||
uint16_t fav[FAV_N];
|
||||
uint32_t crc;
|
||||
} clip_side_t;
|
||||
_Static_assert(sizeof(clip_side_t) == 44u && sizeof(clip_side_t) <= ST_SIDE_MAX, "the side record");
|
||||
static clip_side_t side_out, side_saved;
|
||||
static void side_fill(clip_side_t *r) /* what the side record holds now */
|
||||
/* 0.9: then the TUNING (voice.c tune_cfg), its own magic and CRC (0.7 / 0.8 read their part and pass over it; their
|
||||
* saves leave it erased: EQUAL) */
|
||||
#if CLIPPER_SYNTH
|
||||
#define TUNE_SIDE_MAGIC 0x394E5554u /* "TUN9" */
|
||||
typedef struct {
|
||||
uint32_t magic;
|
||||
tune_t t;
|
||||
uint32_t crc;
|
||||
} tune_side_t;
|
||||
#endif
|
||||
typedef struct {
|
||||
clip_side_t a;
|
||||
#if CLIPPER_SYNTH
|
||||
tune_side_t tu;
|
||||
#endif
|
||||
} side2_t;
|
||||
_Static_assert(sizeof(clip_side_t) == 44u && sizeof(side2_t) <= ST_SIDE_MAX, "the side record");
|
||||
static side2_t side_out, side_saved;
|
||||
static void side_fill(side2_t *s) /* what the side record holds now */
|
||||
{
|
||||
memset(r, 0, sizeof *r);
|
||||
clip_side_t *r = &s->a;
|
||||
memset(s, 0, sizeof *s);
|
||||
r->magic = CLIP_SIDE_MAGIC;
|
||||
r->usb_rate = (uint8_t)(usb_rate % 3u);
|
||||
r->clk_out = (uint8_t)(clk_out != 0u);
|
||||
memcpy(r->fav, fav, sizeof fav);
|
||||
r->crc = st_crc32(r, sizeof *r - 4u);
|
||||
#if CLIPPER_SYNTH
|
||||
s->tu.magic = TUNE_SIDE_MAGIC;
|
||||
s->tu.t = tune_cfg;
|
||||
s->tu.crc = st_crc32(&s->tu, sizeof s->tu - 4u);
|
||||
#endif
|
||||
}
|
||||
static void side_take(const clip_side_t *r) /* a side record read back: when it checks out */
|
||||
static void side_take(const side2_t *s) /* a side record read back: each part when it checks out */
|
||||
{
|
||||
if (r->magic != CLIP_SIDE_MAGIC || r->crc != st_crc32(r, sizeof *r - 4u))
|
||||
return;
|
||||
usb_rate = (uint8_t)(r->usb_rate % 3u);
|
||||
clk_out = (uint8_t)(r->clk_out & 1u);
|
||||
memcpy(fav, r->fav, sizeof fav);
|
||||
const clip_side_t *r = &s->a;
|
||||
if (r->magic == CLIP_SIDE_MAGIC && r->crc == st_crc32(r, sizeof *r - 4u)) {
|
||||
usb_rate = (uint8_t)(r->usb_rate % 3u);
|
||||
clk_out = (uint8_t)(r->clk_out & 1u);
|
||||
memcpy(fav, r->fav, sizeof fav);
|
||||
}
|
||||
#if CLIPPER_SYNTH
|
||||
if (s->tu.magic == TUNE_SIDE_MAGIC && s->tu.crc == st_crc32(&s->tu, sizeof s->tu - 4u)) {
|
||||
tune_cfg = s->tu.t;
|
||||
tune_build();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
/* settings + learned panel table: one flash object. The flash copy wins at
|
||||
* boot (the .noinit copies are garbage after a power-off). */
|
||||
@@ -880,7 +932,7 @@ static void persist_boot(void) /* before settings_init / pane
|
||||
#endif
|
||||
persist_saved = p;
|
||||
{ /* 0.7: the favourites and USB RATE, in the side record of the same copy */
|
||||
clip_side_t r;
|
||||
side2_t r;
|
||||
if (st_side_load(OBJ_SETTINGS, &r, sizeof r) == 0)
|
||||
side_take(&r);
|
||||
side_fill(&side_saved);
|
||||
|
||||
+50
-3
@@ -1166,7 +1166,7 @@ static void arp_remove(track_t *t, uint32_t note)
|
||||
* CHORD all the held notes together (the first 4), an octave higher each step through OCT. ORD (Felucca 1.4) always
|
||||
* plays the notes in the order they were pressed (up to 2.6 it played as UP unless ARP 2 ORD was PLAY) */
|
||||
enum { AM_OFF, AM_UP, AM_DN, AM_UPDN, AM_RND, AM_ORD, AM_REPEAT, AM_DNUP, AM_UP8, AM_CONV, AM_DIVG, AM_PINKY,
|
||||
AM_THUMB, AM_WALK, AM_CHORD };
|
||||
AM_THUMB, AM_WALK, AM_CHORD, AM_TURING };
|
||||
|
||||
/* the arp's note list (its length returned, 0: nothing to play; up to 64, + 1 for UP+8): the held notes as they play
|
||||
* now (#191), each once (*cnt of them), sorted or as played, over OCT octaves */
|
||||
@@ -1280,6 +1280,15 @@ static void arp_play(track_t *t, uint32_t n, uint32_t vel)
|
||||
* turned (another variation). A note may rest (up to 1 in 6), jump an octave (up to 1 in 4, mostly up), and its
|
||||
* velocity and gate move (up to +-63, x 0.05 .. 1.95). What is stored is never changed */
|
||||
typedef struct { uint8_t skip; int8_t oct; uint8_t vel, gate; } spice_t; /* gate: x / 64 */
|
||||
static uint32_t spice_loop(const track_t *t) /* (0.9) LOOP: the variation comes round every LOOP notes */
|
||||
{
|
||||
#if CLIPPER_SYNTH
|
||||
return (uint32_t)clamp(t->p[P_SLOOP], 1, 16);
|
||||
#else
|
||||
(void)t;
|
||||
return 16u;
|
||||
#endif
|
||||
}
|
||||
static uint32_t spice_gate = 64u; /* (the arp's last note: arp_tick's gate) */
|
||||
static int spice_of(const track_t *t, uint32_t k, uint32_t vel, spice_t *o)
|
||||
{
|
||||
@@ -1339,6 +1348,37 @@ static void mseq_tick(track_t *t, uint32_t adv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 0.9, the arp's TURNG (after Music Thing Modular's Turing Machine): a shift register of LOOP bits (SPICE page) turns
|
||||
* one step a note; the bit that comes round is flipped with the chance MUTAT (SPICE: 0 a locked loop, 127 nearly a
|
||||
* coin toss), and the register read as a number picks the note from the held notes over OCT octaves (low to high),
|
||||
* its velocity from two more bits. SEED (DICE) chooses the loop it starts from: the same SEED, the same loop. The
|
||||
* notes are always the held ones: in key whatever it plays */
|
||||
static uint32_t turing_step(track_t *t, uint32_t len, uint32_t *vel)
|
||||
{
|
||||
#if CLIPPER_SYNTH
|
||||
uint32_t loop = (uint32_t)clamp(t->p[P_SLOOP], 1, 16), mut = (uint32_t)clamp(t->p[P_SPICE], 0, 127);
|
||||
int32_t seed = clamp(t->p[P_DICE], 0, 127) + 1;
|
||||
#else
|
||||
uint32_t loop = 16u, mut = 0;
|
||||
int32_t seed = 1;
|
||||
#endif
|
||||
uint32_t mask = (1u << loop) - 1u, r = t->tm_reg, bit, v8;
|
||||
if (t->tm_seed != seed) { /* a new SEED: its loop */
|
||||
uint32_t h = (uint32_t)seed * 0x9E3779B1u;
|
||||
h ^= h >> 15, h *= 0x2C1B3C6Du, h ^= h >> 13;
|
||||
t->tm_seed = (int16_t)seed;
|
||||
r = (h >> 8) & 0xFFFFu;
|
||||
}
|
||||
bit = (r >> (loop - 1u)) & 1u;
|
||||
if (mut && (rng() & 255u) < mut)
|
||||
bit ^= 1u;
|
||||
r = ((r << 1) | bit) & mask;
|
||||
t->tm_reg = (uint16_t)r;
|
||||
v8 = loop >= 8u ? r & 255u : (r << (8u - loop)) & 255u;
|
||||
*vel = 88u + ((r >> 1) & 3u) * 12u; /* 88 .. 124 */
|
||||
return (v8 * len) >> 8;
|
||||
}
|
||||
|
||||
/* an arp step: the next note of the list by MODE, or (CHORD) the first 4 notes together, OCT octaves in turn. 1: it
|
||||
* plays (arp_note set), 0: nothing to play */
|
||||
static int arp_step(track_t *t)
|
||||
@@ -1348,7 +1388,14 @@ static int arp_step(track_t *t)
|
||||
return 0;
|
||||
spice_t sp;
|
||||
t->arp_idx++;
|
||||
spice_of(t, t->arp_idx % 16u, 100u, &sp); /* (0.8) SPICE: this note's variation */
|
||||
if (t->p[P_AMODE] == AM_TURING) { /* (0.9) TURNG: its register picks the note */
|
||||
uint32_t vel, k = turing_step(t, len, &vel);
|
||||
spice_gate = 64u;
|
||||
t->arp_note = (uint8_t)list[k < len ? k : len - 1u];
|
||||
arp_play(t, t->arp_note, vel);
|
||||
return 1;
|
||||
}
|
||||
spice_of(t, t->arp_idx % spice_loop(t), 100u, &sp); /* (0.8) SPICE: this note's variation (0.9: every LOOP) */
|
||||
spice_gate = sp.gate;
|
||||
if (t->p[P_AMODE] != AM_CHORD) {
|
||||
uint32_t nt = list[arp_pick(t, list, len)];
|
||||
@@ -2207,7 +2254,7 @@ static void seq_step(track_t *t, const step_t *s, uint32_t slen, uint32_t skip)
|
||||
if (t->p[P_SPICE] && s->time == ST_NOTE && s->n && !s->rat && !(s->flags & SF_CONT_ALL)) {
|
||||
spice_t sp;
|
||||
int32_t base = (s->flags & SF_ACCENT) ? 127 : (s->vel ? s->vel : 96);
|
||||
spice_of(t, t->seq_idx, 100u, &sp);
|
||||
spice_of(t, t->seq_idx % spice_loop(t), 100u, &sp);
|
||||
if (sp.skip) {
|
||||
seq_release(t);
|
||||
return;
|
||||
|
||||
+3
-1
@@ -3,7 +3,7 @@
|
||||
/* Felucca user interface. Four columns map to KNOB 1..4. Rendering is lazy:
|
||||
* every element remembers what it last drew and is redrawn only on change. */
|
||||
#ifndef FELUCCA_VERSION
|
||||
#define FELUCCA_VERSION "CLIPPER 0.8" /* the synthesizer firmware for the FM-1 (from SLOOP 2.5, based on Felucca) */
|
||||
#define FELUCCA_VERSION "CLIPPER 0.9" /* the synthesizer firmware for the FM-1 (from SLOOP 2.5, based on Felucca) */
|
||||
#endif
|
||||
static void project_save(uint32_t slot);
|
||||
static void arrangement_save(void);
|
||||
@@ -542,6 +542,8 @@ static const struct { uint8_t kind, e; const char *name; } BANK[] = {
|
||||
{BK_PAD, ENGI_VECTOR, "STRING VS"}, {BK_FX, ENGI_VECTOR, "METAL HIT"}, {BK_KEYS, ENGI_VECTOR, "HOLLOW KEYS"},
|
||||
{BK_LEAD, ENGI_VECTOR, "RESO VECTOR"}, {BK_FX, ENGI_VECTOR, "SPACE DRONE"}, {BK_LEAD, ENGI_VECTOR, "VS LEAD"},
|
||||
{BK_PAD, ENGI_VECTOR, "CHOIR VS"},
|
||||
/* Clipper 0.9 (appended: the favourites keep their places) */
|
||||
{BK_PLUCK, ENGI_JUNO, "TURING JUNO"}, {BK_LEAD, ENGI_VECTOR, "MS20 VECTOR"}, {BK_BASS, ENGI_VECTOR, "DIODE VS BASS"},
|
||||
#endif
|
||||
};
|
||||
#define NBANK (sizeof BANK / sizeof BANK[0])
|
||||
|
||||
+15
-1
@@ -18,6 +18,7 @@ enum { X_LYMODE, X_LYSOUND, X_LYSPLIT, X_LYLEVEL, X_LYOCT, X_LYPAN, X_LYFILT, X_
|
||||
X_FTO, X_FFROM, X_FAMT, X_FOUT, X_FDTN, X_FFIX, X_FPEG, X_FPTIM, X_FSLOT, X_FSTORE,
|
||||
X_HPOS, X_HCMP, /* 0.7: UNDO (the place in the sound's history), COMPARE */
|
||||
X_QLANE, X_QSTEP, X_QVAL, X_QFILL, /* 0.8: the MOD SEQ: the lane, the step, its value, a SHAPE */
|
||||
X_TSYS, X_TROOT, /* 0.9: the TUNING (voice.c tune_cfg; kept with the settings) */
|
||||
X_COUNT };
|
||||
static void mseq_fill(struct track *t, uint32_t l, uint32_t f);
|
||||
static const char *const N_QFILL[] = {"--", "RAMP+", "RAMP-", "TRI", "SINE", "SQR", "RND", "FLAT", "INVRT", "SHIFT"};
|
||||
@@ -31,7 +32,7 @@ static const char *const N_FRATIO[32] = {"0.5", "1", "2", "3", "4", "5", "6", "7
|
||||
"14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26",
|
||||
"27", "28", "29", "30", "31"};
|
||||
static const char *const N_FFIXC[4] = {"1Hz", "10Hz", "100Hz", "1kHz"};
|
||||
_Static_assert(X_FOP == 19 && X_FSTORE == 40 && X_HPOS == 41 && X_QLANE == 43 && QF_N == NELEM(N_QFILL),
|
||||
_Static_assert(X_FOP == 19 && X_FSTORE == 40 && X_HPOS == 41 && X_QLANE == 43 && X_TSYS == 47 && QF_N == NELEM(N_QFILL),
|
||||
"params.c PAGES: FMX's ids, UNDO's, MOD SEQ's");
|
||||
static const char *const N_CMP[] = {"EDIT", "ORIG"};
|
||||
static param_desc_t xd_sound = {"SOUND", F_INT, 0, 0, 0, 0, 0}; /* (its range: the list's length, syn_desc) */
|
||||
@@ -76,6 +77,8 @@ static const param_desc_t XD[X_COUNT] = {
|
||||
[X_QSTEP] = PD("STEP", F_INT, 1, 16, 1),
|
||||
[X_QVAL] = PD("VALUE", F_INT, -8, 7, 0),
|
||||
[X_QFILL] = PE("SHAPE", N_QFILL, 0),
|
||||
[X_TSYS] = PE("TUNE", N_TUNE, 0),
|
||||
[X_TROOT] = PE("ROOT", N_NOTE, 0),
|
||||
[X_FSTORE] = PE("STORE", N_GO, 0),
|
||||
[X_HPOS] = PD("UNDO", F_INT, -16, 0, 0),
|
||||
[X_HCMP] = PE("CMP", N_CMP, 0),
|
||||
@@ -563,6 +566,8 @@ static const param_desc_t *syn_desc(uint32_t id, int16_t **valp)
|
||||
return &hd;
|
||||
}
|
||||
case X_HCMP: xv[X_HCMP] = hist_cmp_on; *valp = &xv[X_HCMP]; break;
|
||||
case X_TSYS: xv[X_TSYS] = (int16_t)(tune_cfg.sys % TU_N); *valp = &xv[X_TSYS]; break;
|
||||
case X_TROOT: xv[X_TROOT] = (int16_t)(tune_cfg.root % 12u); *valp = &xv[X_TROOT]; break;
|
||||
case X_QVAL: /* (0.8) the selected step of the selected lane */
|
||||
xv[X_QVAL] = TSEL->ms[clamp(xv[X_QLANE], 1, 4) - 1][clamp(xv[X_QSTEP], 1, 16) - 1];
|
||||
*valp = &xv[X_QVAL];
|
||||
@@ -689,6 +694,15 @@ static void syn_changed(uint32_t id, int16_t *vp)
|
||||
TSEL->ms[clamp(xv[X_QLANE], 1, 4) - 1][clamp(xv[X_QSTEP], 1, 16) - 1] = (int8_t)clamp(*vp, -8, 7);
|
||||
ui.force = 1;
|
||||
break;
|
||||
case X_TSYS:
|
||||
case X_TROOT: /* (0.9) the TUNING: the table again, saved with the settings */
|
||||
if (id == X_TSYS)
|
||||
tune_cfg.sys = (uint8_t)clamp(*vp, 0, TU_N - 1);
|
||||
else
|
||||
tune_cfg.root = (uint8_t)clamp(*vp, 0, 11);
|
||||
tune_build();
|
||||
settings_later = 1;
|
||||
break;
|
||||
case X_QFILL:
|
||||
mseq_fill(TSEL, (uint32_t)clamp(xv[X_QLANE], 1, 4) - 1u, (uint32_t)clamp(*vp, 0, QF_N - 1));
|
||||
ui.force = 1;
|
||||
|
||||
+28
-9
@@ -54,7 +54,7 @@ _Static_assert(P_COUNT < 128, "user preset record: P_COUNT");
|
||||
static const uint8_t UP_XW[UP_NX] = {7, 3, 1, 7, 7, 7, 7, 4, 4, 7, 4, 4, 7, 4, 4, 7, 4, 4, 7, 4, 4, 7, 4, 4, 7,
|
||||
4, 7, 7, 7, 7}; /* bits (0.6: + the INSERT's TYPE, A, B, C, MIX) */
|
||||
_Static_assert(UP_NX == 30u && P_L2RATE == UP_E0V && P_ITYPE == UP_E0V + UP_NX4 && P_IMIX + 1 == P_MSRATE &&
|
||||
P_DICE == P_E0 - 1, "the packed parameters, in order");
|
||||
P_SLOOP == P_E0 - 1, "the packed parameters, in order");
|
||||
#define UP_XMS 161u /* (0.8) a bit of the stream: note / flags hold the MOD SEQ's steps */
|
||||
/* bit k of the packed stream: the record's p[UP_NP + k / 16] for k < 160, then p[71]'s high byte */
|
||||
static int16_t *up_xword(int16_t *p, uint32_t k, uint32_t *sh)
|
||||
@@ -109,16 +109,24 @@ static up_bank_t up_bank[UP_SLOTS / UP_PER_BANK] __attribute__((section(".pool")
|
||||
* bank's side record (storage.c st_side: SLOOP never sees it), a slot's bytes v[0] = 1 (set), then each value - its
|
||||
* minimum; a slot without them (an older save, SLOOP's) loads their defaults. The steps: the record's note / flags
|
||||
* (16 + 16 bytes, two steps a byte, + 8: SLOOP stores its pattern there and loads none of it), marked by UP_XMS */
|
||||
/* 0.9: + VINTAGE and LOOP (UP_NS 8): a slot's v[0] 2; 0.8's side (UPS8, 8 bytes a slot, v[0] 1, 6 values) still read */
|
||||
#define UP_NS ((uint32_t)P_E0 - P_MSRATE)
|
||||
#define UP_SIDE_MAGIC 0x38535055u /* "UPS8" */
|
||||
#define UP_NS8 6u /* (0.8's) */
|
||||
#define UP_SIDE_MAGIC 0x39535055u /* "UPS9" */
|
||||
#define UP_SIDE_MAGIC8 0x38535055u /* "UPS8" (0.8) */
|
||||
typedef struct {
|
||||
uint32_t magic;
|
||||
uint8_t v[UP_PER_BANK][10];
|
||||
uint32_t crc;
|
||||
} up_side_t;
|
||||
typedef struct {
|
||||
uint32_t magic;
|
||||
uint8_t v[UP_PER_BANK][8];
|
||||
uint32_t crc;
|
||||
} up_side_t;
|
||||
_Static_assert(UP_NS == 6u && sizeof(up_side_t) == 136u, "the user presets' side record");
|
||||
} up_side8_t;
|
||||
_Static_assert(UP_NS == 8u && sizeof(up_side_t) == 168u && sizeof(up_side8_t) == 136u, "the user presets' side record");
|
||||
static up_side_t up_side[UP_SLOTS / UP_PER_BANK];
|
||||
static uint8_t up_xs[8]; /* the side bytes of the record up_rec_set made last (up_put's) */
|
||||
static uint8_t up_xs[10]; /* the side bytes of the record up_rec_set made last (up_put's) */
|
||||
static const uint8_t *up_side_of(const up_rec_t *r) /* a record's side bytes, 0 = none */
|
||||
{
|
||||
uint32_t b;
|
||||
@@ -182,7 +190,7 @@ static void up_rec_set(up_rec_t *r, const int16_t *v)
|
||||
for (i = 0; i < 8u; i++)
|
||||
r->p[UP_E0V + i] = v[P_E0 + i];
|
||||
up_xpack(r->p, &v[UP_E0V]);
|
||||
up_xs[0] = 1;
|
||||
up_xs[0] = 2;
|
||||
for (i = 0; i < UP_NS; i++)
|
||||
up_xs[1u + i] = (uint8_t)clamp(v[P_MSRATE + i] - TP[P_MSRATE + i].min, 0, 255);
|
||||
#else
|
||||
@@ -208,8 +216,9 @@ static void up_params(const up_rec_t *r, int16_t *out, const int16_t *def)
|
||||
out[P_ITYPE + i] = r->p[UP_E0V + i];
|
||||
{
|
||||
const uint8_t *sd = up_xrec(r) ? up_side_of(r) : 0; /* (0.8) the MOD SEQ's and SPICE's: the side's */
|
||||
uint32_t nv = !sd ? 0u : sd[0] == 2u ? UP_NS : sd[0] == 1u ? UP_NS8 : 0u; /* (0.8's: 6 of them) */
|
||||
for (i = 0; i < UP_NS; i++)
|
||||
out[P_MSRATE + i] = sd && sd[0] == 1u ? (int16_t)(sd[1u + i] + TP[P_MSRATE + i].min) : def[P_MSRATE + i];
|
||||
out[P_MSRATE + i] = i < nv ? (int16_t)(sd[1u + i] + TP[P_MSRATE + i].min) : def[P_MSRATE + i];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -373,8 +382,18 @@ static void up_boot(void) /* persist_boot: the banks from f
|
||||
st_save(OBJ_UPRESET0 + b, &up_bank[b], sizeof up_bank[b]); /* (a 0.4 bank: written back as SLOOP reads it) */
|
||||
else if (flash_ok && (st_side_load(OBJ_UPRESET0 + b, &up_side[b], sizeof up_side[b]) ||
|
||||
up_side[b].magic != UP_SIDE_MAGIC ||
|
||||
up_side[b].crc != st_crc32(&up_side[b], sizeof up_side[b] - 4u)))
|
||||
memset(&up_side[b], 0, sizeof up_side[b]); /* (0.8: none, or another firmware's) */
|
||||
up_side[b].crc != st_crc32(&up_side[b], sizeof up_side[b] - 4u))) {
|
||||
up_side8_t o; /* (none, another firmware's, or 0.8's: made 0.9's) */
|
||||
uint32_t k;
|
||||
memset(&up_side[b], 0, sizeof up_side[b]);
|
||||
if (!st_side_load(OBJ_UPRESET0 + b, &o, sizeof o) && o.magic == UP_SIDE_MAGIC8 &&
|
||||
o.crc == st_crc32(&o, sizeof o - 4u)) {
|
||||
up_side[b].magic = UP_SIDE_MAGIC;
|
||||
for (k = 0; k < UP_PER_BANK; k++)
|
||||
memcpy(up_side[b].v[k], o.v[k], sizeof o.v[k]); /* (v[0] 1: its 6 values) */
|
||||
up_side[b].crc = st_crc32(&up_side[b], sizeof up_side[b] - 4u);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
up_bank_check(b, flash_ok ? st_load(OBJ_UPRESET0 + b, &up_bank[b], sizeof up_bank[b]) : -1);
|
||||
|
||||
+102
-1
@@ -941,6 +941,101 @@ static void mseq_init(track_t *t)
|
||||
memcpy(t->ms, MSEQ_INIT, sizeof t->ms);
|
||||
}
|
||||
static int32_t mseq_q15(int32_t v) { return clamp(v * 4369, -32767, 32767); } /* a step: -8 full scale, 7 just under */
|
||||
/* Clipper 0.9, the TUNING (GLO > TUNING; the editor sends a Scala scale): every note's pitch off equal temperament by
|
||||
* tun_tab (1/4096 semitone), between notes interpolated (a glide goes through the scale). Two kinds of systems:
|
||||
* 12-note tables, each pitch class's deviation from equal temperament around ROOT (JUST, PYTHAG, MEANTONE, WERCK3,
|
||||
* KIRNB3, the maqams RAST and BAYATI with their neutral thirds);
|
||||
* scales of n degrees in a period (SLENDRO, PELOG, 19 / 24 / 31-EDO, the USER scale from a .scl file): every key
|
||||
* the next degree, C4 + ROOT the scale's 1/1 at its equal-tempered pitch.
|
||||
* G_TUNE (A4 in cents) still moves it all. EQUAL: tun_on 0, nothing touched, bit for bit */
|
||||
enum { TU_EQUAL, TU_JUST, TU_PYTH, TU_MEAN, TU_WERCK, TU_KIRN, TU_RAST, TU_BAYATI, TU_SLENDRO, TU_PELOG, TU_19, TU_24,
|
||||
TU_31, TU_USER, TU_N };
|
||||
static const char *const N_TUNE[TU_N] = {"EQUAL", "JUST", "PYTHA", "MEANT", "WERCK", "KIRNB", "RAST", "BAYAT", "SLEND",
|
||||
"PELOG", "19EDO", "24EDO", "31EDO", "USER"};
|
||||
#define TU_MAXDEG 48u
|
||||
typedef struct {
|
||||
uint8_t sys, root, n, rsv; /* system, ROOT (0..11), USER: degrees (1..TU_MAXDEG) */
|
||||
uint16_t period; /* USER: the period, 1/16 cent (1200 cents: 19200) */
|
||||
uint16_t deg[TU_MAXDEG]; /* USER: degrees 1..n - 1 above 1/1 (deg[0] = 0), 1/16 cent */
|
||||
} tune_t;
|
||||
static tune_t tune_cfg = {TU_EQUAL, 0, 12, 0, 19200, /* (USER until a scale comes: equal temperament) */
|
||||
{0, 1600, 3200, 4800, 6400, 8000, 9600, 11200, 12800, 14400, 16000, 17600}};
|
||||
static int32_t tun_tab[129];
|
||||
static volatile uint8_t tun_on;
|
||||
static const int16_t TU_TAB12[6][12] = { /* 1/10 cent off equal temperament, from ROOT */
|
||||
{0, 117, 39, 156, -137, -20, -98, 20, 137, -156, 176, -117}, /* JUST (5-limit) */
|
||||
{0, -98, 39, -59, 78, -20, 117, 20, -78, 59, -39, 98}, /* PYTHAG */
|
||||
{0, -240, -68, 103, -137, 34, -205, -34, -274, -103, 68, -171}, /* MEANTONE (1/4 comma) */
|
||||
{0, -98, -78, -59, -98, -20, -117, -39, -78, -117, -39, -78}, /* WERCKMEISTER III */
|
||||
{0, -98, -68, -59, -137, -20, -98, -34, -78, -103, -39, -117}, /* KIRNBERGER III */
|
||||
{0, 0, 0, 0, -500, 0, 0, 0, 0, 0, 0, -500}, /* RAST: E and B half flat */
|
||||
};
|
||||
static int32_t tun_deg_cents16(uint32_t sys, uint32_t k, uint32_t *n, uint32_t *period) /* degree k, 1/16 cent */
|
||||
{
|
||||
static const uint16_t SL[5] = {0, 231, 474, 717, 955}, PE[7] = {0, 120, 258, 539, 675, 785, 943};
|
||||
switch (sys) {
|
||||
case TU_SLENDRO: *n = 5, *period = 19200; return SL[k % 5u] * 16;
|
||||
case TU_PELOG: *n = 7, *period = 19200; return PE[k % 7u] * 16;
|
||||
case TU_19: *n = 19, *period = 19200; return (int32_t)(k % 19u) * 19200 / 19;
|
||||
case TU_24: *n = 24, *period = 19200; return (int32_t)(k % 24u) * 800;
|
||||
case TU_31: *n = 31, *period = 19200; return (int32_t)(k % 31u) * 19200 / 31;
|
||||
default:
|
||||
*n = clamp(tune_cfg.n, 1, TU_MAXDEG), *period = clamp(tune_cfg.period, 16, 65535);
|
||||
return k % *n ? tune_cfg.deg[k % *n] : 0;
|
||||
}
|
||||
}
|
||||
/* the table from tune_cfg (the main loop: a change on GLO > TUNING, the editor, power-on) */
|
||||
static void tune_build(void)
|
||||
{
|
||||
static int32_t tab[129];
|
||||
uint32_t sys = tune_cfg.sys < TU_N ? tune_cfg.sys : TU_EQUAL, key, root = tune_cfg.root % 12u;
|
||||
for (key = 0; key < 128u; key++) {
|
||||
int32_t off = 0;
|
||||
if (sys >= TU_JUST && sys <= TU_RAST) {
|
||||
off = TU_TAB12[sys - TU_JUST][(key + 12u - root) % 12u] * 4096 / 1000;
|
||||
} else if (sys == TU_BAYATI) { /* (on ROOT: its 2nd degree half flat) */
|
||||
off = (key + 12u - root) % 12u == 2u ? -50 * 4096 / 100 : 0;
|
||||
} else if (sys != TU_EQUAL) {
|
||||
int32_t d = (int32_t)key - (60 + (int32_t)root), oct, k;
|
||||
uint32_t n, per;
|
||||
tun_deg_cents16(sys, 0, &n, &per);
|
||||
oct = d >= 0 ? d / (int32_t)n : -((-d + (int32_t)n - 1) / (int32_t)n);
|
||||
k = d - oct * (int32_t)n;
|
||||
off = (oct * (int32_t)per + tun_deg_cents16(sys, (uint32_t)k, &n, &per)) * 64 / 25 -
|
||||
d * 4096; /* (1/16 cent x 4096 / 1600; fits 32 bits: +-8 octaves) */
|
||||
off = clamp(off, -100 * 4096, 100 * 4096);
|
||||
}
|
||||
tab[key] = off;
|
||||
}
|
||||
tab[128] = tab[127];
|
||||
fm1_irq_off();
|
||||
memcpy(tun_tab, tab, sizeof tun_tab);
|
||||
tun_on = (uint8_t)(sys != TU_EQUAL);
|
||||
fm1_irq_on();
|
||||
}
|
||||
static inline int32_t tun_at(int32_t p16) /* the offset at a pitch in 1/16 semitone */
|
||||
{
|
||||
int32_t n = clamp(p16, 0, 127 * 16) >> 4, f = clamp(p16, 0, 127 * 16) & 15;
|
||||
return tun_tab[n] + (((tun_tab[n + 1] - tun_tab[n]) * f) >> 4);
|
||||
}
|
||||
|
||||
/* Clipper 0.9, VINTAGE (VOICE 2 > VINTG): the voices of an analog polysynth are never quite alike (the Prophet-5's
|
||||
* "slop"): each voice here has its own small tuning error and filter offset (its "card", fixed), a slow drift of its
|
||||
* pitch (a random walk, a new target every second or so) and each note a little of its own. At 127: the card +-6 cents,
|
||||
* the drift +-5, the note +-2, the filter +-1.5 steps; 0: nothing, bit for bit */
|
||||
static int32_t vcard(uint32_t k, uint32_t salt) /* the voice card's value, Q15 */
|
||||
{
|
||||
uint32_t h = (k + 1u) * 0x9E3779B1u ^ (salt + 7u) * 0x85EBCA77u;
|
||||
h ^= h >> 15, h *= 0x2C1B3C6Du, h ^= h >> 12;
|
||||
return (int32_t)(h >> 16) - 32768;
|
||||
}
|
||||
static int32_t vintage_pitch(voice_t *v, uint32_t k, int32_t vint) /* 1/4096 semitone; once a block */
|
||||
{
|
||||
if ((rng() & 1023u) < 2u) /* (~1.4 s between targets) */
|
||||
v->vdtgt = (int16_t)((int32_t)(rng() >> 16) - 32768);
|
||||
v->vdrift = (int16_t)(v->vdrift + ((v->vdtgt - v->vdrift) >> 9));
|
||||
return ((((vcard(k, 0u) * 246) >> 15) + ((v->vdrift * 205) >> 15) + ((v->rnd * 82) >> 15)) * vint) >> 7;
|
||||
}
|
||||
/* LFO 2's rate index, + the slots to MT_L2RATE (sv: the sources) */
|
||||
static uint32_t mx_l2rate(const int16_t *p, const mx_t *x, const int32_t *sv)
|
||||
{
|
||||
@@ -1047,7 +1142,7 @@ static uint32_t track_render(track_t *t, int32_t *out, uint32_t n)
|
||||
vib = osc_sine(vib_ph[(uint32_t)(t - trk) % NPART]);
|
||||
/* Clipper 0.4: the matrix (mx_load); sv: its sources (the part's here, the voice's in the loop) */
|
||||
mx_t mx;
|
||||
int32_t sv[MS_NSRC], l2free, pan_new = 0;
|
||||
int32_t sv[MS_NSRC], l2free, pan_new = 0, vint = clamp(t->p[P_VINT], 0, 127);
|
||||
uint32_t pan_age = 0, catr = part_ctl[pc].at;
|
||||
#endif
|
||||
/* TUNE in cents: whole 1/16 semitones in the pitch, the rest as a fine factor (no dead zone) */
|
||||
@@ -1211,6 +1306,10 @@ static uint32_t track_render(track_t *t, int32_t *out, uint32_t n)
|
||||
q += clamp(mpit, -24 * 4096, 24 * 4096); /* the matrix */
|
||||
if (mpe) /* MPE: the note's own bend */
|
||||
q += (mpe_bend[v->ch & 15u] * (int32_t)MPE_RANGE[mpe_mode % MPE_MODES]) >> 3;
|
||||
if (tun_on) /* (0.9) the TUNING: the note's own pitch (glides too) */
|
||||
q += tun_at(v->pitch_cur);
|
||||
if (vint) /* (0.9) VINTAGE: the voice's own tuning and drift */
|
||||
q += vintage_pitch(v, (uint32_t)(t - trk) * NVOICE + i, vint);
|
||||
}
|
||||
#endif
|
||||
pitch = (q >> 8) + tune;
|
||||
@@ -1244,6 +1343,8 @@ static uint32_t track_render(track_t *t, int32_t *out, uint32_t n)
|
||||
if (p[P_ATDST] == MD_SHP)
|
||||
m.shape += a * 128;
|
||||
m.cutoff += clamp(mcut, -32767, 32767); /* the matrix */
|
||||
if (vint) /* (0.9) VINTAGE: each voice's filter a little off */
|
||||
m.cutoff += ((vcard((uint32_t)(t - trk) * NVOICE + i, 1u) * 400) >> 15) * vint >> 7;
|
||||
if (mshp)
|
||||
m.shape = clamp(m.shape + clamp(mshp, -32767, 32767), 0, 127 << 8);
|
||||
if (mpe && !(mx.srcs & (1u << MS_SLIDE))) /* MPE: SLIDE to the cutoff when no slot takes it */
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only
|
||||
* Copyright (C) 2026 3dSam (Clipper) */
|
||||
/* Clipper 0.9: no click where the sound is changed while it plays. Each case holds a chord, changes something, and
|
||||
* compares the largest second difference of the output (what a click leaves: a step or a corner) around the change
|
||||
* with the largest one of the steady sound before and after it (each the same sound: a click is a mark above both):
|
||||
* a sound loaded (every engine's first presets, one into the next), VOICE steals (12 notes on 8 voices), MUTE on and
|
||||
* off, LEVEL and PAN jumped, the INSERT's TYPE turned through every type, the master FILT jumped, MODEL (the duck),
|
||||
* CHOR of JUNO, the MOD SEQ's SMTH to the cutoff, LFO 2 KEY, VINTAGE turned up, the TUNING changed (a pitch step:
|
||||
* the phase goes on), the LAYER turned on and off.
|
||||
* Bound: the change's mark under 2 x the steady one + 400 (about -38 dB of the limiter's ceiling). */
|
||||
#define main hostsim_main
|
||||
#include "hostsim.c"
|
||||
#undef main
|
||||
|
||||
static int fails, cases;
|
||||
#define NCAP (4096u * 24u)
|
||||
static int32_t cl[NCAP], cr[NCAP];
|
||||
static uint32_t ncap;
|
||||
static void run(uint32_t nb)
|
||||
{
|
||||
static int32_t o[CTL * 2];
|
||||
uint32_t b, i;
|
||||
ncap = 0;
|
||||
for (b = 0; b < nb; b++) {
|
||||
mix_block(o, CTL);
|
||||
for (i = 0; i < CTL; i++)
|
||||
if (ncap < NCAP) {
|
||||
cl[ncap] = o[2 * i];
|
||||
cr[ncap++] = o[2 * i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
static int32_t d2max(void)
|
||||
{
|
||||
int32_t mx = 0;
|
||||
uint32_t i;
|
||||
for (i = 2; i < ncap; i++) {
|
||||
int32_t a = cl[i] - 2 * cl[i - 1] + cl[i - 2], b = cr[i] - 2 * cr[i - 1] + cr[i - 2];
|
||||
a = a < 0 ? -a : a, b = b < 0 ? -b : b;
|
||||
mx = a > mx ? a : mx, mx = b > mx ? b : mx;
|
||||
}
|
||||
return mx;
|
||||
}
|
||||
static void quiet(void)
|
||||
{
|
||||
uint32_t i, k;
|
||||
for (i = 0; i < NPART; i++)
|
||||
trk_all_off(&trk[i]);
|
||||
run(500);
|
||||
for (i = 0; i < NPART; i++)
|
||||
for (k = 0; k < NVOICE; k++)
|
||||
trk[i].v[k].active = trk[i].v[k].gate = 0, trk[i].v[k].stage = 0, trk[i].v[k].env = trk[i].v[k].env_out = 0;
|
||||
run(400);
|
||||
}
|
||||
static void neutral(track_t *t)
|
||||
{
|
||||
t->p[P_DLY] = t->p[P_REV] = 0; /* (the tails would mix the before into the after) */
|
||||
t->p[P_LD_PIT] = 0, t->p[P_AMODE] = 0, t->p[P_ATK] = t->p[P_ATK] > 40 ? 40 : t->p[P_ATK];
|
||||
}
|
||||
typedef void (*change_fn)(track_t *t, uint32_t k);
|
||||
/* hold a chord, the steady sound, k changes (each followed by settle blocks), the steady sound again */
|
||||
static void check(const char *what, uint32_t eng, uint32_t pi, change_fn fn, uint32_t k, uint32_t settle)
|
||||
{
|
||||
static const uint8_t ch[3] = {48, 55, 64};
|
||||
track_t *t = &trk[0];
|
||||
int32_t before, after, worst = 0, at = -1;
|
||||
uint32_t j, i;
|
||||
quiet();
|
||||
host_preset(t, eng, pi);
|
||||
neutral(t);
|
||||
for (i = 0; i < 3u; i++)
|
||||
trk_note_on(t, ch[i], 100);
|
||||
run(300);
|
||||
run(200);
|
||||
before = d2max();
|
||||
for (j = 0; j < k; j++) {
|
||||
int32_t s, steady;
|
||||
fn(t, j);
|
||||
run(settle);
|
||||
s = d2max();
|
||||
run(150);
|
||||
steady = d2max();
|
||||
if (s > 2 * (steady > before ? steady : before) + 400 && s > worst)
|
||||
worst = s, at = (int32_t)j;
|
||||
before = steady;
|
||||
}
|
||||
run(200);
|
||||
after = d2max();
|
||||
cases++;
|
||||
if (worst) {
|
||||
fails++;
|
||||
printf("clean: %-58s FAIL (change %d: %d, steady %d)\n", what, at, worst, after);
|
||||
}
|
||||
}
|
||||
static void ch_preset(track_t *t, uint32_t k)
|
||||
{
|
||||
uint32_t e = t->eng_req;
|
||||
sound_fade_begin(t);
|
||||
host_preset_req(t, e, (t->preset + 1u + k) % ENGINES[e]->npresets);
|
||||
neutral(t);
|
||||
}
|
||||
static void ch_steal(track_t *t, uint32_t k) { trk_note_on(t, 70 + k, 100); }
|
||||
static void ch_mute(track_t *t, uint32_t k) { t->p[P_MUTE] = (int16_t)!(k & 1u); }
|
||||
static void ch_level(track_t *t, uint32_t k) { t->p[P_LEVEL] = (int16_t)(k & 1u ? 127 : 40); }
|
||||
static void ch_pan(track_t *t, uint32_t k) { t->p[P_PAN] = (int16_t)(k & 1u ? 64 : -64); }
|
||||
static void ch_dist(track_t *t, uint32_t k) { t->p[P_DIST] = (int16_t)(k & 1u ? 0 : 1 + 20 * (k >> 1)); }
|
||||
static void ch_sendc(track_t *t, uint32_t k) { t->p[P_CHOR] = (int16_t)(k & 1u ? 0 : 127); }
|
||||
static void ch_sendd(track_t *t, uint32_t k) { t->p[P_DLY] = (int16_t)(k & 1u ? 0 : 127); }
|
||||
static void ch_sendr(track_t *t, uint32_t k) { t->p[P_REV] = (int16_t)(k & 1u ? 0 : 127); }
|
||||
static void ch_dtime(track_t *t, uint32_t k) { t->p[P_DLY] = 100; song.g[G_DTIME] = (int16_t)(k % 7u); }
|
||||
static void ch_rsize(track_t *t, uint32_t k) { t->p[P_REV] = 100; song.g[G_RSIZE] = (int16_t)(k & 1u ? 10 : 120); }
|
||||
static void ch_crate(track_t *t, uint32_t k) { t->p[P_CHOR] = 100; song.g[G_CRATE] = (int16_t)(k & 1u ? 5 : 120); song.g[G_CDEPTH] = (int16_t)(k & 2u ? 20 : 127); }
|
||||
static void ch_eq(track_t *t, uint32_t k) { (void)t; song.g[G_EQLOW] = (int16_t)(EQ_LOW_C + (k & 1u ? 12 : -12)); song.g[G_EQHIGH] = (int16_t)(EQ_HIGH_C + (k & 1u ? -12 : 12)); }
|
||||
static void ch_wtab(track_t *t, uint32_t k) { t->p[P_E0] = (int16_t)((k * 5u + 3u) % 16u); }
|
||||
static void ch_fmx(track_t *t, uint32_t k) { t->p[P_E0] = (int16_t)((k + 1u) % 16u); }
|
||||
static void ch_engine(track_t *t, uint32_t k)
|
||||
{
|
||||
static const uint8_t E[6] = {ENGI_JUNO, 0, ENGI_VECTOR, ENGI_WAVE, ENGI_HYBRID, ENGI_FMX};
|
||||
host_preset_req(t, E[k % 6u], 0); /* (as set_engine_of: the ISR fades the old engine out) */
|
||||
neutral(t);
|
||||
}
|
||||
static void ch_insert(track_t *t, uint32_t k) { t->p[P_ITYPE] = (int16_t)((k + 1u) % IT_N); t->p[P_IMIX] = 100; }
|
||||
static void ch_filt(track_t *t, uint32_t k) { (void)t; song.g[G_FILT] = (int16_t)(k & 1u ? -50 : 40); }
|
||||
static void ch_model(track_t *t, uint32_t k) { t->p[P_FMODEL] = (int16_t)(FM_SVF + (k + 1u) % FM_LAST); }
|
||||
static void ch_chor(track_t *t, uint32_t k) { t->p[P_E7] = (int16_t)((k + 1u) % 4u); }
|
||||
static void ch_vint(track_t *t, uint32_t k) { t->p[P_VINT] = (int16_t)(k & 1u ? 0 : 127); }
|
||||
static void ch_tune(track_t *t, uint32_t k)
|
||||
{
|
||||
(void)t;
|
||||
tune_cfg.sys = (uint8_t)((k + 1u) % TU_USER);
|
||||
tune_build();
|
||||
}
|
||||
static void ch_layer(track_t *t, uint32_t k)
|
||||
{
|
||||
(void)t;
|
||||
trk[1].p[P_LYMODE] = (int16_t)(k & 1u ? LY_OFF : LY_LAYER);
|
||||
}
|
||||
static void ch_mseq(track_t *t, uint32_t k)
|
||||
{
|
||||
t->p[P_M1SRC] = MS_SEQ2, t->p[P_M1DST] = MT_CUT, t->p[P_M1AMT] = 40;
|
||||
t->p[P_MSSMTH] = (int16_t)(k & 1u ? 120 : 60), t->p[P_MSRATE] = 4;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint32_t e, i;
|
||||
host_tracks_init();
|
||||
for (i = 0; i < NPART; i++)
|
||||
host_preset(&trk[i], i ? 1u : ENGI_HYBRID, 0);
|
||||
clipper_proj_neutral();
|
||||
trk[1].p[P_LYMODE] = LY_OFF;
|
||||
song.g[G_BPM] = 120;
|
||||
for (e = 0; e < NENGINES; e++) { /* a sound loaded under the chord, every engine */
|
||||
char w[80];
|
||||
if (e == 4u || e == ENGI_GRAIN)
|
||||
continue; /* (the user's samples: none here) */
|
||||
snprintf(w, sizeof w, "%s: sounds loaded under a held chord", ENGINES[e]->name);
|
||||
check(w, e, 0, ch_preset, ENGINES[e]->npresets < 6u ? ENGINES[e]->npresets - 1u : 5u, 40);
|
||||
}
|
||||
check("ANALOG: VOICE steals (9 .. 12 notes on 8 voices)", 0, 12, ch_steal, 9, 30);
|
||||
check("ANALOG: MUTE on and off", 0, 13, ch_mute, 6, 30);
|
||||
check("ANALOG: LEVEL jumped (40 <-> 127)", 0, 13, ch_level, 6, 30);
|
||||
check("ANALOG: PAN jumped (left <-> right)", 0, 13, ch_pan, 6, 30);
|
||||
check("ANALOG: the INSERT's TYPE through every type", 0, 13, ch_insert, IT_N + 1u, 40);
|
||||
{ /* and each comes in when turned on under a held chord (FLANG / CHOR: after their line is full) */
|
||||
static const uint8_t ch[3] = {48, 55, 64};
|
||||
uint32_t ty, bad = 0;
|
||||
for (ty = IT_SOFT; ty <= IT_CHORUS; ty++) {
|
||||
quiet();
|
||||
host_preset(&trk[0], 0, 13);
|
||||
neutral(&trk[0]);
|
||||
trk_note_on(&trk[0], ch[0], 100), trk_note_on(&trk[0], ch[1], 100), trk_note_on(&trk[0], ch[2], 100);
|
||||
run(200);
|
||||
trk[0].p[P_ITYPE] = (int16_t)ty, trk[0].p[P_IMIX] = 100;
|
||||
run(200);
|
||||
bad += !(trk[0].ins_run && ins[0].w > 0 && ins[0].type == ty && !ins[0].fill);
|
||||
}
|
||||
trk[0].p[P_ITYPE] = 0;
|
||||
cases++;
|
||||
if (bad) {
|
||||
fails++;
|
||||
printf("clean: the INSERT turned on under a held chord: %u types never came in FAIL\n", bad);
|
||||
}
|
||||
}
|
||||
check("ANALOG: DIST on and off (1, 21, 41)", 0, 13, ch_dist, 6, 30);
|
||||
check("ANALOG: the CHOR send jumped (0 <-> 127)", 0, 13, ch_sendc, 6, 30);
|
||||
check("ANALOG: the DLY send jumped (0 <-> 127)", 0, 13, ch_sendd, 6, 30);
|
||||
check("ANALOG: the REV send jumped (0 <-> 127)", 0, 13, ch_sendr, 6, 30);
|
||||
check("ANALOG: the master FILT jumped", 0, 13, ch_filt, 6, 30);
|
||||
song.g[G_FILT] = 0;
|
||||
check("ANALOG: MODEL through every model", 0, 13, ch_model, FM_LAST, 40);
|
||||
check("WAVE: MODEL through every model", ENGI_WAVE, 2, ch_model, FM_LAST, 40);
|
||||
check("JUNO: CHOR through its modes", ENGI_JUNO, 0, ch_chor, 8, 40);
|
||||
check("ANALOG: VINTAGE on and off", 0, 13, ch_vint, 6, 30);
|
||||
check("ANALOG: the delay's TIME through its values (DLY send on)", 0, 13, ch_dtime, 8, 40);
|
||||
song.g[G_DTIME] = GP[G_DTIME].def;
|
||||
check("ANALOG: the reverb's SIZE jumped (REV send on)", 0, 13, ch_rsize, 6, 40);
|
||||
song.g[G_RSIZE] = GP[G_RSIZE].def;
|
||||
check("ANALOG: the chorus's RATE and DEPTH jumped (CHOR send on)", 0, 13, ch_crate, 6, 40);
|
||||
song.g[G_CRATE] = GP[G_CRATE].def, song.g[G_CDEPTH] = GP[G_CDEPTH].def;
|
||||
check("ANALOG: the master EQ jumped (+-12 dB)", 0, 13, ch_eq, 6, 40);
|
||||
song.g[G_EQLOW] = EQ_LOW_C, song.g[G_EQHIGH] = EQ_HIGH_C;
|
||||
check("WAVE: TABL turned under a held chord (a table built)", ENGI_WAVE, 0, ch_wtab, 6, 60);
|
||||
check("FMX: PTCH turned under a held chord", ENGI_FMX, 0, ch_fmx, 6, 60);
|
||||
check("an ENGINE switched under a held chord", 0, 13, ch_engine, 6, 60);
|
||||
check("ANALOG: the TUNING through every system", 0, 13, ch_tune, TU_USER, 30);
|
||||
tune_cfg.sys = TU_EQUAL;
|
||||
tune_build();
|
||||
check("HYBRID: the LAYER on and off", ENGI_HYBRID, 1, ch_layer, 6, 40);
|
||||
trk[1].p[P_LYMODE] = LY_OFF;
|
||||
check("JUNO: the MOD SEQ (SMTH 60 / 120) on the cutoff", ENGI_JUNO, 0, ch_mseq, 6, 60);
|
||||
printf("clean: %d cases\n", cases);
|
||||
printf(fails ? "clean: %d FAILED\n" : "clean: all passed\n", fails);
|
||||
return fails;
|
||||
}
|
||||
+185
-185
@@ -4,210 +4,210 @@ preset/ANALOG/00_808_BOOM 69d0901c64773d4c
|
||||
preset/ANALOG/01_808_DIRTY 13baa79fb0755730
|
||||
preset/ANALOG/02_SUB_BASS abdebef79fb80860
|
||||
preset/ANALOG/03_808_SLIDE 4ffca0e08379ba48
|
||||
preset/ANALOG/04_ACID_303 7b34a7bbb4d84c82
|
||||
preset/ANALOG/05_PLUGG_BASS 1657d7673a5be304
|
||||
preset/ANALOG/06_REESE 12bae0ba2bf32215
|
||||
preset/ANALOG/07_WOBBLE ccd93c7fac93b59c
|
||||
preset/ANALOG/08_FUNK_BASS 1d2f05993423676b
|
||||
preset/ANALOG/09_G-FUNK_LD 53c42c116337620a
|
||||
preset/ANALOG/10_TRAP_PLUCK 97c18830fddd545c
|
||||
preset/ANALOG/11_SYN_BRASS 763e5d7c6fccdf86
|
||||
preset/ANALOG/04_ACID_303 2ac9f8b41e0666dd
|
||||
preset/ANALOG/05_PLUGG_BASS 38ae9e1d79a8630c
|
||||
preset/ANALOG/06_REESE 5cfd48a652276095
|
||||
preset/ANALOG/07_WOBBLE 6bf621c9829a9ea2
|
||||
preset/ANALOG/08_FUNK_BASS b3ede207b908d705
|
||||
preset/ANALOG/09_G-FUNK_LD ed970730e5e7c14f
|
||||
preset/ANALOG/10_TRAP_PLUCK 0373876d84f74bc7
|
||||
preset/ANALOG/11_SYN_BRASS dbc08613c198e607
|
||||
preset/ANALOG/12_SUPERSAW 7b011debfd85e923
|
||||
preset/ANALOG/13_WARM_PAD 2d52f18b6ece5992
|
||||
preset/ANALOG/14_DARK_STR 28ced2ee15a9e75e
|
||||
preset/ANALOG/15_ATMOS_PAD 3aa962707a591993
|
||||
preset/ANALOG/16_PAN_FLUTE 2dc304c565814b20
|
||||
preset/ANALOG/17_FAT_LEAD ef3e7318d99fb312
|
||||
preset/ANALOG/18_MONO_BASS 561f16f5eda2940c
|
||||
preset/ANALOG/13_WARM_PAD b534a0816bca3880
|
||||
preset/ANALOG/14_DARK_STR 8adcecd67c4258c3
|
||||
preset/ANALOG/15_ATMOS_PAD 57563c8864e7e358
|
||||
preset/ANALOG/16_PAN_FLUTE 25de841ba44cb5de
|
||||
preset/ANALOG/17_FAT_LEAD 6e9a1cf730c5ea0d
|
||||
preset/ANALOG/18_MONO_BASS b12ab80892b98cfa
|
||||
preset/ANALOG/19_PWM_LEAD 52b45468d9501a18
|
||||
preset/ANALOG/20_SAW_BASS 345c4dd1f0f310ec
|
||||
preset/ANALOG/21_SINE_PAD bdacce6c70aa91dc
|
||||
preset/ANALOG/22_MINI_BASS 6fda1a676cf0d9c8
|
||||
preset/ANALOG/23_MINI_LEAD 3e0b5452668c0b86
|
||||
preset/DIGITAL/00_RHODES 421fe16e43b750a8
|
||||
preset/DIGITAL/01_DX_RHODES 6eaf3fe5e76d0308
|
||||
preset/DIGITAL/02_WURLI 766b59505a188766
|
||||
preset/DIGITAL/03_CLAV cc3238f92a9137a2
|
||||
preset/DIGITAL/04_M1_PIANO 562df51d78c2c270
|
||||
preset/DIGITAL/05_AFRO_KEYS fd9d3c8fdd2a7276
|
||||
preset/DIGITAL/06_TRAP_BELL 7a43417bb95c66e3
|
||||
preset/DIGITAL/07_MUSIC_BOX ae7dd85ba48c5c19
|
||||
preset/DIGITAL/08_MARIMBA 1afed4d945973f8c
|
||||
preset/DIGITAL/09_KALIMBA b6d7e2d695868e50
|
||||
preset/DIGITAL/10_PLUGG_BELL b2a99d2ad75cd688
|
||||
preset/DIGITAL/11_GLASS_PAD c2742b8b784fd907
|
||||
preset/DIGITAL/12_FM_BASS 52862e1e7445f4e2
|
||||
preset/DIGITAL/13_STEEL_DRUM d1eb74682165e643
|
||||
preset/DIGITAL/14_GLOCKEN 0636919143151a78
|
||||
preset/DIGITAL/15_CELESTA 1a5bad30d3f37955
|
||||
preset/DIGITAL/16_XYLOPHONE 7e6660fa87085d14
|
||||
preset/DIGITAL/17_HARP 5db832f89080cf58
|
||||
preset/DIGITAL/18_BASS_GTR 9aa5cd6c12eaa870
|
||||
preset/DIGITAL/19_TUBE_BELL 6072767f1d183b76
|
||||
preset/DIGITAL/20_FM_PLUCK 1a82523e312bcc4d
|
||||
preset/DIGITAL/21_FM_GRAND 6d3520e310a5265b
|
||||
preset/PHASE/00_CZ_BASS 0af10af70faa24f1
|
||||
preset/PHASE/01_SOFT_KEYS 1302c3907079f4a4
|
||||
preset/PHASE/02_CZ_STRING 09e82139f1fdcf12
|
||||
preset/PHASE/03_RESO_PLUCK 652f45b6e999a4e3
|
||||
preset/PHASE/04_CZ_BRASS 66aa186da039bbdd
|
||||
preset/PHASE/05_CZ_LEAD e1b036cb5107ba6a
|
||||
preset/PHASE/06_CZ_PAD 753c31dfd4e86885
|
||||
preset/PHASE/07_CZ_RESO 0899ebc55106697d
|
||||
preset/ANALOG/20_SAW_BASS 647eb690094b0b06
|
||||
preset/ANALOG/21_SINE_PAD 225be334e8cf72a7
|
||||
preset/ANALOG/22_MINI_BASS cb40c9b848c2d80b
|
||||
preset/ANALOG/23_MINI_LEAD 3f6c3247b4e038f1
|
||||
preset/DIGITAL/00_RHODES b62083dd25231ad8
|
||||
preset/DIGITAL/01_DX_RHODES 81f42b810b490c21
|
||||
preset/DIGITAL/02_WURLI 634a2f11a3cca298
|
||||
preset/DIGITAL/03_CLAV bed5aa5ec1585ac2
|
||||
preset/DIGITAL/04_M1_PIANO 7bf97161428c5789
|
||||
preset/DIGITAL/05_AFRO_KEYS c849c9df5be53a46
|
||||
preset/DIGITAL/06_TRAP_BELL 70196d4ee2763876
|
||||
preset/DIGITAL/07_MUSIC_BOX fca4c22c68ae3a49
|
||||
preset/DIGITAL/08_MARIMBA 07eeca1bab86ce40
|
||||
preset/DIGITAL/09_KALIMBA 9104dc667795cadb
|
||||
preset/DIGITAL/10_PLUGG_BELL d614915cc4dfea42
|
||||
preset/DIGITAL/11_GLASS_PAD f33fd03c45bc6e7b
|
||||
preset/DIGITAL/12_FM_BASS e702f105b4e31be7
|
||||
preset/DIGITAL/13_STEEL_DRUM dca4fd954c04785a
|
||||
preset/DIGITAL/14_GLOCKEN 3df59ffe630e6ea9
|
||||
preset/DIGITAL/15_CELESTA eead7459b3169f76
|
||||
preset/DIGITAL/16_XYLOPHONE 3cbc70dc8dec34eb
|
||||
preset/DIGITAL/17_HARP 5ff3af4fdc27390c
|
||||
preset/DIGITAL/18_BASS_GTR 7734e26632d230ef
|
||||
preset/DIGITAL/19_TUBE_BELL 65e97324d50298da
|
||||
preset/DIGITAL/20_FM_PLUCK 93ca32163f7028b5
|
||||
preset/DIGITAL/21_FM_GRAND 74d924abd7c27f75
|
||||
preset/PHASE/00_CZ_BASS e96706957d91ecae
|
||||
preset/PHASE/01_SOFT_KEYS 5f0e4fe55c4ce76a
|
||||
preset/PHASE/02_CZ_STRING 7db0fca714217b45
|
||||
preset/PHASE/03_RESO_PLUCK 5edc4850b8ef18f9
|
||||
preset/PHASE/04_CZ_BRASS 3b1b3a35657223f3
|
||||
preset/PHASE/05_CZ_LEAD 62abe54518ba2c60
|
||||
preset/PHASE/06_CZ_PAD 72c55108745a95b7
|
||||
preset/PHASE/07_CZ_RESO a8f173ac48ac2fa3
|
||||
preset/LOFI/00_GAME_LEAD 2b0101cbd336635d
|
||||
preset/LOFI/01_GB_BASS d2baabc5474103d4
|
||||
preset/LOFI/01_GB_BASS 2b2caf1131d2d8e4
|
||||
preset/LOFI/02_8BIT_ARP 806922784ebe92fd
|
||||
preset/LOFI/03_NES_BASS 45488b0a033b5ce8
|
||||
preset/LOFI/04_CHIP_CHORD e55424ac13f3ece1
|
||||
preset/LOFI/05_1BIT_BEEP e1742bf68ea67ad1
|
||||
preset/LOFI/03_NES_BASS 01a313ed161d6fe0
|
||||
preset/LOFI/04_CHIP_CHORD 4e6ab9a7c33dba09
|
||||
preset/LOFI/05_1BIT_BEEP f3a51c96983395f1
|
||||
preset/LOFI/06_WAVE_LEAD 23a2f1e11d67dfad
|
||||
preset/LOFI/07_CHIP_NOISE ca1058917a10b3b0
|
||||
preset/SAMPLE/00_GRAND_PNO d923a2cd58dd6c07
|
||||
preset/SAMPLE/01_UP_BASS ab929b7cd01d615c
|
||||
preset/SAMPLE/02_VIBES b990857c2a729642
|
||||
preset/LOFI/07_CHIP_NOISE 5ea9e47a5dcf7009
|
||||
preset/SAMPLE/00_GRAND_PNO 3709b5c837c2e987
|
||||
preset/SAMPLE/01_UP_BASS 275f44a5ceb4bae5
|
||||
preset/SAMPLE/02_VIBES 67f6ca4cf7d220bf
|
||||
preset/SAMPLE/03_HORN_STAB f2b3917cde0d0110
|
||||
preset/SAMPLE/04_STRING_STB 131105f7f10785fe
|
||||
preset/SAMPLE/05_LOFI_FLUTE 79c66528bf0b1c74
|
||||
preset/SAMPLE/06_SCRATCH 3d6567bb372be864
|
||||
preset/SAMPLE/07_GM_KIT 13999abe5e115815
|
||||
preset/SAMPLE/08_DUSTY_PNO 3918c5839bb7a848
|
||||
preset/SAMPLE/09_LOFI_KEYS 6fa2f6b1e30b1f3d
|
||||
preset/SAMPLE/10_DEEP_BASS d68154cf4ef76038
|
||||
preset/VOICE/00_CHOIR_AAH d71bac99365842d0
|
||||
preset/VOICE/01_SOUL_OOH 54efb0da8718978f
|
||||
preset/SAMPLE/04_STRING_STB 4eb6f02ad09952c4
|
||||
preset/SAMPLE/05_LOFI_FLUTE 91003c87d4e158fa
|
||||
preset/SAMPLE/06_SCRATCH 35a7220a647b2484
|
||||
preset/SAMPLE/07_GM_KIT a5f9d22f362a8e8f
|
||||
preset/SAMPLE/08_DUSTY_PNO 629f9d8917229828
|
||||
preset/SAMPLE/09_LOFI_KEYS cadb20909acd606e
|
||||
preset/SAMPLE/10_DEEP_BASS 525d8bf07ed99c20
|
||||
preset/VOICE/00_CHOIR_AAH 9d631818998e4fcf
|
||||
preset/VOICE/01_SOUL_OOH 1cfb47ddc13d0b75
|
||||
preset/VOICE/02_TALKBOX 21c8a39e3ffaed5a
|
||||
preset/VOICE/03_WOW_BASS 2b3e7f74138ae8a0
|
||||
preset/VOICE/03_WOW_BASS a750d27f4575a85c
|
||||
preset/VOICE/04_HARMONICA 2b0c12b4331d68c6
|
||||
preset/VOICE/05_ROBOT 25af475d3031ab3d
|
||||
preset/VOICE/06_VOX_PAD f11e65a2934657c3
|
||||
preset/TRIO/00_FAT_BASS aae2a8d886288062
|
||||
preset/TRIO/01_MIN_STAB eea67a68ea470e80
|
||||
preset/TRIO/02_MIN7_STAB 3c04ebffb1f9b66b
|
||||
preset/TRIO/03_RAVE_STAB 12f9334768fa999e
|
||||
preset/TRIO/04_DUB_CHORD 5b1db563ceeab2e6
|
||||
preset/TRIO/05_SAW_PAD c3671956d48a22f5
|
||||
preset/TRIO/06_SYNC_LEAD ba69a3efce95f6dc
|
||||
preset/TRIO/07_HOOVER 1740917f80172506
|
||||
preset/TRIO/08_ACCORDION c3e77a567b85a75c
|
||||
preset/TRIO/09_ENSEMBLE 11022ca584ec6a67
|
||||
preset/TRIO/10_80S_POLY b8ad1b14065de51e
|
||||
preset/VOICE/06_VOX_PAD 23f7da887166dd0c
|
||||
preset/TRIO/00_FAT_BASS 6c4ca500c885adaf
|
||||
preset/TRIO/01_MIN_STAB 7c609fa0356ab9fa
|
||||
preset/TRIO/02_MIN7_STAB 9083129c0afc94fe
|
||||
preset/TRIO/03_RAVE_STAB ec9b260d62db03e0
|
||||
preset/TRIO/04_DUB_CHORD db50e8240f26fcce
|
||||
preset/TRIO/05_SAW_PAD ae99310d2e14e892
|
||||
preset/TRIO/06_SYNC_LEAD 0999a6f155b975e9
|
||||
preset/TRIO/07_HOOVER 02ae0d2869d47945
|
||||
preset/TRIO/08_ACCORDION 0cb3b5f9d1c85908
|
||||
preset/TRIO/09_ENSEMBLE 1ba3d7ed3a974533
|
||||
preset/TRIO/10_80S_POLY f9420daaa779141d
|
||||
preset/TRIO/11_SQR_LEAD d98536f9d4590375
|
||||
preset/TRIO/12_POWER_STAB aff37a8b7ce92421
|
||||
preset/TRIO/13_PULSE_PAD 30a1990d9db892cb
|
||||
preset/WHEEL/00_SOUL_ORGAN cef2bd90f0e1c34c
|
||||
preset/WHEEL/01_GOSPEL 65c1181e19719dd8
|
||||
preset/WHEEL/02_JAZZ_ORGAN 559525673e373810
|
||||
preset/TRIO/12_POWER_STAB fc9419b8903c46fd
|
||||
preset/TRIO/13_PULSE_PAD 19adfe2b8444803a
|
||||
preset/WHEEL/00_SOUL_ORGAN a5caf2722c71adb1
|
||||
preset/WHEEL/01_GOSPEL d56aff974860dd4d
|
||||
preset/WHEEL/02_JAZZ_ORGAN 2b8aa903bb77bd7f
|
||||
preset/WHEEL/03_DIRTY_B3 02ffafecc2a084b7
|
||||
preset/WHEEL/04_HOUSE_ORGN 1e676ba00c8e2be9
|
||||
preset/WHEEL/04_HOUSE_ORGN 60f1ebb29ba38794
|
||||
preset/WHEEL/05_ROCK_ORGAN b1c318b9361b9cd5
|
||||
preset/WHEEL/06_CHAPEL 05ff719df9583b1b
|
||||
preset/WHEEL/07_REGGAE_ORG 2be04c3f7b04d4da
|
||||
preset/GRAIN/00_LOFI_CLOUD bda40c6aad4f1319
|
||||
preset/GRAIN/01_VIBE_HAZE 0a76ecddbe3e2211
|
||||
preset/GRAIN/02_FLUTE_DUST 5d640471862bfabd
|
||||
preset/GRAIN/03_STR_CLOUD 4bf449a155919813
|
||||
preset/GRAIN/04_SHIMMER f247719d39436922
|
||||
preset/GRAIN/05_DRONE d66c0c2ae68a36aa
|
||||
preset/GRAIN/06_PNO_FREEZE e64d7776f4704a51
|
||||
preset/GRAIN/07_HORN_CLOUD 76c412766bd79821
|
||||
preset/FM6/00_TINE_EP d140f3fe55e42633
|
||||
preset/FM6/01_GLASS_BELL 659b1cdce56b7af2
|
||||
preset/FM6/02_ROUND_BASS daf611066fa95457
|
||||
preset/FM6/03_BRASS_SECT b73c24e3c390d538
|
||||
preset/FM6/04_SOFT_PAD f1605fea2af19078
|
||||
preset/FM6/05_WOOD_BARS b8bc4acff797552b
|
||||
preset/FM6/06_DRAWBARS c731dba26e816787
|
||||
preset/FM6/07_NYLON_PICK 08f20f5ef9e920ac
|
||||
preset/PHYS/00_BELL_TREE edc6ba7c5a18080e
|
||||
preset/PHYS/01_MODAL_BAR f1efdb63f9fb7d78
|
||||
preset/PHYS/02_STR_PLUCK 9a8d92d71a1e5361
|
||||
preset/PHYS/03_BOWED_MTL e0b35c074ce5e89a
|
||||
preset/PHYS/04_THUMB_PNO 2d0f1bae79e0ca6f
|
||||
preset/PHYS/05_HAND_DRUM c63514883fe1e9df
|
||||
preset/PHYS/06_MEMB_TOMS c4bf65287922da13
|
||||
preset/PHYS/07_SITAR 9c5e4177782304b2
|
||||
preset/PHYS/08_PHYS_HARP 016d601ec02d1623
|
||||
preset/PHYS/09_NYLON_GTR 0c0c6581fccfb380
|
||||
preset/PHYS/10_STEEL_GTR 644f4d2ed5e018d6
|
||||
preset/PHYS/11_MUTED_GTR 9ff8ea386c541b51
|
||||
preset/PHYS/12_PLUCK_BASS 4574b89266e09213
|
||||
preset/PHYS/13_KOTO 35273505b119cdb7
|
||||
preset/PHYS/14_BANJO 09002b8927701730
|
||||
preset/WHEEL/06_CHAPEL 830bb9caf5d7c03a
|
||||
preset/WHEEL/07_REGGAE_ORG 209bb98ac036737e
|
||||
preset/GRAIN/00_LOFI_CLOUD 32c2a3affa0d2120
|
||||
preset/GRAIN/01_VIBE_HAZE 5f0a50654df5a4d7
|
||||
preset/GRAIN/02_FLUTE_DUST 6963d1906fc56e07
|
||||
preset/GRAIN/03_STR_CLOUD 1b78cfdccd6e19bd
|
||||
preset/GRAIN/04_SHIMMER 47aa5d4b0921110a
|
||||
preset/GRAIN/05_DRONE 41a57c92fdc81da3
|
||||
preset/GRAIN/06_PNO_FREEZE 3ef812ae36115efd
|
||||
preset/GRAIN/07_HORN_CLOUD ada77277790d8603
|
||||
preset/FM6/00_TINE_EP 830b6dcf069c0460
|
||||
preset/FM6/01_GLASS_BELL 2b2167d31b505d12
|
||||
preset/FM6/02_ROUND_BASS 65d55cb431504a25
|
||||
preset/FM6/03_BRASS_SECT 80fa6513518eb2bc
|
||||
preset/FM6/04_SOFT_PAD ddd4b535aa6a47fd
|
||||
preset/FM6/05_WOOD_BARS 65e7aadc87e84b54
|
||||
preset/FM6/06_DRAWBARS 3287628c0375f4e2
|
||||
preset/FM6/07_NYLON_PICK 5ad8bdcded17b15c
|
||||
preset/PHYS/00_BELL_TREE 5e3894c1adf715be
|
||||
preset/PHYS/01_MODAL_BAR cb34ccb73e216eb2
|
||||
preset/PHYS/02_STR_PLUCK bb6198b747b463df
|
||||
preset/PHYS/03_BOWED_MTL 21c9c360be27e476
|
||||
preset/PHYS/04_THUMB_PNO 6aacd82db2c43880
|
||||
preset/PHYS/05_HAND_DRUM 565818d14a566c4a
|
||||
preset/PHYS/06_MEMB_TOMS f77a44ba92e940a2
|
||||
preset/PHYS/07_SITAR 49d88197aa85c7c2
|
||||
preset/PHYS/08_PHYS_HARP 3e3cc4f7293aca9f
|
||||
preset/PHYS/09_NYLON_GTR 5c03f6ee765aabca
|
||||
preset/PHYS/10_STEEL_GTR 4b324bdaa17c5b1c
|
||||
preset/PHYS/11_MUTED_GTR 5a5fcc3778369b65
|
||||
preset/PHYS/12_PLUCK_BASS bca731c0f700e1b1
|
||||
preset/PHYS/13_KOTO 3d6077bc5afa22cb
|
||||
preset/PHYS/14_BANJO 15954160a1890df9
|
||||
preset/PHYS/15_CELLO_BOW 42550aeaf1f47bc8
|
||||
preset/PHYS/16_TANPURA f2b8c85ed6ffd9cb
|
||||
preset/PHYS/17_CHIMES 1449edbcafaacf7b
|
||||
preset/PHYS/18_BIG_BELL 9b4e849f930e3473
|
||||
preset/PHYS/19_VIBRA_BAR 0ec323cb72fde185
|
||||
preset/PHYS/16_TANPURA a49c707d3b46177d
|
||||
preset/PHYS/17_CHIMES c53b78a4e11e55c9
|
||||
preset/PHYS/18_BIG_BELL 7858493e86c9c8ff
|
||||
preset/PHYS/19_VIBRA_BAR 15f7a6ee4a9649cf
|
||||
preset/PHYS/20_GLASS_BOWL c9cf505ecea3b8f5
|
||||
preset/PHYS/21_STEEL_PAN 50d84bb716aaa718
|
||||
preset/PHYS/22_WOOD_BLOCK 8fe5f920d2efe9e5
|
||||
preset/PHYS/23_TABLA 67b4b8b89b8f041b
|
||||
preset/PHYS/24_CONGA f8da9d4b3c9bd3c7
|
||||
preset/PHYS/25_TIMPANI b4cab8352e46bad3
|
||||
preset/NOISE/00_WIND 1b7c905854ade21e
|
||||
preset/NOISE/01_RAIN 9baef5e15ae337cb
|
||||
preset/NOISE/02_NZ_ARCADE 2e2d7b4eeaff3af6
|
||||
preset/NOISE/03_NZ_METAL 2edc99e81ffc69f9
|
||||
preset/NOISE/04_OCEAN 6d626b093f874d1d
|
||||
preset/NOISE/05_VINYL adccb64a58d666fe
|
||||
preset/NOISE/06_HISS 2bddccebfba286de
|
||||
preset/NOISE/07_RISER fcea3ada4f424206
|
||||
preset/NOISE/08_NZ_SNARE b0fe837467457eee
|
||||
preset/NOISE/09_BITCRUSH 57785f07c4efb016
|
||||
preset/NOISE/10_RADIO 7bdab4709d2209ac
|
||||
preset/HYBRID/00_CLIPPER 5fab5a7ac8bee36c
|
||||
preset/HYBRID/01_POLY_PAD f1cb45a4f92b95fb
|
||||
preset/HYBRID/02_STRINGS 8d81aeb8541c6dbe
|
||||
preset/HYBRID/03_ACID 474ab762b77ab63c
|
||||
preset/PHYS/21_STEEL_PAN 20cc90225187294c
|
||||
preset/PHYS/22_WOOD_BLOCK 21cbac659a119354
|
||||
preset/PHYS/23_TABLA 23672362da5f6357
|
||||
preset/PHYS/24_CONGA 3917b67a7347a740
|
||||
preset/PHYS/25_TIMPANI 56cea6c5bb4f1a0e
|
||||
preset/NOISE/00_WIND cf9a262e84230d48
|
||||
preset/NOISE/01_RAIN 4673a1b05bb8b9eb
|
||||
preset/NOISE/02_NZ_ARCADE 05970d2a5744e9d4
|
||||
preset/NOISE/03_NZ_METAL 0cf292216c75a128
|
||||
preset/NOISE/04_OCEAN 7910fc9bb9cee400
|
||||
preset/NOISE/05_VINYL 307c6f895056eb78
|
||||
preset/NOISE/06_HISS 5d57fdb54063c64e
|
||||
preset/NOISE/07_RISER b8e0509b00f7ef07
|
||||
preset/NOISE/08_NZ_SNARE 536f9e93124264dc
|
||||
preset/NOISE/09_BITCRUSH 7e1be7ae2abcde73
|
||||
preset/NOISE/10_RADIO 9b013ea0fc8d5384
|
||||
preset/HYBRID/00_CLIPPER 741fb28d3267be9a
|
||||
preset/HYBRID/01_POLY_PAD 92555bf4c344c890
|
||||
preset/HYBRID/02_STRINGS 55d11dc70494e177
|
||||
preset/HYBRID/03_ACID e0d2d59df102db19
|
||||
preset/HYBRID/04_SYNC_LEAD bdef2b7a2aafe7b5
|
||||
preset/HYBRID/05_FM_BELL a9d17b38041aea17
|
||||
preset/HYBRID/06_FM_KEYS 8dfa8632a2eaa74d
|
||||
preset/HYBRID/07_WOBBLE 9ad725db7748db99
|
||||
preset/HYBRID/08_REESE 4eb7c57bdc5531e8
|
||||
preset/HYBRID/09_HOOVER 1bb8f4109442a1a8
|
||||
preset/HYBRID/10_BRASS ddfe956e452518ef
|
||||
preset/HYBRID/11_VOX c39160c32f2b1812
|
||||
preset/HYBRID/12_PLUCK 9363871282eeef9c
|
||||
preset/HYBRID/13_RISER f39f1851b2e79a53
|
||||
preset/HYBRID/14_METAL c4ce2f13852aa44d
|
||||
preset/HYBRID/15_FOLD_BASS 24de1f82911ad674
|
||||
preset/HYBRID/05_FM_BELL 80215624e8784222
|
||||
preset/HYBRID/06_FM_KEYS 3f7e7f2e84ed1ed0
|
||||
preset/HYBRID/07_WOBBLE 8556127b8695c3b0
|
||||
preset/HYBRID/08_REESE 09686c46edc86f92
|
||||
preset/HYBRID/09_HOOVER db86e3d54abc5047
|
||||
preset/HYBRID/10_BRASS 602c2fa72e9d7e9e
|
||||
preset/HYBRID/11_VOX a392a4e7e7aeef9f
|
||||
preset/HYBRID/12_PLUCK bfffc18fdcb2201d
|
||||
preset/HYBRID/13_RISER 5af006d19006c33b
|
||||
preset/HYBRID/14_METAL 68ba9e49fc480827
|
||||
preset/HYBRID/15_FOLD_BASS 72f3d64b523b998d
|
||||
preset/HYBRID/16_CHIP_LEAD d68a293ceff88da5
|
||||
preset/HYBRID/17_GLASS_PAD a720361c43a26b35
|
||||
preset/HYBRID/18_DRONE a561f274e9cded82
|
||||
preset/HYBRID/19_808_SUB 9f0cfd1f4c8a1a50
|
||||
preset/HYBRID/20_TRANCE ac86d6f978644dc4
|
||||
preset/HYBRID/21_SAW_PLUCK 823d62a58ef704fb
|
||||
preset/HYBRID/22_SPACE_BEL 3a9258b298b01db1
|
||||
preset/HYBRID/23_INIT 93968b3d2ffd68f8
|
||||
preset/HYBRID/24_MOOG_BASS 81c09f5d0fd54f04
|
||||
preset/HYBRID/25_MOOG_LEAD c11d21d475f17690
|
||||
preset/HYBRID/26_LADDER_PAD 49b0559931c156ed
|
||||
drums/gm_kit 97750328f0896d25
|
||||
mode/ANALOG/POLY 8469751e1f620a8c
|
||||
preset/HYBRID/17_GLASS_PAD 04cc93cc4bdf2744
|
||||
preset/HYBRID/18_DRONE 7d1b01f4353798ae
|
||||
preset/HYBRID/19_808_SUB 00cd8308d878c854
|
||||
preset/HYBRID/20_TRANCE 03ee2c39bb0a7e51
|
||||
preset/HYBRID/21_SAW_PLUCK e3de9666dd9d2c70
|
||||
preset/HYBRID/22_SPACE_BEL e2cbfd8444c10df4
|
||||
preset/HYBRID/23_INIT 1da3dff6e6ccdd90
|
||||
preset/HYBRID/24_MOOG_BASS 9717bf9d01bea154
|
||||
preset/HYBRID/25_MOOG_LEAD b1fe3b045a96a455
|
||||
preset/HYBRID/26_LADDER_PAD d94b87816b9fbc4d
|
||||
drums/gm_kit bf735e63cb82d7ed
|
||||
mode/ANALOG/POLY a7a9ef2a2e63290c
|
||||
mode/ANALOG/MONO 9583d8d67d814abc
|
||||
mode/ANALOG/LEGATO 688683752bbf85f8
|
||||
mode/ANALOG/UNISON 8bb858f31b261198
|
||||
mode/DIGITAL/POLY 6eaf3fe5e76d0308
|
||||
mode/DIGITAL/MONO 05ef3c10b54c76a1
|
||||
mode/DIGITAL/LEGATO a7613f98364ceb26
|
||||
mode/DIGITAL/UNISON 762ab1e50571e207
|
||||
mode/VOICE/POLY d71bac99365842d0
|
||||
mode/DIGITAL/POLY 81f42b810b490c21
|
||||
mode/DIGITAL/MONO e79a15b9af2d8570
|
||||
mode/DIGITAL/LEGATO 979838bb49ba2760
|
||||
mode/DIGITAL/UNISON 3195a4d97b069829
|
||||
mode/VOICE/POLY 9d631818998e4fcf
|
||||
mode/VOICE/MONO 9450adb85fb70d90
|
||||
mode/VOICE/LEGATO 1a04dbc937476869
|
||||
mode/VOICE/UNISON 1fbb5b94bb4ec6fc
|
||||
sends/ANALOG/dry 8bd8ed5fdef461b8
|
||||
sends/ANALOG/chorus 54db3f297abe1ef6
|
||||
sends/ANALOG/delay b7b81d709bc097c4
|
||||
sends/ANALOG/reverb 0b9eca45667b05f9
|
||||
sends/ANALOG/all 041a19e59e693ea0
|
||||
sends/ANALOG/dist 9f8d9c59091192da
|
||||
sends/DIGITAL/dry 8dbda764d41b9db8
|
||||
sends/DIGITAL/chorus 392d686336b442c7
|
||||
sends/DIGITAL/delay a7796f5483684590
|
||||
sends/DIGITAL/reverb 054e0968f4fe10af
|
||||
sends/DIGITAL/all 89200ffa1d59426f
|
||||
sends/DIGITAL/dist 175553bf51b61037
|
||||
song/4track_mix ff4ab83a67ee9a84
|
||||
slicer/gate/ANALOG_DARK_STR 35d6d06a168b40d2
|
||||
slicer/stut/DIGITAL_RHODES 2272d80d58109e6b
|
||||
slicer/song_gate_stut 59e22f92ed7d4a31
|
||||
sends/ANALOG/dry deabf8b98f7ab640
|
||||
sends/ANALOG/chorus 121c8d78aaa247d6
|
||||
sends/ANALOG/delay afca9fa890650d3c
|
||||
sends/ANALOG/reverb 7a9ee7a261797e1e
|
||||
sends/ANALOG/all a392a524049f8e91
|
||||
sends/ANALOG/dist 917a9fdf6aa27763
|
||||
sends/DIGITAL/dry 3f72412f9006460c
|
||||
sends/DIGITAL/chorus def2c63365cee4da
|
||||
sends/DIGITAL/delay 0b232f20f9015c90
|
||||
sends/DIGITAL/reverb 29b9c515f012bd0c
|
||||
sends/DIGITAL/all 25e149e3a2567b5e
|
||||
sends/DIGITAL/dist dc90f710521f8da1
|
||||
song/4track_mix f2c14e52d7d380ce
|
||||
slicer/gate/ANALOG_DARK_STR 23376a6defb8ab6f
|
||||
slicer/stut/DIGITAL_RHODES 692678a659332022
|
||||
slicer/song_gate_stut 1f6869b794a1e026
|
||||
@@ -240,13 +240,13 @@ int main(int argc, char **argv)
|
||||
ok(!kh_any(t), "KBD HOLD off: the held notes end");
|
||||
}
|
||||
{
|
||||
static const char *const want[15] = {"OFF", "UP", "DN", "UPDN", "RND", "ORD", "REPEAT", "DNUP", "UP+8", "CONV",
|
||||
"DIVG", "PINKY", "THUMB", "WALK", "CHORD"};
|
||||
static const char *const want[16] = {"OFF", "UP", "DN", "UPDN", "RND", "ORD", "REPEAT", "DNUP", "UP+8", "CONV",
|
||||
"DIVG", "PINKY", "THUMB", "WALK", "CHORD", "TURNG"};
|
||||
const param_desc_t *d = &TP[P_AMODE];
|
||||
int okm = d->max == 14;
|
||||
for (i = 0; i < 15u && okm; i++)
|
||||
int okm = d->max == 15;
|
||||
for (i = 0; i < 16u && okm; i++)
|
||||
okm = !strcmp(d->names[i], want[i]);
|
||||
ok(okm, "ARP: 15 modes (REPEAT DNUP UP+8 CONV DIVG PINKY THUMB WALK CHORD after UP .. ORD)");
|
||||
ok(okm, "ARP: 16 modes (REPEAT DNUP UP+8 CONV DIVG PINKY THUMB WALK CHORD after UP .. ORD; 0.9: TURNG)");
|
||||
}
|
||||
{ /* a sound loaded under a running arp: the arp and its notes go on */
|
||||
t->p[P_AMODE] = 1;
|
||||
|
||||
@@ -175,6 +175,42 @@ int main(int argc, char **argv)
|
||||
"INSERT: JUNO1 JUNO2 JUN12, their A B C: WIDTH TONE NOISE");
|
||||
t->p[P_ITYPE] = 0;
|
||||
}
|
||||
{ /* 0.9: TUNING (GLO), VINTAGE (VOICE 2), the filter MODELs (FILTER), TURNG's labels (SPICE) */
|
||||
set_engine_of(t, 0);
|
||||
apply_preset_to(t, 0);
|
||||
frames(3);
|
||||
ok(go_page("TUNING") && PAGES[ui.page].fam == FAM_GLO, "TUNING: a page of the GLO family");
|
||||
knob(0, 1);
|
||||
ok(tune_cfg.sys == TU_JUST && tun_on, "TUNING: KNOB 1 to JUST: the table on");
|
||||
knob(1, 2);
|
||||
ok(tune_cfg.root == 2u, "TUNING: KNOB 2: ROOT D");
|
||||
ppm("tune-page");
|
||||
knob(0, -1);
|
||||
ok(tune_cfg.sys == TU_EQUAL && !tun_on, "TUNING: back to EQUAL: off");
|
||||
knob(1, -2);
|
||||
go_page("VOICE 2");
|
||||
ok(PAGES[ui.page].id[3] == P_VINT, "VINTAGE: VOICE 2's fourth knob");
|
||||
knob(3, 30);
|
||||
ok(t->p[P_VINT] == 30, "VINTAGE turned");
|
||||
ppm("vint-page");
|
||||
t->p[P_VINT] = 0;
|
||||
go_page("FILTER");
|
||||
knob(1, 2);
|
||||
ok(t->p[P_FMODEL] == FM_MS20, "FILTER MODL: SVF MOOG MS20 ..");
|
||||
ppm("filter-ms20");
|
||||
knob(1, 6);
|
||||
ok(t->p[P_FMODEL] == FM_HP, "FILTER MODL: up to HP");
|
||||
knob(1, -10);
|
||||
ok(t->p[P_FMODEL] == FM_SVF, "FILTER MODL: down to SVF");
|
||||
t->p[P_AMODE] = AM_TURING;
|
||||
go_page("SPICE");
|
||||
ok(!strcmp(track_desc(t, P_SPICE)->label, "MUTAT") && !strcmp(track_desc(t, P_DICE)->label, "SEED") &&
|
||||
!strcmp(track_desc(t, P_SLOOP)->label, "LOOP"), "SPICE page in TURNG: MUTAT SEED LOOP");
|
||||
ppm("turing-spice");
|
||||
t->p[P_AMODE] = 0;
|
||||
frame();
|
||||
ok(!strcmp(track_desc(t, P_SPICE)->label, "SPICE"), "SPICE page otherwise: SPICE DICE LOOP");
|
||||
}
|
||||
printf(fails ? "mseq_ui: %d FAILED\n" : "mseq_ui: all passed\n", fails);
|
||||
return fails;
|
||||
}
|
||||
+11
-1
@@ -174,7 +174,17 @@ if $SYN_UB -o "$OUT/synth8_ub" tests/synth8_test.c -lm 2>/dev/null; then
|
||||
fi
|
||||
mkdir -p "$OUT/mseq_ui"
|
||||
$SYN -o "$OUT/mseq_ui_test" tests/mseq_ui_test.c -lm -lpthread
|
||||
run "Clipper 0.8 on the FM-1: MOD SEQ pages (lane, step, value, SHAPE), MOD SEQ 2, SPICE, UNDO of a step, the layer SWAP, JUNO / VECTOR in the browser" "$OUT/mseq_ui_test" "$OUT/mseq_ui"
|
||||
run "Clipper 0.8 / 0.9 on the FM-1: MOD SEQ pages (lane, step, value, SHAPE), MOD SEQ 2, SPICE, UNDO of a step, the layer SWAP, JUNO / VECTOR in the browser, TUNING, VINTG, MODL, TURNG's labels" "$OUT/mseq_ui_test" "$OUT/mseq_ui"
|
||||
$SYN -o "$OUT/synth9_test" tests/synth9_test.c -lm
|
||||
run "Clipper 0.9: the filter MODELs (SVF MOOG MS20 DIODE SEM NOTCH BP HP: bounded, responses, switch without a click), VINTAGE, the TUNING (JUST, 19-EDO, RAST, a USER scale), the TURNG arp and LOOP, projects and user presets" "$OUT/synth9_test"
|
||||
if $SYN_UB -o "$OUT/synth9_ub" tests/synth9_test.c -lm 2>/dev/null; then
|
||||
run "Clipper 0.9 under ASan + UBSan" sh -c "'$OUT/synth9_ub' >/dev/null && echo clean"
|
||||
fi
|
||||
$SYN -o "$OUT/clean_test" tests/clean_test.c -lm
|
||||
run "Clipper 0.9 audio: no click or crackle (45 cases: presets of every engine, steals, mute, level, pan, INSERT, DIST, the sends, FILT, MODL, CHOR, VINTAGE, delay TIME, reverb SIZE, EQ, WAVE TABL, FMX PTCH, engine switch, TUNING, LAYER, MOD SEQ)" "$OUT/clean_test"
|
||||
if $SYN_UB -o "$OUT/clean_ub" tests/clean_test.c -lm 2>/dev/null; then
|
||||
run "Clipper 0.9 audio under ASan + UBSan" sh -c "'$OUT/clean_ub' >/dev/null && echo clean"
|
||||
fi
|
||||
$SYN -o "$OUT/engines3_test" tests/engines3_test.c -lm
|
||||
run "Clipper 0.5 VPS (vector phaseshaping: pitch, formant, D, no DC, no aliasing, no step) and TERRAIN (every surface pitched, RAD, DRIFT, no aliasing), bounded, cost" "$OUT/engines3_test" build/eng3_demo
|
||||
if $SYN_UB -o "$OUT/engines3_ub" tests/engines3_test.c -lm 2>/dev/null; then
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ static void t_insert(void)
|
||||
for (i = 0; i < CTL; i++)
|
||||
b[i] = c[i] = cl[ncap - CTL + i];
|
||||
t->p[P_ITYPE] = IT_FUZZ, t->p[P_IMIX] = 0;
|
||||
track_insert(t, b, CTL);
|
||||
track_insert(t, b, CTL, 0);
|
||||
for (i = 0; i < CTL; i++)
|
||||
same &= b[i] == c[i];
|
||||
ok(same && !t->ins_run && !ins[0].w, "INSERT: MIX 0 is the sound bit for bit as with TYPE OFF (nothing runs)");
|
||||
|
||||
@@ -0,0 +1,499 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only
|
||||
* Copyright (C) 2026 3dSam (Clipper) */
|
||||
/* Clipper 0.9 (CLIPPER_SYNTH 1): the filter MODELs, VINTAGE, the TUNING, the arp's TURNG, LOOP; and the sound's
|
||||
* cleanliness (no click, no blow-up) where 0.9 touches it.
|
||||
* MODELS every model bounded at full resonance on a loud chord (ANALOG, WAVE, VECTOR); each one its response:
|
||||
* the low-passes keep the bass and lose the top, HP the other way round, BP a peak, NOTCH a dip; MS20 and
|
||||
* DIODE sing at full resonance; a MODEL changed under a held chord: no click (the duck)
|
||||
* VINTAGE 0: every voice in tune; 127: each voice its own tuning, within +-15 cents, and a slow drift
|
||||
* TUNING EQUAL: in tune; JUST: E a pure third (-13.7 cents); 19-EDO: one key a 19th of an octave; a USER scale; ROOT
|
||||
* TURNG MUTAT 0: a loop of LOOP notes, the held notes only; another SEED, another loop; MUTAT up: it changes
|
||||
* LOOP SPICE's variation comes round every LOOP notes
|
||||
* STORE projects (VINTAGE, LOOP of both sounds; a 0.8 project: their defaults), user presets (the side's 8 values;
|
||||
* a 0.8 side: its 6, the 2 new at defaults)
|
||||
* CLEAN a cutoff swept by the knob's steps on every model: no click; a full mix at its loudest: no sample at the
|
||||
* rail */
|
||||
#define main hostsim_main
|
||||
#include <stddef.h>
|
||||
#include "hostsim.c"
|
||||
#undef main
|
||||
#define PROJ_HOST 1
|
||||
static const uint8_t TRK_DEF[NPART][2] = {{ENGI_HYBRID, 0}, {1, 0}, {4, 5}}; /* (ui.c, Clipper) */
|
||||
static uint32_t trk_def_engine(uint32_t i) { return i < NPART ? TRK_DEF[i][0] : 0u; }
|
||||
#include "../firmware/src/project.c"
|
||||
#define UP_HOST 1
|
||||
#include "../firmware/src/upreset.c"
|
||||
|
||||
static int fails;
|
||||
static void ok(int c, const char *what)
|
||||
{
|
||||
printf("synth9: %-96s %s\n", what, c ? "ok" : "FAIL");
|
||||
fails += !c;
|
||||
}
|
||||
|
||||
#define NCAP (4096u * 24u)
|
||||
static int32_t cl[NCAP], cr[NCAP];
|
||||
static uint32_t ncap;
|
||||
static void run(uint32_t nb)
|
||||
{
|
||||
static int32_t o[CTL * 2];
|
||||
uint32_t b, i;
|
||||
ncap = 0;
|
||||
for (b = 0; b < nb; b++) {
|
||||
mix_block(o, CTL);
|
||||
for (i = 0; i < CTL; i++)
|
||||
if (ncap < NCAP) {
|
||||
cl[ncap] = o[2 * i];
|
||||
cr[ncap++] = o[2 * i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
static void quiet(void)
|
||||
{
|
||||
uint32_t i, k;
|
||||
for (i = 0; i < NPART; i++)
|
||||
trk_all_off(&trk[i]);
|
||||
run(400);
|
||||
for (i = 0; i < NPART; i++)
|
||||
for (k = 0; k < NVOICE; k++)
|
||||
trk[i].v[k].active = trk[i].v[k].gate = 0, trk[i].v[k].stage = 0, trk[i].v[k].env = trk[i].v[k].env_out = 0;
|
||||
run(300);
|
||||
}
|
||||
static void plain(track_t *t, uint32_t eng, uint32_t pi)
|
||||
{
|
||||
host_preset(t, eng, pi);
|
||||
t->p[P_DIST] = t->p[P_CHOR] = t->p[P_DLY] = t->p[P_REV] = 0;
|
||||
t->p[P_LD_PIT] = t->p[P_LD_FLT] = t->p[P_LD_SHP] = t->p[P_LD_AMP] = t->p[P_ED_PIT] = t->p[P_ED_FLT] = 0;
|
||||
t->p[P_ATK] = 0, t->p[P_SUS] = 127, t->p[P_REL] = 10, t->p[P_VOICE] = V_POLY, t->p[P_PAN] = 0, t->p[P_GLIDE] = 0;
|
||||
t->p[P_MWDST] = t->p[P_ATDST] = MD_OFF;
|
||||
t->p[P_AMODE] = 0, t->p[P_VINT] = 0, t->p[P_FMODEL] = FM_SVF;
|
||||
t->p[P_ITYPE] = 0, t->p[P_IMIX] = 127;
|
||||
}
|
||||
static double mag(double f, uint32_t a, uint32_t n)
|
||||
{
|
||||
double re = 0, im = 0;
|
||||
uint32_t i;
|
||||
for (i = 0; i < n; i++) {
|
||||
double w = 0.5 - 0.5 * cos(2 * M_PI * i / n), x = cl[a + i] * w;
|
||||
re += x * cos(2 * M_PI * f * i / FS);
|
||||
im += x * sin(2 * M_PI * f * i / FS);
|
||||
}
|
||||
return sqrt(re * re + im * im) / n;
|
||||
}
|
||||
/* the frequency of the strongest partial near f (+-4 %), to a hundredth of a cent or so */
|
||||
static double freq_near(double f, uint32_t a, uint32_t n)
|
||||
{
|
||||
double best = f, bm = 0, step = f * 0.0005, x;
|
||||
for (x = f * 0.96; x <= f * 1.04; x += step) {
|
||||
double m = mag(x, a, n);
|
||||
if (m > bm)
|
||||
bm = m, best = x;
|
||||
}
|
||||
for (step /= 20.0, x = best - 20 * step; x <= best + 20 * step; x += step) {
|
||||
double m = mag(x, a, n);
|
||||
if (m > bm)
|
||||
bm = m, best = x;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
static double cents(double f, double ref) { return 1200.0 * log2(f / ref); }
|
||||
static int bounded(void)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < ncap; i++)
|
||||
if (cl[i] >= (1 << 23) || cl[i] <= -(1 << 23) || cr[i] >= (1 << 23) || cr[i] <= -(1 << 23))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
static int32_t d2max(uint32_t a, uint32_t n) /* the largest second difference: a click's mark */
|
||||
{
|
||||
int32_t mx = 0;
|
||||
uint32_t i;
|
||||
for (i = a + 2u; i < a + n && i < ncap; i++) {
|
||||
int32_t d = cl[i] - 2 * cl[i - 1] + cl[i - 2];
|
||||
d = d < 0 ? -d : d;
|
||||
mx = d > mx ? d : mx;
|
||||
}
|
||||
return mx;
|
||||
}
|
||||
static double rms(uint32_t a, uint32_t n)
|
||||
{
|
||||
double e = 0;
|
||||
uint32_t i;
|
||||
for (i = a; i < a + n && i < ncap; i++)
|
||||
e += (double)cl[i] * cl[i];
|
||||
return sqrt(e / n);
|
||||
}
|
||||
|
||||
static const char *const MN[9] = {"", "SVF", "MOOG", "MS20", "DIODE", "SEM", "NOTCH", "BP", "HP"};
|
||||
static void t_models(void)
|
||||
{
|
||||
static const uint32_t engs[3] = {0, ENGI_WAVE, ENGI_VECTOR};
|
||||
static const uint8_t ch[4] = {36, 48, 55, 64};
|
||||
track_t *t = &trk[0];
|
||||
uint32_t e, m, i, good = 1;
|
||||
char w[200];
|
||||
for (e = 0; e < 3u; e++) /* full resonance, a loud chord, every model: bounded */
|
||||
for (m = FM_SVF; m <= FM_LAST; m++) {
|
||||
quiet();
|
||||
plain(t, engs[e], 0);
|
||||
t->p[P_FMODEL] = (int16_t)m;
|
||||
if (engs[e] != ENGI_VECTOR)
|
||||
t->p[P_E5] = 127; /* (RES) */
|
||||
for (i = 0; i < 4u; i++)
|
||||
trk_note_on(t, ch[i], 127);
|
||||
run(1200);
|
||||
if (!bounded()) {
|
||||
good = 0;
|
||||
printf(" %s %s: out of bounds\n", ENGINES[engs[e]]->name, MN[m]);
|
||||
}
|
||||
}
|
||||
ok(good, "MODELS: every one at full resonance on a loud chord (ANALOG, WAVE, VECTOR): bounded");
|
||||
{ /* the responses: a saw at A2 (110 Hz), the cutoff ~1 kHz: the 2nd harmonic against the 20th (2.2 kHz) */
|
||||
double lo[9], hi[9], h5[9];
|
||||
for (m = FM_SVF; m <= FM_LAST; m++) {
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 0, t->p[P_E2] = 0, t->p[P_E3] = 0, t->p[P_E4] = 70, t->p[P_E5] = 40, t->p[P_E6] = 0, t->p[P_E7] = 0;
|
||||
t->p[P_FMODEL] = (int16_t)m;
|
||||
trk_note_on(t, 45, 100);
|
||||
run(700);
|
||||
lo[m] = mag(220, 8192, 8192) / 0.5; /* (the saw's own falls as 1 / k) */
|
||||
hi[m] = mag(2200, 8192, 8192) / 0.05;
|
||||
h5[m] = mag(550, 8192, 8192) / 0.2;
|
||||
}
|
||||
good = 1;
|
||||
for (m = FM_SVF; m <= FM_SEM; m++)
|
||||
if (!(lo[m] > (m == FM_MOOG || m == FM_DIODE ? 4.0 : 3.0) * hi[m])) {
|
||||
good = 0;
|
||||
printf(" %s: low %.1f high %.1f\n", MN[m], lo[m], hi[m]);
|
||||
}
|
||||
ok(good, "MODELS: SVF MOOG MS20 DIODE SEM low-pass (the bass kept, the top 10 dB down, 12 for MOOG and DIODE)");
|
||||
ok(hi[FM_HP] > 4.0 * lo[FM_HP], "MODELS: HP the other way round");
|
||||
ok(lo[FM_NOTCH] > 0.3 * lo[FM_SVF] && hi[FM_NOTCH] > 2.0 * hi[FM_SVF], "MODELS: NOTCH keeps both ends");
|
||||
ok(lo[FM_BP] < 0.5 * lo[FM_SVF] && hi[FM_BP] < 0.85 * hi[FM_HP] && h5[FM_BP] > lo[FM_BP],
|
||||
"MODELS: BP a band (the bass down against SVF, the top against HP, the middle up)");
|
||||
}
|
||||
{ /* MS20 and DIODE sing at full resonance (a quiet note: the resonance rings on) */
|
||||
double r[2];
|
||||
for (i = 0; i < 2u; i++) {
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 3, t->p[P_E4] = 70, t->p[P_E5] = 127; /* a sine: the ring is the filter's */
|
||||
t->p[P_FMODEL] = (int16_t)(i ? FM_DIODE : FM_MS20);
|
||||
trk_note_on(t, 33, 20);
|
||||
run(800);
|
||||
r[i] = rms(16384, 8192);
|
||||
}
|
||||
ok(r[0] > 200 && r[1] > 200, "MODELS: MS20 and DIODE ring at full resonance");
|
||||
}
|
||||
{ /* a MODEL changed under a held chord: no click */
|
||||
int32_t steady, sw = 0;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E4] = 80, t->p[P_E5] = 60;
|
||||
for (i = 0; i < 3u; i++)
|
||||
trk_note_on(t, ch[i + 1u], 100);
|
||||
run(600);
|
||||
steady = d2max(4096, 12000);
|
||||
for (m = FM_SVF + 1u; m <= FM_LAST + 1u; m++) {
|
||||
int32_t a, b2;
|
||||
run(200);
|
||||
a = d2max(0, ncap);
|
||||
t->p[P_FMODEL] = (int16_t)(m > FM_LAST ? FM_SVF : m);
|
||||
run(16);
|
||||
b2 = d2max(0, ncap);
|
||||
run(200);
|
||||
a = a > d2max(0, ncap) ? a : d2max(0, ncap); /* (the steady sound before and after) */
|
||||
if (b2 > a * 3 / 2 + 64) {
|
||||
sw = b2;
|
||||
printf(" to %s: %d (steady %d)\n", MN[m > FM_LAST ? FM_SVF : m], b2, a);
|
||||
}
|
||||
}
|
||||
(void)steady;
|
||||
ok(!sw, "MODELS: changed under a held chord, every one in turn: no click (a 6 ms S-curve duck)");
|
||||
}
|
||||
}
|
||||
|
||||
static void t_vintage(void)
|
||||
{
|
||||
track_t *t = &trk[0];
|
||||
uint32_t i;
|
||||
double f[8], spread0 = 0, spread = 0, mx = 0;
|
||||
for (i = 0; i < 8u; i++) { /* VINTAGE 0: one note on each voice in turn: in tune */
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 3, t->p[P_E4] = 127, t->p[P_E5] = 0;
|
||||
t->v[i].age = 0;
|
||||
trk_note_on(t, 69, 100);
|
||||
run(450);
|
||||
f[i] = cents(freq_near(440, 4096, 8192), 440);
|
||||
spread0 = fabs(f[i]) > spread0 ? fabs(f[i]) : spread0;
|
||||
}
|
||||
ok(spread0 < 0.3, "VINTAGE 0: every note in tune (within 0.3 cent)");
|
||||
{
|
||||
double c[NVOICE];
|
||||
uint32_t k, n = 0;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 3, t->p[P_E4] = 127, t->p[P_E5] = 0, t->p[P_VINT] = 127;
|
||||
for (k = 0; k < NVOICE; k++) { /* each voice its own card: the same note on each */
|
||||
uint32_t j;
|
||||
for (j = 0; j < NVOICE; j++)
|
||||
t->v[j].active = 0;
|
||||
trk_note_on(t, 69, 100);
|
||||
run(450);
|
||||
c[n++] = cents(freq_near(440, 4096, 8192), 440);
|
||||
trk_note_off(t, 69);
|
||||
run(60);
|
||||
}
|
||||
for (k = 0; k < n; k++) {
|
||||
mx = fabs(c[k]) > mx ? fabs(c[k]) : mx;
|
||||
for (i = 0; i < n; i++)
|
||||
spread = fabs(c[k] - c[i]) > spread ? fabs(c[k] - c[i]) : spread;
|
||||
}
|
||||
ok(spread > 2.0 && mx < 15.0, "VINTAGE 127: the voices each their own tuning (spread over 2 cents, none past 15)");
|
||||
}
|
||||
{ /* a held note drifts slowly */
|
||||
double a, b;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 3, t->p[P_E4] = 127, t->p[P_E5] = 0, t->p[P_VINT] = 127;
|
||||
trk_note_on(t, 69, 100);
|
||||
run(2900);
|
||||
a = cents(freq_near(440, 2048, 8192), 440);
|
||||
b = cents(freq_near(440, ncap - 8192, 8192), 440);
|
||||
run(2900);
|
||||
b = fabs(cents(freq_near(440, ncap - 8192, 8192), 440) - a) > fabs(b - a) ? cents(freq_near(440, ncap - 8192, 8192), 440) : b;
|
||||
ok(fabs(b - a) > 0.2 && fabs(b - a) < 12.0, "VINTAGE 127: a held note drifts, slowly and a little");
|
||||
t->p[P_VINT] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void t_tuning(void)
|
||||
{
|
||||
track_t *t = &trk[0];
|
||||
double e, j, k19, u;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E0] = 3, t->p[P_E4] = 127, t->p[P_E5] = 0;
|
||||
tune_cfg.sys = TU_EQUAL, tune_cfg.root = 0;
|
||||
tune_build();
|
||||
trk_note_on(t, 64, 100);
|
||||
run(450);
|
||||
e = cents(freq_near(329.628, 4096, 8192), 329.628);
|
||||
quiet();
|
||||
tune_cfg.sys = TU_JUST;
|
||||
tune_build();
|
||||
trk_note_on(t, 64, 100);
|
||||
run(450);
|
||||
j = cents(freq_near(329.628, 4096, 8192), 329.628);
|
||||
ok(fabs(e) < 0.3 && fabs(j + 13.7) < 0.6 && tun_on, "TUNING: EQUAL in tune; JUST: E4 a pure third (-13.7 cents)");
|
||||
quiet();
|
||||
tune_cfg.sys = TU_19;
|
||||
tune_build();
|
||||
trk_note_on(t, 61, 100);
|
||||
run(450);
|
||||
k19 = cents(freq_near(261.626 * pow(2, 1 / 19.0), 4096, 8192), 261.626);
|
||||
ok(fabs(k19 - 1200.0 / 19) < 0.6, "TUNING: 19-EDO: C#4 a 19th of an octave above C4");
|
||||
quiet();
|
||||
tune_cfg.sys = TU_USER, tune_cfg.n = 3, tune_cfg.period = 19200; /* 0, 400, 700 cents */
|
||||
tune_cfg.deg[1] = 400 * 16, tune_cfg.deg[2] = 700 * 16, tune_cfg.root = 2; /* from D4 */
|
||||
tune_build();
|
||||
trk_note_on(t, 64, 100); /* D4 + 2 keys: the third degree, 700 cents above D4 */
|
||||
run(450);
|
||||
u = cents(freq_near(293.665 * pow(2, 7 / 12.0), 4096, 8192), 293.665);
|
||||
ok(fabs(u - 700) < 0.6, "TUNING: a USER scale of 3 degrees from ROOT D: E4 is its 3rd degree (D + 700 cents)");
|
||||
quiet();
|
||||
tune_cfg.sys = TU_RAST, tune_cfg.root = 0;
|
||||
tune_build();
|
||||
trk_note_on(t, 71, 100);
|
||||
run(450);
|
||||
u = cents(freq_near(493.883, 4096, 8192), 493.883);
|
||||
ok(fabs(u + 50) < 0.6, "TUNING: RAST: B half flat (-50 cents)");
|
||||
trk_note_off(t, 71);
|
||||
tune_cfg.sys = TU_EQUAL;
|
||||
tune_build();
|
||||
ok(!tun_on, "TUNING: EQUAL: off (nothing touched)");
|
||||
quiet();
|
||||
}
|
||||
|
||||
/* the arp's notes over k steps */
|
||||
static void arp_take(uint32_t mode, uint32_t mut, uint32_t seed, uint32_t loop, uint8_t *notes, uint32_t k)
|
||||
{
|
||||
track_t *t = &trk[0];
|
||||
uint32_t n = 0, b, last;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_AMODE] = (int16_t)mode, t->p[P_ARATE] = 2, t->p[P_AGATE] = 64, t->p[P_APROB] = 127, t->p[P_AOCT] = 2;
|
||||
t->p[P_SPICE] = (int16_t)mut, t->p[P_DICE] = (int16_t)seed, t->p[P_SLOOP] = (int16_t)loop;
|
||||
t->arp_idx = 0, t->tm_seed = 0;
|
||||
input_on(t, 60, 100);
|
||||
input_on(t, 63, 100);
|
||||
input_on(t, 67, 100);
|
||||
last = t->arp_idx;
|
||||
for (b = 0; b < 12000u && n < k; b++) {
|
||||
run(1);
|
||||
if (t->arp_idx != last)
|
||||
last = t->arp_idx, notes[n++] = t->arp_note;
|
||||
}
|
||||
input_off(t, 60);
|
||||
input_off(t, 63);
|
||||
input_off(t, 67);
|
||||
t->p[P_AMODE] = 0, t->p[P_SPICE] = 0, t->p[P_DICE] = 0, t->p[P_SLOOP] = 16;
|
||||
run(30);
|
||||
}
|
||||
static void t_turing(void)
|
||||
{
|
||||
uint8_t a[48], b[48], c[48], d[48];
|
||||
uint32_t i, per = 1, inkey = 1, diff = 0;
|
||||
arp_take(AM_TURING, 0, 3, 8, a, 48);
|
||||
for (i = 8; i < 48u; i++)
|
||||
per &= a[i] == a[i - 8u];
|
||||
for (i = 0; i < 48u; i++) {
|
||||
uint32_t pc = a[i] % 12u;
|
||||
inkey &= a[i] >= 60 && a[i] < 84 && (pc == 0u || pc == 3u || pc == 7u);
|
||||
}
|
||||
ok(per && inkey, "TURNG MUTAT 0, LOOP 8: a loop of 8 notes, every one a held note (over OCT 2)");
|
||||
arp_take(AM_TURING, 0, 4, 8, b, 48);
|
||||
ok(memcmp(a, b, 48) != 0, "TURNG: another SEED, another loop");
|
||||
arp_take(AM_TURING, 0, 3, 8, c, 48);
|
||||
ok(!memcmp(a, c, 48), "TURNG: the same SEED, the same loop");
|
||||
arp_take(AM_TURING, 100, 3, 8, d, 48);
|
||||
for (i = 8; i < 48u; i++)
|
||||
diff += d[i] != d[i - 8u];
|
||||
ok(diff >= 4u, "TURNG MUTAT 100: the loop changes as it goes");
|
||||
{ /* LOOP: SPICE's variation every LOOP notes (UP over 3 notes and LOOP 6: a period of 6) */
|
||||
uint8_t s[48];
|
||||
uint32_t same = 1;
|
||||
arp_take(AM_UP, 127, 5, 6, s, 48);
|
||||
for (i = 6; i < 48u; i++)
|
||||
same &= s[i] == s[i - 6u];
|
||||
ok(same, "LOOP 6: SPICE's variation comes round every 6 notes");
|
||||
}
|
||||
}
|
||||
|
||||
static project_t pj;
|
||||
static void t_store(void)
|
||||
{
|
||||
track_t *a = &trk[0], *b = &trk[1];
|
||||
quiet();
|
||||
plain(a, 0, 0);
|
||||
plain(b, ENGI_JUNO, 0);
|
||||
a->p[P_VINT] = 99, a->p[P_SLOOP] = 5, b->p[P_VINT] = 17, b->p[P_SLOOP] = 12, a->p[P_FMODEL] = FM_DIODE;
|
||||
a->p[P_MSLEN] = 7, a->p[P_DICE] = 44;
|
||||
proj_capture(&pj);
|
||||
a->p[P_VINT] = b->p[P_VINT] = 0, a->p[P_SLOOP] = b->p[P_SLOOP] = 16, a->p[P_FMODEL] = FM_SVF, a->p[P_MSLEN] = 16;
|
||||
proj_apply(&pj, 1);
|
||||
ok(a->p[P_VINT] == 99 && a->p[P_SLOOP] == 5 && b->p[P_VINT] == 17 && b->p[P_SLOOP] == 12 && a->p[P_FMODEL] == FM_DIODE &&
|
||||
a->p[P_MSLEN] == 7 && a->p[P_DICE] == 44 && sizeof pj == 3840u,
|
||||
"project: VINTAGE, LOOP of both sounds and the MODEL kept (with 0.8's), the size unchanged");
|
||||
{ /* as 0.8 wrote it: track 4's 0.9 bytes and mark not there */
|
||||
uint32_t k;
|
||||
proj_capture(&pj);
|
||||
for (k = 0; k < NLOCK; k++) {
|
||||
plock_t *l = &pj.t[3].lock[k];
|
||||
uint32_t n0 = 3u * k;
|
||||
if (n0 + 2u >= PROJ_X9_AT) {
|
||||
if (n0 >= PROJ_X9_AT)
|
||||
l->param = 0;
|
||||
if (n0 + 1u >= PROJ_X9_AT)
|
||||
l->val = (int16_t)((uint16_t)l->val & (n0 + 1u >= PROJ_X9_AT ? 0x0000u : 0x00FFu));
|
||||
if (n0 + 1u < PROJ_X9_AT)
|
||||
l->val = (int16_t)((uint16_t)l->val & 0x00FFu);
|
||||
}
|
||||
}
|
||||
proj_apply(&pj, 1);
|
||||
ok(a->p[P_VINT] == 0 && a->p[P_SLOOP] == 16 && a->p[P_MSLEN] == 7 && a->ms[0][0] == MSEQ_INIT[0][0],
|
||||
"a project of 0.8: its MOD SEQ read, VINTAGE and LOOP at their defaults");
|
||||
}
|
||||
{ /* user presets */
|
||||
up_rec_t r;
|
||||
int16_t v[P_COUNT], out[P_COUNT], def[P_COUNT];
|
||||
uint32_t i, same = 1;
|
||||
for (i = 0; i < P_COUNT; i++)
|
||||
def[i] = i >= P_E0 ? 0 : TP[i].def;
|
||||
for (i = 0; i < P_COUNT; i++)
|
||||
v[i] = (int16_t)(i >= P_E0 ? 40 + i : i < UP_E0V ? i * 3 : TP[i].min + (int32_t)(i * 7u) % (TP[i].max - TP[i].min + 1));
|
||||
memset(&r, 0, sizeof r);
|
||||
r.used = UP_USED, r.ver = UP_VER, r.name[0] = 'N';
|
||||
up_rec_set(&r, v);
|
||||
up_params(&r, out, def);
|
||||
for (i = 0; i < P_COUNT; i++)
|
||||
same &= out[i] == v[i];
|
||||
ok(same && up_xs[0] == 2u, "user presets: every value back, VINTAGE and LOOP with them (the side's 8)");
|
||||
up_xs[0] = 1; /* (0.8's side: its 6 values) */
|
||||
up_params(&r, out, def);
|
||||
ok(out[P_MSLEN] == v[P_MSLEN] && out[P_DICE] == v[P_DICE] && out[P_VINT] == TP[P_VINT].def &&
|
||||
out[P_SLOOP] == TP[P_SLOOP].def, "user presets: a 0.8 side: its 6 values, VINTAGE and LOOP at their defaults");
|
||||
}
|
||||
}
|
||||
|
||||
static void t_clean(void)
|
||||
{
|
||||
track_t *t = &trk[0];
|
||||
uint32_t m, i, bad = 0;
|
||||
for (m = FM_SVF; m <= FM_LAST; m++) { /* the cutoff swept by the knob, a step a UI frame */
|
||||
int32_t steady, sweep = 0;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
t->p[P_E4] = 40, t->p[P_E5] = 70, t->p[P_FMODEL] = (int16_t)m;
|
||||
trk_note_on(t, 48, 100);
|
||||
trk_note_on(t, 55, 100);
|
||||
run(500);
|
||||
steady = d2max(2048, 12000);
|
||||
for (i = 0; i < 80u; i++) {
|
||||
int32_t d;
|
||||
t->p[P_E4] = (int16_t)(40 + i);
|
||||
run(22);
|
||||
d = d2max(0, ncap);
|
||||
sweep = d > sweep ? d : sweep;
|
||||
}
|
||||
run(400);
|
||||
steady = d2max(2048, 9000) > steady ? d2max(2048, 9000) : steady; /* (open: the sound brighter) */
|
||||
if (sweep > steady * 2 + 200) {
|
||||
bad++;
|
||||
printf(" %s: sweep %d steady %d\n", MN[m], sweep, steady);
|
||||
}
|
||||
}
|
||||
ok(!bad, "CLEAN: the cutoff swept by the knob on every model (a step each UI frame): no click");
|
||||
{ /* the loudest mix: two parts, eight voices of a hot saw chord, every send, the INSERT, VINTAGE */
|
||||
uint32_t rail = 0, k;
|
||||
quiet();
|
||||
plain(t, 0, 0);
|
||||
plain(&trk[1], ENGI_JUNO, 0);
|
||||
trk[1].p[P_LYMODE] = LY_LAYER;
|
||||
t->p[P_E6] = 127, t->p[P_E5] = 100, t->p[P_FMODEL] = FM_MS20, t->p[P_VINT] = 127, t->p[P_LEVEL] = 127;
|
||||
t->p[P_DIST] = 127, t->p[P_CHOR] = 127, t->p[P_DLY] = 127, t->p[P_REV] = 127, t->p[P_ITYPE] = 4;
|
||||
trk[1].p[P_LEVEL] = 127;
|
||||
song.master_q12 = 4088; /* (the MASTER knob all the way up) */
|
||||
for (k = 0; k < 8u; k++)
|
||||
trk_note_on(t, 36 + 5 * k, 127);
|
||||
run(3000);
|
||||
for (k = 0; k < ncap; k++)
|
||||
rail += cl[k] >= (1 << 23) - 1 || cl[k] <= -(1 << 23) || cr[k] >= (1 << 23) - 1 || cr[k] <= -(1 << 23);
|
||||
ok(!rail && bounded(), "CLEAN: the loudest mix (2 parts, 8 hot voices, every send, FUZZ, MS20): no sample at the rail");
|
||||
song.master_q12 = 4096;
|
||||
trk[1].p[P_LYMODE] = LY_OFF;
|
||||
quiet();
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint32_t i;
|
||||
host_tracks_init();
|
||||
for (i = 0; i < NPART; i++)
|
||||
host_preset(&trk[i], TRK_DEF[i][0], TRK_DEF[i][1]);
|
||||
clipper_proj_neutral();
|
||||
trk[1].p[P_LYMODE] = LY_OFF;
|
||||
song.g[G_BPM] = 120;
|
||||
t_models();
|
||||
t_vintage();
|
||||
t_tuning();
|
||||
t_turing();
|
||||
t_store();
|
||||
t_clean();
|
||||
printf(fails ? "synth9: %d FAILED\n" : "synth9: all passed\n", fails);
|
||||
return fails;
|
||||
}
|
||||
@@ -481,6 +481,29 @@ START (ids 83..86) and SPICE, DICE (87, 88: the arp's and the sequencer's notes
|
||||
- 0.8 also has the engines JUNO (21) and VECTOR (22), and the INSERT's types JUNO1, JUNO2, JUN12 (9..11: the JUNO
|
||||
chorus on any sound; A WIDTH, B TONE, C NOISE).
|
||||
|
||||
## v14: the TUNING (Clipper 0.9)
|
||||
|
||||
INFO ends with 14. 0.9 adds two parameters before P_E0: VINTAGE (89, VOICE 2: each voice's own tuning, drift and
|
||||
cutoff, 0..127) and LOOP (90, the SPICE page: 1..16, how many notes SPICE / DICE and the TURNG arp repeat); P_E0 is 91,
|
||||
P_COUNT 99. The filter's MODL (ANALOG, WAVE, VECTOR) goes SVF, MOOG, MS20, DIODE, SEM, NOTCH, BP, HP (1..8); the arp's
|
||||
MODE gains TURNG (15: a Turing machine over the held notes; SPICE its MUTATion, DICE its SEED, LOOP its length).
|
||||
|
||||
The FM-1's tuning (GLO > TUNING: the system and its ROOT, every sound) is kept with the settings; the USER system plays
|
||||
a scale sent here (a Scala .scl file: the editor reads it):
|
||||
|
||||
| cmd | name | request | reply |
|
||||
|---|---|---|---|
|
||||
| 95 | TUNE_GET | - | rc, system, root, n, period (3 bytes), n - 1 degrees (3 bytes each) |
|
||||
| 96 | TUNE_PUT | system, root, n, period (3 bytes), n - 1 degrees (3 bytes each) | rc |
|
||||
|
||||
- system 0..13: EQUAL, JUST, PYTHA, MEANT, WERCK (Werckmeister III), KIRNB (Kirnberger III), RAST, BAYAT, SLEND,
|
||||
PELOG, 19EDO, 24EDO, 31EDO, USER. root 0..11 (C..B): the note that is 1/1 (the tables) or C4 + root (USER).
|
||||
- The USER scale: n 1..48 degrees (the first, 0, not sent), the period and the degrees in 1/16 cent, each 21 bits as
|
||||
3 bytes of 7 bits (low first). The degrees rise and stay below the period (16..65535). Each key plays the next degree;
|
||||
a period other than 1200 cents (the tritave of Bohlen-Pierce, ...) is kept as it is.
|
||||
- rc 0 ok, 1 bad request (a system / root out of range, n 0 or above 48, the bytes not as n says, degrees not rising).
|
||||
TUNE_PUT keeps the scale even when another system plays (USER plays it); the settings are written a few seconds later.
|
||||
|
||||
## Notes for the editor
|
||||
|
||||
- **One request at a time.** Wait for the reply, about 10–50 ms, before sending the next.
|
||||
|
||||
+129
-6
@@ -596,6 +596,17 @@
|
||||
<label><span data-t="fxStoreTo"></span> <select id="fxslot"></select></label> <button id="fxstore" data-t="fxStore"></button></p>
|
||||
<div id="fxbody"></div>
|
||||
</div>
|
||||
<!-- Clipper 0.9: the TUNING (firmware protocol v14): kept with the FM-1's settings -->
|
||||
<div class="card" id="tupanel" hidden>
|
||||
<h2 data-t="tuTitle" data-ic="ui_knob"></h2>
|
||||
<p class="dim" data-t="tuHelp"></p>
|
||||
<p class="bar"><label><span data-t="tuSystem"></span> <select id="tusys"></select></label>
|
||||
<label><span data-t="tuRoot"></span> <select id="turoot"></select></label>
|
||||
<button id="tuscl" data-t="tuLoad" data-ic="symbol_upload"></button>
|
||||
<input type="file" id="tufile" accept=".scl,text/plain" hidden>
|
||||
<button id="tusend" class="pri" data-t="tuSendBtn"></button></p>
|
||||
<p class="dim" id="tuinfo"></p>
|
||||
</div>
|
||||
<!-- Clipper 0.8: the MOD SEQ's steps (firmware protocol v13): every engine -->
|
||||
<div class="card" id="mspanel" hidden>
|
||||
<h2 data-t="msTitle" data-ic="ui_knob"></h2>
|
||||
@@ -809,7 +820,8 @@ const CMD = { INFO: 1, GET: 2, SET: 3, DUMP: 4, DESC: 5, STEP_GET: 6, STEP_SET:
|
||||
DSYN_LIST: 72, DSYN_GET: 73, DSYN_PUT: 74, DSYN_STORE: 75, DSYN_PLAY: 76, /* v10 (SLOOP 2.5): the SYN drum kits */
|
||||
HY_GET: 77, HY_PUT: 78, /* v11 (Clipper): the HYBRID engine's patches */
|
||||
FMX_GET: 90, FMX_PUT: 91, FMX_STORE: 92, /* v12 (Clipper 0.6): the FMX engine's patches */
|
||||
MSEQ_GET: 93, MSEQ_PUT: 94 }; /* v13 (Clipper 0.8): the MOD SEQ's steps of a part */
|
||||
MSEQ_GET: 93, MSEQ_PUT: 94, /* v13 (Clipper 0.8): the MOD SEQ's steps of a part */
|
||||
TUNE_GET: 95, TUNE_PUT: 96 }; /* v14 (Clipper 0.9): the TUNING (a Scala scale) */
|
||||
/* v7: the parameters a step can lock (firmware seq.c p_lockable: the sound, not the sequencer / arp / key / voice
|
||||
mode); ids as core.h: LEVEL .. LFO dests, GATE, the sends, GLIDE, PAN, DETUNE, the SLICER, the engine's 8 (from pe0:
|
||||
53, or 78 on Clipper 0.4, whose LFO 2, ENV 2 and matrix at 53..77 are not lockable) */
|
||||
@@ -1015,6 +1027,12 @@ const parse = {
|
||||
/* v13: part, rc, 64 values (lane 1's 16 steps, lane 2's ..: -8..7) */
|
||||
[CMD.MSEQ_GET](a) { return { part: a[0], rc: a[1], steps: a[1] ? null : Array.from(a.slice(2, 66), (x) => x - 8) }; },
|
||||
[CMD.MSEQ_PUT](a) { return { part: a[0], rc: a[1] }; },
|
||||
/* v14: rc, system, root, n, period (21 bits), n - 1 degrees (21 bits each; 1/16 cent) */
|
||||
[CMD.TUNE_GET](a) {
|
||||
const u21 = (k) => a[k] | a[k + 1] << 7 | a[k + 2] << 14, n = a[3] || 0;
|
||||
return { rc: a[0], sys: a[1], root: a[2], n, period: u21(4), deg: [0, ...Array.from({ length: Math.max(0, n - 1) }, (_, i) => u21(7 + 3 * i))] };
|
||||
},
|
||||
[CMD.TUNE_PUT](a) { return { rc: a[0] }; },
|
||||
[CMD.FMX_STORE](a) { return { slot: a[0], rc: a[1] }; },
|
||||
[CMD.FM6_LIST](a) {
|
||||
const r = new Reader(a), o = { factory: r.b(), bank: r.b(), slots: [] };
|
||||
@@ -1119,6 +1137,12 @@ const req = {
|
||||
fmxGet: (target, i) => [CMD.FMX_GET, [target & 0x7F, i & 0x7F]],
|
||||
fmxPut: (part, bytes) => [CMD.FMX_PUT, [0, part & 0x7F, ...pack7(bytes)]],
|
||||
mseqGet: (part) => [CMD.MSEQ_GET, [part & 0x7F]],
|
||||
tuneGet: () => [CMD.TUNE_GET, []],
|
||||
/* sys, root, deg: [0, d1 .. d(n-1)] and period, in 1/16 cent */
|
||||
tunePut: (sys, root, deg, period) => {
|
||||
const u21 = (v) => [v & 127, (v >> 7) & 127, (v >> 14) & 127];
|
||||
return [CMD.TUNE_PUT, [sys & 127, root & 127, deg.length & 127, ...u21(period), ...deg.slice(1).flatMap(u21)]];
|
||||
},
|
||||
mseqPut: (part, steps) => [CMD.MSEQ_PUT, [part & 0x7F, ...steps.map((v) => Math.max(0, Math.min(15, (v | 0) + 8)))]],
|
||||
fmxStore: (slot, bytes) => [CMD.FMX_STORE, [slot & 0x7F, ...pack7(bytes)]],
|
||||
fm6List: () => [CMD.FM6_LIST, []],
|
||||
@@ -1133,6 +1157,29 @@ const req = {
|
||||
dsynPlay: (k, lane, vel = 110) => [CMD.DSYN_PLAY, [k & 0x7F, lane & 0x7F, Math.max(1, Math.min(127, vel | 0))]],
|
||||
};
|
||||
|
||||
/* v14: a Scala .scl file -> {desc, deg: [0, ...] and period in 1/16 cent} (null: not a scale this device takes) */
|
||||
function parseScl(text) {
|
||||
const lines = String(text).split(/\r?\n/).filter((l) => !/^\s*!/.test(l));
|
||||
if (lines.length < 2) return null;
|
||||
const desc = lines[0].trim(), n = parseInt(lines[1], 10);
|
||||
if (!(n >= 1) || n > 48 || lines.length < 2 + n) return null;
|
||||
const cents = [];
|
||||
for (let i = 0; i < n; i++) {
|
||||
const t = lines[2 + i].trim().split(/\s+/)[0];
|
||||
let c;
|
||||
if (/^-?\d*\.\d*$/.test(t)) c = parseFloat(t);
|
||||
else if (/^\d+\/\d+$/.test(t)) { const [x, y] = t.split("/").map(Number); c = 1200 * Math.log2(x / y); }
|
||||
else if (/^\d+$/.test(t)) c = 1200 * Math.log2(+t);
|
||||
else return null;
|
||||
if (!isFinite(c)) return null;
|
||||
cents.push(c);
|
||||
}
|
||||
const period = Math.round(cents[n - 1] * 16), deg = [0, ...cents.slice(0, n - 1).map((c) => Math.round(c * 16))];
|
||||
for (let i = 1; i < deg.length; i++) if (!(deg[i] > deg[i - 1]) || deg[i] >= period) return null;
|
||||
if (!(period > 0) || period > 65535) return null;
|
||||
return { desc, deg, period };
|
||||
}
|
||||
|
||||
/* which reply belongs to which request (the device echoes these) */
|
||||
function replyMatches(cmd, args, a) {
|
||||
switch (cmd) {
|
||||
@@ -1155,6 +1202,7 @@ function replyMatches(cmd, args, a) {
|
||||
case CMD.FMX_GET: case CMD.FMX_PUT: return a[0] === args[0] && a[1] === args[1];
|
||||
case CMD.FMX_STORE: return a[0] === args[0];
|
||||
case CMD.MSEQ_GET: case CMD.MSEQ_PUT: return a[0] === args[0];
|
||||
case CMD.TUNE_GET: case CMD.TUNE_PUT: return true;
|
||||
case CMD.FM6_ERASE: return a[0] === args[0];
|
||||
case CMD.DSYN_GET: return a[0] === args[0];
|
||||
case CMD.DSYN_PUT: case CMD.DSYN_PLAY: return a[0] === args[0] && a[1] === args[1];
|
||||
@@ -2540,7 +2588,8 @@ function makeMockDevice(opt = {}) {
|
||||
D("PITCH", F.PCT, 0, 127, 64), D("CUT", F.CUTOFF, 0, 127, 110), D("RES", F.PCT, 0, 127, 10)],
|
||||
presets: ["WAVE STEPS", "RHYTHM SEQ", "SWEEP PAD", "FIFTH STAB"].map((n, i) => P(n, [i, 40, 20, 0, 0, 64, 110, 10], [0, 90, 110, 50], 0)) });
|
||||
ge.names = [...ge.names, "FMX", "WSEQ"];
|
||||
if (opt.clipper !== "0.6" && opt.clipper !== "0.7") { /* Clipper 0.8: JUNO, VECTOR, protocol 13 (the MOD SEQ) */
|
||||
if (opt.clipper !== "0.6" && opt.clipper !== "0.7") { /* Clipper 0.8: JUNO, VECTOR, protocol 13 (the MOD SEQ); 0.9:
|
||||
protocol 14 (the TUNING) */
|
||||
ENG.push({ name: "JUNO", titles: ["DCO", "VCF"], edit: [E("WAVE", ["SAW", "PLS", "S+P"], 2), D("PW", F.PCT, 0, 127, 30),
|
||||
D("SUB", F.PCT, 0, 127, 40), D("NOIS", F.PCT, 0, 127, 0), E("HPF", ["0", "1", "2", "3"], 1), D("CUT", F.CUTOFF, 0, 127, 90),
|
||||
D("RES", F.PCT, 0, 127, 20), E("CHOR", ["OFF", "I", "II", "I+II"], 1)],
|
||||
@@ -2765,7 +2814,7 @@ function makeMockDevice(opt = {}) {
|
||||
s(opt.legacy ? "FELUCCA 0.4 BETA (MOCK)" : opt.v3 ? "FELUCCA 0.8 (MOCK)" : (opt.clipper ? "FELUCCA CLIPPER 0.2 (MOCK)" : "FELUCCA SLOOP 2.0 (MOCK)")); b(ENG.length); b(P_COUNT); b(G_COUNT); b(NSTEP); b(P_E0);
|
||||
ENG.forEach((e) => s(e.name));
|
||||
if (!opt.legacy) b(NTRK);
|
||||
if (v5) b(opt.noBackup ? 5 : opt.v7 ? 7 : opt.v8 ? 8 : opt.v9 ? 9 : opt.clipper ? (JU_E >= 0 ? 13 : FX_E >= 0 ? 12 : 11) : 10); /* v10: SYN kits (v9: FM6 patches, v8: fill conditions, v7: nudges and locks, v6: backup) */
|
||||
if (v5) b(opt.noBackup ? 5 : opt.v7 ? 7 : opt.v8 ? 8 : opt.v9 ? 9 : opt.clipper ? (JU_E >= 0 ? (opt.clipper === "0.8" ? 13 : 14) : FX_E >= 0 ? 12 : 11) : 10); /* v10: SYN kits (v9: FM6 patches, v8: fill conditions, v7: nudges and locks, v6: backup) */
|
||||
break;
|
||||
case CMD.GET: case CMD.SET: {
|
||||
if (a.length < 2) return null;
|
||||
@@ -3075,6 +3124,24 @@ function makeMockDevice(opt = {}) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CMD.TUNE_GET: case CMD.TUNE_PUT: { /* Clipper 0.9: editor_fmx.c (TU_N 14 systems, 48 degrees) */
|
||||
if (JU_E < 0 || opt.clipper === "0.8") return null;
|
||||
const u21 = (v) => [v & 127, (v >> 7) & 127, (v >> 14) & 127];
|
||||
st.tune = st.tune || { sys: 0, root: 0, period: 19200, deg: Array.from({ length: 12 }, (_, i) => i * 1600) };
|
||||
if (cmd === CMD.TUNE_GET) {
|
||||
b(0); b(st.tune.sys); b(st.tune.root); b(st.tune.deg.length);
|
||||
u21(st.tune.period).forEach(b);
|
||||
st.tune.deg.slice(1).forEach((d) => u21(d).forEach(b));
|
||||
} else {
|
||||
const nd = a[2] | 0, g = (k) => a[k] | a[k + 1] << 7 | a[k + 2] << 14;
|
||||
let rc = a.length < 6 || a[0] >= 14 || a[1] > 11 || nd < 1 || nd > 48 || a.length !== 6 + 3 * (nd - 1) ? 1 : 0;
|
||||
const deg = [0];
|
||||
for (let i = 1; !rc && i < nd; i++) { const d = g(6 + 3 * (i - 1)); if (d <= deg[i - 1] || d >= g(3)) rc = 1; deg.push(d); }
|
||||
if (!rc) st.tune = { sys: a[0], root: a[1], period: g(3), deg };
|
||||
b(rc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CMD.MSEQ_GET: case CMD.MSEQ_PUT: { /* Clipper 0.8: editor_fmx.c ed_mseq_handle */
|
||||
if (JU_E < 0) return null;
|
||||
const tr = a.length && a[0] < 2 ? st.tracks[a[0]] : null;
|
||||
@@ -4155,6 +4222,8 @@ const TEXT = {
|
||||
hyTitle: "HYBRID の音色(Clipper)", hyHelp: "HYBRID エンジンの音色をまるごと編集します。ボイスごとに 3 オシレーター、2 フィルター、専用のエンベロープ 2 つと LFO 2 つ、16 スロットのモジュレーション・マトリクス。本体のノブはこの上の 8 つの値です(CUT、RES、FENV、PTCH、マクロ M1〜M4 はマトリクスのソース)。LIVE ではすぐに音が変わります。PTCH を回すか別の音を読み込むまでトラックの音色です(プロジェクトは PTCH だけ保存:残したい音色は書き出してください)。",
|
||||
msTitle: "MOD SEQ(16ステップ×4レーン)", msHelp: "サウンドのモジュレーション・シーケンサー:16ステップ(-8..7)の4レーン。RATEで進み(LFOグループのMOD SEQ 2:RATE・LEN・SMTH・START)、マトリックスのソースSEQ1..SEQ4になります。バーを上下にドラッグ、レーン名のクリックでSHAPEの対象を選択。ライブで変更ごとに送信。サウンドと一緒に保存(ユーザープリセット・プロジェクト)。",
|
||||
msShape: "シェイプ", msApply: "レーンに適用",
|
||||
tuTitle: "チューニング(音律・Scala)", tuHelp: "FM-1全体のチューニング:平均律、純正律、ピタゴラス、ミーントーン、ヴェルクマイスターIII、キルンベルガーIII、マカーム(ラースト・バヤーティー)、スレンドロ、ペロッグ、19/24/31平均律、またはScalaの.sclファイルのUSER音階(48音まで。キーごとに次の音度、C4+ROOTが1/1)。FM-1ではGLO > TUNING。",
|
||||
tuSystem: "音律", tuRoot: "ルート", tuLoad: ".sclを読み込む", tuBad: "FM-1で使えない音階(.scl、1〜48音、上昇、周期内):", tuUser: "USER音階:", tuSendBtn: "FM-1へ送信",
|
||||
fxTitle: "FMXパッチ(6オペレーター・自由なルーティング)", fxHelp: "FMXエンジンのパッチ全体:オペレーターごとの波形とモード(PM・FM・RING)、比率または固定周波数、エンベロープ。どのオペレーターも他のどれでも変調でき(自分自身はフィードバック)、どれでも出力へ。テンプレート(DX7の32種と8種)から始めて自由に変更。STOREでバンク(B1..B27)に保存(再生を止めてから)。",
|
||||
fxRouting: "ルーティング", fxTemplate: "テンプレート", fxTemplateHelp: "(行がオペレーター、列がそれを変調するもの、対角線はフィードバック、OUTは出力)",
|
||||
fxOps: "オペレーター", fxGlobal: "ピッチエンベロープとレベル", fxStoreTo: "保存先", fxStore: "保存", fxStored: "保存しました", fxEmpty: "空のスロット:", fxStopFirst: "先に再生を止めてください",
|
||||
@@ -4375,6 +4444,8 @@ const TEXT = {
|
||||
hyTitle: "HYBRID patch (Clipper)", hyHelp: "The whole patch of the HYBRID engine: three oscillators, two filters, two envelopes and two LFOs of its own per voice, and a 16-slot modulation matrix. The device's knobs play eight values on top of it (CUT, RES, FENV, PTCH and the macros M1..M4: matrix sources). With LIVE each change is heard at once; the patch stays the track's until PTCH turns or another sound loads (a project keeps PTCH: export the patch to keep it).",
|
||||
msTitle: "MOD SEQ (four lanes of 16 steps)", msHelp: "The sound's modulation sequencer: four lanes of 16 steps (-8..7), stepping at RATE (MOD SEQ 2 in the LFO group: RATE, LEN, SMTH, START), read by the matrix as SEQ1..SEQ4. Drag a bar up or down; click a lane's name to pick it for SHAPE. LIVE sends each change. Kept with the sound (user presets, projects).",
|
||||
msShape: "shape", msApply: "Apply to the lane",
|
||||
tuTitle: "Tuning (scales, temperaments, Scala)", tuHelp: "The FM-1's tuning, for every sound: equal temperament, just intonation, Pythagorean, meantone, Werckmeister III, Kirnberger III, the maqams Rast and Bayati, slendro, pelog, 19 / 24 / 31-EDO, or a USER scale from a Scala .scl file (up to 48 notes; each key the next degree, C4 + ROOT its 1/1). On the FM-1: GLO > TUNING.",
|
||||
tuSystem: "system", tuRoot: "root", tuLoad: "Load a .scl", tuBad: "Not a scale the FM-1 takes (.scl, 1..48 notes, rising, inside the period):", tuUser: "USER scale:", tuSendBtn: "send to the FM-1",
|
||||
fxTitle: "FMX patch (six operators, any routing)", fxHelp: "The whole patch of the FMX engine: each operator its own wave (sine, triangle, saw, square, OPL halves and quarters, pulse, 8-bit sine, noise) and its own mode (PM as the DX7, true FM, RING), a ratio or a fixed frequency, an envelope; any operator into any other (its own: feedback) and any to the output. Start from a template (the DX7's 32 and 8 more), then change any connection. The device's EDIT knobs are macros on top (PTCH, ALG, MOD, FB, TIME, DTN, VEL, KTRK). With LIVE each change is heard at once; STORE keeps it in a bank slot (B1..B27, stop the device first): then it is a PTCH value, kept with presets and projects.",
|
||||
fxRouting: "Routing", fxTemplate: "template", fxTemplateHelp: "(fills the grid: a row is an operator, a column what modulates it; the diagonal is feedback; OUT to the output)",
|
||||
fxOps: "Operators", fxGlobal: "Pitch envelope and level", fxStoreTo: "store to", fxStore: "Store", fxStored: "Stored in", fxEmpty: "Empty slot:", fxStopFirst: "Stop the song first (a flash write silences the audio a moment)",
|
||||
@@ -4623,8 +4694,10 @@ const EXPECT_04 = { pcount: 86, pe0: 78 };
|
||||
const EXPECT_06 = { pcount: 91, pe0: 83 };
|
||||
/* Clipper 0.8: 6 more just before P_E0: the MOD SEQ's RATE LEN SMTH START (83..86), SPICE, DICE (87, 88) */
|
||||
const EXPECT_08 = { pcount: 97, pe0: 89 };
|
||||
/* Clipper 0.9: 2 more: VINTAGE (89), LOOP (90) */
|
||||
const EXPECT_09 = { pcount: 99, pe0: 91 };
|
||||
const layoutKnown = (info) => EXPECT.gcount.includes(info.gcount) &&
|
||||
[EXPECT, EXPECT_04, EXPECT_06, EXPECT_08].some((x) => info.pcount === x.pcount && info.pe0 === x.pe0);
|
||||
[EXPECT, EXPECT_04, EXPECT_06, EXPECT_08, EXPECT_09].some((x) => info.pcount === x.pcount && info.pe0 === x.pe0);
|
||||
const MX_PAGES = [1, 2, 3, 4, 5, 6].map((k) => ["MATRIX " + k, 0, [57 + 3 * k, 58 + 3 * k, 59 + 3 * k]]);
|
||||
const P = { LEVEL: 0, SLEN: 29, CHORD: 49 };
|
||||
const LAYOUT = (pe0) => [
|
||||
@@ -4633,11 +4706,12 @@ const LAYOUT = (pe0) => [
|
||||
...(pe0 >= 78 ? [{ t: "LFO", title: "MATRIX", pages: MX_PAGES }] : []),
|
||||
...(pe0 >= 89 ? [{ t: "LFO", title: "MOD SEQ", pages: [["MOD SEQ 2", 0, [83, 84, 85, 86]]] }] : []),
|
||||
{ t: "EDIT", engine: true, pages: [["EDIT 1", 0, [pe0, pe0 + 1, pe0 + 2, pe0 + 3]], ["EDIT 2", 0, [pe0 + 4, pe0 + 5, pe0 + 6, pe0 + 7]]] },
|
||||
{ t: "VOICE", pages: [["LEVEL", 0, [0]], ["VOICE", 0, [37, 38, 41, 42]], ["VOICE 2", 0, [43, 44, 39, 40]]] },
|
||||
{ t: "VOICE", pages: [["LEVEL", 0, [0]], ["VOICE", 0, [37, 38, 41, 42]], ["VOICE 2", 0, [43, 44, 39, 40]],
|
||||
...(pe0 >= 91 ? [["VINTAGE", 0, [89]]] : [])] },
|
||||
{ t: "FX", pages: [["FX", 0, [33, 34, 35, 36]], ["FILTER", 0, [50]], ...(pe0 >= 83 ? [["INSERT", 0, [78, 79, 80, 81]], ["INSERT 2", 0, [82]]] : []),
|
||||
["SLICER", 0, [45, 46, 47, 48]], ["DLY", 1, [4, 5, 6, 7]], ["REV/CHO", 1, [8, 9, 10, 11]]] },
|
||||
{ t: "SEL", pages: [["SEL", 0, [25, 26, 27, 49]], ["SEL 2", 0, [28, 51, 52]]] },
|
||||
{ t: "ARP", pages: [["ARP", 0, [17, 18, 19, 20]], ["ARP 2", 0, [21, 22, 23, 24]], ...(pe0 >= 89 ? [["SPICE", 0, [87, 88]]] : [])] },
|
||||
{ t: "ARP", pages: [["ARP", 0, [17, 18, 19, 20]], ["ARP 2", 0, [21, 22, 23, 24]], ...(pe0 >= 89 ? [["SPICE", 0, pe0 >= 91 ? [87, 88, 90] : [87, 88]]] : [])] },
|
||||
{ t: "SEQ PATTERN", tab: "seqgroups", pages: [["PATTERN", 0, [29, 30, 31, 32]]] },
|
||||
{ t: "GLOBAL", tab: "setgroups", pages: [["GLOBAL", 1, [0, 1, 2, 3]]] },
|
||||
{ t: "MASTER", tab: "setgroups", pages: [["MASTER", 1, [27, 28, 29, 30]]] },
|
||||
@@ -4932,6 +5006,7 @@ function updateBrowser() {
|
||||
hyShow();
|
||||
fxShow();
|
||||
msShow();
|
||||
tuShow();
|
||||
}
|
||||
|
||||
function visible(d) { return d && d.max > d.min && d.label !== "-"; }
|
||||
@@ -8557,6 +8632,54 @@ $("hyfile").addEventListener("change", async (e) => {
|
||||
sayK("hyImported", ` ${hyv.name}`);
|
||||
} catch (err) { sayK("hyBadFile", ` ${f.name}`); }
|
||||
});
|
||||
/* ---------------------------------------------------------------- TUNING --- */
|
||||
/* Clipper 0.9: the FM-1's tuning (firmware v14): a system and its root, or a USER scale from a Scala .scl file */
|
||||
const TU_NAMES = ["EQUAL", "JUST", "PYTHAG", "MEANTONE", "WERCK III", "KIRNB III", "RAST", "BAYATI", "SLENDRO", "PELOG",
|
||||
"19-EDO", "24-EDO", "31-EDO", "USER"];
|
||||
let tuv = null;
|
||||
const tuOk = () => !!dev && !!dev.info && dev.info.proto >= 14;
|
||||
function tuShow() {
|
||||
const on = tuOk();
|
||||
$("tupanel").hidden = !on;
|
||||
if (!on) return;
|
||||
if (!$("tusys").options.length) {
|
||||
$("tusys").replaceChildren(...TU_NAMES.map((n, i) => el("option", { value: i, text: n })));
|
||||
$("turoot").replaceChildren(...["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"].map((n, i) => el("option", { value: i, text: n })));
|
||||
}
|
||||
if (tuShow.dev !== dev) { tuShow.dev = dev; op(tuRead); }
|
||||
}
|
||||
function tuRender() {
|
||||
if (!tuv) return;
|
||||
$("tusys").value = String(tuv.sys);
|
||||
$("turoot").value = String(tuv.root);
|
||||
$("tuinfo").textContent = `${t("tuUser")} ${tuv.desc || ""} ${tuv.deg.length} / ${(tuv.period / 16).toFixed(2)} ct: ` +
|
||||
tuv.deg.map((d) => (d / 16).toFixed(1)).join(" ");
|
||||
}
|
||||
async function tuRead() {
|
||||
const r = parse[CMD.TUNE_GET](await rq(req.tuneGet()));
|
||||
if (r.rc) return;
|
||||
tuv = { ...r, desc: tuv && tuv.desc };
|
||||
tuRender();
|
||||
}
|
||||
async function tuSend() {
|
||||
if (!tuv) return;
|
||||
const r = parse[CMD.TUNE_PUT](await rq(req.tunePut(tuv.sys, tuv.root, tuv.deg, tuv.period)));
|
||||
checkRc(r.rc);
|
||||
}
|
||||
$("tusys").addEventListener("change", () => { if (tuv) { tuv.sys = +$("tusys").value; op(tuSend); } });
|
||||
$("turoot").addEventListener("change", () => { if (tuv) { tuv.root = +$("turoot").value; op(tuSend); } });
|
||||
$("tusend").addEventListener("click", () => op(tuSend));
|
||||
$("tuscl").addEventListener("click", () => $("tufile").click());
|
||||
$("tufile").addEventListener("change", async (e) => {
|
||||
const f = e.target.files[0];
|
||||
e.target.value = "";
|
||||
if (!f) return;
|
||||
const sc = parseScl(await f.text());
|
||||
if (!sc) { sayK("tuBad", ` ${f.name}`); return; }
|
||||
tuv = { ...(tuv || { root: 0 }), sys: TU_NAMES.length - 1, deg: sc.deg, period: sc.period, desc: sc.desc };
|
||||
tuRender();
|
||||
op(tuSend);
|
||||
});
|
||||
/* --------------------------------------------------------------- MOD SEQ --- */
|
||||
/* Clipper 0.8: the MOD SEQ's steps of the selected part (firmware v13, EDITOR_PROTOCOL.md "MOD SEQ"), on every engine:
|
||||
four lanes of 16 bars, dragged up and down (-8..7); a SHAPE fills the selected lane over the 16 steps. Its RATE, LEN,
|
||||
|
||||
+26
-9
@@ -34,7 +34,7 @@ const E = vm.runInNewContext(proto + `
|
||||
CHOP, chopNovelty, chopHits, chopSnap, chopGrid, chopEqual, chopList, chopPick, chopFit, chopZones, wavFile, zipStore, crc32,
|
||||
UP, bank, capturePatch, auditionPatch, startWatch, libraryFile, readLibraryFile, paramKeys, patternFromSteps, stepsFromPattern, upName,
|
||||
mixer, GM_DRUM, drumName, parseNotes, fmtValue, F, DRUM_LANES, LV_NAMES, emptyDrum, lockable, MICRO, FC, fillGet, fillSet, pack7, unpack7,
|
||||
backupCapture, backupRestore, backupObjects, b64enc, b64dec, FM6, KIT, kitPad, kitZones, kitLen, kitBytes, kitFit, kitSplit, kitLaneOf, kitPlace, zipRead, ROLL, SMF, ARR, mockSettings, fm6CartWrite, fm6CartPreset, fm6CartSlots, fm6CartPresets, DSYN, DSYN_MOCK_NAMES, DSYN_MOCK_KITS, HY, FX, WT, SetGate, patchByCount, bkProjFormat, bkDevFormat, bkFwAtLeast, FM1_PORT_ED: FM1_PORT, fm1Ports })`,
|
||||
backupCapture, backupRestore, backupObjects, b64enc, b64dec, FM6, KIT, kitPad, kitZones, kitLen, kitBytes, kitFit, kitSplit, kitLaneOf, kitPlace, zipRead, ROLL, SMF, ARR, mockSettings, fm6CartWrite, fm6CartPreset, fm6CartSlots, fm6CartPresets, DSYN, DSYN_MOCK_NAMES, DSYN_MOCK_KITS, HY, FX, WT, SetGate, patchByCount, bkProjFormat, bkDevFormat, bkFwAtLeast, FM1_PORT_ED: FM1_PORT, fm1Ports, parseScl })`,
|
||||
{ setTimeout, clearTimeout, setInterval, clearInterval, console, TextEncoder, TextDecoder, Blob, Response, DecompressionStream });
|
||||
|
||||
async function editorMock() {
|
||||
@@ -661,7 +661,7 @@ async function fmxPatch() {
|
||||
const empty = E.parse[E.CMD.FMX_GET](await rq(E.req.fmxGet(2, 6)));
|
||||
const st = E.parse[E.CMD.FMX_STORE](await rq(E.req.fmxStore(6, X.pack(kick))));
|
||||
const back = E.parse[E.CMD.FMX_GET](await rq(E.req.fmxGet(2, 6)));
|
||||
ok(info.proto === 13 && info.engines.includes("FMX") && !put.rc && eq(Array.from(got.bytes), fx.factory[0]) && empty.rc === 2 && !st.rc
|
||||
ok(info.proto === 14 && info.engines.includes("FMX") && !put.rc && eq(Array.from(got.bytes), fx.factory[0]) && empty.rc === 2 && !st.rc
|
||||
&& eq(Array.from(back.bytes), fx.factory[10]), "FMX: through the mock: PUT, GET back, an empty slot (rc 2), STORE, the slot read");
|
||||
/* Clipper 0.8 (protocol 13): JUNO and VECTOR, the MOD SEQ's steps (editor_fmx.c ed_mseq_handle) */
|
||||
const q = E.req.mseqPut(1, Array.from({ length: 64 }, (_, i) => (i % 16) - 8));
|
||||
@@ -674,6 +674,22 @@ async function fmxPatch() {
|
||||
ok(info.engines.includes("JUNO") && info.engines.includes("VECTOR") && !g0.rc && g0.steps.length === 64 && g0.steps[0] === -8 && g0.steps[15] === 7
|
||||
&& !p1.rc && !g1.rc && g1.steps[16] === -8 && g1.steps[31] === 7 && bad.rc === 1,
|
||||
"MOD SEQ through the mock: JUNO, VECTOR listed; the shapes to start from; PUT, GET back; a part out of range (rc 1)");
|
||||
/* Clipper 0.9 (protocol 14): the TUNING (editor_fmx.c ED_TUNE_GET / ED_TUNE_PUT) and Scala .scl files */
|
||||
const scl = E.parseScl("! test.scl\n!\nQuarter-tone test\n 5\n!\n 150.0\n 6/5\n 500.\n 3/2 comment\n 2/1\n");
|
||||
ok(scl && scl.desc === "Quarter-tone test" && scl.deg.length === 5 && scl.deg[0] === 0 && scl.deg[1] === 2400
|
||||
&& scl.deg[2] === 5050 && scl.deg[3] === 8000 && scl.deg[4] === 11231 && scl.period === 19200,
|
||||
".scl: description, count, cents and ratios (1/16 cent), the period the last line");
|
||||
ok(!E.parseScl("x\n 3\n 100.0\n 50.0\n 2/1\n") && !E.parseScl("x\n 2\n 100.0\n") && !E.parseScl("x\n 49\n" + " 10.0\n".repeat(49))
|
||||
&& E.parseScl("x\n 1\n 3/1\n").period === 30431, ".scl: falling, short or too long refused; 1 note: the period alone (tritave)");
|
||||
const tq = E.req.tunePut(13, 2, scl.deg, scl.period);
|
||||
ok(tq[0] === E.CMD.TUNE_PUT && tq[0] === 96 && tq[1].length === 6 + 3 * 4 && tq[1].every((x) => x < 128), "TUNING: TUNE_PUT is sys, root, n, period, n-1 degrees (21 bits each)");
|
||||
const t0 = E.parse[E.CMD.TUNE_GET](await rq(E.req.tuneGet()));
|
||||
const tp = E.parse[E.CMD.TUNE_PUT](await rq(tq));
|
||||
const t1 = E.parse[E.CMD.TUNE_GET](await rq(E.req.tuneGet()));
|
||||
const tb = E.parse[E.CMD.TUNE_PUT](await rq(E.req.tunePut(1, 0, [0, 3000, 2000], 19200)));
|
||||
ok(!t0.rc && t0.sys === 0 && t0.deg.length === 12 && t0.deg[11] === 17600 && t0.period === 19200 && !tp.rc && !t1.rc && t1.sys === 13 && t1.root === 2
|
||||
&& t1.deg.join() === scl.deg.join() && t1.period === 19200 && tb.rc === 1,
|
||||
"TUNING through the mock: 12-EDO to start; PUT a .scl, GET it back; degrees not rising refused (rc 1)");
|
||||
}
|
||||
|
||||
/* ------------------------------------- editor v5 (SLOOP 2.0): lanes, levels, ratchets --- */
|
||||
@@ -692,11 +708,11 @@ async function editorV5() {
|
||||
&& names.indexOf("ED_MICRO_GET") + 1 === C.MICRO_GET && names.indexOf("ED_MICRO_SET") + 1 === C.MICRO_SET
|
||||
&& names.indexOf("ED_FILL_GET") + 1 === C.FILL_GET && names.indexOf("ED_FILL_SET") + 1 === C.FILL_SET
|
||||
&& /ED_FM6_GET = 68, ED_FM6_PUT, ED_FM6_LIST, ED_FM6_ERASE/.test(ec) && C.FM6_GET === 68 && C.FM6_ERASE === 71
|
||||
&& /#define ED_PROTO \(CLIPPER_SYNTH \? 13u : 11u\)/.test(ec) && /ed_b\(ED_PROTO\);/.test(ec)
|
||||
&& /#define ED_PROTO \(CLIPPER_SYNTH \? 14u : 11u\)/.test(ec) && /ed_b\(ED_PROTO\);/.test(ec)
|
||||
&& /enum \{ ED_FMX_GET = 90, ED_FMX_PUT, ED_FMX_STORE \};/.test(readFileSync(join(HERE, "../firmware/src/editor_fmx.c"), "utf8"))
|
||||
&& C.FMX_GET === 90 && C.FMX_STORE === 92
|
||||
&& /enum \{ ED_MSEQ_GET = 93, ED_MSEQ_PUT \};/.test(readFileSync(join(HERE, "../firmware/src/editor_fmx.c"), "utf8"))
|
||||
&& C.MSEQ_GET === 93 && C.MSEQ_PUT === 94
|
||||
&& /enum \{ ED_MSEQ_GET = 93, ED_MSEQ_PUT, ED_TUNE_GET, ED_TUNE_PUT \};/.test(readFileSync(join(HERE, "../firmware/src/editor_fmx.c"), "utf8"))
|
||||
&& C.MSEQ_GET === 93 && C.MSEQ_PUT === 94 && C.TUNE_GET === 95 && C.TUNE_PUT === 96
|
||||
&& /enum \{ ED_HY_GET = 77, ED_HY_PUT \};/.test(readFileSync(join(HERE, "../firmware/src/editor_hybrid.c"), "utf8")) && C.HY_GET === 77 && C.HY_PUT === 78
|
||||
&& /enum \{ ED_DSYN_LIST = 72, ED_DSYN_GET, ED_DSYN_PUT, ED_DSYN_STORE, ED_DSYN_PLAY \};/.test(readFileSync(join(HERE, "../firmware/src/editor_dsyn.c"), "utf8"))
|
||||
&& C.DSYN_LIST === 72 && C.DSYN_PLAY === 76, "v5..v13: command numbers and INFO == editor.c / editor_dsyn.c / editor_hybrid.c / editor_fmx.c");
|
||||
@@ -785,10 +801,11 @@ async function editorV7() {
|
||||
const sy = {}; let k = 0;
|
||||
for (const nm of (/enum \{\s*\/\* per-track parameters \*\/([^}]*)\}/.exec(ch) || [])[1].replace(/#(if|endif)[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").split(",").map((x) => x.trim()).filter(Boolean)) sy[nm] = k++;
|
||||
ok(sy.P_L2RATE === 53 && sy.P_E2ATK === 56 && sy.P_M1SRC === 60 && sy.P_M6AMT === 77 && sy.P_ITYPE === 78 && sy.P_IMIX === 82
|
||||
&& sy.P_MSRATE === 83 && sy.P_MSKEY === 86 && sy.P_SPICE === 87 && sy.P_DICE === 88 && sy.P_E0 === 89 && sy.P_COUNT === 97
|
||||
&& E.lockable(sy.P_E0, 89) && E.lockable(sy.P_E7, 89) && !E.lockable(sy.P_L2RATE, 89) && !E.lockable(sy.P_M6AMT, 89)
|
||||
&& !E.lockable(sy.P_ITYPE, 89) && !E.lockable(sy.P_IMIX, 89) && !E.lockable(sy.P_MSRATE, 89) && !E.lockable(sy.P_DICE, 89),
|
||||
"v7: Clipper's layout (LFO 2 53, ENV 2 56, MATRIX 60, INSERT 78, 0.8's MOD SEQ 83, SPICE 87, P_E0 89): its EDIT values lockable, the rest not");
|
||||
&& sy.P_MSRATE === 83 && sy.P_MSKEY === 86 && sy.P_SPICE === 87 && sy.P_DICE === 88 && sy.P_VINT === 89 && sy.P_SLOOP === 90
|
||||
&& sy.P_E0 === 91 && sy.P_COUNT === 99
|
||||
&& E.lockable(sy.P_E0, 91) && E.lockable(sy.P_E7, 91) && !E.lockable(sy.P_L2RATE, 91) && !E.lockable(sy.P_M6AMT, 91)
|
||||
&& !E.lockable(sy.P_ITYPE, 91) && !E.lockable(sy.P_IMIX, 91) && !E.lockable(sy.P_MSRATE, 91) && !E.lockable(sy.P_DICE, 91) && !E.lockable(sy.P_SLOOP, 91),
|
||||
"v7: Clipper's layout (LFO 2 53, ENV 2 56, MATRIX 60, INSERT 78, 0.8's MOD SEQ 83, SPICE 87, 0.9's VINTAGE 89 LOOP 90, P_E0 91): its EDIT values lockable, the rest not");
|
||||
}
|
||||
{ /* (after SLOOP 2.6) SetGate: a value set again is sent once the last request is answered */
|
||||
const g = new E.SetGate();
|
||||
|
||||
Reference in new issue
Block a user