diff --git a/.github/workflows/voice-user-check.yml b/.github/workflows/voice-user-check.yml index 913c3cb7..f71ac9ec 100644 --- a/.github/workflows/voice-user-check.yml +++ b/.github/workflows/voice-user-check.yml @@ -78,6 +78,8 @@ jobs: build/song-check/key-trk | tee build/song-check/key-trk.log cc -O1 -w -Ibuild/gen -Ifirmware/src tests/west_test.c -lm -o build/song-check/west build/song-check/west | tee build/song-check/west.log + cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src tests/wave_test.c -lm -o build/song-check/wave + build/song-check/wave | tee build/song-check/wave.log cc -O1 -w -fsanitize=address,bounds tests/usb_host_desc_test.c -o build/song-check/usbhost build/song-check/usbhost | tee build/song-check/usbhost.log for test in audio perform upreset; do diff --git a/docs/NRPN.md b/docs/NRPN.md index 5bf51fa2..68d02359 100644 --- a/docs/NRPN.md +++ b/docs/NRPN.md @@ -53,7 +53,7 @@ its own way the engines are named. P_E0..P_E7 (CC98 115..122) are the engine's E | 38 | GLIDE | 0..127 | 0 | | | 39 | PAN | -64..63 | 0 | | | 44 | UNISON | 0..127 | 40 | | -| 61 | ATK | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WEST FM6 ADD ANIMAL EXT) | +| 61 | ATK | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WAVE WEST FM6 ADD ANIMAL EXT) | | 61 | RESTART | 0..1 | 1 | (MATH) | | 61 | LANG | 0..9 | 0 | OFF ES EN JA RU DE FR ZH PT GN (VOICE) | | 61 | KEY MAP | 0..9 | 1 | BASIC EXTRA KICK SNARE CLAP HH CL HH OP TOM RIM BELL (DRUM) | @@ -69,22 +69,22 @@ its own way the engines are named. P_E0..P_E7 (CC98 115..122) are the engine's E | 71 | MORPH | 0..127 | 0 | | | 72 | C.LEN | 0..64 | 0 | OFF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ... | | 73 | DRIFT | 0..127 | 127 | | -| 74 | IMAGE | 0..127 | 0 | (ANALOG PHASE WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 74 | IMAGE | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 74 | TIME | 0..2 | 1 | KEY LOCK TEMPO (MATH) | | 74 | LYRIC | 0..25 | 0 | TEXT W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16 S1 S2 S3 S4 S5 S6 S7 S8 TEXT FIXED (VOICE) | | 75 | DUST | 0..127 | 127 | | | 76 | CHORD | 0..16 | 0 | OFF TRIAD 7TH ADD9 SUS2 SUS4 MAJ MIN 7 MAJ7 MIN7 POWER POP JAZZ SOUL DREAM QUART | | 77 | VOICING | 0..3 | 0 | CLOSE LEAD OPEN +BASS | -| 78 | DEPTH | 0..127 | 127 | (ANALOG PHASE VOICE WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 78 | DEPTH | 0..127 | 127 | (ANALOG PHASE VOICE WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 78 | ALGO B | 0..127 | 127 | (MATH) | | 79 | STRUM | 0..127 | 0 | | | 80 | VEL | 0..127 | 127 | | | 81 | ROTATE | -32..32 | 0 | | | 82 | PITCH | -24..24 | 0 | | -| 83 | IMAGE | 0..127 | 127 | (ANALOG PHASE MATH VOICE WHEEL STRING WEST FM6 ADD ANIMAL) | +| 83 | IMAGE | 0..127 | 127 | (ANALOG PHASE MATH VOICE WHEEL STRING WAVE WEST FM6 ADD ANIMAL) | | 83 | KICK | 0..127 | 127 | (DRUM) | | 83 | - | 0..127 | 127 | (EXT) | -| 84 | SNARE | 0..127 | 127 | (ANALOG PHASE MATH WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 84 | SNARE | 0..127 | 127 | (ANALOG PHASE MATH WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 84 | CONS | 0..127 | 127 | (VOICE) | | 85 | CLAP | 0..127 | 127 | | | 86 | HH CL | 0..127 | 127 | | @@ -167,6 +167,14 @@ Each engine's EDIT values as its preset 1 shows them (a mode may rename one: DES | STRING 8 | 120 | BODY | 0..127 | 40 | | | STRING 8 | 121 | SIZE | 0..127 | 40 | | | STRING 8 | 122 | BOW | 0..127 | 0 | | +| WAVE 9 | 115 | A | 0..23 | 0 | SINE FM2 FMR TRISY SAWSQ DRIVE RING FOLD ODD PULSE STEP BITS FORMT NOISE SINTR SATUR U1 U2 U3 U4 U5 U6 U7 U8 | +| WAVE 9 | 116 | POS | 0..127 | 0 | | +| WAVE 9 | 117 | WARP | 0..5 | 0 | OFF SYNC BEND MIRROR QUANT FM | +| WAVE 9 | 118 | AMT | 0..127 | 0 | | +| WAVE 9 | 119 | B | 0..23 | 0 | SINE FM2 FMR TRISY SAWSQ DRIVE RING FOLD ODD PULSE STEP BITS FORMT NOISE SINTR SATUR U1 U2 U3 U4 U5 U6 U7 U8 | +| WAVE 9 | 120 | MIX | 0..127 | 0 | | +| WAVE 9 | 121 | DETUNE | 0..127 | 0 | | +| WAVE 9 | 122 | SUB | 0..127 | 0 | | | DRUM 10 | 115 | MORPH | 0..127 | 64 | | | DRUM 10 | 116 | TUNE | 0..127 | 64 | | | DRUM 10 | 117 | TONE | 0..127 | 64 | | diff --git a/firmware/src/core.h b/firmware/src/core.h index af0c6894..bc1b40fa 100644 --- a/firmware/src/core.h +++ b/firmware/src/core.h @@ -23,9 +23,9 @@ #define NENGINES 16 /* the stores' engine numbers 0..15 (engines.c ENGINES[], append-only; 0.8.3: 14 ANIMAL; * 0.9.9-snd5: STRING and ADD in the retired GRAIN's 8 and SLICE's 13; V10.54: 15 INPUT) */ #define ENGI_DIGITAL 1u /* reserved without FELUCCA_FM4: never selectable (eng_ok), its sounds load as FM6 */ -#define NENG_SHOWN (NENGINES - !FELUCCA_FM4 - 3) /* the engines one can pick: PRESETS, the EDIT layer, the editor, - * in the display order of engines.c ENGINE_ORDER (PHYS 9, and in - * JIANT SAMPLE 4, GRAIN 8, SLICE 13: retired) */ +#define NENG_SHOWN (NENGINES - !FELUCCA_FM4 - 2) /* the engines one can pick: PRESETS, the EDIT layer, the editor, + * in the display order of engines.c ENGINE_ORDER (JIANT SAMPLE 4 and + * TRIO 6: retired; PHYS 9 is WAVE's now) */ /* (JIANT 0.6.71) the second core (hal/fm1_multicore.h; fx.c mix_block hands it some synth tracks). MC_CPU(): the core * running this, for the scratch each core has its own of (fx.c part_buf and the mix, mod.c's matrix, fm6_core.c's * buses, voice.c's filter flags). The host (tests): no second core; mc_host runs its jobs at once, as core 1 */ @@ -129,7 +129,7 @@ static const char PNE[] = #else "-\0" #endif - "PHASE\0" "MATH\0" "-\0" "VOICE\0" "-\0" "WHEEL\0" "STRING\0" "-\0" "DRUM\0" "WEST\0" "FM6\0" "ADD\0" "ANIMAL\0" "EXT\0" + "PHASE\0" "MATH\0" "-\0" "VOICE\0" "-\0" "WHEEL\0" "STRING\0" "WAVE\0" "DRUM\0" "WEST\0" "FM6\0" "ADD\0" "ANIMAL\0" "EXT\0" ; #define CLAY_SHN ((const char *const *)(PNE + 0)) #define CLAY_EU ((const char *const *)(PNE + 351)) @@ -377,7 +377,8 @@ static void params_by_count(int16_t *out, const int16_t *in, uint32_t np, const /* engine indices the stores name (engines.c ENGINES[]: append-only) */ #define ENGI_ANALOG 0u /* (JIANT 0.5: named for its FILTER page) */ -#define ENGI_PHYS 9u +#define ENGI_PHYS 9u /* (retired in TONIC: an old sound of it plays as ANALOG, eng_phys_old) */ +#define ENGI_WAVE 9u /* eng_wave.c: the wavetable, JIANT BYTE's (PHYS's number) */ #define ENGI_DRUM 10u #define ENGI_GRAIN 8u #define ENGI_SLICE 13u @@ -398,8 +399,13 @@ static void params_by_count(int16_t *out, const int16_t *in, uint32_t np, const * set as DRUM first: drum_from_perc) */ static inline int eng_gone(uint32_t e) { - return e == ENGI_PHYS || e == ENGI_SAMPLE || e == ENGI_TRIO; /* (0.9.9-snd5: GRAIN's 8 and SLICE's 13 are STRING and ADD) */ /* (0.9.9-snd5: GRAIN's 8 and SLICE's 13 are STRING and ADD) */ + return e == ENGI_SAMPLE || e == ENGI_TRIO; /* (0.9.9-snd5: GRAIN's 8 and SLICE's 13 are STRING and ADD; 9, PHYS's, + * WAVE's: eng_phys_old) */ } +/* (WAVE) engine 9 was PHYS (retired in TONIC) and is WAVE now: a record stored before WAVE that names it is PHYS's, and + * plays as ANALOG as before (a user preset of a layout before 4: upreset.c; a project of before PROJ_WAVE: project.c); + * one stored since is WAVE's */ +static inline int eng_phys_old(uint32_t e, int old) { return e == ENGI_PHYS && old; } /* (JIANT 0.4) a sound stored before 0.4 -> today's E values, in place: LOFI (3) {.., SWP, VIB, ARP, TONE} -> {.., CUT * (its TONE), VIB, BEND 0, MASK 0}; ANALOG (0) KTR -> INT 0 (the key tracking fixed at its old default). Projects * (project.c: the kit's marker below 3, or an older format) and user presets (upreset.c: no UP_V04_MARK) */ diff --git a/firmware/src/eng_wave.c b/firmware/src/eng_wave.c new file mode 100644 index 00000000..56af4608 --- /dev/null +++ b/firmware/src/eng_wave.c @@ -0,0 +1,371 @@ +/* SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */ +/* WAVE: a wavetable, JIANT BYTE's (eng_wave.c, BYTE main 94f8ac9) made of tables. Two oscillators, each a table of + * eight frames of 128 points, read between two points and two frames (bilinear); POS moves through the frames: + * A the first oscillator's table POS the position (the matrix's SHAPE moves it too), glided a sample + * WARP the phase bent before the table: OFF SYNC BEND MIRROR QUANT FM (B into A's phase) AMT its amount + * B the second oscillator's table MIX A .. B (B at the same POS) + * DETUNE 0 one voice; up three, spread around the note SUB a sine an octave down + * A and B pick one of BYTE's 16 waves (BYTE draws each from a formula of its formula machine, f(w, A): here they are + * that formula's frames at POS k x 127 / 7, made by tools/gen_wave_tables.c with BYTE's own machine and kept Rice-coded + * in wave_tables.h, ~8 KB) or a user table U1..U8 (Studio's wavetable editor, EDITOR_PROTOCOL.md 1.7: not stored yet, + * an empty slot plays SINE). Not BYTE's: CAOS, the spectral warps (SMEAR SKEW SHEPARD DISPERSE), VOICES WIDTH BLEND + * FRAMES; BITS and NOISE are tables here (BYTE runs their formula as written). + * + * Memory: none of its own but a few bytes a part. The frames are int8 in the part's COMB line (voice.c comb_buf: 2 KB, + * A's eight frames in its first half, B's in its second), free while the part is WAVE: a COMB TYPE plays as BP (as + * STRING's: string_block), and the line is the tables' again after anything else used it (the COMB, STRING: wave_block + * finds its marks changed, wv_sig) -- the tables decoded again, four frames a block, the + * part held silent meanwhile and in again after (voice.c's fade-in, t->xin). Voice state: ph[0..2] the three phases, + * s[0] POS at the last sample (Q8 + 1), s[3] the sub's phase. Engine 9 (PHYS's, retired in TONIC: its old sounds still + * play as ANALOG, core.h eng_phys_old) */ +#include "wave_tables.h" +/* A's and B's names (BYTE's waves, then the user tables), WARP's: lists of pointers (params.c desc_nm reads a packed + * list only inside PNB or PNE, and icons.c / ui_graph.c index d->names), here (build.py late_tables: out of .rodata, + * the sound's recorded tables where they were) */ +static const char *const N_WAVEF[] = {"SINE", "FM2", "FMR", "TRISY", "SAWSQ", "DRIVE", "RING", "FOLD", "ODD", "PULSE", + "STEP", "BITS", "FORMT", "NOISE", "SINTR", "SATUR", "U1", "U2", "U3", "U4", "U5", + "U6", "U7", "U8"}; +static const char *const N_WWARP[] = {"OFF", "SYNC", "BEND", "MIRROR", "QUANT", "FM"}; +enum { WW_OFF, WW_SYNC, WW_BEND, WW_MIRROR, WW_QUANT, WW_FM, WW_N }; +#define WV_NU 8u /* user tables U1..U8 (A and B: WT_NF + 0 .. 7) */ +#define WV_NT (WT_NF + WV_NU) +#define WV_FN 128u /* points a frame */ +#define WV_HALF 1024u /* bytes an oscillator: eight frames */ +#define WV_STEPS 4u /* frames decoded a block, a part */ +#define WV_CH 32u /* samples a pass (the arrays on the audio's stack) */ +static int16_t comb_buf[NTRK][1024] __attribute__((section(".pool"))); /* (voice.c's, COMB_LEN: here int8 frames) */ +typedef struct { + uint8_t want[2], have[2]; /* A's and B's table + 1: asked for, whole in the line (0: none) */ + uint8_t nf[2]; /* the next step of their decoding */ + uint8_t busy; /* bit h: half h written by the main loop (a user table) */ + uint8_t mx0, mx1; /* MIX at the block's start and end */ + uint8_t am0, am1; /* .. AMT (FM's index, ramped as MIX: a step of it is one of A's phase) */ + uint32_t sig; /* the whole halves' marks (wv_sig) at the last block */ +} wv_t; +static wv_t wv[NTRK] __attribute__((section(".pool"))); /* (zeroed at boot; .pool: .bss as it was, the sound's code where it was) */ +/* (EDITOR_PROTOCOL.md 1.7) a user table in slot u, whole: none stored yet (an empty slot plays SINE) */ +static int wv_user_ok(uint32_t u) { (void)u; return 0; } + +/* k bits from bit *b of s, LSB first */ +static uint32_t wv_bits(const uint8_t *s, uint32_t *b, uint32_t k) +{ + uint32_t v = 0, j; + for (j = 0; j < k; j++, ++*b) + v |= (uint32_t)((s[*b >> 3] >> (*b & 7u)) & 1u) << j; + return v; +} +/* a kept frame from its code s (tools/gen_wave_tables.py): its predictor, k, then 128 Rice-coded residuals; pv the + * frame before (predictors 2 and 3) */ +static void wv_frame(int8_t *x, const int8_t *pv, const uint8_t *s) +{ + uint32_t b = 0, m = wv_bits(s, &b, 2u), k = wv_bits(s, &b, 3u), i; + for (i = 0; i < WV_FN; i++) { + uint32_t q = 0, u; + int32_t a = i ? x[i - 1u] : 0, p; + while (q < 1024u && wv_bits(s, &b, 1u)) + q++; + u = q << k | wv_bits(s, &b, k); + p = m == 0u ? a : m == 1u ? 2 * a - (i > 1u ? x[i - 2u] : 0) : m == 2u ? pv[i] : pv[i] + a - (i ? pv[i - 1u] : 0); + x[i] = (int8_t)(p + (u & 1u ? -(int32_t)((u + 1u) >> 1) : (int32_t)(u >> 1))); + } +} +/* step s of factory table f into the eight frames at F: its kept frames one a step, then the rest (copies of SINE's, + * the blend of POS 0's and 127's); 1 when they are whole */ +static int wv_step(int8_t *F, uint32_t f, uint32_t s) +{ + uint32_t n = WT_KEPT[f], j = 0, i, g; + for (i = 0; i < f; i++) + j += WT_KEPT[i]; + if (s < n) { + g = n == 2u ? s * 7u : s; /* (the grid's frame it is) */ + wv_frame(F + g * WV_FN, s ? F + (n == 2u ? 0u : g - 1u) * WV_FN : 0, WT_Z + WT_FOFF[j + s]); + return n == 8u && s == 7u; + } + for (g = 1; g < 7u + (n == 1u); g++) + for (i = 0; i < WV_FN; i++) + F[g * WV_FN + i] = (int8_t)(n == 1u ? F[i] : (((int32_t)F[i] * (int32_t)(7u - g) + (int32_t)F[7u * WV_FN + i] * + (int32_t)g + 896) * 2 + 7) / 14 - 128); + return 1; +} +static int wv_ready(const wv_t *w) { return w->have[0] == w->want[0] && w->have[1] == w->want[1] && w->want[0]; } +/* the table a value of A or B plays: a user slot empty or damaged, SINE */ +static uint32_t wv_table(int32_t v) +{ + uint32_t f = (uint32_t)clamp(v, 0, (int32_t)WV_NT - 1); + return f >= WT_NF && !wv_user_ok(f - WT_NF) ? 0u : f; +} + +/* the halves whole (bit h: A, B) */ +static uint32_t wv_whole(const wv_t *w) +{ + return (uint32_t)(w->want[0] && w->have[0] == w->want[0]) | (uint32_t)(w->want[1] && w->have[1] == w->want[1]) << 1; +} +/* the line's marks: two words of each of its eight 256-byte stretches (a STRING voice's line each: STRING clears its + * own at a note from silence, the COMB the whole at its start), those of the halves hm, mixed. Another's sound in the + * line since (STRING's, the COMB's, the part asleep or another engine meanwhile) changes them: no clock of the + * audio's needed (one would reorder the globals the sound's recorded code reaches, tools/audio_layout.txt) */ +static uint32_t wv_sig(const int16_t *L, uint32_t hm) +{ + uint32_t s = hm, k; + for (k = 0; k < 8u; k++) + if ((hm >> (k >> 2)) & 1u) + s = (s << 5 | s >> 27) ^ (uint16_t)L[k * 128u + 16u] ^ (uint32_t)(uint16_t)L[k * 128u + 80u] << 16; + return s; +} + +/* once a block and part: A's and B's frames into the line when they are not there, the part held silent until they + * are; MIX's ramp */ +static void wave_block(track_t *t) +{ + uint32_t ti = (uint32_t)(t - trk) % NTRK, h, n = 0, hm; + wv_t *w = &wv[ti]; + int8_t *F = (int8_t *)comb_buf[ti]; + if (FT_IS_COMB(ft_of(t->p))) /* (the line is the tables': a COMB TYPE plays as BP) */ + t->p[P_FTYPE] = FT_BP; + if ((hm = wv_whole(w)) && wv_sig(comb_buf[ti], hm) != w->sig) { /* (the line another's meanwhile) */ + w->have[0] = w->have[1] = 0; + w->nf[0] = w->nf[1] = 0; + } + w->mx0 = w->mx1; + w->mx1 = (uint8_t)clamp(t->p[P_E5], 0, 127); + w->am0 = w->am1; + w->am1 = (uint8_t)clamp(t->p[P_E3], 0, 127); + for (h = 0; h < 2u; h++) { + uint32_t f = wv_table(t->p[h ? P_E4 : P_E0]); + if (w->want[h] != f + 1u) { + w->want[h] = (uint8_t)(f + 1u); + w->have[h] = 0; + w->nf[h] = 0; + } + if (f >= WT_NF || ((w->busy >> h) & 1u)) /* (a user table: the main loop's) */ + continue; + while (w->have[h] != w->want[h] && n++ < WV_STEPS) + if (wv_step(F + h * WV_HALF, f, w->nf[h]++)) + w->have[h] = w->want[h]; + } + w->sig = wv_sig(comb_buf[ti], wv_whole(w)); + if (!wv_ready(w)) { /* held silent, then in (voice.c track_render: t->xin) */ + if (!t->xin_len) + t->xin_len = (uint8_t)(128u / CTL); + t->xin = (uint8_t)(t->xin_len + 1u); + } +} + +/* the phase w (Q16 turns) bent by WARP, its amount k (0 .. 127): BYTE's wave_warp / wph_init / wave_phw (BEND MIRROR: + * their slopes once a block) */ +typedef struct { uint32_t warp, amt, mb, r0, r1, sm; } wph_t; +static void wph_init(wph_t *q, uint32_t warp, uint32_t amt) +{ + q->warp = warp, q->amt = amt, q->mb = 0, q->sm = warp == WW_SYNC ? 16u + amt * 112u / 127u : 0u; /* (SYNC: x1 .. x8) */ + if (warp == WW_BEND || warp == WW_MIRROR) { + uint32_t top = warp == WW_BEND ? 32768u : 65535u; + q->mb = warp == WW_BEND ? 32768u - amt * 29491u / 127u : 65535u - amt * 32767u / 127u; + q->r0 = (top << 16) / q->mb, q->r1 = (top << 16) / (65536u - q->mb); + } +} +static uint32_t wv_phw(const wph_t *q, uint32_t *W, uint32_t n, uint32_t ph, uint32_t iu) +{ + uint32_t i, mb = q->mb; + if (mb) { + for (i = 0; i < n; i++, ph += iu) { + uint32_t w = ph >> 16; + w = w < mb ? (uint32_t)(((uint64_t)w * q->r0) >> 16) : q->warp == WW_BEND ? 32768u + (uint32_t)(((uint64_t)(w - mb) * q->r1) >> 16) + : (uint32_t)(((uint64_t)(65535u - w) * q->r1) >> 16); + W[i] = w & 0xFFFFu; + } + } else if (q->sm) + for (i = 0; i < n; i++, ph += iu) + W[i] = ((ph >> 16) * q->sm >> 4) & 0xFFFFu; + else if (q->warp == WW_QUANT) { /* 64 .. 4 steps a cycle */ + uint32_t s = 65536u / (64u - q->amt * 60u / 127u); + for (i = 0; i < n; i++, ph += iu) + W[i] = (ph >> 16) / s * s; + } else + for (i = 0; i < n; i++, ph += iu) + W[i] = ph >> 16; + return ph; +} +/* eight frames F read at phases W, the frame fi (Q12) dfi further a sample: Q16 (a frame's int8 x 512) */ +static void wv_read(const int8_t *F, const uint32_t *W, uint32_t n, int32_t fi, int32_t dfi, int32_t *y) +{ + uint32_t i; + for (i = 0; i < n; i++, fi += dfi) { + uint32_t w = W[i] & 0xFFFFu, j = w >> 9, j1 = (j + 1u) & (WV_FN - 1u), b = (uint32_t)fi & 4095u; + const int8_t *r = F + ((uint32_t)fi >> 12) * WV_FN; + int32_t x = (int32_t)(w & 511u), a = (r[j] << 9) + (r[j1] - r[j]) * x; + if (b) { + const int8_t *q = r + WV_FN; + int32_t c = (q[j] << 9) + (q[j1] - q[j]) * x; + a += ((c - a) * (int32_t)b) >> 12; + } + y[i] = a; + } +} + +static void wave_note_on(track_t *t, voice_t *v) +{ + (void)t; + v->ph[0] = v->ph[1] = v->ph[2] = 0; + v->s[0] = 0; + v->s[3] = 0; +} + +static void wave_render(track_t *t, voice_t *v, int32_t *out, uint32_t n, const vmod_t *m) +{ + const int16_t *p = t->p; + uint32_t ti = (uint32_t)(t - trk) % NTRK, i, u, o; + const wv_t *w = &wv[ti]; + const int8_t *FA = (const int8_t *)comb_buf[ti], *FB = FA + WV_HALF; + uint32_t warp = (uint32_t)clamp(p[P_E2], 0, WW_N - 1), amt = (uint32_t)clamp(p[P_E3], 0, 127); + uint32_t det = (uint32_t)clamp(p[P_E6], 0, 127), sub = (uint32_t)clamp(p[P_E7], 0, 127), inc = m->inc; + uint32_t nu = det ? 3u : 1u; + int32_t p1 = clamp((clamp(p[P_E1], 0, 127) << 8) + m->shape - (64 << 8), 0, 127 << 8), p0 = v->s[0] ? v->s[0] - 1 : p1; + int32_t f1 = p1 * 112 / 127, fi = p0 * 112 / 127, dfi, mx, dmx, am, dam; /* (POS Q8 -> the frame, Q12: 127 the 7th) */ + wph_t wq; + if (!n || !wv_ready(w)) + return; + v->s[0] = p1 + 1; + dfi = (f1 - fi) / (int32_t)n; + fi += dfi; + dmx = ((w->mx1 - w->mx0) << 8) / (int32_t)n; + mx = (w->mx0 << 8) + dmx; + dam = ((w->am1 - w->am0) << 8) / (int32_t)n; + am = (w->am0 << 8) + dam; + wph_init(&wq, warp, amt); + for (o = 0; o < n; o += WV_CH) { + uint32_t c = n - o < WV_CH ? n - o : WV_CH, needb = mx || dmx || warp == WW_FM; + int32_t acc[WV_CH], ya[WV_CH], yb[WV_CH]; + uint32_t W[WV_CH]; + for (i = 0; i < c; i++) + acc[i] = 0; + for (u = 0; u < nu; u++) { + uint32_t ph = v->ph[u], iu = u == 0u ? inc : u == 1u ? inc + (inc >> 16) * det * 3u : inc - (inc >> 16) * det * 3u; + if (warp == WW_OFF && !needb) { /* (one table, the phase as it runs) */ + int32_t q = fi; + for (i = 0; i < c; i++, ph += iu, q += dfi) { + uint32_t j = ph >> 25, j1 = (j + 1u) & (WV_FN - 1u), b = (uint32_t)q & 4095u; + const int8_t *r = FA + ((uint32_t)q >> 12) * WV_FN; + int32_t x = (int32_t)(ph >> 16 & 511u), a = (r[j] << 9) + (r[j1] - r[j]) * x; + if (b) { + const int8_t *s = r + WV_FN; + int32_t d = (s[j] << 9) + (s[j1] - s[j]) * x; + a += ((d - a) * (int32_t)b) >> 12; + } + acc[i] += a; + } + } else { + ph = wv_phw(&wq, W, c, ph, iu); + if (needb) + wv_read(FB, W, c, fi, dfi, yb); + if (warp == WW_FM) /* FM: B into A's phase, AMT the index (up to a turn) */ + for (i = 0; i < c; i++) + W[i] = (W[i] + (uint32_t)(((yb[i] >> 1) * ((am + dam * (int32_t)i) >> 1)) >> 13)) & 0xFFFFu; + wv_read(FA, W, c, fi, dfi, ya); + if (mx || dmx) /* A .. B (Q8 MIX ramped) */ + for (i = 0; i < c; i++) + ya[i] += (((yb[i] - ya[i]) >> 1) * ((mx + dmx * (int32_t)i) >> 1)) >> 13; + for (i = 0; i < c; i++) + acc[i] += ya[i]; + } + v->ph[u] = ph; + } + for (i = 0; i < c; i++) { + int32_t s = nu == 1u ? acc[i] >> 1 : ((acc[i] >> 2) * 18919) >> 14; /* (Q16 -> Q15; three: / sqrt 3 x 0.5) */ + if (sub) { + uint32_t sp = (uint32_t)v->s[3]; + s += sine_i(sp) * (int32_t)sub >> 8; + v->s[3] = (int32_t)(sp + (inc >> 1)); + } + out[o + i] += voice_amp(soft_knee(s >> 1, 16000) << 1, m, o + i); + } + fi += dfi * (int32_t)c; + mx += dmx * (int32_t)c; + am += dam * (int32_t)c; + } +} + +/* {A, POS, WARP, AMT, B, MIX, DETUNE, SUB}, {A D S R}, fenv, mono: BYTE's WAVE presets (eng_wave.c), but SHEPARD, PPG + * STEP and WAVE SEQ (the spectral warp, FRAMES STEP and SEQ: not here) and VOICES (P_MORPH on BYTE) */ +static const preset_t WAVE_PRESETS[] = { + {"INIT WAVE", {0, 0, 0, 0, 0, 0, 0, 0}, {0, 64, 100, 30}, 0, TAG(KEYS), FX(0, 0, 0, 0)}, + {"FM KEYS", {1, 40, 0, 0, 0, 0, 0, 0}, {0, 70, 60, 40}, 0, TAG(KEYS), FX(0, 15, 25, 30), PAT(6), + MODS(MENV2(0, 60, 0, 30), MMOD(1, PS_ENV2, PD_SHP, 30))}, /* POS opens with the note, closes */ + {"SAW PAD", {4, 20, 0, 0, 3, 50, 40, 0}, {80, 90, 100, 95}, 0, TAG(PAD), FX(0, 40, 30, 60), PAT(5), + MODS(P_LRATE, 12, MMOD(1, PS_LFO, PD_SHP, 20))}, /* three voices, POS breathing */ + {"SYNC LEAD", {3, 30, 1, 60, 0, 0, 12, 0}, {2, 70, 100, 40}, 0, 1 | TAG(LEAD), FX(0, 0, 35, 25), PAT(4), + MODS(MMOD(1, PS_MODW, PD_SHP, 40), P_GLIDE, 10)}, + {"SUB BASS", {7, 30, 2, 40, 0, 0, 0, 80}, {0, 60, 90, 20}, 0, 1 | TAG(BASS), FX(0, 0, 5, 0), PAT(2), + MODS(P_GLIDE, 8)}, + {"BIT TABLE", {11, 64, 4, 50, 13, 30, 0, 0}, {0, 75, 80, 40}, 0, 1 | TAG(FX), FX(0, 10, 30, 30), PAT(3), + MODS(P_LWAVE, LW_SH, P_LRATE, -8, MMOD(1, PS_LFO, PD_SHP, 40))}, /* POS jumps each 1/8 */ + {"FM BELL", {0, 0, 5, 70, 2, 0, 0, 0}, {0, 88, 0, 70}, 12, TAG(BELL), FX(0, 20, 35, 55), PAT(7), + MODS(MMOD(1, PS_VEL, PD_SHP, 30))}, /* B into A's phase */ + {"FORMANT", {12, 50, 0, 0, 8, 40, 20, 0}, {30, 80, 90, 60}, 0, TAG(PAD), FX(0, 30, 30, 50), PAT(5), + MODS(P_LRATE, 6, MMOD(1, PS_LFO, PD_SHP, 35))}, + {"REESE", {4, 8, 0, 0, 0, 0, 90, 50}, {0, 70, 110, 25}, 0, 1 | TAG(BASS), FX(10, 0, 0, 10), PAT(2), + MODS(P_GLIDE, 8, P_FCUT, 76, P_FRES, 30, MLFO(LW_TRI, 20, 0, 14), MMOD(1, PS_LFO, PD_SHP, 16))}, + {"ACID BASS", {3, 6, 0, 0, 0, 0, 0, 30}, {0, 60, 100, 15}, 0, 1 | TAG(BASS), FX(25, 0, 20, 0), PAT(2), + MODS(P_GLIDE, 12, P_FCUT, 46, P_FRES, 100, MENV2(0, 76, 0, 20), MMOD(1, PS_ENV2, PD_SHP, 50), + MMOD(2, PS_ENV2, PD_FCUT, 40))}, /* ENV 2: the sync and the filter snap */ + {"FM GROWL", {5, 27, 5, 30, 2, 0, 0, 40}, {0, 70, 110, 20}, 0, 1 | TAG(BASS), FX(15, 0, 0, 0), PAT(2), + MODS(P_GLIDE, 6, MENV2(0, 75, 30, 30), MMOD(1, PS_ENV2, PD_E(3), 40), MLFO(LW_TRI, -5, 0, 0), + MMOD(2, PS_LFO, PD_E(3), 16), MMOD(3, PS_LFO, PD_SHP, 8))}, /* FM's index: struck, then a 1/4 growl */ + {"808 BOOM", {5, 6, 0, 0, 0, 0, 0, 30}, {0, 100, 0, 50}, 0, 1 | TAG(BASS), FX(5, 0, 0, 5), PAT(2), + MODS(MENV2(0, 68, 0, 10), MMOD(1, PS_ENV2, PD_PITCH, 36), MMOD(2, PS_ENV2, PD_SHP, 40))}, /* the drop, the click */ + {"WOBBLE", {7, 40, 0, 0, 0, 0, 0, 60}, {0, 70, 110, 20}, 0, 1 | TAG(BASS), FX(20, 0, 0, 0), PAT(2), + MODS(P_FCUT, 96, MLFO(LW_SIN, -8, 0, 20), MMOD(1, PS_LFO, PD_SHP, 40))}, /* the fold in 1/8, from each note */ + {"SWEEP PAD", {7, 0, 0, 0, 0, 0, 40, 0}, {90, 90, 110, 100}, 0, TAG(PAD), FX(0, 30, 30, 70), PAT(5), + MODS(MENV2(115, 0, 127, 105), MMOD(1, PS_ENV2, PD_SHP, 63), P_LRATE, 10, MMOD(2, PS_LFO, PD_SHP, 14))}, /* ~4 s up */ + {"MORPH PAD", {4, 30, 0, 0, 8, 64, 50, 0}, {70, 90, 110, 95}, 0, TAG(PAD), FX(0, 35, 25, 60), PAT(5), + MODS(MLFO(LW_TRI, -2, 0, 0), P_LPHASE, -1, MMOD(1, PS_LFO, PD_E(5), 30), MMOD(2, PS_LFO, PD_SHP, -20))}, /* A .. B, 2 bars */ + {"GLASS PAD", {2, 62, 0, 0, 0, 40, 20, 0}, {40, 90, 100, 90}, 0, TAG(PAD), FX(0, 40, 35, 75), PAT(5), + MODS(P_LRATE, 30, MMOD(1, PS_LFO, PD_E(5), 30), MMOD(2, PS_VEL, PD_SHP, 8))}, /* the 4:1 glass, a sine in and out */ + {"PWM STRNG", {9, 80, 0, 0, 0, 0, 0, 0}, {50, 90, 110, 80}, 0, TAG(PAD), FX(0, 60, 20, 60), PAT(5), + MODS(P_LRATE, 45, MMOD(1, PS_LFO, PD_SHP, 36))}, /* the width swung */ + {"SUPERSAW", {4, 0, 0, 0, 0, 0, 127, 20}, {20, 90, 110, 70}, 0, TAG(PAD), FX(0, 60, 30, 55), PAT(5), + MODS(MENV2(60, 100, 40, 70), MMOD(1, PS_ENV2, PD_SHP, 40), P_DXIMG, 90)}, /* the saws bloom square, settle */ + {"SHIMMER", {14, 40, 3, 20, 0, 0, 30, 0}, {80, 100, 110, 110}, 0, TAG(PAD), FX(0, 50, 60, 100), PAT(5), + MODS(MENV2(110, 0, 127, 110), MMOD(1, PS_ENV2, PD_SHP, 50), P_LRATE, 30, MMOD(2, PS_LFO, PD_E(3), 20), P_DXIMG, 80)}, + {"DARK DRONE", {8, 30, 0, 0, 0, 0, 60, 60}, {100, 100, 127, 110}, 0, TAG(PAD), FX(10, 20, 20, 80), PAT(5), + MODS(P_FCUT, 60, P_FRES, 40, MLFO(LW_SIN, 4, 0, 16), MMOD(1, PS_LFO, PD_SHP, 30))}, /* the odd partials, slowly */ + {"FM PLUCK", {1, 0, 0, 0, 0, 0, 0, 0}, {0, 85, 0, 60}, 0, TAG(PLUCK), FX(0, 15, 40, 40), PAT(6), + MODS(MENV2(0, 70, 0, 40), MMOD(1, PS_ENV2, PD_SHP, 63), MMOD(2, PS_VEL, PD_SHP, 20), P_ED_SHP, 40)}, /* the index struck */ + {"METAL PLK", {2, 90, 1, 0, 0, 0, 0, 0}, {0, 82, 0, 55}, 0, TAG(PLUCK), FX(0, 10, 45, 45), PAT(6), + MODS(MENV2(0, 72, 0, 40), MMOD(1, PS_ENV2, PD_SHP, 30), MMOD(2, PS_ENV2, PD_E(3), 30))}, /* the ratio steps down */ + {"YAH LEAD", {12, 20, 0, 0, 8, 30, 10, 0}, {5, 80, 110, 40}, 0, 1 | TAG(VOX), FX(0, 10, 40, 35), PAT(4), + MODS(P_GLIDE, 15, MENV2(65, 75, 30, 40), MMOD(1, PS_ENV2, PD_SHP, 45), P_LRATE, 88, P_LFADE, 70, P_LD_PIT, 1)}, /* "ya" */ + {"CHIME", {6, 100, 0, 0, 0, 120, 0, 0}, {0, 100, 0, 95}, 0, TAG(BELL), FX(0, 20, 40, 65), PAT(7), + MODS(MENV2(0, 80, 0, 60), MMOD(1, PS_ENV2, PD_E(5), -50))}, /* the 5th and 7th die first */ + {"NOISE RISE", {13, 0, 0, 0, 7, 50, 0, 0}, {60, 90, 127, 90}, 0, 1 | TAG(FX), FX(0, 20, 50, 70), PAT(3), + MODS(MENV2(112, 0, 127, 90), MMOD(1, PS_ENV2, PD_SHP, 63), MMOD(2, PS_ENV2, PD_PITCH, 40))}, /* finer, up */ + {"HYPER SAW", {4, 0, 0, 0, 0, 0, 100, 0}, {10, 90, 110, 70}, 0, TAG(PAD), FX(0, 30, 30, 60), PAT(5), + MODS(P_DXIMG, 127)}, +}; +/* browsing (BYTE's order): KEYS PLUCK, PAD, LEAD VOX, BASS, BELL, FX, INIT */ +static const uint8_t WAVE_ORDER[] = {1, 20, 21, 2, 13, 14, 15, 16, 17, 18, 19, 25, 7, 3, 22, 4, 8, 9, 10, 11, 12, 6, 23, 5, + 24, 0}; +_Static_assert(sizeof WAVE_ORDER == NELEM(WAVE_PRESETS), "WAVE's browsing order: every preset once"); +_Static_assert(NELEM(WAVE_PRESETS) <= 32u, "WAVE's stars: four bytes (favorites.c)"); + +static const engine_t ENG_WAVE = { + .name = "WAVE", + .page_title = {"WAVE", "OSC B"}, + .edit = { + {"A", F_ENUM, 0, WV_NT - 1u, 0, N_WAVEF}, + {"POS", F_PCT, 0, 127, 0, 0}, + {"WARP", F_ENUM, 0, WW_N - 1u, 0, N_WWARP}, + {"AMT", F_PCT, 0, 127, 0, 0}, + {"B", F_ENUM, 0, WV_NT - 1u, 0, N_WAVEF}, + {"MIX", F_PCT, 0, 127, 0, 0}, + {"DETUNE", F_PCT, 0, 127, 0, 0}, + {"SUB", F_PCT, 0, 127, 0, 0}, + }, + .presets = WAVE_PRESETS, + .npresets = NELEM(WAVE_PRESETS), + .note_on = wave_note_on, + .render = wave_render, + .block = wave_block, /* (the tables into the line; MIX's ramp) */ + .half = 1, /* (voice.c voice_half's generic path: the increments doubled) */ + .knob = {P_E0, P_E1, P_E2, P_E3}, +}; diff --git a/firmware/src/engines.c b/firmware/src/engines.c index 1fe291a4..01c1b876 100644 --- a/firmware/src/engines.c +++ b/firmware/src/engines.c @@ -27,14 +27,16 @@ static const int8_t R_WFOLD[] = {P_GLIDE, 12, MMOD(1, PS_MODW, PD_E(0), 40), MMO #include "eng_string.c" /* (JIANT 0.9.9-snd5) STRING: Karplus-Strong, in the COMB's lines (engine 8) */ #include "eng_add.c" /* (JIANT 0.9.9-snd5) ADD: additive, nine partials, in WHEEL's voice state (engine 13) */ #include "eng_input.c" /* (V10.54) INPUT: the audio input on a track (engine 15) */ +#include "eng_wave.c" /* WAVE: the wavetable, JIANT BYTE's, in PHYS's 9 (its tables in the COMB's lines) */ #include "fm4_convert.c" /* DIGITAL's tables, and its sounds -> FM6 */ #if FELUCCA_FM4 #include "eng_digital.c" /* DIGITAL: four-operator FM (retired; FELUCCA_FM4=1 builds it) */ #endif #include "clay_form.c" /* (V10.8.21) DRONE CLAY's composer (JIANT BYTE's, GPL): its state before mod.c reads it */ -/* PHYS (engine 9): retired in TONIC (its 50 KB of voice state went to the song and the drums); SAMPLE (4), GRAIN (8) and - * SLICE (13): retired in JIANT (core.h eng_gone). The numbers stay reserved, as DIGITAL's: the stores name engines by +/* PHYS (engine 9): retired in TONIC (its 50 KB of voice state went to the song and the drums; 9 is WAVE's now: an old + * PHYS sound still plays as ANALOG, core.h eng_phys_old); SAMPLE (4), GRAIN (8) and SLICE (13): retired in JIANT (core.h + * eng_gone). The numbers stay reserved, as DIGITAL's: the stores name engines by * index and the table is append-only. ENG_GONE below has no presets and is never offered (eng_ok); a sound of theirs * that arrives anyway -- a project, a user preset, the editor's PRESET / SET G_ENGSEL, a backup -- plays as ANALOG's * first preset (eng_live; project.c proj_phys_gone, ui.c set_engine_of, ui_input.c). A SAMPLE PERC user preset still @@ -73,7 +75,7 @@ static const engine_t *const ENGINES[NENGINES] = { &ENG_GONE, /* 6: reserved (TRIO, folded into ANALOG in JIANT 0.4: core.h analog_from_trio) */ &ENG_WHEEL, /* 7 */ &ENG_STRING, /* 8 (ENGI_STRING, 0.9.9-snd5; GRAIN's, retired in JIANT: its sounds play as STRING's) */ - &ENG_GONE, /* 9: reserved (PHYS, retired in TONIC: its sounds play as ANALOG) */ + &ENG_WAVE, /* 9 (ENGI_WAVE; PHYS's, retired in TONIC: a sound stored as PHYS's plays as ANALOG) */ &ENG_DRUM, /* 10 (ENGI_DRUM) */ &ENG_WEST, /* 11 */ &ENG_FM6, /* 12 (ENGI_FM6) */ @@ -108,6 +110,7 @@ static const uint8_t ENGINE_ORDER[NENG_SHOWN] = { ENGI_LOFI, ENGI_WHEEL, /* MATH (was LOFI) WHEEL */ ENGI_WEST, /* WEST */ ENGI_STRING, ENGI_ADD, /* (0.9.9-snd5) STRING ADD */ + ENGI_WAVE, /* the wavetable */ ENGI_INPUT, /* (V10.54) the audio input */ #if FELUCCA_FM4 ENGI_DIGITAL, /* DIGITAL (retired, FELUCCA_FM4 builds only): after the rest */ @@ -124,6 +127,7 @@ static const uint8_t ENGINE_PC_ORDER[NENG_SHOWN] = { ENGI_PHASE, ENGI_LOFI, ENGI_VOICE, ENGI_WHEEL, ENGI_WEST, ENGI_DRUM, ENGI_ANIMAL, ENGI_STRING, ENGI_ADD, /* (0.9.9-snd5: after ANIMAL, every number before kept) */ ENGI_INPUT, /* (V10.54) */ + ENGI_WAVE, /* (after INPUT: every number before kept) */ }; /* the engines one can pick (engine 1 only with FELUCCA_FM4), in ENGINE_ORDER: eng_ok(e), the n-th of them diff --git a/firmware/src/favorites.c b/firmware/src/favorites.c index 27393ebb..072ecde1 100644 --- a/firmware/src/favorites.c +++ b/firmware/src/favorites.c @@ -18,23 +18,30 @@ static __attribute__((noinline)) void fav_rows_new(void) favorites.factory[15][25] = 3u; /* (prefs_rev) */ settings_save(); } +/* (WAVE) engine e's stars: its own row, WAVE's (9: PHYS's row holds the crash log, cpu_safe.c CRASH_LOG) the first four + * bytes of TRIO's retired one (bt.c uses its bytes 19 ..; cleared once: ui.c prefs_update, revision 7) */ +static uint8_t *fav_row(uint32_t engine) +{ + return engine == ENGI_WAVE ? favorites.factory[ENGI_TRIO] : favorites.factory[engine]; +} +#define FAV_MAX(e) ((e) == ENGI_WAVE ? 32u : 256u) static int favorite_has(uint32_t engine, uint32_t preset) { if (engine == NENGINES) return preset < UP_SLOTS && ((favorites.user >> preset) & 1u); - return engine < NENGINES && engine < 16u && preset < 256u && - ((favorites.factory[engine][preset / 8u] >> (preset % 8u)) & 1u); + return engine < NENGINES && engine < 16u && preset < FAV_MAX(engine) && + ((fav_row(engine)[preset / 8u] >> (preset % 8u)) & 1u); } static int favorite_set(uint32_t engine, uint32_t preset, int on) { - if (engine > NENGINES || (engine == NENGINES ? preset >= UP_SLOTS : engine >= 16u || preset >= 256u)) + if (engine > NENGINES || (engine == NENGINES ? preset >= UP_SLOTS : engine >= 16u || preset >= FAV_MAX(engine))) return 0; if (favorite_has(engine, preset) == !!on) return 0; if (engine == NENGINES) { if (on) favorites.user |= 1u << preset; else favorites.user &= ~(1u << preset); } else { - uint8_t *b = &favorites.factory[engine][preset / 8u]; + uint8_t *b = &fav_row(engine)[preset / 8u]; if (on) *b |= (uint8_t)(1u << (preset % 8u)); else *b &= (uint8_t)~(1u << (preset % 8u)); } diff --git a/firmware/src/midi_control.c b/firmware/src/midi_control.c index f330e9f3..0d0e3634 100644 --- a/firmware/src/midi_control.c +++ b/firmware/src/midi_control.c @@ -256,7 +256,7 @@ static const uint8_t MIDI_CC_ENG[NENGINES] = { 0x56, 0x00, 0x30, 0x00, 0x50, 0x07, 0x67, 0x00, /* ANALOG CUT RES, -, PHASE DCW, MATH - (V10.6h: was E8, now its LOOP: * its CUT RES are the FILTER page's), SAMPLE CUT, VOICE Q, TRIO * CUT RES, WHEEL - */ - 0x32, 0x30, 0x30, 0x17, 0x30, /* (snd5) STRING BRIGHT DECAY, PHYS BRIT, DRUM TONE, WEST FOLD RES (V10.7.56; was NOISE's FREQ RES: RATIO, a list), FM6 MLVL */ + 0x32, 0x24, 0x30, 0x17, 0x30, /* (snd5) STRING BRIGHT DECAY, (WAVE: was PHYS BRIT) WAVE POS AMT, DRUM TONE, WEST FOLD RES (V10.7.56; was NOISE's FREQ RES: RATIO, a list), FM6 MLVL */ 0x26, /* (snd5) ADD BRIGHT FORMNT */ 0x23, 0x00, /* (V10.54: then INPUT, none) */ /* ANIMAL PRESS (TOUCH CLICK BUZZ MOUTH), CHAOS (COUPLE Q DRIFT ROUGH) */ }; diff --git a/firmware/src/mod.c b/firmware/src/mod.c index d15df55f..63beabb2 100644 --- a/firmware/src/mod.c +++ b/firmware/src/mod.c @@ -763,6 +763,7 @@ BTAPP_FN static int mod_dst_ok(const track_t *t, uint32_t d) if (e == ENGI_FM6 && (k == 7u || k == 3u || k == 5u)) return 0; /* SLOT requires a bank load, not a parameter offset. */ if (e == ENGI_LOFI && k == 1u) return 0; /* (V10.8.62) MATH's WAVE (BYTE FLOAT SYNC): a list, as when it was two */ if (e == ENGI_STRING && k == 3u && t->p[P_E0] != SX_FDBK) return 0; /* POS is excitation-only. */ + if (e == ENGI_WAVE && (k == 0u || k == 2u || k == 4u)) return 0; /* WAVE's A WARP B: lists (a table, a warp) */ if (e == ENGI_INPUT && (k == 3u || (k == 5u && !t->p[P_E3]) || (k == 4u && (t->p[P_E0] != AIN_ST || t->p[P_E3])))) return 0; } return 1; @@ -821,7 +822,7 @@ BTAPP_FN static const char *mod_dst_name_bt(const track_t *t, int32_t v) } if (v == MD_SHP) { static const uint8_t SHP_ID[NENGINES] = {P_MORPH, P_MORPH, P_E2, P_MORPH, P_MORPH, P_E4, P_MORPH, P_E6, - P_E2, P_MORPH, P_MORPH, P_E1, P_MORPH, P_E5, P_MORPH, P_MORPH}; + P_E2, P_E1, P_MORPH, P_E1, P_MORPH, P_E5, P_MORPH, P_MORPH}; if (e == ENGI_FM6) return "FB+MOD"; if (e == ENGI_STRING && t->p[P_E0] == SX_FDBK) return "BR+SIZE"; k = e == ENGI_LOFI && t->p[P_E1] >= RW_BYTE ? P_E3 : SHP_ID[e]; diff --git a/firmware/src/project.c b/firmware/src/project.c index 876ba56d..7da92fdd 100644 --- a/firmware/src/project.c +++ b/firmware/src/project.c @@ -78,6 +78,10 @@ #define PROJ_LT 4u /* the tracks of every format before FUNC */ #define PROJ_PHYS 3u /* project_t.phys: PHYS without DUST and DRUM (2, see the top); (V10.7.36) * 3: engine 11 is WEST (below: NOISE, proj_phys_gone) */ +#define PROJ_WAVE 4u /* (WAVE) phys 4: a project with a WAVE track (engine 9, PHYS's number + * of before 1.0): only such a project is written with it, every other + * one as before (3); engine 9 in a project below 4 is PHYS's, refused + * as it always was (proj_import) */ #define PROJ_NAME_LEN 12u /* the name: FUN7 bytes PROJ_NAME_OFF.. (the reserved tail's end) */ typedef struct { /* one track */ int16_t p[P_COUNT]; @@ -390,7 +394,8 @@ static int proj_import(project_t *q, const void *b, int n) if (!proj_import_any(q, b, n) || !proj_engines_ok(q)) return 0; for (k = 0; k < NTRK; k++) - if (eng_gone(q->t[k].engine) || q->t[k].preset == PROJ_DEF_KEEP) + if (eng_gone(q->t[k].engine) || eng_phys_old(q->t[k].engine, q->phys < PROJ_WAVE) || + q->t[k].preset == PROJ_DEF_KEEP) proj_sl_found = 0; if (proj_sl_found != 1) return proj_sl_found = 2, 0; @@ -1403,6 +1408,7 @@ static void project_capture(project_t *p) p->t[i].preset = trk[i].preset; memcpy(p->t[i].step, trk[i].step, sizeof trk[i].step); fm6_pack(fm6_patch[i], p->fm6[i]); + if (p->t[i].engine == ENGI_WAVE) p->phys = PROJ_WAVE; } p->motion = motion; memcpy(p->dx, dx_kit, sizeof p->dx); diff --git a/firmware/src/ui.c b/firmware/src/ui.c index 6e94014e..da59ca3a 100644 --- a/firmware/src/ui.c +++ b/firmware/src/ui.c @@ -218,6 +218,11 @@ static void prefs_update(void) prefs_rev = 6u; settings_save(); } + if (prefs_rev < 7u) { /* (WAVE) its stars in TRIO's retired row: what TRIO left there gone */ + memset(favorites.factory[ENGI_TRIO], 0, 4u); /* (favorites.c fav_row) */ + prefs_rev = 7u; + settings_save(); + } } /* MENU > AUDIO CLICK, CLICK LEVEL, COUNT-IN (1.1, Discussion #131; click.c, seq.c): two bits each in another byte no * engine uses, saved with the settings: bits 0-1 CLICK (OFF REC ON), 2-3 CLICK LEVEL (stored 0 MID, 1 LOW, 2 HIGH), @@ -1551,6 +1556,7 @@ static const uint8_t *preset_order(const engine_t *e, uint32_t *n) if (e == &ENG_WEST) { *n = sizeof WEST_ORDER; return WEST_ORDER; } if (e == &ENG_FM6) { *n = sizeof FM6_ORDER; return FM6_ORDER; } if (e == &ENG_WHEEL) { *n = sizeof WHEEL_ORDER; return WHEEL_ORDER; } + if (e == &ENG_WAVE) { *n = sizeof WAVE_ORDER; return WAVE_ORDER; } *n = 0; return 0; } diff --git a/firmware/src/ui_being.c b/firmware/src/ui_being.c index 48ddea9f..e3cd3c4c 100644 --- a/firmware/src/ui_being.c +++ b/firmware/src/ui_being.c @@ -36,7 +36,8 @@ static const genome_t GENOME[9] = { /* (JIANT 0.5) a species per engine: ANALOG the radiolarian, PHASE the swirling amoeba, LOFI the blunt diatom, VOICE the * hydra (a mouth of tentacles), WHEEL the ciliate (a fringe of pipes), NOISE the spore, FM6 the pollen grain (its * operators' geometry), the retired slots the worm; (0.8.3) ANIMAL the larva */ -static const uint8_t EGEN[NENGINES] = {0, 5, 1, 2, 5, 7, 5, 3, 5, 5, 0, 4, 6, 0, 8, 7}; /* (snd5: STRING 8 the worm, ADD 13 the radiolarian) */ +static const uint8_t EGEN[NENGINES] = {0, 5, 1, 2, 5, 7, 5, 3, 5, 1, 0, 4, 6, 0, 8, 7}; /* (snd5: STRING 8 the worm, ADD 13 the radiolarian; + * WAVE 9 the amoeba, PHASE's: a shape that morphs) */ static const genome_t LANE_G_HOME = {12, 0, 10, 3, 18, 0, 6}; /* HOME: a DRUM-X track's being (spiky, a beat) */ typedef struct { int32_t spikes, len, wob, lob, nuc, sep, fray, ripple; /* len wob sep fray ripple 0..256 */ diff --git a/firmware/src/upreset.c b/firmware/src/upreset.c index ef44fcbc..ea233b21 100644 --- a/firmware/src/upreset.c +++ b/firmware/src/upreset.c @@ -95,6 +95,9 @@ static void up_migrate(up_rec_t *r) if (!up_valid(r)) return; /* (V10.7.13+, room for FORM MY LOOP: SAMPLE PERC, TRIO, LOFI's chips * and 0.3 / 0.4's values no longer converted: a retired engine * plays ANALOG, eng_live) */ + if (eng_phys_old(r->engine, r->ver < 4u)) /* (WAVE) a PHYS sound of before (engine 9 is WAVE's now): a + * retired engine's, ANALOG's first preset as it was */ + r->engine = ENGI_SAMPLE; if (r->ver >= 4u && r->np <= UP_VEL_AT && r->packed[UP_VEL_AT] != UP_VEL_MARK) { /* (V10.7.6) VEL 100 % */ if (P_TVEL + 8u < r->np && r->engine != ENGI_DIGITAL) up_set_value(r, P_TVEL, 127); /* (DIGITAL: its OP4) */ r->packed[UP_VEL_AT] = UP_VEL_MARK; diff --git a/firmware/src/wave_tables.h b/firmware/src/wave_tables.h new file mode 100644 index 00000000..704ca574 --- /dev/null +++ b/firmware/src/wave_tables.h @@ -0,0 +1,366 @@ +/* SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */ +/* Generated by tools/gen_wave_tables.py (tools/gen_wave_tables.c, JIANT BYTE main 94f8ac9): do not edit. + * WAVE's 16 factory tables, BYTE's formulas at FM's eight POS (k x 127 / 7), int8, Rice-coded a frame each + * (eng_wave.c wv_frame). Against BYTE's int16 frames (dB): SINE 49.3 FM2 49.0 FMR 49.0 TRISY 53.4 SAWSQ 43.7 DRIVE 49.9 RING 46.9 FOLD 49.4 ODD 48.6 PULSE 45.2 STEP 47.3 BITS 115.6 FORMT 45.6 NOISE 48.3 SINTR 47.0 SATUR 49.6 */ +#pragma once +#define WT_NF 16u +#define WT_ZSIZE 8186u +/* the frames kept a table (1: SINE, 2: POS 0 and 127, the six between their blend; 8: the grid) */ +static const uint8_t WT_KEPT[WT_NF] = {1, 8, 8, 8, 2, 8, 8, 8, 2, 8, 8, 8, 8, 8, 2, 8}; +/* each kept frame's first byte in WT_Z, the tables one after the other (the last: the end) */ +static const uint16_t WT_FOFF[104] = { + 0, 31, 62, 122, 204, 303, 414, 535, 660, 791, 822, 856, 916, 1006, 1119, 1249, + 1389, 1535, 1600, 1668, 1740, 1819, 1903, 1992, 2087, 2186, 2251, 2324, 2355, 2392, 2439, 2487, + 2528, 2563, 2595, 2625, 2668, 2685, 2736, 2798, 2868, 2946, 3032, 3049, 3124, 3218, 3328, 3447, + 3574, 3706, 3845, 3986, 4017, 4073, 4090, 4163, 4236, 4309, 4382, 4455, 4528, 4601, 4674, 4749, + 4825, 4902, 4979, 5056, 5133, 5210, 5275, 5364, 5454, 5543, 5628, 5716, 5807, 5864, 5895, 5942, + 6008, 6089, 6182, 6283, 6392, 6507, 6606, 6734, 6874, 7015, 7157, 7298, 7429, 7543, 7574, 7642, + 7686, 7751, 7821, 7891, 7963, 8040, 8118, 8186, +}; +/* (tests/wave_test.c) FNV-1a of each table's eight frames (1024 int8) as the device makes them */ +#define WT_HASH_INIT {0xff72d285u, 0x1cf0f119u, 0x99efad23u, 0x6fda8005u, 0xfcf55f01u, 0x24a9b1a9u, 0x69329c35u, 0xca9574efu, 0x7a175fe1u, 0x239aa2d5u, 0x0a78e8b2u, 0xbe3315c5u, 0xad5be9eau, 0x8c602344u, 0xb8af39e5u, 0x47e3061au} +static const uint8_t WT_Z[WT_ZSIZE] = { + 0xc1, 0xff, 0x5b, 0x40, 0x0b, 0xa2, 0xa5, 0xdd, 0x14, 0x28, 0xbb, 0xa5, 0x45, 0xd0, 0x02, 0x9a, 0x06, 0xac, 0xc1, 0x58, 0xb3, 0x5e, 0xb6, 0x66, + 0x6d, 0x7a, 0xcd, 0x1a, 0x83, 0x35, 0x60, 0xc1, 0xff, 0x5b, 0x40, 0x0b, 0xa2, 0xa5, 0xdd, 0x14, 0x28, 0xbb, 0xa5, 0x45, 0xd0, 0x02, 0x9a, 0x06, + 0xac, 0xc1, 0x58, 0xb3, 0x5e, 0xb6, 0x66, 0x6d, 0x7a, 0xcd, 0x1a, 0x83, 0x35, 0x60, 0x09, 0xff, 0x3f, 0xcb, 0xbd, 0xf6, 0xea, 0x6a, 0x09, 0x60, + 0x04, 0x23, 0x91, 0x24, 0x01, 0x49, 0x2e, 0x94, 0x25, 0x01, 0x24, 0x13, 0x19, 0x8c, 0x20, 0x20, 0x75, 0xf5, 0xda, 0xab, 0x5d, 0xc8, 0x18, 0xf3, + 0x98, 0x23, 0x07, 0x09, 0xc8, 0x96, 0x0b, 0x25, 0x09, 0x20, 0x19, 0x11, 0x11, 0x24, 0x01, 0x49, 0x85, 0xb2, 0x6c, 0x01, 0xe4, 0xc8, 0x31, 0x8f, + 0x39, 0x02, 0x0d, 0xfe, 0x1f, 0xfb, 0xf5, 0xf5, 0x7e, 0x5d, 0x0a, 0xa4, 0x98, 0x72, 0x62, 0x46, 0x42, 0x62, 0x4e, 0x21, 0x07, 0x26, 0x6b, 0x7d, + 0xdf, 0xf6, 0xde, 0x8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0x20, 0x75, 0xf5, 0xda, 0xab, 0x5d, 0xc8, + 0x18, 0xf3, 0x98, 0x23, 0x07, 0x09, 0xc8, 0x96, 0x0b, 0x25, 0x09, 0x20, 0x19, 0x11, 0x11, 0x24, 0x01, 0x49, 0x85, 0xb2, 0x6c, 0x01, 0xe4, 0xc8, + 0x31, 0x8f, 0x39, 0x02, 0x11, 0xfc, 0xbc, 0xda, 0xed, 0x36, 0x8d, 0x44, 0x94, 0x07, 0x9c, 0x73, 0x0e, 0x91, 0xf2, 0x5d, 0xdb, 0x56, 0x0e, 0xd0, + 0x84, 0x73, 0x0a, 0x19, 0xc3, 0x3c, 0x49, 0x02, 0xa4, 0xfb, 0xed, 0xc5, 0xaa, 0x40, 0x51, 0x1e, 0x87, 0x18, 0x19, 0x25, 0x95, 0x01, 0x30, 0x88, + 0xc2, 0x8c, 0x02, 0x59, 0x75, 0x95, 0x95, 0x00, 0x31, 0xca, 0x90, 0xb1, 0x5d, 0x5b, 0x37, 0x26, 0x99, 0x9d, 0x8c, 0x07, 0xdc, 0xf8, 0xa2, 0xd0, + 0x56, 0x29, 0x27, 0xb5, 0x2e, 0xa4, 0xc0, 0x49, 0x9e, 0x67, 0x01, 0x33, 0x4e, 0x6b, 0xad, 0xbd, 0x96, 0x86, 0x46, 0xa3, 0xe1, 0x10, 0x15, 0xf8, + 0xdc, 0xfa, 0xd5, 0x2d, 0x89, 0x0f, 0x25, 0x58, 0x3c, 0x90, 0x41, 0xc5, 0xa5, 0x1b, 0x5b, 0x4a, 0x72, 0x28, 0x49, 0x3a, 0xae, 0xac, 0x51, 0xb1, + 0xc1, 0x09, 0x61, 0xff, 0x8d, 0x7d, 0x61, 0x62, 0x30, 0x46, 0x69, 0xb2, 0xeb, 0x90, 0xc9, 0xa1, 0xa4, 0xb2, 0x75, 0x63, 0x49, 0x44, 0x33, 0x01, + 0x9c, 0x4d, 0x84, 0x78, 0x69, 0xeb, 0xea, 0x3a, 0x30, 0x7f, 0x76, 0x8c, 0x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, 0x8e, 0x3e, 0x34, 0x11, 0x24, 0x25, + 0x46, 0x8e, 0x25, 0x6f, 0x5b, 0x94, 0x20, 0x66, 0x8a, 0xd6, 0x82, 0x0e, 0x0e, 0xa7, 0x39, 0x41, 0xf0, 0xd9, 0x0e, 0x19, 0xe8, 0xbe, 0x00, 0x27, + 0xee, 0x73, 0xc7, 0xd5, 0x7a, 0x5f, 0xe0, 0x32, 0x10, 0x10, 0x88, 0xb1, 0x4b, 0xb4, 0x14, 0x48, 0x7a, 0xdc, 0x29, 0x7b, 0x58, 0x48, 0x3a, 0x0a, + 0xed, 0x7c, 0xf5, 0x2a, 0x23, 0x02, 0x98, 0xd3, 0x6e, 0xd0, 0x16, 0xa0, 0xf2, 0x6a, 0xa8, 0x2a, 0xc6, 0x53, 0xb1, 0x5c, 0x66, 0x65, 0x9e, 0x60, + 0x2c, 0xeb, 0x61, 0x9d, 0x38, 0x80, 0x82, 0xc6, 0x2e, 0xd7, 0xb7, 0x38, 0x7c, 0x83, 0xd5, 0x40, 0xdc, 0x6a, 0x96, 0xd7, 0xcb, 0x8b, 0x05, 0xe9, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x2d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7e, + 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf7, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf1, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0xdf, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x8f, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xff, 0xdf, 0x02, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x1f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xe8, 0xff, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0xff, 0x2d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x7f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0xff, 0xff, 0xff, 0xef, + 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xff, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xef, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, + 0xbd, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xed, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xfd, 0xef, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x7f, 0x13, 0x00, 0x00, 0x00, 0x80, 0x87, 0x7f, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xbf, 0xdf, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xee, 0x7f, 0x07, 0x00, 0x00, 0x00, 0x80, 0x7f, 0x78, 0x00, + 0x00, 0x00, 0x00, 0x90, 0xff, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfd, 0x0e, 0x00, 0x00, 0x00, 0x00, + 0xed, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xbf, 0x77, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x1e, 0x00, + 0x00, 0x00, 0xe0, 0xef, 0xdf, 0x01, 0x00, 0x00, 0xe0, 0x87, 0x7f, 0x00, 0x00, 0x00, 0x80, 0xfb, 0x7f, 0x07, 0x00, 0x00, 0x80, 0xe1, 0xff, 0x01, + 0x00, 0x00, 0x00, 0xe4, 0xff, 0x9b, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfd, 0x0e, 0x00, 0x00, 0x00, 0xff, 0xf0, + 0x03, 0x00, 0x00, 0x00, 0x7c, 0xff, 0x3b, 0x00, 0x00, 0x00, 0x3c, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0xd0, 0xff, 0xef, 0x00, 0x00, 0x00, 0x00, 0xf1, + 0xff, 0xef, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x6f, 0x05, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf1, 0xb7, 0x02, + 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0x80, 0xf8, 0x5b, 0x01, 0x00, 0x00, 0x00, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x40, 0xfc, 0xad, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x20, 0xfe, 0x56, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x10, 0x7f, 0x2b, 0x00, + 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x88, 0xbf, 0x15, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xc4, 0xdf, 0x0a, 0x00, + 0x00, 0x00, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0xff, 0x5b, 0xb4, + 0xb4, 0x5a, 0x04, 0x41, 0x0b, 0xb4, 0x20, 0x88, 0x56, 0x4b, 0x8b, 0x46, 0x5b, 0x66, 0x6d, 0x8d, 0xc1, 0x60, 0x0d, 0xac, 0xc1, 0x60, 0xac, 0xad, + 0x99, 0xb6, 0x00, 0xc1, 0xff, 0xff, 0xff, 0xff, 0xaa, 0xbb, 0x3e, 0x9d, 0xb4, 0x03, 0x00, 0x00, 0x00, 0xdc, 0x92, 0xcb, 0xd7, 0x5d, 0x65, 0xdb, + 0x7b, 0xfb, 0xd9, 0x33, 0xeb, 0x01, 0x00, 0x00, 0x00, 0x5e, 0x33, 0x6f, 0x7e, 0x7b, 0x6f, 0x03, 0x85, 0xff, 0xff, 0xff, 0xd3, 0xfb, 0xde, 0xdd, + 0x56, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x77, 0xef, 0x7b, 0xcb, 0x3c, 0x9f, 0xe7, 0x9c, 0x99, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x66, 0xce, 0x79, 0x3e, 0x0f, 0x87, 0xff, 0xf9, 0x33, 0xee, 0xbd, 0xb7, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x9e, 0xe7, 0x39, 0xe9, 0xef, 0x7f, 0xff, 0xfb, 0xdb, 0x9c, 0xe7, 0x79, 0x26, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xde, 0xbb, 0xce, 0x1f, 0xc3, 0xff, 0xff, 0xfb, 0xd7, 0xf7, 0xf7, 0x77, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x7f, 0xff, 0x7e, 0xfb, 0xfb, 0xff, 0xbf, 0xff, 0xff, 0xfb, 0xdb, 0xef, 0xdf, 0xbf, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc0, 0xfd, 0xfd, 0x7d, 0xfd, 0x03, 0xc3, 0xff, 0xff, 0xde, 0xf7, 0xfd, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0xf7, 0xfb, + 0xdd, 0xff, 0x7f, 0xff, 0xff, 0xdd, 0xef, 0xf7, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xdf, 0xf7, 0x3d, 0xc3, 0xff, 0xbf, 0x7d, 0xff, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x7f, 0xbf, 0xfe, 0xff, 0xfe, 0xff, 0xfa, 0xfd, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0xff, 0x7d, 0x03, 0xc3, 0xff, 0xbf, 0xfb, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdf, 0xef, 0xfd, 0xff, 0xfd, 0xff, 0xbd, 0xdf, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfb, 0x0e, 0xc1, 0xbc, 0x67, 0x5e, 0x23, 0x75, 0xae, 0xee, 0x7c, 0x3a, 0xc9, 0xcc, 0x9b, 0x9f, 0xf7, + 0xb6, 0xe7, 0x6d, 0x46, 0x3b, 0xb9, 0x73, 0xee, 0xe4, 0x16, 0xb3, 0x3d, 0x6f, 0x7b, 0xcf, 0xcf, 0x9e, 0x99, 0xe4, 0xf2, 0xb9, 0xab, 0x73, 0x25, + 0xd6, 0x33, 0xef, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x4c, 0x26, + 0x01, 0xb4, 0xed, 0x76, 0xdd, 0x16, 0x21, 0x33, 0x33, 0xcf, 0x3c, 0xf3, 0xcc, 0xcc, 0x04, 0xa4, 0x5d, 0xb7, 0xdb, 0x56, 0x81, 0x64, 0x32, 0x33, + 0x99, 0x04, 0xd0, 0xb6, 0xdb, 0x75, 0x5b, 0x84, 0xcc, 0xcc, 0x3c, 0xf3, 0xcc, 0x33, 0x33, 0x13, 0x90, 0x76, 0xdd, 0x6e, 0x5b, 0x05, 0x92, 0x09, + 0x09, 0x4c, 0x26, 0x00, 0xb9, 0xaa, 0xab, 0xaa, 0x0c, 0x30, 0x72, 0x8c, 0x39, 0xe7, 0x98, 0x91, 0x84, 0xca, 0xab, 0xd7, 0x5a, 0xdd, 0x65, 0x01, + 0x91, 0x99, 0x39, 0x32, 0x83, 0x00, 0x4a, 0xe5, 0x52, 0x01, 0x60, 0x64, 0x8e, 0xcc, 0xcc, 0x00, 0xe4, 0xea, 0x5e, 0x6b, 0xf5, 0x72, 0x09, 0xcc, + 0x98, 0x63, 0xce, 0x39, 0x46, 0x06, 0x01, 0x57, 0x55, 0x75, 0x95, 0x05, 0x20, 0x09, 0x09, 0x11, 0x49, 0xc0, 0x5d, 0xab, 0xbb, 0x0d, 0x64, 0x1e, + 0xe7, 0x71, 0x1e, 0x47, 0x26, 0xdc, 0x7b, 0xbf, 0xf6, 0x6b, 0xef, 0x36, 0x32, 0x8f, 0xe3, 0x3c, 0xce, 0x23, 0x13, 0x70, 0x77, 0xaf, 0x6a, 0x03, + 0xcc, 0x18, 0x91, 0x04, 0xdc, 0xb5, 0xba, 0xdb, 0x40, 0xe6, 0x71, 0x1e, 0xe7, 0x71, 0x64, 0xc2, 0xbd, 0xf7, 0x6b, 0xbf, 0xf6, 0x6e, 0x23, 0xf3, + 0x38, 0xce, 0xe3, 0x3c, 0x32, 0x01, 0x77, 0xf7, 0xaa, 0x36, 0xc0, 0x04, 0x0d, 0x90, 0x19, 0x40, 0xb5, 0xb4, 0xe2, 0x0a, 0x14, 0xd3, 0x34, 0x0d, + 0x39, 0x32, 0x78, 0xed, 0xdb, 0xbe, 0x2d, 0x55, 0x81, 0xf3, 0x34, 0x1e, 0xc6, 0x21, 0x07, 0xd0, 0x56, 0xfb, 0xb2, 0x94, 0x26, 0xc0, 0x21, 0xc5, + 0xc4, 0x0c, 0xa0, 0xea, 0xaa, 0x00, 0xcc, 0x29, 0xa6, 0xc0, 0x20, 0xad, 0x2c, 0x4b, 0xaf, 0x4d, 0x21, 0xe4, 0x61, 0x3c, 0x8c, 0x53, 0x66, 0xd0, + 0xba, 0x6c, 0xfb, 0xd6, 0xab, 0x03, 0xc7, 0x3c, 0x4c, 0x53, 0x8a, 0x04, 0xea, 0xa5, 0x15, 0x55, 0x00, 0x06, 0x0d, 0x30, 0x20, 0x48, 0x69, 0xad, + 0x15, 0xa0, 0x34, 0x8c, 0xf3, 0x34, 0x04, 0x29, 0xcb, 0x7e, 0xbd, 0xac, 0x8b, 0xd1, 0x30, 0x1f, 0x1f, 0x8e, 0xf3, 0x40, 0xb6, 0xac, 0x97, 0xeb, + 0xbe, 0x14, 0x09, 0xc3, 0x34, 0x8f, 0x43, 0x22, 0x28, 0xad, 0xb5, 0x22, 0x80, 0x21, 0x04, 0x04, 0x29, 0xad, 0xb5, 0x02, 0x94, 0x86, 0x71, 0x9e, + 0x86, 0x20, 0x65, 0xd9, 0xaf, 0x97, 0x75, 0x31, 0x1a, 0xe6, 0xe3, 0xc3, 0x71, 0x1e, 0xc8, 0x96, 0xf5, 0x72, 0xdd, 0x97, 0x22, 0x61, 0x98, 0xe6, + 0x71, 0x48, 0x04, 0xa5, 0xb5, 0x56, 0x04, 0x10, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0d, 0xfe, 0xb3, 0xd7, 0x6d, 0xdd, 0xf6, 0x5e, 0x55, 0x28, 0x85, 0x9c, 0x53, 0x4c, 0xcc, 0x44, 0x20, 0x62, 0xa2, 0x62, 0x66, 0x66, 0xa2, + 0x62, 0x22, 0x40, 0xc4, 0x9c, 0x62, 0xca, 0x39, 0x24, 0x12, 0xad, 0x7d, 0xdf, 0xd6, 0xad, 0x3a, 0x84, 0x3c, 0x8e, 0x87, 0x79, 0xc8, 0x4c, 0x52, + 0xbc, 0xd6, 0xe6, 0x4d, 0x55, 0x04, 0x88, 0x90, 0x98, 0x10, 0x11, 0x91, 0x98, 0x90, 0x08, 0x44, 0x54, 0x9b, 0xb7, 0x5a, 0xbd, 0x08, 0x71, 0x1e, + 0xe6, 0xc3, 0x38, 0x66, 0x11, 0xfc, 0x61, 0xbd, 0xbe, 0xbc, 0x59, 0x59, 0x3a, 0x18, 0xcf, 0x87, 0x31, 0x05, 0x45, 0x53, 0x96, 0x85, 0xb7, 0x06, + 0x10, 0xc6, 0x10, 0x64, 0x8c, 0x21, 0xc6, 0x18, 0x44, 0x8c, 0x11, 0x60, 0xac, 0x2f, 0xca, 0xb2, 0x29, 0x00, 0x8d, 0x87, 0xf3, 0xf1, 0x80, 0xda, + 0xd5, 0xcd, 0xe5, 0xba, 0x06, 0xf9, 0xfc, 0xf4, 0x68, 0xc6, 0x75, 0xbd, 0x5e, 0x2e, 0x5b, 0x09, 0x92, 0x28, 0x0d, 0x33, 0x8e, 0x11, 0x10, 0x4a, + 0x19, 0xa7, 0x94, 0x32, 0x4a, 0x29, 0x67, 0x94, 0x12, 0x00, 0x61, 0x9e, 0x85, 0x69, 0x94, 0x00, 0xd9, 0x2e, 0x97, 0xeb, 0x5a, 0xf3, 0xd9, 0xd1, + 0xe9, 0x1c, 0x15, 0x78, 0x7e, 0xe3, 0xca, 0x85, 0x22, 0x38, 0x33, 0x3f, 0x1a, 0x72, 0x8a, 0x3b, 0x1b, 0x3d, 0x91, 0x0a, 0x64, 0x52, 0x3c, 0x8b, + 0x01, 0x8a, 0x23, 0x59, 0x8e, 0xe2, 0x28, 0x86, 0xe2, 0x28, 0x8e, 0x25, 0x39, 0x0a, 0x80, 0xb1, 0x7c, 0x2a, 0x13, 0xa0, 0xc4, 0xde, 0xc6, 0x4e, + 0xd1, 0x09, 0x8d, 0xce, 0xcf, 0x80, 0xc5, 0x0b, 0x57, 0x36, 0x80, 0x91, 0x33, 0x27, 0x92, 0xde, 0xca, 0xfa, 0x66, 0x07, 0x4a, 0x0e, 0x8d, 0x04, + 0x49, 0xc9, 0xaf, 0x94, 0x74, 0xd5, 0x02, 0x18, 0x88, 0xc2, 0x20, 0x06, 0x62, 0x10, 0x06, 0x62, 0x20, 0x8c, 0x82, 0x18, 0xc0, 0x52, 0xf5, 0x52, + 0xc5, 0x97, 0xc8, 0xe0, 0xc8, 0x50, 0x12, 0xea, 0x6c, 0xae, 0xaf, 0x78, 0xc9, 0x13, 0x67, 0x00, 0x15, 0xf8, 0xfc, 0xf5, 0xaf, 0x5c, 0x08, 0x3c, + 0xf4, 0xe8, 0x5c, 0xe7, 0xea, 0x1b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0xd2, + 0x88, 0x60, 0xa6, 0xb0, 0xa4, 0xc7, 0x6d, 0x23, 0x90, 0x68, 0x34, 0x12, 0x86, 0x41, 0x30, 0x00, 0x0c, 0x04, 0x06, 0x86, 0x44, 0xa3, 0x91, 0x08, + 0x36, 0x77, 0x4f, 0x89, 0x90, 0x19, 0x3c, 0x22, 0x49, 0xb9, 0x6a, 0xa9, 0x3e, 0xf7, 0xa0, 0x29, 0xfe, 0xbb, 0x36, 0xc3, 0xce, 0x02, 0x19, 0x70, + 0xee, 0x4b, 0xaf, 0x9b, 0xf0, 0xec, 0xe4, 0x4b, 0xde, 0xa4, 0x3c, 0xed, 0x4c, 0xd8, 0xee, 0x5b, 0xf4, 0xa9, 0x53, 0xa3, 0x21, 0x3d, 0x9d, 0x55, + 0x42, 0x04, 0x91, 0x09, 0x84, 0x51, 0x00, 0x02, 0x89, 0x43, 0x22, 0x00, 0x50, 0x60, 0x40, 0x26, 0x11, 0x21, 0xac, 0xea, 0xec, 0x81, 0x44, 0x4f, + 0x4d, 0xd5, 0xdf, 0xb2, 0x1b, 0x76, 0xe6, 0x69, 0xca, 0x37, 0x5d, 0x92, 0xfc, 0xec, 0x09, 0xd7, 0xbd, 0x14, 0xf0, 0xd4, 0xf3, 0x36, 0xbc, 0xb8, + 0xf9, 0x94, 0x47, 0x31, 0x2f, 0xbb, 0xd2, 0x35, 0xfc, 0x18, 0x7e, 0xe9, 0xd2, 0x66, 0x47, 0x50, 0x68, 0x16, 0xd1, 0x20, 0x54, 0x0a, 0x4d, 0x16, + 0x00, 0x81, 0x02, 0xa1, 0x10, 0x00, 0x16, 0x93, 0x50, 0x29, 0x34, 0x10, 0xb3, 0x42, 0x83, 0x1c, 0xcd, 0x4b, 0x4b, 0xf9, 0xc7, 0x0c, 0x77, 0x5d, + 0x79, 0x19, 0xf3, 0x51, 0xa7, 0x34, 0xbf, 0x78, 0xc3, 0x79, 0x18, 0x70, 0xfa, 0xa2, 0x57, 0x63, 0x1e, 0x3e, 0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f2, 0x0d, 0x40, 0xb3, 0x41, 0xd9, 0x1c, 0xb3, 0x29, 0xac, 0xa8, 0x3c, 0x5c, 0xac, 0x85, + 0xaa, 0xce, 0x91, 0xbb, 0x7e, 0xff, 0xe0, 0x73, 0x54, 0x5d, 0x28, 0xd6, 0x70, 0xca, 0x2b, 0x2a, 0xcc, 0x96, 0xa3, 0xec, 0x06, 0x34, 0x03, 0xe4, + 0x53, 0x2b, 0xdb, 0x4e, 0x88, 0x3b, 0x55, 0x0e, 0x48, 0x04, 0x29, 0x3d, 0x3b, 0x2d, 0x1d, 0x09, 0x0a, 0x1e, 0x2e, 0x3c, 0x3e, 0x2a, 0x03, 0xc7, + 0x1a, 0xa5, 0xb4, 0x89, 0xe2, 0xa5, 0x65, 0xab, 0xd7, 0x5f, 0x66, 0x84, 0xb4, 0x35, 0x56, 0x63, 0x98, 0x91, 0x79, 0xb7, 0x56, 0x13, 0x65, 0x5d, + 0xa3, 0x37, 0xc1, 0xff, 0x5b, 0x40, 0x0b, 0xa2, 0xa5, 0xdd, 0x14, 0x28, 0xbb, 0xa5, 0x45, 0xd0, 0x02, 0x9a, 0x06, 0xac, 0xc1, 0x58, 0xb3, 0x5e, + 0xb6, 0x66, 0x6d, 0x7a, 0xcd, 0x1a, 0x83, 0x35, 0x60, 0x85, 0xff, 0xff, 0xff, 0xb8, 0x7b, 0xef, 0xbb, 0xbb, 0x8d, 0x33, 0xc9, 0x21, 0xa2, 0xa5, + 0x40, 0x86, 0x09, 0x50, 0xaa, 0x18, 0x4e, 0x32, 0x63, 0xba, 0xbb, 0xef, 0xbd, 0xbb, 0x92, 0x73, 0x9e, 0xe7, 0x73, 0xce, 0x19, 0xd3, 0xea, 0x62, + 0x48, 0x86, 0x01, 0x2c, 0x15, 0x18, 0x26, 0x21, 0xb2, 0xda, 0xc6, 0x39, 0xe7, 0x7c, 0x9e, 0xe7, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x09, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x37, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, + 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0x01, 0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0x6f, 0x00, + 0x00, 0x00, 0xe0, 0xff, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x6f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x0d, 0x00, 0x00, + 0x00, 0xfc, 0xff, 0xff, 0x05, 0x00, 0x00, 0x00, 0xfc, 0x0b, 0x00, 0x00, 0x00, 0xff, 0x04, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x04, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0x13, 0x00, 0x00, 0x3c, 0x01, 0x00, + 0xc0, 0x0b, 0x00, 0x00, 0xfc, 0x7f, 0x03, 0x00, 0x80, 0xff, 0xff, 0x17, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x17, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x17, + 0x00, 0x00, 0xf8, 0xff, 0x7f, 0x03, 0x00, 0x80, 0xff, 0x2f, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0x07, 0x00, 0x00, + 0xf8, 0xff, 0x7f, 0x02, 0x00, 0x00, 0x08, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x09, 0x00, 0xc0, 0xff, 0x4f, 0x00, 0xc0, 0x7f, + 0x00, 0x00, 0x30, 0x01, 0x00, 0x0b, 0x00, 0xf0, 0x6f, 0x00, 0x00, 0xfe, 0x7f, 0x01, 0x00, 0xfe, 0xff, 0x0b, 0x00, 0x80, 0xff, 0xff, 0x1b, 0x00, + 0xf0, 0xff, 0x7f, 0x03, 0x00, 0xfe, 0xff, 0x0b, 0x00, 0x80, 0xff, 0x5f, 0x00, 0x80, 0x7f, 0x03, 0x00, 0xb0, 0x01, 0x00, 0x07, 0x00, 0xe0, 0x3f, + 0x00, 0x00, 0xf8, 0xff, 0x09, 0x00, 0xf8, 0xff, 0x4f, 0x00, 0x00, 0x08, 0x00, 0x80, 0xff, 0x7f, 0x02, 0xc0, 0xff, 0x9f, 0x00, 0x80, 0xff, 0x4f, + 0x00, 0xf8, 0x1f, 0x00, 0xf0, 0x13, 0x00, 0x90, 0x00, 0x50, 0x00, 0xf0, 0x0b, 0x00, 0xf0, 0xbf, 0x00, 0xe0, 0xff, 0x0d, 0x00, 0xff, 0x7f, 0x01, + 0x00, 0xfe, 0xff, 0x05, 0x00, 0xff, 0xff, 0x02, 0x80, 0xff, 0xbf, 0x00, 0x00, 0xff, 0x5f, 0x00, 0xf0, 0xdf, 0x00, 0xf0, 0x0b, 0x00, 0xd0, 0x00, + 0x30, 0x00, 0xe0, 0x27, 0x00, 0xe0, 0x7f, 0x02, 0xc0, 0xff, 0x07, 0x00, 0xfc, 0xff, 0x09, 0x00, 0x08, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xfe, 0x7f, + 0x00, 0xf8, 0x7f, 0x00, 0xc0, 0xff, 0x00, 0xf0, 0x27, 0x00, 0x7c, 0x00, 0x40, 0x00, 0x30, 0x00, 0xbc, 0x01, 0xfc, 0x05, 0x00, 0xff, 0x0d, 0xe0, + 0xff, 0x06, 0x80, 0xff, 0x6f, 0x00, 0xf8, 0xff, 0x06, 0xf0, 0xff, 0x0b, 0x00, 0xfe, 0xbf, 0x00, 0xfc, 0xdf, 0x00, 0xf0, 0xdf, 0x00, 0xfe, 0x02, + 0x80, 0x37, 0x00, 0x14, 0x80, 0x04, 0x80, 0x0f, 0x00, 0x7f, 0x02, 0xc0, 0xff, 0x00, 0xf0, 0xff, 0x04, 0x80, 0xff, 0x4f, 0x00, 0x08, 0x00, 0xf0, + 0xff, 0x04, 0xf0, 0xff, 0x00, 0xf0, 0x7f, 0x00, 0xf8, 0x1f, 0x00, 0xfe, 0x04, 0xf0, 0x03, 0xc0, 0x03, 0x00, 0x01, 0x08, 0xc0, 0x0d, 0xe0, 0x1b, + 0xc0, 0xdf, 0x00, 0xfe, 0x0b, 0xc0, 0xff, 0x06, 0xf0, 0x7f, 0x03, 0xf8, 0x7f, 0x01, 0xf8, 0x7f, 0x01, 0xf8, 0xbf, 0x01, 0xfc, 0x6f, 0x00, 0xff, + 0x0d, 0xe0, 0x2f, 0x00, 0xdf, 0x00, 0x6e, 0x00, 0x06, 0x10, 0x00, 0x1e, 0x00, 0x7e, 0x00, 0xf8, 0x07, 0x80, 0xff, 0x04, 0xf0, 0x7f, 0x00, 0xf8, + 0x7f, 0x00, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x3f, 0x40, 0x87, 0x01, + 0x3a, 0x0c, 0xd0, 0x61, 0x80, 0x0e, 0xff, 0xdf, 0xa1, 0xc3, 0x00, 0x1d, 0x06, 0xe8, 0x30, 0x40, 0x87, 0xff, 0xff, 0x01, 0x3a, 0x0c, 0xd0, 0x61, + 0x80, 0x0e, 0x03, 0x74, 0xf8, 0xff, 0x0e, 0x1d, 0x06, 0xe8, 0x30, 0x40, 0x87, 0x01, 0x3a, 0xfc, 0xff, 0x0f, 0xd0, 0x61, 0x80, 0x0e, 0x03, 0x74, + 0x18, 0xa0, 0xc3, 0xff, 0x77, 0xe8, 0x30, 0x40, 0x87, 0x01, 0x3a, 0x0c, 0xd0, 0xe1, 0xff, 0x7f, 0x80, 0x0e, 0x03, 0x74, 0x18, 0xa0, 0xc3, 0x00, + 0x1d, 0xfe, 0xbf, 0x43, 0x87, 0x01, 0x3a, 0x0c, 0xd0, 0x61, 0x80, 0x0e, 0xec, 0xff, 0x3b, 0x22, 0xde, 0x10, 0xf1, 0x11, 0x11, 0x6f, 0x88, 0xf8, + 0x88, 0x88, 0x37, 0x44, 0x7c, 0x44, 0xc4, 0x1b, 0x22, 0xfe, 0xff, 0xff, 0xdf, 0x10, 0xf1, 0x86, 0x88, 0x8f, 0x88, 0x78, 0x43, 0xc4, 0x47, 0x44, + 0xbc, 0x21, 0xe2, 0x23, 0x22, 0xde, 0x10, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x11, 0x11, 0x6f, 0x88, 0xf8, 0x88, 0x88, 0x37, 0x44, 0x7c, 0x44, 0xc4, + 0x1b, 0x22, 0x3e, 0x22, 0xe2, 0x0d, 0x11, 0xff, 0xff, 0xff, 0x6f, 0x88, 0x78, 0x43, 0xc4, 0x47, 0x44, 0xbc, 0x21, 0xe2, 0x23, 0x22, 0xde, 0x10, + 0xf1, 0x11, 0x11, 0x6f, 0x88, 0x08, 0xef, 0x3f, 0x41, 0x87, 0x01, 0x3a, 0x0c, 0xd0, 0x61, 0x80, 0x0e, 0xff, 0xdf, 0xa1, 0xc3, 0x00, 0x1d, 0x06, + 0xe8, 0x30, 0x40, 0x87, 0xff, 0xff, 0x01, 0x3a, 0x0c, 0xd0, 0x61, 0x80, 0x0e, 0x03, 0x74, 0xf8, 0xff, 0x0e, 0x1d, 0x06, 0xe8, 0x30, 0x40, 0x87, + 0x01, 0x3a, 0xfc, 0xff, 0x0f, 0xd0, 0x61, 0x80, 0x0e, 0x03, 0x74, 0x18, 0xa0, 0xc3, 0xff, 0x77, 0xe8, 0x30, 0x40, 0x87, 0x01, 0x3a, 0x0c, 0xd0, + 0xe1, 0xff, 0x7f, 0x80, 0x0e, 0x03, 0x74, 0x18, 0xa0, 0xc3, 0x00, 0x1d, 0xfe, 0xbf, 0x43, 0x87, 0x01, 0x3a, 0x0c, 0xd0, 0x61, 0x80, 0x0e, 0xec, + 0x09, 0x11, 0x11, 0x11, 0xff, 0x86, 0x88, 0x88, 0x88, 0xff, 0x88, 0x88, 0x88, 0x88, 0x7f, 0x43, 0x44, 0x44, 0xc4, 0x7f, 0x44, 0x44, 0x44, 0xc4, + 0xbf, 0x21, 0x22, 0x22, 0xe2, 0x3f, 0x22, 0x22, 0x22, 0xe2, 0xdf, 0x10, 0x11, 0x11, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x88, 0x88, + 0x88, 0xf8, 0x37, 0x44, 0x44, 0x44, 0xfc, 0x47, 0x44, 0x44, 0x44, 0xfc, 0x1b, 0x22, 0x22, 0x22, 0xfe, 0x23, 0x22, 0x22, 0x22, 0xfe, 0x0d, 0x11, + 0x11, 0x11, 0xff, 0x11, 0x11, 0x11, 0x11, 0xff, 0x86, 0x88, 0x88, 0x88, 0xef, 0x3f, 0xb9, 0xfb, 0xc1, 0xdd, 0x0f, 0xee, 0x7e, 0x70, 0xf7, 0xff, + 0x77, 0x77,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00, 0x09, 0x0d, 0xfe, 0x4f, 0x6d, 0xbf, 0xde, 0xaf, 0xb7, 0xea, 0x61, 0x38, 0x1c, 0x1f, 0x4e, 0x63, 0x16, + 0x5d, 0xd7, 0xdb, 0x75, 0x5b, 0x14, 0xd3, 0x3c, 0x1f, 0xe7, 0x31, 0xa1, 0xd6, 0x75, 0xbb, 0x2c, 0xdd, 0x29, 0xc5, 0x79, 0x1c, 0xa7, 0x44, 0x52, + 0xfa, 0xb2, 0xf5, 0xe6, 0x12, 0xd2, 0x30, 0x0c, 0x39, 0xb0, 0x69, 0x6b, 0xbd, 0xba, 0x03, 0xa5, 0x90, 0x63, 0x62, 0x36, 0xf1, 0xe6, 0x5e, 0x0c, + 0x88, 0x31, 0x05, 0x64, 0x02, 0x51, 0x35, 0x35, 0x01, 0x22, 0x62, 0x42, 0x00, 0x10, 0x11, 0x01, 0x00, 0x11, 0xfc, 0x49, 0xb7, 0xbf, 0xb9, 0x58, + 0x79, 0x9c, 0xcf, 0x8f, 0xc6, 0x39, 0xf3, 0x8b, 0xfd, 0x7a, 0xd7, 0x80, 0x6c, 0x36, 0x1e, 0xe7, 0xdc, 0x75, 0xab, 0xed, 0xa6, 0x54, 0x3c, 0x9d, + 0x0d, 0x07, 0x09, 0x28, 0xda, 0xd5, 0xa2, 0x94, 0x28, 0x19, 0x4c, 0xf2, 0x08, 0xb9, 0xaa, 0xed, 0x4b, 0x2b, 0x70, 0x18, 0x87, 0x19, 0x55, 0xb6, + 0x2b, 0x2b, 0x6d, 0x58, 0x10, 0x85, 0x01, 0x25, 0xae, 0x28, 0x0a, 0xad, 0x08, 0xe5, 0x09, 0xa7, 0xc4, 0x48, 0x6d, 0xad, 0x02, 0x8c, 0x52, 0x0a, + 0x89, 0x50, 0x4a, 0x2a, 0x21, 0x08, 0x63, 0x08, 0x01, 0x21, 0x84, 0x11, 0x04, 0x00, 0x11, 0xfc, 0xd3, 0xf5, 0xcb, 0x2f, 0xee, 0x8a, 0xf0, 0xc1, + 0xe3, 0x27, 0x33, 0xb5, 0x7d, 0xf5, 0xee, 0x42, 0xa7, 0xa7, 0xcf, 0x8e, 0x07, 0x72, 0x79, 0x7f, 0xbf, 0x75, 0xe9, 0xd1, 0x83, 0xa3, 0x54, 0x2e, + 0x2f, 0xaf, 0x56, 0x2a, 0x3d, 0x38, 0x9c, 0x47, 0x76, 0x75, 0x71, 0x51, 0x9b, 0x74, 0x7c, 0x30, 0x0b, 0xec, 0x66, 0xbb, 0x2b, 0x41, 0x36, 0x9c, + 0xe6, 0x54, 0xf6, 0xab, 0x45, 0x01, 0xb2, 0xc9, 0x20, 0xa4, 0xba, 0x5b, 0x74, 0x1e, 0x05, 0x79, 0x18, 0x21, 0x59, 0x75, 0x8d, 0x44, 0x3c, 0x4b, + 0x38, 0x91, 0xbe, 0xb0, 0x0a, 0x61, 0x8e, 0x19, 0x50, 0x52, 0x3a, 0x81, 0x18, 0x64, 0x44, 0x18, 0x63, 0x00, 0x01, 0x15, 0xf8, 0xc0, 0xd2, 0xb5, + 0xfd, 0x5a, 0x62, 0xf6, 0xd8, 0x20, 0xd6, 0xbc, 0x70, 0xa3, 0x89, 0x0d, 0x9d, 0x18, 0xc5, 0x1b, 0x9b, 0xeb, 0x75, 0x23, 0x3c, 0x3c, 0x9a, 0x11, + 0x57, 0x76, 0xfb, 0x66, 0x6a, 0x6c, 0x30, 0x67, 0x54, 0xf7, 0x16, 0x6c, 0x3a, 0x3f, 0x96, 0x84, 0x3a, 0x1b, 0xfd, 0x06, 0x96, 0x1c, 0x89, 0x82, + 0x72, 0xb7, 0x5e, 0x21, 0x22, 0xe9, 0x28, 0xab, 0xd5, 0xaa, 0x1d, 0x85, 0xce, 0x05, 0x71, 0xa7, 0xd0, 0xea, 0x58, 0x60, 0x26, 0x45, 0x03, 0x6a, + 0xa5, 0xe0, 0x51, 0x74, 0x82, 0x46, 0x34, 0xdb, 0xf6, 0x08, 0x14, 0x66, 0x21, 0x49, 0x54, 0x2d, 0x81, 0x42, 0x39, 0x48, 0x91, 0x34, 0x09, 0x60, + 0x20, 0x0a, 0x31, 0x0c, 0xc5, 0x00, 0x10, 0x04, 0x15, 0xf8, 0xe8, 0xad, 0x37, 0x6f, 0x10, 0x87, 0x9e, 0x3b, 0x62, 0xdc, 0x78, 0x69, 0x1f, 0x39, + 0xf0, 0xcc, 0xb8, 0xb1, 0xfd, 0xc2, 0x2e, 0x31, 0x7e, 0x7c, 0x54, 0xd8, 0xbd, 0xba, 0x89, 0x8c, 0x9e, 0x1c, 0x34, 0xf6, 0xae, 0x6d, 0x21, 0x63, + 0xa7, 0x86, 0x8c, 0x9d, 0x2b, 0x1b, 0xc4, 0xd0, 0x81, 0x01, 0x61, 0x63, 0xb9, 0x8f, 0x0c, 0xcc, 0xc6, 0x8d, 0xf6, 0x62, 0x17, 0x09, 0xcf, 0x45, + 0x8d, 0xe6, 0x52, 0x8f, 0x88, 0x8e, 0xc4, 0x84, 0x5e, 0xbd, 0x85, 0xc4, 0xd2, 0x21, 0xa3, 0x53, 0x6d, 0x20, 0x91, 0x64, 0xc0, 0xf0, 0x6b, 0x36, + 0x11, 0x08, 0xc1, 0x82, 0x5d, 0x70, 0x11, 0x98, 0x47, 0x0d, 0x53, 0xf6, 0x10, 0x90, 0xc5, 0x04, 0xcf, 0x73, 0x08, 0x0c, 0x43, 0x04, 0x47, 0x31, + 0x10, 0x84, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x80, 0xff, 0xff, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xef, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x4c, 0x04, 0x00, 0xbe, 0x0f, 0x00, 0xf8, 0x70, 0x00, 0xe0, 0xeb, 0x00, 0x80, 0x0f, 0x07, + 0x00, 0xbe, 0x0f, 0x00, 0xf8, 0x70, 0x00, 0xe0, 0xeb, 0x00, 0x80, 0x1d, 0x00, 0xc0, 0x44, 0x00, 0x60, 0x09, 0x00, 0x30, 0x11, 0x00, 0xd8, 0x01, + 0x00, 0x4c, 0x04, 0x00, 0x96, 0x00, 0x00, 0x13, 0x01, 0x80, 0x1d, 0x00, 0xc0, 0x44, 0x00, 0x60, 0x09, 0x60, 0x22, 0x00, 0xb0, 0x03, 0x00, 0x98, + 0x08, 0x00, 0x2c, 0x01, 0x00, 0x26, 0x02, 0x00, 0x3b, 0x00, 0x80, 0x89, 0x00, 0xc0, 0x12, 0x00, 0x60, 0x22, 0x00, 0xb0, 0x03, 0x00, 0x98, 0x08, + 0x00, 0xec, 0x00, 0x00, 0x06, 0x02, 0x00, 0x3b, 0x00, 0x80, 0x89, 0x00, 0xc0, 0x0e, 0x00, 0x60, 0x20, 0x00, 0xb0, 0x03, 0x00, 0xf8, 0x3a, 0xc0, + 0x87, 0x03, 0x00, 0xdf, 0x07, 0x00, 0x4c, 0x04, 0x00, 0x26, 0x02, 0x00, 0x3b, 0x00, 0x18, 0x00, 0x98, 0x08, 0xf8, 0xbe, 0x0f, 0x07, 0x7c, 0x1d, + 0xe0, 0xc3, 0xbf, 0x0f, 0xf0, 0xe1, 0x5f, 0x07, 0xd8, 0x01, 0x98, 0xb8, 0x04, 0x30, 0x11, 0xb0, 0x63, 0x22, 0x60, 0xc9, 0x44, 0xc0, 0x0e, 0xc0, + 0xc4, 0x25, 0x80, 0x89, 0x80, 0x1d, 0x13, 0x01, 0x4b, 0x26, 0x02, 0x76, 0x00, 0x26, 0x2e, 0x01, 0x4c, 0x04, 0xec, 0x98, 0x08, 0xd8, 0x31, 0x10, + 0xb0, 0x03, 0x30, 0x71, 0x07, 0x60, 0x20, 0x60, 0xc7, 0xd7, 0x01, 0x3e, 0xfc, 0xfb, 0x00, 0x13, 0x01, 0x13, 0x77, 0x00, 0x06, 0x02, 0x76, 0x4c, + 0x04, 0xec, 0x18, 0x08, 0xd8, 0x01, 0x98, 0xb8, 0x03, 0x30, 0x10, 0xb0, 0x63, 0x22, 0x60, 0xc7, 0xf7, 0x01, 0x3e, 0x1c, 0xf0, 0x75, 0x1f, 0x0e, + 0xf8, 0x3e, 0xc0, 0x87, 0x7f, 0x1d, 0xe0, 0xc3, 0xbf, 0x0f, 0xf0, 0xe1, 0x80, 0xaf, 0xdb, 0x01, 0x98, 0x08, 0x58, 0x32, 0x11, 0xb0, 0x63, 0x22, + 0x60, 0x09, 0x60, 0xe2, 0x0e, 0xc0, 0xc4, 0x25, 0x80, 0x89, 0x1e, 0x00, 0x00, 0x60, 0xdf, 0xe1, 0xd7, 0xa5, 0x81, 0x39, 0xc8, 0x8a, 0x34, 0xda, + 0x1b, 0x7a, 0x93, 0x91, 0x45, 0x75, 0x8d, 0x1a, 0x55, 0x15, 0x93, 0x92, 0x52, 0x2f, 0xb7, 0x1e, 0x72, 0x6c, 0x64, 0x64, 0xe4, 0x19, 0x8c, 0xf8, + 0xf9, 0xf1, 0x2d, 0xf8, 0xf9, 0x25, 0xe6, 0xc9, 0xb2, 0x74, 0x98, 0x8e, 0x1d, 0x3b, 0x12, 0x77, 0x74, 0x72, 0x52, 0xaa, 0x45, 0xaf, 0xd1, 0x8b, + 0x5e, 0x43, 0xa3, 0x4a, 0x94, 0xa9, 0x29, 0x28, 0x30, 0x30, 0x12, 0xeb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c, 0xd3, 0xf0, 0xb7, 0x61, 0x1a, 0xa6, 0x61, 0x1a, 0xa6, 0x61, 0x1a, 0xa6, + 0x61, 0x1a, 0xa6, 0x61, 0xfa, 0xff, 0xef, 0xfc, 0x8f, 0xc0, 0x34, 0x4c, 0xc3, 0xf4, 0xff, 0xdf, 0xa1, 0x61, 0x9a, 0x86, 0x69, 0x98, 0x86, 0x69, + 0x98, 0x86, 0xbf, 0x0d, 0xd3, 0x30, 0x0d, 0xc1, 0xff, 0x5b, 0x40, 0x0b, 0xa2, 0xa5, 0xdd, 0x14, 0x28, 0xbb, 0xa5, 0x45, 0xd0, 0x02, 0x9a, 0x06, + 0xac, 0xc1, 0x58, 0xb3, 0x5e, 0xb6, 0x66, 0x6d, 0x7a, 0xcd, 0x1a, 0x83, 0x35, 0x60, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x2d, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x7e, 0x0b, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0xff, 0xff, 0x53, 0xb6, 0x6b, 0x2d, 0x22, 0x18, 0x31, 0xa6, 0x11, 0x8a, 0x54, + 0x8a, 0xc4, 0x21, 0xc3, 0x90, 0x21, 0x61, 0x08, 0x09, 0x00, 0xa0, 0x48, 0x51, 0x2a, 0xa5, 0xd2, 0x48, 0x18, 0x32, 0x84, 0x81, 0x38, 0xc6, 0x10, + 0x03, 0x21, 0x4c, 0x26, 0x67, 0x0e, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x97, 0x2c, 0x48, 0x14, 0x00, + 0x00, 0xa2, 0x44, 0xd3, 0x90, 0x0c, 0x09, 0x00, 0x82, 0x24, 0x23, 0x10, 0x64, 0x80, 0x04, 0x45, 0x03, 0x32, 0x20, 0x09, 0x90, 0x20, 0xc8, 0xb2, + 0xaa, 0x2c, 0x83, 0x19, 0x31, 0x98, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0xcc, 0xc8, 0x39, 0x92, 0x70, 0x77, 0x03, 0xe9, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x0b, 0x80, 0x28, 0xd1, 0x34, 0x0c, 0x0b, 0x02, 0x88, + 0x60, 0x04, 0x23, 0x18, 0x0c, 0x52, 0x94, 0x21, 0x0b, 0x06, 0x24, 0x00, 0x00, 0x00, 0x00, 0x30, 0xa4, 0xaa, 0xb5, 0xd6, 0x72, 0x1e, 0xc7, 0x9c, + 0x11, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x47, 0x1e, 0x73, 0x02, 0xab, 0x57, 0xbb, 0x0c, 0x13, 0xe9, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0x96, 0x0c, 0x11, 0xc1, 0x88, 0x60, 0x30, 0x99, 0x11, 0x19, 0x21, 0x96, 0xda, + 0xb6, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xea, 0xf5, 0x7a, 0xbf, 0x70, 0x7e, 0x7c, 0x1c, 0x63, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x46, 0xce, 0x39, 0x13, 0x55, 0xbd, 0xca, 0xb6, 0x60, 0x40, 0x82, 0x01, 0xe9, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x04, 0x40, 0x82, 0x40, 0x30, 0x72, 0x8c, 0x73, 0xa6, 0xf6, 0xde, 0xdb, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0xdf, 0x7f, 0x7d, 0xe1, 0xe7, 0x1f, 0x1f, 0xc7, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x91, 0x31, 0x32, 0x49, 0x97, 0xbb, 0x6c, 0xdb, 0x76, 0xc9, 0x16, 0x88, 0x8c, 0x20, 0xe9, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x13, 0x00, 0x10, 0x63, 0x3e, 0x7e, 0xfc, 0x91, 0xaf, 0xdf, 0xdf, 0xfb, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xfb, 0xeb, 0x5f, 0x5f, 0xf1, 0x8f, 0x3f, 0x9e, 0x73, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x30, 0x23, 0x48, 0xd9, 0xe5, 0x76, 0x55, 0xa9, 0x00, 0x46, 0x32, 0x18, 0x24, 0x00, 0x00, 0x00, 0x00, + 0xed, 0xff, 0xff, 0xff, 0xd7, 0xff, 0xff, 0xff, 0x9f, 0x21, 0x8f, 0x8f, 0x9f, 0xf9, 0xfd, 0xdb, 0xda, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xf5, 0xf5, 0xde, 0xe3, 0xe1, 0x34, 0x04, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x42, 0x44, 0x0c, 0x84, 0x22, 0x6a, 0x6e, 0xae, 0xaa, 0xae, 0x2a, 0xc2, 0x18, 0x02, 0x32, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xf7, 0xff, 0xfd, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0xdd, 0xef, 0xdb, 0xf3, 0xf1, 0x38, 0x72, 0x90, 0x01, 0x22, 0xc8, 0x1c, 0x99, 0x33, 0x50, 0xd5, 0xed, 0x96, + 0x0c, 0x09, 0x56, 0xd7, 0xbe, 0xef, 0xe6, 0xf9, 0xf9, 0x98, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3f, + 0xff, 0x1f, +}; diff --git a/tests/app_contract_test.c b/tests/app_contract_test.c index 932da441..c9c01d29 100644 --- a/tests/app_contract_test.c +++ b/tests/app_contract_test.c @@ -136,12 +136,13 @@ static int32_t v14_at(const uint8_t *r) { return (int32_t)(r[0] | r[1] << 7) - 8 /* ------------------------------------------------------------------ the frozen tables */ /* the engine byte: numbers fixed for good, new engines appended. The names INFO sends (the display may differ) */ static const char *const ENGINE_NAMES[16] = {"ANALOG", "-", "PHASE", "MATH", "-", "VOICE", "-", "WHEEL", - "STRING", "-", "DRUM", "WEST", "FM6", "ADD", "ANIMAL", "EXT"}; + "STRING", "WAVE", "DRUM", "WEST", "FM6", "ADD", "ANIMAL", "EXT"}; /* the app's own table (Fm1Link Fm1State.engineName, VisFeed ENG): the number of each engine it names */ static const struct { uint32_t id; const engine_t *e; const char *app; } APP_ENGINES[] = { {0, &ENG_ANALOG, "ANALOG"}, {2, &ENG_PHASE, "PHASE"}, {3, &ENG_LOFI, "LOFI"}, {5, &ENG_FORMANT, "VOICE"}, {7, &ENG_WHEEL, "WHEEL"}, {10, &ENG_DRUM, "DRUM"}, {11, &ENG_WEST, "WEST"}, {12, &ENG_FM6, "FM6"}, {14, &ENG_ANIMAL, "ANIMAL"}, {8, &ENG_STRING, "STRING"}, {13, &ENG_ADD, "ADD"}, {15, &ENG_INPUT, "EXT"}, + {9, &ENG_WAVE, "WAVE"}, /* (WAVE) the reserved 9 (PHYS, retired before 1.0): the app names it by INFO */ }; /* the contract's command numbers (frozen) and the app's parameter ids */ enum { C_INFO = 1, C_GET = 2, C_SET = 3, C_WATCH = 22, C_CHANGED = 23, C_RELOAD = 24, C_PING = 25, C_TRACK = 27, @@ -171,7 +172,7 @@ static int contract_constants(void) ED_MENU[APP_MO_INDEX][1] == APP_MO_ID && ED_MENU[APP_MO_INDEX][0] == MI_MIDIOUT && MO_ALL == APP_MO_ALL); for (i = 0; i < NENGINES; i++) same &= !strcmp(ENGINES[i]->name, ENGINE_NAMES[i]); - ok("engine id table: 0 ANALOG 2 PHASE 3 MATH 5 VOICE 7 WHEEL 8 STRING 10 DRUM 11 WEST 12 FM6 13 ADD 14 ANIMAL 15 EXT", same); + ok("engine id table: 0 ANALOG 2 PHASE 3 MATH 5 VOICE 7 WHEEL 8 STRING 9 WAVE 10 DRUM 11 WEST 12 FM6 13 ADD 14 ANIMAL 15 EXT", same); { uint32_t pc = 0, k = 0; for (i = 0; i < NENG_SHOWN && ENGINE_PC_ORDER[i] != ENGI_WEST; i++) @@ -188,9 +189,9 @@ static int contract_constants(void) ok("every engine the app names is at the number it uses (3 is the LOFI engine, shown as MATH)", same); same = 1; for (i = 0; i < NENGINES; i++) /* the reserved numbers stay reserved */ - if (i == 1 || i == 4 || i == 6 || i == 9) + if (i == 1 || i == 4 || i == 6) /* (WAVE: 9 is WAVE's, PHYS's old data gated: upreset.c, project.c) */ same &= ENGINES[i]->name[0] == '-' && !ENGINES[i]->npresets; - ok("reserved engine numbers 1 4 6 9: named '-', no presets", same); + ok("reserved engine numbers 1 4 6: named '-', no presets", same); return 0; } diff --git a/tests/cpu_lines_test.c b/tests/cpu_lines_test.c index 71cd0e8e..b2a493f2 100644 --- a/tests/cpu_lines_test.c +++ b/tests/cpu_lines_test.c @@ -91,6 +91,22 @@ static uint32_t scene(uint32_t mask, uint32_t nblk) } #endif } + if (mask == 0x0fu) { /* (WAVE) its three synths WAVE, their chords and steps kept: its + * heaviest (FORMANT: B mixed, three voices a note), SUPERSAW, + * FM GROWL (WARP FM) */ + static const char *const PRE[3] = {"FORMANT", "SUPERSAW", "FM GROWL"}; + uint32_t k, j; + for (k = 0; k < 3u; k++) { + static step_t keep[NSTEP]; + for (j = 0; j < ENG_WAVE.npresets && strcmp(ENG_WAVE.presets[j].name, PRE[k]); j++) + ; + memcpy(keep, trk[k].step, sizeof keep); + set_engine_of(&trk[k], ENGI_WAVE); + apply_preset_to(&trk[k], j); + memcpy(trk[k].step, keep, sizeof keep); + trk[k].p[P_VOICE] = V_POLY; trk[k].p[P_SLEN] = 32; trk[k].p[P_SGATE] = 120; + } + } } song.master_q12 = 4096; if (getenv("CL_OTT")) { /* (V10.8.71, as JIANT BYTE's) every track's OTT at this DEPTH (the diff --git a/tests/cpu_lines_test.py b/tests/cpu_lines_test.py index f7febcc0..f3745337 100644 --- a/tests/cpu_lines_test.py +++ b/tests/cpu_lines_test.py @@ -27,7 +27,8 @@ HOSTMAP = {"mix_part": "mix_part_m0", "mix_part_m": "mix_part_m", "fx_run": "fx_ NAMES = {"101": "GEN EXPLORE s123 + CLOUD, delay, chorus", "102": "GEN EXPLORE s7 DANCE", "103": "GEN genre 7 s42", "104": "GEN genre 12 s2024 DANCE", "105": "GEN EXPLORE s999", "106": "GEN EXPLORE s321 CALM", "107": "GEN genre 3 s77 DANCE", "108": "GEN NEO CLASSIC s5 CALM", "0c": "CPU TEST's song, TRACKS 4", - "0d": "0c, its synths MATH (B02 F28 F12)", "0e": "0d, two MATH USER (B03, F20)"} + "0d": "0c, its synths MATH (B02 F28 F12)", "0e": "0d, two MATH USER (B03, F20)", + "0f": "0c, its synths WAVE (FORMANT SUPERSAW FM GROWL)"} def sh(*a, **k): diff --git a/tests/cpu_vg.c b/tests/cpu_vg.c index a287686c..a38ac402 100644 --- a/tests/cpu_vg.c +++ b/tests/cpu_vg.c @@ -138,7 +138,8 @@ int main(void) { static const struct { const char *eng, *pre; uint32_t notes; } E[] = { {"ANALOG", "FAT BASS", 8}, {"PHASE", "STRING", 8}, {"LOFI", "BYTE BENT", 8}, {"VOICE", "WOW BASS", 4}, - {"WHEEL", "ROCK DRIVE", 8}, {"DRUM", "", 8}, {"WEST", "METAL", 8}, {"FM6", "BRASS", 8}, {"ANIMAL", "ROAR", 8}}; + {"WHEEL", "ROCK DRIVE", 8}, {"DRUM", "", 8}, {"WEST", "METAL", 8}, {"FM6", "BRASS", 8}, {"ANIMAL", "ROAR", 8}, + {"WAVE", "FORMANT", 8}}; /* (WAVE: its heaviest, B mixed, three voices a note) */ static const int16_t AM[AN_NMODE][8] = { /* (0.8.3) ANIMAL's modes, every option on, no gaps */ {AN_CMOS, 127, 127, 64, 63, 127, 0, 40}, {AN_PULSE, 127, 127, 26, 63, 127, 0, 22}, {AN_WHSTL, 127, 127, 40, 63, 127, 0, 22}, {AN_WING, 127, 127, 64, 63, 127, 0, 22}, diff --git a/tests/golden.txt b/tests/golden.txt index 12e7d501..3521236d 100644 --- a/tests/golden.txt +++ b/tests/golden.txt @@ -96,6 +96,32 @@ preset/STRING/12_FEEDBACK b78462ab35bc4a90 preset/STRING/13_SHOEGAZE 0782f7b15c2c15ac preset/STRING/14_SQUEAL 96c0098a0a8ab5fd preset/STRING/15_EBOW 134e78637570dfd2 +preset/WAVE/00_INIT_WAVE bcd01f14d86aa7ac +preset/WAVE/01_FM_KEYS a194948bca83015b +preset/WAVE/02_SAW_PAD 58cd1af523d3b4cd +preset/WAVE/03_SYNC_LEAD 07b433990c20f88e +preset/WAVE/04_SUB_BASS ab4cea2daebff148 +preset/WAVE/05_BIT_TABLE 86333b91a781be0f +preset/WAVE/06_FM_BELL 2ad1f25e4dc8e64c +preset/WAVE/07_FORMANT 8d92c7c5b0cc9472 +preset/WAVE/08_REESE 8861b33d46b36179 +preset/WAVE/09_ACID_BASS 68fdd1da8c2cfa60 +preset/WAVE/10_FM_GROWL 588329f39ba4a000 +preset/WAVE/11_808_BOOM 9aad2d573529b48a +preset/WAVE/12_WOBBLE a9c63e295a984328 +preset/WAVE/13_SWEEP_PAD 964a4404204de246 +preset/WAVE/14_MORPH_PAD 02bcf3fcb2aedd42 +preset/WAVE/15_GLASS_PAD 1bb61ef259d710b0 +preset/WAVE/16_PWM_STRNG e690f949ec03f696 +preset/WAVE/17_SUPERSAW c10b2f76451e80a1 +preset/WAVE/18_SHIMMER 554ae094f637e35b +preset/WAVE/19_DARK_DRONE 3e3352c31ecf9285 +preset/WAVE/20_FM_PLUCK af1034e73d085183 +preset/WAVE/21_METAL_PLK 938ea1319f8f0fad +preset/WAVE/22_YAH_LEAD 27acc3324714837d +preset/WAVE/23_CHIME 55e6ea1d156737bf +preset/WAVE/24_NOISE_RISE 639536bd64ffe43f +preset/WAVE/25_HYPER_SAW eb4a042ce1574873 preset/DRUM/00_DRUM-X 844d508621e58708 preset/DRUM/01_909_CLUB 3bde38a87e953d39 preset/DRUM/02_808_BOOM eb28c43758a6baa2 diff --git a/tests/project_test.c b/tests/project_test.c index 448946d4..e90e7e03 100644 --- a/tests/project_test.c +++ b/tests/project_test.c @@ -343,7 +343,9 @@ int main(void) ok = proj_pack(&gs, &g); memcpy(&ps0, &gs, sizeof gs); ok = ok && !proj_import(&h, &gs, sizeof gs) && proj_sl_found == 2 && !memcmp(&ps0, &gs, sizeof gs) && - !eng_ok(ENGI_PHYS) && eng_ok(ENGI_STRING) && eng_ok(ENGI_ADD) && !eng_ok(ENGI_SAMPLE) && eng_live(ENGI_PHYS) == ENGI_PHYS_TO; + eng_ok(ENGI_STRING) && eng_ok(ENGI_ADD) && !eng_ok(ENGI_SAMPLE) && eng_live(ENGI_SAMPLE) == ENGI_PHYS_TO && + eng_ok(ENGI_WAVE) && eng_live(ENGI_WAVE) == ENGI_WAVE; /* (WAVE: 9 is WAVE's now; a PHYS track of a + * project of before, phys below PROJ_WAVE, still refused) */ bad += check("V10.8.51: SAMPLE and PHYS tracks (retired before V10.7): refused as old (OPEN IN STUDIO), the bytes untouched", ok); } { /* (JIANT 0.6) FUNC: six tracks in FUNB's 3840 bytes, only the steps that are not empty stored */ diff --git a/tests/target_budget.py b/tests/target_budget.py index ed344bbf..b645e479 100644 --- a/tests/target_budget.py +++ b/tests/target_budget.py @@ -35,6 +35,7 @@ FUNCS = ["analog_render", "digital_render", "digital_render_legacy", "digital_re "dly_lo", # (0.8.4) the delay at half / a quarter rate (fx.c) "animal_render", # (JIANT 0.8.3) ANIMAL (eng_animal.c): its five sources (one loop a voice) "string_render", "add_render", # (0.9.9-snd5) STRING (its loop at 1 / 2^d), ADD (nine partials) + "wave_render", "wave_block", # (WAVE) its tables read, the frames decoded into the line "formant_word_render", "formant_block", # (JIANT 0.8.5) VOICE singing words (eng_formant.c, sing.c) "djf_block", # (0.9.1) the master DJ FILTER (fx.c), while it is off the middle "eq_block", # (p9) the master EQ (fx.c), while a band is off 0 diff --git a/tests/target_budget.txt b/tests/target_budget.txt index c1d610a9..8a16fe57 100644 --- a/tests/target_budget.txt +++ b/tests/target_budget.txt @@ -48,6 +48,8 @@ dly_lo 2351 animal_render 731 string_render 225 add_render 300 +wave_render 2762 +wave_block 1841 formant_word_render 384 formant_block 55 djf_block 199 diff --git a/tests/ui_test.c b/tests/ui_test.c index 5dc970d5..3ce8476c 100644 --- a/tests/ui_test.c +++ b/tests/ui_test.c @@ -6388,8 +6388,9 @@ static int test_fm6_charts(void) static int test_fm4_retired(void) { int bad = 0, ok = 1; - uint32_t i, k, e, total, seen = 0, all = ((1u << NENGINES) - 1u) & ~(1u << ENGI_DIGITAL) & ~(1u << ENGI_PHYS) & - ~(1u << ENGI_SAMPLE) & ~(1u << ENGI_TRIO); /* (0.9.9-snd5: GRAIN's 8 and SLICE's 13 are STRING and ADD) */ + uint32_t i, k, e, total, seen = 0, all = ((1u << NENGINES) - 1u) & ~(1u << ENGI_DIGITAL) & + ~(1u << ENGI_SAMPLE) & ~(1u << ENGI_TRIO); /* (0.9.9-snd5: GRAIN's 8 and SLICE's 13 are STRING and ADD; WAVE 9, + * PHYS's) */ int16_t p[P_COUNT]; uint8_t v[FP_SIZE + 1u]; ui_power_on(); @@ -6401,8 +6402,8 @@ static int test_fm4_retired(void) if (e < NENGINES) seen |= 1u << e; } - bad += check("PRESETS: the list holds every engine's presets but the retired ones' (DIGITAL PHYS SAMPLE TRIO)", - seen == all && NENG_SHOWN == NENGINES - 4u); + bad += check("PRESETS: the list holds every engine's presets but the retired ones' (DIGITAL SAMPLE TRIO)", + seen == all && NENG_SHOWN == NENGINES - 3u); go_page(GR_BROWSE); set_engine_of(TSEL, 0); for (i = 0, seen = 0; i < NENG_SHOWN; i++) { @@ -6413,10 +6414,11 @@ static int test_fm4_retired(void) seen == all && TSEL->eng_req == 0u && eng_step(0, 1) == ENGI_PHASE && eng_step(ENGI_FM6, 1) == ENGI_VOICE && eng_step(ENGI_FM6, -1) == ENGI_PHASE && eng_step(0, -1) == ENGI_DRUM && eng_step(ENGI_DRUM, 1) == 0u && eng_step(ENGI_VOICE, 1) == ENGI_ANIMAL && eng_step(ENGI_ANIMAL, 1) == ENGI_LOFI && eng_step(ENGI_DRUM, -1) == ENGI_INPUT && eng_step(ENGI_WEST, 1) == ENGI_STRING && - eng_step(ENGI_STRING, 1) == ENGI_ADD && eng_step(ENGI_ADD, 1) == ENGI_INPUT && eng_step(ENGI_INPUT, 1) == ENGI_DRUM); /* (V10.54: INPUT last) */ + eng_step(ENGI_STRING, 1) == ENGI_ADD && eng_step(ENGI_ADD, 1) == ENGI_WAVE && eng_step(ENGI_WAVE, 1) == ENGI_INPUT && + eng_step(ENGI_INPUT, 1) == ENGI_DRUM); /* (V10.54: INPUT last; WAVE before it) */ { /* the display order (engines.c ENGINE_ORDER, 0.9.9): every engine one can pick once; the PRESETS list follows it * (was ANALOG FM6 PHASE LOFI VOICE WHEEL NOISE DRUM ANIMAL: test_engine_order_099 has PROGRAM CHANGE's) */ - static const char *const ORDER[] = {"DRUM", "ANALOG", "PHASE", "FM6", "VOICE", "ANIMAL", "MATH", "WHEEL", "WEST", "STRING", "ADD", "EXT"}; + static const char *const ORDER[] = {"DRUM", "ANALOG", "PHASE", "FM6", "VOICE", "ANIMAL", "MATH", "WHEEL", "WEST", "STRING", "ADD", "WAVE", "EXT"}; uint32_t last = 0xFFu, r = 0, n = 0; ok = NENG_SHOWN == NELEM(ORDER); for (i = 0; ok && i < NENG_SHOWN; i++) @@ -6431,7 +6433,7 @@ static int test_fm4_retired(void) last = e; r++; } - bad += check("engines shown DRUM ANALOG PHASE FM6 VOICE ANIMAL MATH WHEEL NOISE STRING ADD EXT (ENGINE_ORDER); PRESETS lists them so", + bad += check("engines shown DRUM ANALOG PHASE FM6 VOICE ANIMAL MATH WHEEL NOISE STRING ADD WAVE EXT (ENGINE_ORDER); PRESETS lists them so", ok && r == NENG_SHOWN); } /* a user preset stored with engine 1: kept as it is, it loads as FM6 with the init patch (V10.6s) */ @@ -11979,6 +11981,8 @@ static int test_style(void) * in the settings' export), the panel applied at once with its banner; AUTO B only for the late-2026 flash */ persist_t p, q; uint8_t was = lcd_pnl; + memset(&p, 0, sizeof p); /* (export keeps the bold field's old value: not the stack's) */ + memset(&q, 0, sizeof q); ok = menu_get(MI_LCD) == 0u && str_eq(menu_vname(MI_LCD, 0), "AUTO") && str_eq(menu_vname(MI_LCD, 2), "B"); menu_put(MI_LCD, 2u); ok &= menu_get(MI_LCD) == 2u && (lcd_pnl & 3u) == 2u && host_panel == 1 && str_eq(ui.msg, "PANEL B"); @@ -13822,13 +13826,13 @@ static int test_power_on_099(void) * saved on 0.9.8's parts loads as it was saved, whatever the power-on */ static int test_engine_order_099(void) { - static const char *const IDX[NENGINES] = {"ANALOG", 0, "PHASE", "MATH", "-", "VOICE", "-", "WHEEL", "STRING", "-", "DRUM", + static const char *const IDX[NENGINES] = {"ANALOG", 0, "PHASE", "MATH", "-", "VOICE", "-", "WHEEL", "STRING", "WAVE", "DRUM", "WEST", "FM6", "ADD", "ANIMAL"}; static const char *const PC[] = {"ANALOG", "FM6", #if FELUCCA_FM4 "DIGITAL", #endif - "PHASE", "MATH", "VOICE", "WHEEL", "WEST", "DRUM", "ANIMAL", "STRING", "ADD", "EXT"}; /* (V10.54) */ + "PHASE", "MATH", "VOICE", "WHEEL", "WEST", "DRUM", "ANIMAL", "STRING", "ADD", "EXT", "WAVE"}; /* (V10.54; WAVE after) */ int bad = 0, ok = 1; uint32_t i, e, k, n, all, seen = 0; project_store_t st; diff --git a/tests/v23_editing_test.c b/tests/v23_editing_test.c index 7e71bc82..1ae90170 100644 --- a/tests/v23_editing_test.c +++ b/tests/v23_editing_test.c @@ -72,7 +72,7 @@ int main(void) bad+=check("drum cursor previews the selected lane only",note_gate(DRUM_LANE_NOTE[2])&&!note_gate(DRUM_LANE_NOTE[0])); edit_reset();prefs_rev=4;ui_prefs|=PREF_LARGE;prefs_update(); /* (V10.7.73, the owner: LARGE off, CLICK REC, COUNT-IN 1 BAR, once) */ - bad+=check("settings migrate once: LARGE off, CLICK REC, COUNT-IN 1 BAR",prefs_rev==6&&!(ui_prefs&PREF_LARGE)&&rp_get(RP_CLICK)==1u&&rp_get(RP_COUNTIN)==1u); + bad+=check("settings migrate once: LARGE off, CLICK REC, COUNT-IN 1 BAR",prefs_rev==7&&!(ui_prefs&PREF_LARGE)&&rp_get(RP_CLICK)==1u&&rp_get(RP_COUNTIN)==1u); ui_prefs&=~PREF_LARGE;prefs_update(); bad+=check("later compact-type choice is respected",!(ui_prefs&PREF_LARGE)); bad+=test_rec_layer(); diff --git a/tests/wave_test.c b/tests/wave_test.c new file mode 100644 index 00000000..11b4b559 --- /dev/null +++ b/tests/wave_test.c @@ -0,0 +1,470 @@ +/* SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */ +/* WAVE (src/eng_wave.c, engine 9: JIANT BYTE's wavetables) on the host, on the real sources (ui_test.c's). + * build/host/wave_test + * 1. the tables: each of the 16 factory tables decoded (wv_step, the audio's own) is the generator's, frame for frame + * (wave_tables.h WT_HASH_INIT: tools/gen_wave_tables.py's FNV of the eight frames it means); SINE is a sine; a part + * playing A and B has them in its line. + * 2. every value is heard: POS, MIX (with B), WARP (each of SYNC BEND MIRROR QUANT FM, and AMT in it), DETUNE, SUB, A and + * B change the sound; B unheard at MIX 0 (no change at all); a note renders the same twice. + * 3. no clicks: POS swept over the eight frames, MIX swept, a WARP's AMT swept, against the same note held still (the + * largest second difference no larger); A changed under a held note (a dip and back, no step); a COMB TYPE asked + * for on a sounding WAVE part (it plays BP: the line is the tables'). + * 4. an empty user slot (U1..U8: none stored) plays SINE, silently: A and B alike. + * 5. the line shared: tables in, the part STRING for a while (its lines over WAVE's), WAVE again: the tables back, + * byte for byte; the part asleep meanwhile: kept. + * 6. bounded: every preset, 8 notes at velocity 127 (LEVEL 127): no voice sum past full scale, no mix sample clipped, + * DC under 2 % (BYTE's tables as BYTE has them: some frames of FORMT SATUR NOISE carry 10 .. 20 % of DC, which the + * master's DC blocker takes out, as BYTE's). + * 7. PHYS's old data (engine 9 before WAVE): a user preset record of before (version < 4) plays as ANALOG as before; one + * of today stays WAVE; a project with a WAVE track is written with phys 4 and opens; the same bytes as phys 3 (a + * PHYS project of before) are refused as before; a project without WAVE keeps phys 3. + * 8. cost: ns a sample and voice on this host, WAVE's heaviest setting against ANALOG's SAW LEAD (printed). */ +#define UI_TEST_NO_MAIN 1 +#include "ui_test.c" + +static int bad; +static void ck(const char *what, int ok) +{ + printf("wave: %-100s %s\n", what, ok ? "ok" : "FAIL"); + bad += !ok; +} +static uint32_t wfnv(uint32_t h, const void *p, uint32_t n) +{ + const uint8_t *b = (const uint8_t *)p; + while (n--) + h = (h ^ *b++) * 16777619u; + return h; +} + +#define NS (FS / 4u) /* a quarter second */ +static int16_t base_e[8] = {1, 40, WW_OFF, 0, 4, 0, 0, 0}; /* FM2 at POS 40, B SAWSQ unheard */ + +static void setup(const int16_t *e) +{ + uint32_t i; + memset(trk, 0, sizeof trk); + memset(wv, 0, sizeof wv); + memset(tf_ic1, 0, sizeof tf_ic1), memset(tf_ic2, 0, sizeof tf_ic2), memset(tf_on, 0, sizeof tf_on); /* (the part's + * filter from rest: each render as the first) */ + memset(tf_ft, 0, sizeof tf_ft), memset(tf_xb, 0, sizeof tf_xb), memset(tf_fo, 0, sizeof tf_fo); + memset(tf_cmb, 0, sizeof tf_cmb), memset(drift_clk, 0, sizeof drift_clk); + host_tracks_init(); + host_preset(&trk[0], ENGI_WAVE, 0); + for (i = 0; i < 8u; i++) + trk[0].p[P_E0 + i] = e[i]; + trk[0].p[P_ATK] = 0; + trk[0].p[P_SUS] = 127; + trk[0].p[P_REL] = 10; + trk[0].p[P_ED_FLT] = 0; + trk[0].p[P_FCUT] = 127; + trk[0].p[P_LD_FLT] = trk[0].p[P_LD_SHP] = trk[0].p[P_LD_PIT] = trk[0].p[P_LD_AMP] = 0; + trk[0].p[P_M1SRC] = trk[0].p[P_M2SRC] = trk[0].p[P_M3SRC] = trk[0].p[P_M4SRC] = 0; + trk[0].p[P_VOICE] = V_POLY; + trk[0].p[P_CHOR] = trk[0].p[P_DLY] = trk[0].p[P_REV] = trk[0].p[P_DIST] = 0; + for (i = 0; i < 8u; i++) + trk[0].pe_old[i] = trk[0].p[P_E0 + i]; +} +/* one block of part 0 as the audio runs it (the engine's switch, then the part) */ +static void block(int32_t *b) +{ + engine_block(&trk[0]); + track_render(&trk[0], b, CTL); +} +/* n samples of one note (the tables in first: a few blocks before the note) into y; per block, hook(k) may move a value */ +static void render(const int16_t *e, uint32_t note, double *y, uint32_t n, void (*hook)(uint32_t k, uint32_t nb)) +{ + static int32_t b[CTL]; + uint32_t i, k; + setup(e); + for (i = 0; i < 8u; i++) + block(b); + trk_note_on(&trk[0], note, 100); + for (i = 0; i < 4u; i++) /* (past the attack's first blocks) */ + block(b); + for (i = 0; i < n; i += CTL) { + if (hook) + hook(i / CTL, n / CTL); + block(b); + for (k = 0; k < CTL && i + k < n; k++) + y[i + k] = b[k] / 32768.0; + } +} +static double rms(const double *y, uint32_t n) +{ + double s = 0; + uint32_t i; + for (i = 0; i < n; i++) + s += y[i] * y[i]; + return sqrt(s / (n ? n : 1)); +} +static double rdiff(const double *a, const double *b, uint32_t n) /* the difference's rms over a's */ +{ + double s = 0; + uint32_t i; + for (i = 0; i < n; i++) + s += (a[i] - b[i]) * (a[i] - b[i]); + return sqrt(s / n) / (rms(a, n) + 1e-12); +} +static double d2max(const double *y, uint32_t n) /* the largest second difference (a click's mark) */ +{ + double m = 0; + uint32_t i; + for (i = 2; i < n; i++) { + double d = fabs(y[i] - 2 * y[i - 1] + y[i - 2]); + m = d > m ? d : m; + } + return m; +} + +/* ------------------------------------------------------------ 1. the tables --- */ +static void test_tables(void) +{ + static const uint32_t H[WT_NF] = WT_HASH_INIT; + static int8_t F[WV_HALF]; + static int32_t b[CTL]; + uint32_t f, s, ok = 1, i; + double c = 0, a = 0, q = 0; + for (f = 0; f < WT_NF; f++) { + memset(F, 0x55, sizeof F); + for (s = 0; s < 16u && !wv_step(F, f, s); s++) + ; + ok &= s < 16u && wfnv(2166136261u, F, sizeof F) == H[f]; + } + ck("each of the 16 factory tables decoded is the generator's (tools/gen_wave_tables.py, BYTE main 94f8ac9)", ok); + for (s = 0; !wv_step(F, 0, s); s++) + ; + for (i = 0; i < WV_FN; i++) { + double r = sin(2 * M_PI * i / WV_FN); + c += F[i] * r, a += (double)F[i] * F[i], q += r * r; + } + ck("SINE is a sine (correlation > 0.999, peak 120..127)", c / sqrt(a * q) > 0.999 && F[32] >= 120); + { + int16_t e[8] = {7, 0, 0, 0, 12, 0, 0, 0}; /* A FOLD, B FORMT */ + static int8_t G[WV_HALF]; + setup(e); + for (i = 0; i < 8u; i++) + block(b); + for (s = 0; !wv_step(F, 7, s); s++) + ; + for (s = 0; !wv_step(G, 12, s); s++) + ; + ck("a part's line holds its A and B (FOLD, FORMT) as decoded, after a few blocks", + wv_ready(&wv[0]) && !memcmp(comb_buf[0], F, WV_HALF) && !memcmp((int8_t *)comb_buf[0] + WV_HALF, G, WV_HALF)); + } +} + +/* ------------------------------------------------------------ 2. every value is heard --- */ +static void test_values(void) +{ + static double y0[NS], y1[NS]; + static const char *const NM[8] = {"A", "POS", "WARP", "AMT", "B", "MIX", "DETUNE", "SUB"}; + int16_t e[8]; + uint32_t k, w; + char what[160]; + render(base_e, 45, y0, NS, 0); + render(base_e, 45, y1, NS, 0); + ck("a note renders the same twice", !memcmp(y0, y1, sizeof y0) && rms(y0, NS) > 0.02); + { + static const struct { uint32_t k; int16_t v, mix, warp; } CH[] = { + {0, 9, 0, 0}, {1, 110, 0, 0}, {4, 13, 100, 0}, {5, 100, 0, 0}, {6, 60, 0, 0}, {7, 100, 0, 0}}; + for (k = 0; k < NELEM(CH); k++) { + double d; + memcpy(e, base_e, sizeof e); + e[CH[k].k] = CH[k].v; + if (CH[k].mix) + e[5] = CH[k].mix; + render(e, 45, y1, NS, 0); + if (CH[k].k == 4u) { /* (B: against the same MIX with the first B) */ + int16_t e2[8]; + memcpy(e2, base_e, sizeof e2); + e2[5] = CH[k].mix; + render(e2, 45, y0, NS, 0); + } else + render(base_e, 45, y0, NS, 0); + d = rdiff(y0, y1, NS); + snprintf(what, sizeof what, "%s heard (%s %d: %.0f %% of the sound changed)", NM[CH[k].k], NM[CH[k].k], CH[k].v, 100 * d); + ck(what, d > 0.05 && rms(y1, NS) > 0.02); + } + } + render(base_e, 45, y0, NS, 0); + for (w = WW_SYNC; w < WW_N; w++) { + double d, da; + memcpy(e, base_e, sizeof e); + e[2] = (int16_t)w; + e[3] = 80; + render(e, 45, y1, NS, 0); + d = rdiff(y0, y1, NS); + e[3] = 30; + { + static double y2[NS]; + render(e, 45, y2, NS, 0); + da = rdiff(y1, y2, NS); + } + snprintf(what, sizeof what, "WARP %s heard (AMT 80: %.0f %% changed; its AMT 30 against 80: %.0f %%)", + N_WWARP[w], 100 * d, 100 * da); + ck(what, d > 0.05 && da > 0.02); + } + memcpy(e, base_e, sizeof e); + e[4] = 13; /* B NOISE, MIX 0 */ + render(e, 45, y1, NS, 0); + ck("B unheard at MIX 0 (WARP OFF): the same samples", !memcmp(y0, y1, sizeof y0)); +} + +/* ------------------------------------------------------------ 3. no clicks --- */ +static int16_t sweep_k; /* the value the hook sweeps */ +static void sweep(uint32_t k, uint32_t nb) { trk[0].p[P_E0 + sweep_k] = (int16_t)(127u * k / (nb - 1u)); } +static int16_t change_v; +static void change(uint32_t k, uint32_t nb) { if (k == nb / 2u) trk[0].p[P_E0] = change_v; } +static void comb_on(uint32_t k, uint32_t nb) { if (k == nb / 2u) trk[0].p[P_FTYPE] = FT_COMB; } +static void test_clicks(void) +{ + static double y[NS * 4], z[NS * 4]; + static const struct { uint32_t k; int16_t a, warp, mix; const char *what; } SW[] = { + {1, 1, WW_OFF, 0, "POS swept 0 .. 127 over FM2's eight frames"}, + {1, 2, WW_OFF, 0, "POS swept over FMR's"}, + {1, 4, WW_OFF, 0, "POS swept over SAWSQ's (two kept, the six between their blend)"}, + {5, 1, WW_OFF, 0, "MIX swept A .. B"}, + {3, 1, WW_SYNC, 0, "SYNC's AMT swept"}, + {3, 1, WW_BEND, 0, "BEND's AMT swept"}, + {3, 1, WW_FM, 50, "FM's AMT swept (B into A's phase, MIX 50)"}}; + uint32_t k, j; + char what[200]; + for (k = 0; k < NELEM(SW); k++) { + int16_t e[8] = {SW[k].a, 0, SW[k].warp, 0, 6, SW[k].mix, 0, 0}; + double still = 0, sw; + for (j = 0; j <= 8u; j++) { /* the note held still at nine places of the sweep */ + e[SW[k].k] = (int16_t)(j * 127u / 8u); + render(e, 40, z, NS, 0); + still = d2max(z, NS) > still ? d2max(z, NS) : still; + } + sweep_k = (int16_t)SW[k].k; + render(e, 40, y, NS * 4, sweep); + sw = d2max(y, NS * 4); + snprintf(what, sizeof what, "no click: %s in 1 s (largest 2nd difference %.4f, held still %.4f)", SW[k].what, sw, still); + ck(what, sw <= still * 1.1 + 1e-4); + } + { + int16_t e[8] = {1, 60, 0, 0, 4, 0, 0, 0}; + double still, ch; + render(e, 40, z, NS * 2, 0); + still = d2max(z, NS * 2); + change_v = 8; /* A FM2 -> ODD under the note */ + render(e, 40, y, NS * 2, change); + ch = d2max(y, NS * 2); + snprintf(what, sizeof what, "no click: A changed under a held note (a dip and back: %.4f, held %.4f), it sounds after", + ch, still); + ck(what, ch <= still * 1.1 + 1e-4 && rms(y + NS * 2 - NS / 4, NS / 4) > 0.02); + render(e, 40, y, NS * 2, comb_on); + ch = d2max(y, NS * 2); + snprintf(what, sizeof what, "a COMB TYPE asked for on a sounding WAVE part: BP, no click (%.4f), the tables kept", ch); + ck(what, trk[0].p[P_FTYPE] == FT_BP && ch <= still * 1.1 + 1e-4 && wv_ready(&wv[0]) && + rms(y + NS * 2 - NS / 4, NS / 4) > 0.005); + } +} + +/* ------------------------------------------------------------ 4. empty user slots --- */ +static void test_fallback(void) +{ + static double y0[NS], y1[NS]; + int16_t e[8]; + uint32_t u, ok = 1; + memcpy(e, base_e, sizeof e); + e[0] = 0; + render(e, 52, y0, NS, 0); + for (u = 0; u < WV_NU; u++) { + e[0] = (int16_t)(WT_NF + u); + render(e, 52, y1, NS, 0); + ok &= !memcmp(y0, y1, sizeof y0); + } + ck("an empty user slot U1..U8 as A plays SINE, the same samples", ok && rms(y0, NS) > 0.02); + memcpy(e, base_e, sizeof e); + e[4] = 0, e[5] = 90; + render(e, 52, y0, NS, 0); + e[4] = WT_NF + 3; + render(e, 52, y1, NS, 0); + ck("an empty user slot as B plays SINE too (MIX 90)", !memcmp(y0, y1, sizeof y0)); + ck("U1..U8 named (A's list: the 16 factory names, then U1..U8)", + !strcmp(N_WAVEF[0], "SINE") && !strcmp(N_WAVEF[15], "SATUR") && !strcmp(N_WAVEF[16], "U1") && + !strcmp(N_WAVEF[23], "U8") && ENG_WAVE.edit[0].max == 23); +} + +/* ------------------------------------------------------------ 5. the line shared --- */ +static void test_shared(void) +{ + static int32_t b[CTL]; + static int8_t keep[2 * WV_HALF]; + int16_t e[8] = {2, 30, 0, 0, 10, 50, 0, 0}; /* FMR, STEP */ + uint32_t i, ok; + setup(e); + for (i = 0; i < 8u; i++) + block(b); + memcpy(keep, comb_buf[0], sizeof keep); + host_preset_req(&trk[0], ENGI_STRING, 0); /* STRING: its lines over WAVE's */ + for (i = 0; i < 4u; i++) + block(b); + for (i = 0; i < 4u; i++) + trk_note_on(&trk[0], (uint8_t)(40 + 7 * i), 110); + for (i = 0; i < 200u; i++) + block(b); + ok = trk[0].engine == ENGI_STRING && memcmp(keep, comb_buf[0], sizeof keep); + for (i = 0; i < 4u; i++) + trk_note_off(&trk[0], (uint8_t)(40 + 7 * i)); + host_preset_req(&trk[0], ENGI_WAVE, 0); + for (i = 0; i < 8u; i++) + trk[0].p[P_E0 + i] = e[i]; + for (i = 0; i < 400u && !(trk[0].engine == ENGI_WAVE && wv_ready(&wv[0])); i++) + block(b); + block(b); + ck("STRING played in the part's line, then WAVE again: its tables back, byte for byte", + ok && trk[0].engine == ENGI_WAVE && wv_ready(&wv[0]) && !memcmp(keep, comb_buf[0], sizeof keep)); + trk[0].p[P_FTYPE] = FT_COMB; /* the COMB's own start (as if it ran: its line cleared) */ + memset(comb_buf[0], 0, sizeof comb_buf[0]); + block(b); + ok = !wv_ready(&wv[0]) && trk[0].p[P_FTYPE] == FT_BP; + for (i = 0; i < 8u; i++) + block(b); + ck("the line cleared under WAVE (the COMB's start): seen at the next block, decoded again", ok && wv_ready(&wv[0]) && + !memcmp(keep, comb_buf[0], sizeof keep)); +} + +/* ------------------------------------------------------------ 6. bounded --- */ +static void test_bounded(void) +{ + static int32_t o[2 * CTL], b[CTL]; + uint32_t pi, i, k, j, ok = 1, okv = 1, okdc = 1; + for (pi = 0; pi < ENG_WAVE.npresets; pi++) { + int32_t peak = 0, vpk = 0; + double sum = 0; + uint32_t nb = FS / 2u / CTL; + memset(trk, 0, sizeof trk); + memset(wv, 0, sizeof wv); + host_tracks_init(); + host_preset(&trk[0], ENGI_WAVE, pi); + trk[0].p[P_LEVEL] = 127; + for (i = 0; i < 4u; i++) + mix_block(o, CTL); + for (k = 0; k < 8u; k++) + trk_note_on(&trk[0], (uint8_t)(24u + k * 12u > 120u ? 120u : 24u + k * 12u), 127); + for (i = 0; i < nb; i++) { + mix_block(o, CTL); + for (j = 0; j < 2u * CTL; j++) + peak = abs(o[j]) > peak ? abs(o[j]) : peak; + } + memset(trk, 0, sizeof trk); + memset(wv, 0, sizeof wv); + host_tracks_init(); + host_preset(&trk[0], ENGI_WAVE, pi); + for (i = 0; i < 8u; i++) + trk[0].pe_old[i] = trk[0].p[P_E0 + i]; + for (i = 0; i < 4u; i++) + block(b); + for (k = 0; k < 8u; k++) + trk_note_on(&trk[0], (uint8_t)(24u + k * 12u > 120u ? 120u : 24u + k * 12u), 127); + for (i = 0; i < nb; i++) { + block(b); + for (j = 0; j < CTL; j++) { + vpk = abs(b[j]) > vpk ? abs(b[j]) : vpk; + sum += b[j]; + } + } + ok &= peak < 32767; + okv &= vpk < 8 * 2 * 32768; + okdc &= fabs(sum / (nb * CTL)) < 0.02 * 32768 * 8; + if (peak >= 32767 || vpk >= 8 * 2 * 32768 || fabs(sum / (nb * CTL)) >= 0.02 * 32768 * 8) + printf("wave: %s: mix peak %d, voices %d, mean %.0f\n", ENG_WAVE.presets[pi].name, peak, vpk, sum / (nb * CTL)); + } + ck("every preset, 8 notes at velocity 127, LEVEL 127: no mix sample at full scale", ok); + ck(" the voices' sum within 2 x full scale a voice; DC under 2 % (BYTE's own: FORMT SATUR NOISE frames carry up to 20 %)", + okv && okdc); +} + +/* ------------------------------------------------------------ 7. PHYS's old data --- */ +static void test_old(void) +{ + static up_rec_t r; + static project_store_t st; + static project_t q, back; + uint32_t sum; + memset(&r, 0, sizeof r); + r.used = UP_USED, r.ver = 2u, r.engine = ENGI_PHYS, r.np = 8u; + memcpy(r.name, "OLD PHYS", 8); + up_migrate(&r); + ck("a user preset of before (version 2) with engine 9: PHYS's, plays as ANALOG as before", eng_live(r.engine) == ENGI_ANALOG); + memset(&r, 0, sizeof r); + r.used = UP_USED, r.ver = UP_VER, r.engine = ENGI_WAVE, r.np = P_COUNT; + memcpy(r.name, "MY WAVE", 7); + up_migrate(&r); + ck(" one of today (version 4) with engine 9: WAVE", r.engine == ENGI_WAVE && eng_live(r.engine) == ENGI_WAVE); + ui_power_on(); + host_preset(&trk[1], ENGI_WAVE, 3); + project_capture(&q); + ck("a project with a WAVE track is written with phys 4 and opens, the track WAVE", + q.phys == 4u && proj_pack(&st, &q) && st.raw[64] == 4u && proj_import(&back, &st, sizeof st) && + back.t[1].engine == ENGI_WAVE && back.t[1].p[P_E0] == ENG_WAVE.presets[3].e[0]); + st.raw[64] = 3u; + sum = proj_hash(st.raw, sizeof st.raw - 4u); + memcpy(st.raw + sizeof st.raw - 4u, &sum, sizeof sum); + ck(" the same bytes as phys 3 (engine 9 PHYS's, before WAVE): refused as before (OPEN IN STUDIO)", + !proj_import(&back, &st, sizeof st) && proj_sl_found == 2); + host_preset(&trk[1], ENGI_ANALOG, 0); + project_capture(&q); + ck("a project without WAVE keeps phys 3 (its bytes as before)", q.phys == 3u && proj_pack(&st, &q) && st.raw[64] == 3u); +} + +/* ------------------------------------------------------------ 8. cost --- */ +static double ns_voice(uint32_t e, const int16_t *ev, uint32_t pi) +{ + static int32_t b[CTL]; + uint32_t i, k, nb = FS / CTL, nv = 8; + uint64_t t0; + memset(trk, 0, sizeof trk); + memset(wv, 0, sizeof wv); + host_tracks_init(); + host_preset(&trk[0], e, pi); + if (ev) + for (i = 0; i < 8u; i++) + trk[0].p[P_E0 + i] = ev[i]; + for (i = 0; i < 8u; i++) + trk[0].pe_old[i] = trk[0].p[P_E0 + i]; + trk[0].p[P_VOICE] = V_POLY; + trk[0].p[P_SUS] = 127; + for (i = 0; i < 8u; i++) + block(b); + for (k = 0; k < nv; k++) + trk_note_on(&trk[0], (uint8_t)(36 + 5 * k), 100); + for (i = 0; i < 8u; i++) + block(b); + t0 = now_ns(); + for (i = 0; i < nb; i++) + block(b); + return (double)(now_ns() - t0) / (nb * CTL) / nv; +} +static void test_cost(void) +{ + static const int16_t heavy[8] = {1, 64, WW_FM, 80, 4, 64, 60, 60}; /* FM warp, MIX, three voices, SUB */ + static const int16_t plain[8] = {1, 64, WW_OFF, 0, 4, 0, 0, 0}; + double a = 1e9, w = 1e9, h = 1e9, x; + uint32_t r; + for (r = 0; r < 5u; r++) { /* (the best of five: the host's noise out) */ + x = ns_voice(ENGI_ANALOG, 0, 0); a = x < a ? x : a; + x = ns_voice(ENGI_WAVE, plain, 0); w = x < w ? x : w; + x = ns_voice(ENGI_WAVE, heavy, 0); h = x < h ? x : h; + } + printf("wave: cost, ns a sample and voice on this host: ANALOG SAW LEAD %.1f, WAVE one table %.1f (%.2f x), " + "WAVE FM + MIX + DETUNE + SUB %.1f (%.2f x)\n", a, w, w / a, h, h / a); +} + +int main(void) +{ + test_tables(); + test_values(); + test_clicks(); + test_fallback(); + test_shared(); + test_bounded(); + test_old(); + test_cost(); + printf("wave: %s (%d failed)\n", bad ? "FAILED" : "all passed", bad); + return bad != 0; +} diff --git a/tools/audio_map.txt b/tools/audio_map.txt index 415f392c..ad9e9f0d 100644 --- a/tools/audio_map.txt +++ b/tools/audio_map.txt @@ -34,7 +34,7 @@ animal_init 136 text animal_note_on 32 text * an_mode animal_render 3806 text * an_exp2n an_inc apply_preset 72 text apply_preset_to drum_elsewhere trk_eng tsel_p ui_message -apply_preset_to 548 text eng_gone fm6_adopt fm6_load_slot load_begin param_kept trk_eng trk_engp trk_index tsel_p +apply_preset_to 548 text fm6_adopt fm6_load_slot load_begin param_kept trk_eng trk_engp trk_index tsel_p arp_chord 176 text rec_note rec_on seq_note_on trk_index tvel arp_chord_off 50 text rec_release seq_note_off arp_off 68 text arp_chord_off rec_on rec_release seq_note_off @@ -399,10 +399,10 @@ edit_param 4694 text accel act_cols bt_hw_seg chain_busy comp_knob confirm_open edit_recallable 12 text project_recall_slot empty_column 22 text enc_drop 18 text panel_enc -eng_gone 26 text eng_idx 8 text -eng_live 32 text eng_gone eng_ok -eng_ok 30 text eng_gone +eng_live 32 text eng_ok +eng_ok 24 text +eng_phys_old 20 text eng_rank 34 text eng_live eng_vis 24 text eng_voice_weight 48 text @@ -452,9 +452,10 @@ face_has 46 text fold glyph_at fam_on 52 text fault_flags 32 text fm1_clk_320 fault_tail 370 text crash_code draw_text_line fm1__p33_op hexs str_cpy +fav_row 24 text fav_rows_new 46 text memset -favorite_has 72 text -favorite_set 122 text favorite_has +favorite_has 84 text fav_row +favorite_set 142 text fav_row favorite_has fg_next 98 text rng fg_play 396 text fg_release rng scale_steps seq_note_on seq_src trk_chance trk_kit tvel fg_release 38 text seq_note_off @@ -503,7 +504,7 @@ fm1_irq_off 4 text fm1_irq_on 6 text fm1_lcd_wait 48 text fm1_led_dim_level 40 text -fm1_main 9500 text ! autosave_poll autosave_sig bg_energy boot_splash bt_get bt_hw_seg bt_prox_tick bt_set bt_start chain_defaults chain_valid cpu_clock cpu_lost cv_begin cv_blit cv_text dbg_boot dlg_on draw_confirm draw_text_box ed_service fav_rows_new favorite_set fl_far fm1__sr_bits fm1_adc_read fm1_audio_stop fm1_delay_ms fm1_enter_uboot fm1_guard_enable fm1_guard_lock_top fm1_led_dim_level fm1_mc_hold fm1_wdt_feed fm6_init fvb_boot fxg_chorus fxg_delay fxg_dist fxg_master fxg_reverb graph_adsr graph_eco graph_lfo home_param home_vis irq_save jam_load lcd_init lcd_panel_apply lcd_panel_is_b lcd_power lcd_sync ly_word macro_dice master_lvl master_poll memcpy memset mx_defaults name_on og_cos og_sin ota_crc16 ota_erase ota_fread ota_jl_enc ota_memeq ota_prog ota_rd16 ota_rd32 ota_read ota_reply_identity ota_show ota_take ota_unstage ota_wr16 ota_wr32 ott_defaults palette_to_stored panel_init panel_setup param_format power_sound_of proj_bound proj_fetch proj_import project_restore_runtime scr_fill scr_get scr_holes scr_wake scr_wake_now seg_missing seq_counting settings_import settings_init settings_poll settings_save song_index_load song_mode_restore song_poll splash_at split_cut split_track st_load steps_sig str_cpy str_len str_nth sy_entry track_defaults track_defaults_steps uh_task ui_draw_body ui_input ui_leds ui_message up_bank_check up_used upf_empty upf_valid usb_detach usb_serial_apply usb_start vc_io vis_new vis_pick vr vx_animal vx_draw +fm1_main 9540 text ! autosave_poll autosave_sig bg_energy boot_splash bt_get bt_hw_seg bt_prox_tick bt_set bt_start chain_defaults chain_valid cpu_clock cpu_lost cv_begin cv_blit cv_text dbg_boot dlg_on draw_confirm draw_text_box ed_service fav_rows_new favorite_set fl_far fm1__sr_bits fm1_adc_read fm1_audio_stop fm1_delay_ms fm1_enter_uboot fm1_guard_enable fm1_guard_lock_top fm1_led_dim_level fm1_mc_hold fm1_wdt_feed fm6_init fvb_boot fxg_chorus fxg_delay fxg_dist fxg_master fxg_reverb graph_adsr graph_eco graph_lfo home_param home_vis irq_save jam_load lcd_init lcd_panel_apply lcd_panel_is_b lcd_power lcd_sync ly_word macro_dice master_lvl master_poll memcpy memset mx_defaults name_on og_cos og_sin ota_crc16 ota_erase ota_fread ota_jl_enc ota_memeq ota_prog ota_rd16 ota_rd32 ota_read ota_reply_identity ota_show ota_take ota_unstage ota_wr16 ota_wr32 ott_defaults palette_to_stored panel_init panel_setup param_format power_sound_of proj_bound proj_fetch proj_import project_restore_runtime scr_fill scr_get scr_holes scr_wake scr_wake_now seg_missing seq_counting settings_import settings_init settings_poll settings_save song_index_load song_mode_restore song_poll splash_at split_cut split_track st_load steps_sig str_cpy str_len str_nth sy_entry track_defaults track_defaults_steps uh_task ui_draw_body ui_input ui_leds ui_message up_bank_check up_used upf_empty upf_valid usb_detach usb_serial_apply usb_start vc_io vis_new vis_pick vr vx_animal vx_draw fm1_mc_hold 120 text fm1_mc_park 96 text fm1_mc_hold fm1_p33_read 68 text fm1__p33_xfer @@ -1088,7 +1089,7 @@ mod_dst_name 50 text bt_hw_seg mod_dst_name_bt 176 bt clamp eng_idx mod_dst_ok track_desc mod_dst_offer 32 text bt_hw_seg mod_dst_offer_bt 92 bt eng_idx mod_dst_ok -mod_dst_ok 280 bt eng_idx track_desc +mod_dst_ok 296 bt eng_idx track_desc mod_dst_scope 62 text mod_end 66 text mod_midi 54 text @@ -1351,7 +1352,7 @@ preset_at 82 text list_get preset_all_at preset_all_pos preset_in preset_favorite 42 text tsel_p user_of preset_go 152 text apply_preset preset_at select_engine trk_engp tsel_p up_has_pat up_load up_pat_rank user_of preset_in 82 text favorite_has list_get -preset_order 204 text +preset_order 224 text preset_pos 92 text list_get preset_all_at preset_all_pos preset_in preset_rank 42 text preset_order preset_step 136 text cur_page list_get preset_go preset_pos ui_message ui_say @@ -1374,7 +1375,7 @@ proj_fm_kept 62 text memcmp proj_get 40 text memcpy proj_at proj_gl_used 42 text proj_hash 30 text -proj_import 152 text eng_gone memcpy proj_engines_ok proj_fm4 proj_ok proj_phys_gone proj_unpack_c +proj_import 172 text eng_phys_old memcpy proj_engines_ok proj_fm4 proj_ok proj_phys_gone proj_unpack_c proj_lyr_len 24 text proj_master_put 402 text clay_pack memcpy ott_get proj_mx_put proj_mf_tracks 54 text @@ -1398,7 +1399,7 @@ proj_store_len 38 text proj_sum 8 text proj_tp 144 text proj_unpack_c 4368 text chain_valid clay_pack dx_kit_ok memcpy memset motion_valid mu_algo_in mu_check mx_defaults param_store_def params_by_count proj_at proj_bits proj_eq proj_get proj_hash proj_mx_put proj_name_get proj_pdef proj_split_ok proj_sum proj_tp step_set_ratchet -project_capture 828 text fit_valid fm6_pack memcpy memset mom_base motion_base_value motion_djf_value motion_guard proj_master_put proj_sum str_len +project_capture 840 text fit_valid fm6_pack memcpy memset mom_base motion_base_value motion_djf_value motion_guard proj_master_put proj_sum str_len project_cur_name 12 text project_load 122 text proj_bound proj_fetch proj_import project_restore_runtime project_name 58 text proj_import proj_name_get @@ -1519,7 +1520,7 @@ seq_step 5152 text ! arp_owner cg_near chord_auto cp_order drum_note_lane glide_ seq_stop 268 text ! arp_off fg_reset memset mo_clock_on mo_flush_of mo_send motion_restore seq_release srec_stop seq_unit 68 text set_engine 16 text tsel_p -set_engine_of 102 text apply_preset_to eng_gone load_begin +set_engine_of 106 text apply_preset_to load_begin settings_export 142 text memcpy palette_to_stored settings_fix15 78 text settings_import 456 text memcpy memset palette_from_stored palette_to_stored settings_fix15 @@ -1577,7 +1578,7 @@ song_save_as 730 text bt_hw_seg chain_valid fmt_int memcpy memset proj_err proj_ song_save_tail 196 bt chain_defaults memcpy memset song_saved_index 110 text memcpy st_load song_select 316 text jam_load memcpy memset proj_fetch project_used section_load song_flush song_index_load song_index_save song_mode_restore song_name transport_busy ui_message ui_say -song_stage 1820 text eng_live fit_valid fm6_sanitize fm6_unpack memcpy memset param_desc_of param_fit proj_import proj_steps row_src row_var +song_stage 1824 text eng_live fit_valid fm6_sanitize fm6_unpack memcpy memset param_desc_of param_fit proj_import proj_steps row_src row_var sound_name 74 text str_cpy trk_engp user_of sound_put 338 text dx_kit_ok dx_take fm6_adopt fm6_set_patch fm6_unpack load_begin load_end memcpy param_desc_of param_fit param_kept proj_fm4 proj_phys_gone tsel_p sp_chain 56 text @@ -1771,7 +1772,7 @@ uh_task 418 bt uh_connect uh_host_up uh_hub_port_probe uh_hub_status uh_session_ uh_wait 40 bt fm1_wdt_feed ui_draw_body 1254 text as_mix bt_hw_seg cursor_fix cv_begin cv_blit cv_key_hint cv_keycap cv_text dlg_on dlg_tabs draw_columns draw_confirm draw_countin draw_foot draw_frame draw_graph draw_head draw_layer draw_menu draw_tabs draw_text_box fill_around fmt_int gen_cards_bt kh_ink lcd_sync lz_on name_on nm_card nm_draw_panel nm_len_max nv_page page_entered page_first page_flash_draw page_visible scr_fill seg_screen str_cat str_cpy transport_busy ui_timers ui_input 554 text beat_samples chain_busy eu_mutate gen_tick str_cat str_cpy str_len str_nth track_desc tsel_p ui_input_frame ui_preview_ok ui_say -ui_input_frame 15608 text accel act_col act_cols act_do act_ready apply_preset apply_preset_to black_held bn_set bt_cal_tick bt_hw_seg bt_prox_input bt_prox_ok btn_hold btn_used chain_busy chain_defaults chain_play_ui chord_peek ckeys_on clay_clear clip_launch comp_any comp_legacy comp_migrate confirm_open cp_copy cp_held cp_say cur_page cursor_fix cursor_set dlg_on drum_elsewhere edit_param enc_drop eng_gone ent_commit ent_message eu_anchor eu_gen eu_mutate eu_of ev_len excite_turn fm1_input_edges fm4_apply fm6_bank_slot fm6_load_slot fm6_neutral fm6_pack fm6_set_patch fm6_slot_ok fm6_unpack fmt_cat fmt_int fx_macro_back gen_knob_bt gen_on gen_page gen_press go_home grid_acc grid_hit grid_on home_life home_macros home_param home_vis init_sound_of jam_end jam_load kb_map key_black key_place keys_mode knob_cap kx_frame layer_allowed layer_held layer_key layer_let_go layer_open layer_opened layer_set_open layer_tap live_rec_sel load_begin load_end lock_held lock_id ly_avail ly_bit ly_down ly_page lyr_set macro_dice memcpy memset menu_close menu_put menu_scroll_max menu_set menu_step menu_tab ml_poll mom_knob mom_poll motion_base_value motion_capture motion_clear motion_desc motion_lock_get motion_set_lock motion_thin_id mtab_first mtab_rows name_close name_on name_open nav_button nav_go nav_key nav_mem nav_put nav_sec nav_select nm_black nm_commit nm_do nm_group nm_insert oct_key open_family page_desc page_first page_go page_tap panel_btn_of panel_enc panel_setup param_turn part_dice pk_load pk_per pk_shape pke_knob_bt pke_oct pke_sel_bt preset_all_at_in preset_all_pos preset_at preset_go preset_pos preset_step project_recall_slot project_recall_sound project_rename project_save_as rec_clear_auto rec_first rec_set rec_tap rng row_copy rp_apply rp_get sc_beat sc_dice scr_wake sec_of_fam section_ask section_jump section_keep sel_set seq_counting seq_is_empty seq_sel set_engine set_engine_of skeys_on song_draft_begin song_erase_parts song_idx_touch song_save_as song_select step_accents_of step_lanes_of str_cat str_cpy str_len sy_gen_word system_init take_busy tl_keys tools_key track_defaults_steps track_desc track_select transport_busy trk_base4 trk_engp trk_index trk_slot tsel_p ui_message ui_say undo_mark undo_sound up_load up_ui up_ui_named usb_serial_apply vis_new +ui_input_frame 15610 text accel act_col act_cols act_do act_ready apply_preset apply_preset_to black_held bn_set bt_cal_tick bt_hw_seg bt_prox_input bt_prox_ok btn_hold btn_used chain_busy chain_defaults chain_play_ui chord_peek ckeys_on clay_clear clip_launch comp_any comp_legacy comp_migrate confirm_open cp_copy cp_held cp_say cur_page cursor_fix cursor_set dlg_on drum_elsewhere edit_param enc_drop ent_commit ent_message eu_anchor eu_gen eu_mutate eu_of ev_len excite_turn fm1_input_edges fm4_apply fm6_bank_slot fm6_load_slot fm6_neutral fm6_pack fm6_set_patch fm6_slot_ok fm6_unpack fmt_cat fmt_int fx_macro_back gen_knob_bt gen_on gen_page gen_press go_home grid_acc grid_hit grid_on home_life home_macros home_param home_vis init_sound_of jam_end jam_load kb_map key_black key_place keys_mode knob_cap kx_frame layer_allowed layer_held layer_key layer_let_go layer_open layer_opened layer_set_open layer_tap live_rec_sel load_begin load_end lock_held lock_id ly_avail ly_bit ly_down ly_page lyr_set macro_dice memcpy memset menu_close menu_put menu_scroll_max menu_set menu_step menu_tab ml_poll mom_knob mom_poll motion_base_value motion_capture motion_clear motion_desc motion_lock_get motion_set_lock motion_thin_id mtab_first mtab_rows name_close name_on name_open nav_button nav_go nav_key nav_mem nav_put nav_sec nav_select nm_black nm_commit nm_do nm_group nm_insert oct_key open_family page_desc page_first page_go page_tap panel_btn_of panel_enc panel_setup param_turn part_dice pk_load pk_per pk_shape pke_knob_bt pke_oct pke_sel_bt preset_all_at_in preset_all_pos preset_at preset_go preset_pos preset_step project_recall_slot project_recall_sound project_rename project_save_as rec_clear_auto rec_first rec_set rec_tap rng row_copy rp_apply rp_get sc_beat sc_dice scr_wake sec_of_fam section_ask section_jump section_keep sel_set seq_counting seq_is_empty seq_sel set_engine set_engine_of skeys_on song_draft_begin song_erase_parts song_idx_touch song_save_as song_select step_accents_of step_lanes_of str_cat str_cpy str_len sy_gen_word system_init take_busy tl_keys tools_key track_defaults_steps track_desc track_select transport_busy trk_base4 trk_engp trk_index trk_slot tsel_p ui_message ui_say undo_mark undo_sound up_load up_ui up_ui_named usb_serial_apply vis_new ui_leds 3862 text ! act_cols act_ready beat_samples black_held bt_prox_ok chain_busy click_beat_len cur_page dx_lane_muted edit_recallable fm1_led_dim_level glo_sounding grid_on kb_map key_black key_place layer_btn layer_set_open led_put menu_get menu_step midi_note_held name_on nm_black perf_avail perf_key project_used rec_clearable rp_get scale_mask seq_counting seq_src step_accents_of step_lanes_of trk_index tsel_p ui_message 10 text ui_preview 72 text tsel_p ui_preview_ok @@ -1794,8 +1795,8 @@ up_bank_check 160 text memset up_grid up_migrate up_pat_norm up_valid up_engine 14 text up_rec up_grid 22 text up_has_pat 42 text up_rec up_used -up_load 540 text eng_gone fm4_apply fm6_adopt fm6_set_patch fm6_unpack gz_get load_begin load_end lyr_set memcmp memcpy ott_put param_kept set_engine_of trk_slot tsel_p up_rec up_used up_values upf_get upf_tag upf_valid -up_migrate 154 text up_set_value up_valid up_value west_from_noise +up_load 542 text fm4_apply fm6_adopt fm6_set_patch fm6_unpack gz_get load_begin load_end lyr_set memcmp memcpy ott_put param_kept set_engine_of trk_slot tsel_p up_rec up_used up_values upf_get upf_tag upf_valid +up_migrate 174 text eng_phys_old up_set_value up_valid up_value west_from_noise up_name 52 text up_rec up_name_ok 38 text up_parse 392 c2 memcpy memset up_migrate up_name_ok up_pat_norm up_set_value @@ -1924,6 +1925,9 @@ vx_west 978 text str_nth vx_age vx_bface vx_col vx_fall vx_level vx_line vx_poly vx_wf 62 text og_sin vx_wv 180 text og_sin vx_line vx_x2 50 text +wave_block 930 text * wv_bits wv_sig wv_whole +wave_note_on 18 text * +wave_render 1594 text * wv_read west_F 74 text west_exp2n 48 text west_from_noise 72 text @@ -1932,3 +1936,7 @@ west_render 2172 text * west_F west_exp2n wheel_block 590 text * drw_dust_pick drw_level trk_slot wheel_note_on 190 text * trk_slot wheel_render 954 text * drw_dust trk_slot +wv_bits 56 text +wv_read 110 text +wv_sig 46 text +wv_whole 42 text diff --git a/tools/build.py b/tools/build.py index 13014ccd..3da6464f 100644 --- a/tools/build.py +++ b/tools/build.py @@ -424,11 +424,16 @@ def late_fns(): return names -def late_tables(): +# (WAVE) the files whose tables' compound literals (a preset's MODS) go out of .rodata with them: an engine added since +# the layout was recorded (the older ones' literals sit among the sound's recorded tables, where they stay) +LATE_LIT_FILES = ("eng_wave.c",) + + +def late_tables(files=None): """the generator's own constant tables (gen.c, gen_tables.c): out of .rodata like the UI's recorded ones ('n'), so a new one never moves the sound's merged constants after .rodata""" names = set() - for f in ("gen.c", "gen_tables.c", "eng_string.c", "eng_add.c", "ui_engvis.c", "ui_tools.c"): # (V10.8.52: SEQ EDIT's) # (0.9.9-snd5: the two engines' own + for f in files or ("gen.c", "gen_tables.c", "eng_string.c", "eng_add.c", "eng_wave.c", "wave_tables.h", "ui_engvis.c", "ui_tools.c"): # (V10.8.52: SEQ EDIT's) # (0.9.9-snd5: the two engines' own # tables and descriptors, the creatures' new ones: out of .rodata too, the sound's tables where they were) txt = (FW / "src" / f).read_text() names |= set(re.findall(r"^static const [^=;(]*?\b(\w+)\s*\[", txt, flags=re.M)) @@ -610,6 +615,10 @@ def build_app(): aligns[m.group(2)] = int(m.group(4)) return f'{m.group(1)}, section ".rodata.n.{m.group(2)}"{m.group(3)}' ir, n, saved = share_strings(hot_ir) + owners = late_tables(LATE_LIT_FILES) - tables # (WAVE) their compound literals late with them + for m in re.finditer(r'^@"?([\w.]+)"? = [^\n]*$', ir, flags=re.M): + if m[1] in owners: + late.update(re.findall(r'@"?(\.compoundliteral[\w.]*)', m[0])) if os.environ.get("FELUCCA_CONSTDIV") != "0": ir, nd = const_divs(ir) print(f"divisions: {nd} by a constant turned into multiplies (DIV_FNS)", flush=True) diff --git a/tools/gen_wave_tables.c b/tools/gen_wave_tables.c new file mode 100644 index 00000000..634ea37b --- /dev/null +++ b/tools/gen_wave_tables.c @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-3.0-only + * Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */ +/* WAVE's factory tables (firmware/src/eng_wave.c): JIANT BYTE's 16 wave formulas evaluated by BYTE's own formula + * machine, exactly as BYTE's eng_wave.c draws its frames (wf_build: 128 points a frame, the phase w = i x 512, t = 0, + * no state, POS as FIX = POS (Q8) x 516 >> 8, the result >> 1 as int16), at the eight positions of FM's fixed grid + * (frame k at POS = k x 127 / 7, Q8 rounded). It prints the frames as text, one frame a line (16 x 8 lines of 128 + * int16); tools/gen_wave_tables.py packs them into firmware/src/wave_tables.h. + * + * Built against a JIANT BYTE checkout (GPL, the same owner; only to regenerate the header, CI never needs it): + * cc -O2 -I$BYTE/build/gen -I$BYTE/tests -I$BYTE/firmware/src -o build/host/gen_wave_tables tools/gen_wave_tables.c -lm + * (BYTE's build/gen: its generated headers, from BYTE's own build). Reproduces BYTE main 94f8ac9 (v1.2.1); it checks + * that the formula bank BYTE's device compiles (fvm_bank.c, FVM_WAVE0..) holds the texts of eng_wave.c */ +#include +#define main hostsim_main +#include "hostsim.c" +#undef main +#include "fvm.c" +#include "fvm_bank.c" + +static const char *const TEXT[16] = {WAVE_W00_TEXT, WAVE_W01_TEXT, WAVE_W02_TEXT, WAVE_W03_TEXT, WAVE_W04_TEXT, + WAVE_W05_TEXT, WAVE_W06_TEXT, WAVE_W07_TEXT, WAVE_W08_TEXT, WAVE_W09_TEXT, + WAVE_W10_TEXT, WAVE_W11_TEXT, WAVE_W12_TEXT, WAVE_W13_TEXT, WAVE_W14_TEXT, + WAVE_W15_TEXT}; +static fvm_cc_t cc; +static fvm_scratch_t scr; +static fvm_ins_t ins[FVM_MAXINS]; + +int main(void) +{ + uint32_t f, k, i, b; + for (f = 0; f < 16u; f++) { + static char tx[512]; + fvm_prog_t p = {0}; + fvm_err_t er; + fvm_bank_to(FVM_WAVE0 + f, tx); + if (strcmp(tx, TEXT[f])) { + fprintf(stderr, "wave %u: the bank's text \"%s\" is not eng_wave.c's \"%s\"\n", f, tx, TEXT[f]); + return 1; + } + fvm_prog_init(&p, ins, FVM_MAXINS); + if (fvm_compile(&cc, &p, tx, (uint32_t)strlen(tx), &er)) { + fprintf(stderr, "wave %u: compile error %u at %u\n", f, er.code, er.pos); + return 1; + } + for (k = 0; k < 8u; k++) { + int32_t pq = (int32_t)((k * 127u * 256u + 3u) / 7u); /* the grid: POS k x 127 / 7, Q8 */ + printf("%u %u", f, k); + for (b = 0; b < 4u; b++) { + int32_t st[FVM_MAXSTATE] = {0}; + uint32_t T[FVM_BLK] = {0}, W[FVM_BLK], y[FVM_BLK]; + fvm_env_t e = {{T, W, 0, 0, 0}, {0}, st}; + e.u[FU_AF] = (uint32_t)clamp(pq, 0, 127 << 8) * 516u >> 8; + for (i = 0; i < FVM_BLK; i++) + W[i] = (b * FVM_BLK + i) * (65536u / 128u); + fvm_run(&p, &e, &scr, FVM_BLK, y); + for (i = 0; i < FVM_BLK; i++) + printf(" %d", (int)clamp((int32_t)y[i] >> 1, -32768, 32767)); + } + printf("\n"); + } + } + return 0; +} diff --git a/tools/gen_wave_tables.py b/tools/gen_wave_tables.py new file mode 100644 index 00000000..812397dd --- /dev/null +++ b/tools/gen_wave_tables.py @@ -0,0 +1,199 @@ +# SPDX-License-Identifier: GPL-3.0-only +# Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) +"""WAVE's factory tables (firmware/src/wave_tables.h) from JIANT BYTE's 16 wave formulas. + + python3 tools/gen_wave_tables.py BYTE_CHECKOUT (builds and runs tools/gen_wave_tables.c against it) + python3 tools/gen_wave_tables.py --frames FILE (the C tool's output, already made) + +The C tool evaluates each formula with BYTE's own formula machine as BYTE's eng_wave.c draws its frames, at the eight +positions of FM's grid (frame k at POS k x 127 / 7): 16 x 8 frames of 128 int16. Here they become int8 (rounded: the +device's frames are int8, a user table's own format), and only the frames a table needs are kept: SINE one (POS does +not move it), SAWSQ ODD SINTR two (POS 0 and 127: A in them is linear, the six between are their blend, as BYTE draws +them), the twelve others eight. Each kept frame is coded on its own (byte-aligned): 2 bits its predictor (0 the point +before, 1 the line through the two before, 2 the frame before's point, 3 the frame before's point plus this frame's +step), 3 bits k, then each of the 128 residuals Rice-coded (zigzag u: u >> k one-bits, a zero, then u's low k bits, +LSB first). firmware/src/eng_wave.c wv_frame decodes one; the header is checked here by decoding it back. +The CI never runs this: the header is committed. Reproduces BYTE main 94f8ac9 (v1.2.1).""" +import math +import os +import subprocess +import sys + +HERE = os.path.dirname(os.path.abspath(__file__)) +ROOT = os.path.dirname(HERE) +OUT = os.path.join(ROOT, 'firmware', 'src', 'wave_tables.h') +NAMES = ['SINE', 'FM2', 'FMR', 'TRISY', 'SAWSQ', 'DRIVE', 'RING', 'FOLD', 'ODD', 'PULSE', 'STEP', 'BITS', 'FORMT', + 'NOISE', 'SINTR', 'SATUR'] +KEPT = [1, 8, 8, 8, 2, 8, 8, 8, 2, 8, 8, 8, 8, 8, 2, 8] # frames kept: 1 SINE, 2 the linear ones (A in them is linear) + + +def frames_text(byte): + exe = os.path.join(ROOT, 'build', 'host', 'gen_wave_tables') + os.makedirs(os.path.dirname(exe), exist_ok=True) + subprocess.check_call(['cc', '-O2', '-w', '-I' + os.path.join(byte, 'build', 'gen'), '-I' + os.path.join(byte, 'tests'), + '-I' + os.path.join(byte, 'firmware', 'src'), '-o', exe, + os.path.join(HERE, 'gen_wave_tables.c'), '-lm']) + return subprocess.check_output([exe]).decode() + + +def q8(v): + return max(-128, min(127, int(math.floor(v / 256.0 + 0.5)))) + + +def pred(m, x, prev, i): + a = x[i - 1] if i else 0 + if m == 0: + return a + if m == 1: + return 2 * a - (x[i - 2] if i > 1 else 0) + if m == 2: + return prev[i] + return prev[i] + a - (prev[i - 1] if i else 0) + + +class Bits: + def __init__(self): + self.b = bytearray() + self.n = 0 + + def put(self, v, k): + for j in range(k): + if self.n % 8 == 0: + self.b.append(0) + if (v >> j) & 1: + self.b[-1] |= 1 << (self.n % 8) + self.n += 1 + + def align(self): + self.n = len(self.b) * 8 + + +def code_frame(x, prev): + best = None + for m in range(4 if prev else 2): + r = [x[i] - pred(m, x, prev, i) for i in range(128)] + u = [(d << 1) if d >= 0 else ((-d) << 1) - 1 for d in r] + for k in range(8): + n = sum((v >> k) + 1 + k for v in u) + if best is None or n < best[0]: + best = (n, m, k, u) + _, m, k, u = best + b = Bits() + b.put(m, 2) + b.put(k, 3) + for v in u: + b.put((1 << (v >> k)) - 1, v >> k) + b.put(0, 1) + b.put(v & ((1 << k) - 1), k) + return bytes(b.b) + + +def decode_frame(z, prev): # eng_wave.c wv_frame's, to check the header + pos = [0] + + def bit(): + v = (z[pos[0] >> 3] >> (pos[0] & 7)) & 1 + pos[0] += 1 + return v + + def get(k): + return sum(bit() << j for j in range(k)) + m = get(2) + k = get(3) + x = [] + for i in range(128): + q = 0 + while bit(): + q += 1 + u = (q << k) | get(k) + d = (u >> 1) if not (u & 1) else -((u + 1) >> 1) + x.append(pred(m, x, prev, i) + d) + return x + + +def expand(f, kept): # the eight frames the device makes of the kept ones + if KEPT[f] == 1: + return [kept[0]] * 8 + if KEPT[f] == 2: + a, b = kept + return [[((a[i] * (7 - k) + b[i] * k + 896) * 2 + 7) // 14 - 128 for i in range(128)] for k in range(8)] + return kept + + +def main(): + if len(sys.argv) == 3 and sys.argv[1] == '--frames': + txt = open(sys.argv[2]).read() + elif len(sys.argv) == 2: + txt = frames_text(sys.argv[1]) + else: + sys.exit(__doc__) + fr = {} + for line in txt.splitlines(): + a = list(map(int, line.split())) + fr[(a[0], a[1])] = a[2:] + assert len(fr) == 128 and all(len(v) == 128 for v in fr.values()) + z = bytearray() + offs = [] + snr = [] + exp = [] + for f in range(16): + idx = [0] if KEPT[f] == 1 else [0, 7] if KEPT[f] == 2 else list(range(8)) + kept = [] + prev = None + for k in idx: + x = [q8(v) for v in fr[(f, k)]] + offs.append(len(z)) + c = code_frame(x, prev) + assert decode_frame(c, prev) == x + z += c + kept.append(x) + prev = x + ex = expand(f, kept) + exp.append(ex) + s = n = 0 + for k in range(8): # the device's frames against BYTE's (int16) at every grid point + for i in range(128): + v = fr[(f, k)][i] + d = v - ex[k][i] * 256 + s += v * v + n += d * d + snr.append(10 * math.log10(s / max(n, 1))) + offs.append(len(z)) + assert len(z) < 65536 + hashes = [] # (tests/wave_test.c) each table's eight frames as the device makes them + for f in range(16): + h = 2166136261 + for k in range(8): + for v in exp[f][k]: + h = ((h ^ (v & 255)) * 16777619) & 0xFFFFFFFF + hashes.append(h) + o = ['/* SPDX-License-Identifier: GPL-3.0-only', + ' * Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */', + '/* Generated by tools/gen_wave_tables.py (tools/gen_wave_tables.c, JIANT BYTE main 94f8ac9): do not edit.', + ' * WAVE\'s 16 factory tables, BYTE\'s formulas at FM\'s eight POS (k x 127 / 7), int8, Rice-coded a frame each', + ' * (eng_wave.c wv_frame). Against BYTE\'s int16 frames (dB): ' + + ' '.join('%s %.1f' % (NAMES[f], snr[f]) for f in range(16)) + ' */', + '#pragma once', + '#define WT_NF 16u', + '#define WT_ZSIZE %du' % len(z), + '/* the frames kept a table (1: SINE, 2: POS 0 and 127, the six between their blend; 8: the grid) */', + 'static const uint8_t WT_KEPT[WT_NF] = {%s};' % ', '.join(map(str, KEPT)), + '/* each kept frame\'s first byte in WT_Z, the tables one after the other (the last: the end) */', + 'static const uint16_t WT_FOFF[%d] = {' % len(offs)] + for i in range(0, len(offs), 16): + o.append(' ' + ', '.join(map(str, offs[i:i + 16])) + ',') + o.append('};') + o.append('/* (tests/wave_test.c) FNV-1a of each table\'s eight frames (1024 int8) as the device makes them */') + o.append('#define WT_HASH_INIT {' + ', '.join('0x%08xu' % h for h in hashes) + '}') + o.append('static const uint8_t WT_Z[WT_ZSIZE] = {') + for i in range(0, len(z), 24): + o.append(' ' + ', '.join('0x%02x' % b for b in z[i:i + 24]) + ',') + o.append('};') + open(OUT, 'w').write('\n'.join(o) + '\n') + print('wave_tables.h: %d frames kept, %d B coded (%d B raw int8), %d B of offsets' % + (len(offs) - 1, len(z), (len(offs) - 1) * 128, len(offs) * 2)) + print('SNR against BYTE int16:', ', '.join('%s %.1f' % (NAMES[f], snr[f]) for f in range(16))) + + +if __name__ == '__main__': + main() diff --git a/web/EDITOR_PROTOCOL.md b/web/EDITOR_PROTOCOL.md index 772a3a80..01740648 100644 --- a/web/EDITOR_PROTOCOL.md +++ b/web/EDITOR_PROTOCOL.md @@ -62,9 +62,19 @@ levels), went in before the engine parameters, which moved from 83..90 to 91..98 changed; projects were FUN9 (3648 bytes, see "Projects (FUN9)"; JIANT writes FUNA). See "The DRUM lane levels" below. **JIANT 0.3: SAMPLE (4), GRAIN (8) and SLICE (13) retired** (JIANT 0.9.9-snd5: 8 and 13 hold STRING and ADD again, named so). Their numbers stay, named `-` in `INFO` and `G_ENGSEL`, with no -presets (as PHYS, 9); a sound of theirs that arrives (a project, a user preset, `PRESET`, a `SET` of `G_ENGSEL`, a backup) plays as +presets (as PHYS, 9, was until WAVE took its number); a sound of theirs that arrives (a project, a user preset, `PRESET`, a `SET` of `G_ENGSEL`, a backup) plays as ANALOG's first preset, a SAMPLE PERC sound (SET 4) as DRUM's kit. The factory samples left the firmware. +**WAVE (engine 9):** JIANT BYTE's wavetable synth, in PHYS's number (retired in TONIC, named `-` until now). EDIT: +A (enum 0..23: 0..15 the factory tables SINE FM2 FMR TRISY SAWSQ DRIVE RING FOLD ODD PULSE STEP BITS FORMT NOISE SINTR +SATUR, 16..23 the user tables U1..U8), POS (0..127, eight frames), WARP (0 OFF, 1 SYNC, 2 BEND, 3 MIRROR, 4 QUANT, 5 FM), +AMT, B (as A), MIX (A..B), DETUNE (0: one voice, else three), SUB (an octave down, a sine). An empty or damaged user +table plays SINE, silently. Matrix: E1 (A), E3 (WARP) and E5 (B) are lists, not destinations; SHP moves POS. Old PHYS data +stays told apart: a user preset record of version 1..3 with engine 9, and a project whose `phys` byte (64) is below 4 +with a track of engine 9, are PHYS's and load as before (ANALOG's first preset; such a project is refused, "OPEN IN +STUDIO"). A project with a WAVE track is written with `phys` 4, every other one with 3 as before. BYTE numbers its WAVE +engine 13 (ADD here): a client takes the number from `INFO`'s names, never from BYTE's table. + **JIANT FUNB (120 parameters, 32 globals):** 21 track parameters went in before the engine parameters, which moved from 91..98 to 112..119: P_COUNT 120, P_E0 112; JIANT 0.5 adds the FILTER (112 TYPE, 113 CUT, 114 RES): P_COUNT 123, P_E0 115. Five globals were added after the 27 a project's header holds: G_COUNT 32. No command changed; an editor that takes P_COUNT, G_COUNT and P_E0 from `INFO` keeps working. @@ -139,8 +149,9 @@ tag of the addition, as before). CHAIN_ROWS, then the tags (each tag's number and meaning). The JIANT Stems app reads the string, NENGINES, the fifth byte after it (P_E0) and the names, and ignores the rest. - **The engine byte**: 0 ANALOG, 1 reserved, 2 PHASE, 3 LOFI (named `MATH` by INFO since V10.6d), 4 reserved, - 5 VOICE, 6 reserved, 7 WHEEL, 8 STRING, 9 reserved, 10 DRUM, 11 NOISE, 12 FM6, 13 ADD, 14 ANIMAL, 15 INPUT (named - `EXT`). New engines take the next numbers. The *names* are display text and may change: a client shows the names + 5 VOICE, 6 reserved, 7 WHEEL, 8 STRING, 9 WAVE, 10 DRUM, 11 NOISE, 12 FM6, 13 ADD, 14 ANIMAL, 15 INPUT (named + `EXT`). New engines take the next numbers; NENGINES is full (16), so (WAVE, 1.7) a retired number may be given again + when its old sounds stay told apart (9, PHYS's until TONIC: see "WAVE (engine 9)"). The *names* are display text and may change: a client shows the names `INFO` sends, not a table of its own. - **Parameter ids**: the track parameters 0..P_E0−1 keep their id and the slot keeps its meaning for every engine that reads it (a range may widen, a label change: read `DESC`); E1..E8 are always the last eight, P_E0..P_COUNT−1 @@ -325,7 +336,7 @@ watches (v2, `WATCH`), the device also sends push frames (cmds 23, 24, 26) at an | string | ASCII bytes, ended by a 0 byte | | scope | 0 = parameter of the selected track (`P_*`, 0..P_COUNT−1); 1 = global parameter (`G_*`, 0..G_COUNT−1) | | track | 0..NTRK-1: tracks 1..6 (synth parts; JIANT 0.6: six, INFO's NTRK; before, four) | -| engine byte | 0..NENGINES−1 (firmware before 1.0: NENGINES = its drum track, no engine). The numbers are fixed, new engines are appended: 0 ANALOG, 1 reserved (DIGITAL before 1.0: see below), 2 PHASE, 3 LOFI, 4 SAMPLE, 5 VOICE, 6 TRIO, 7 WHEEL, 8 GRAIN, 9 reserved (PHYS until FELUCCA TONIC: its sounds load as ANALOG's first preset), 10 DRUM, 11 NOISE, 12 FM6, 13 SLICE (retired in JIANT), 14 ANIMAL (JIANT 0.8.3; NENGINES 15, before it 14: an engine byte of 14 from a 0.8.3 store on older firmware is refused as any number past its last; a user-slot favourite (`FAV_GET` / `FAV_SET`, engine = NENGINES) is engine 15 from 0.8.3 on, read NENGINES from `INFO`); JIANT 0.9.9-snd5 puts STRING in GRAIN's 8 and ADD in SLICE's 13 (both retired; NENGINES stays 15: a GRAIN or SLICE sound of an old store plays as STRING / ADD there). V10.54 appends 15 INPUT (NENGINES 16: the user-slot favourite is engine 16 from then on, read NENGINES from `INFO`): SOURCE (0 IN 1, 1 IN 2, 2 1+2, 3 STEREO, 4 SWARM), GAIN (64 = 1.0), GATE, PLAY (0 THRU, 1 KEYS; V10.8.38, SOURCE 4 SWARM: its MODE, 2..7 `>T1`..`>T6`, the swarm's notes play that track's engine and its own voices are silent), WIDTH, RING, BITS, RATE. The device and the editor list them in another order (JIANT 0.9.9: DRUM VOICE ANIMAL LOFI ANALOG FM6 PHASE WHEEL NOISE, snd5: then STRING ADD, DIGITAL last in FELUCCA_FM4 builds: `ENGINE_ORDER`; 0.8.3 .. 0.9.8: ANALOG FM6 PHASE LOFI VOICE WHEEL NOISE DRUM ANIMAL, the order PROGRAM CHANGE still numbers the sounds in); the numbers stay. ANIMAL's EDIT values: MODE (0 CMOS, 1 PULSE, 2 WHSTL, 3 WING, 4 GLOTT), PRESS, CHAOS, SIZE, SWEEP (−64..63), RATE (the LFO's Hz scale), GROUP (0..15: HOLD TRILL 1+1 1+3 2+2 2+6 3+3 3+9 4+4 4+12 6+6 8+8 8+24 12+12 16+16 32+32), TEMP (0..40 °C); the device relabels some per MODE (`DESC` sends these, the engine's own). STRING's: EXCITE (0 NOISE, 1 PLUCK, 2 PICK, 3 HAMMR, 4 STICK), DECAY, BRIGHT, POS, STRETCH, BODY, SIZE, BOW (0..127). ADD's: MODE (0 HARM, 1 ODD, 2 WIDE, 3 BELL, 4 BAR, 5 DRUM), BRIGHT, EVEN (−64..63), STRETCH (−64..63), PEAK, FORMNT, DECAY (127: held), DAMP | +| engine byte | 0..NENGINES−1 (firmware before 1.0: NENGINES = its drum track, no engine). The numbers are fixed, new engines are appended: 0 ANALOG, 1 reserved (DIGITAL before 1.0: see below), 2 PHASE, 3 LOFI, 4 SAMPLE, 5 VOICE, 6 TRIO, 7 WHEEL, 8 GRAIN, 9 reserved (PHYS until FELUCCA TONIC: its sounds load as ANALOG's first preset; WAVE's since 1.7, see "WAVE (engine 9)"), 10 DRUM, 11 NOISE, 12 FM6, 13 SLICE (retired in JIANT), 14 ANIMAL (JIANT 0.8.3; NENGINES 15, before it 14: an engine byte of 14 from a 0.8.3 store on older firmware is refused as any number past its last; a user-slot favourite (`FAV_GET` / `FAV_SET`, engine = NENGINES) is engine 15 from 0.8.3 on, read NENGINES from `INFO`); JIANT 0.9.9-snd5 puts STRING in GRAIN's 8 and ADD in SLICE's 13 (both retired; NENGINES stays 15: a GRAIN or SLICE sound of an old store plays as STRING / ADD there). V10.54 appends 15 INPUT (NENGINES 16: the user-slot favourite is engine 16 from then on, read NENGINES from `INFO`): SOURCE (0 IN 1, 1 IN 2, 2 1+2, 3 STEREO, 4 SWARM), GAIN (64 = 1.0), GATE, PLAY (0 THRU, 1 KEYS; V10.8.38, SOURCE 4 SWARM: its MODE, 2..7 `>T1`..`>T6`, the swarm's notes play that track's engine and its own voices are silent), WIDTH, RING, BITS, RATE. The device and the editor list them in another order (JIANT 0.9.9: DRUM VOICE ANIMAL LOFI ANALOG FM6 PHASE WHEEL NOISE, snd5: then STRING ADD, DIGITAL last in FELUCCA_FM4 builds: `ENGINE_ORDER`; 0.8.3 .. 0.9.8: ANALOG FM6 PHASE LOFI VOICE WHEEL NOISE DRUM ANIMAL, the order PROGRAM CHANGE still numbers the sounds in); the numbers stay. ANIMAL's EDIT values: MODE (0 CMOS, 1 PULSE, 2 WHSTL, 3 WING, 4 GLOTT), PRESS, CHAOS, SIZE, SWEEP (−64..63), RATE (the LFO's Hz scale), GROUP (0..15: HOLD TRILL 1+1 1+3 2+2 2+6 3+3 3+9 4+4 4+12 6+6 8+8 8+24 12+12 16+16 32+32), TEMP (0..40 °C); the device relabels some per MODE (`DESC` sends these, the engine's own). STRING's: EXCITE (0 NOISE, 1 PLUCK, 2 PICK, 3 HAMMR, 4 STICK), DECAY, BRIGHT, POS, STRETCH, BODY, SIZE, BOW (0..127). ADD's: MODE (0 HARM, 1 ODD, 2 WIDE, 3 BELL, 4 BAR, 5 DRUM), BRIGHT, EVEN (−64..63), STRETCH (−64..63), PEAK, FORMNT, DECAY (127: held), DAMP | The engine parameters are `P_E0..P_E7`: P_COUNT−8 .. P_COUNT−1 (91..98), and `INFO` gives `P_E0`. Their meaning, range and names depend on the current engine, so re-read `DESC` for them diff --git a/web/NRPN.md b/web/NRPN.md index 5bf51fa2..68d02359 100644 --- a/web/NRPN.md +++ b/web/NRPN.md @@ -53,7 +53,7 @@ its own way the engines are named. P_E0..P_E7 (CC98 115..122) are the engine's E | 38 | GLIDE | 0..127 | 0 | | | 39 | PAN | -64..63 | 0 | | | 44 | UNISON | 0..127 | 40 | | -| 61 | ATK | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WEST FM6 ADD ANIMAL EXT) | +| 61 | ATK | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WAVE WEST FM6 ADD ANIMAL EXT) | | 61 | RESTART | 0..1 | 1 | (MATH) | | 61 | LANG | 0..9 | 0 | OFF ES EN JA RU DE FR ZH PT GN (VOICE) | | 61 | KEY MAP | 0..9 | 1 | BASIC EXTRA KICK SNARE CLAP HH CL HH OP TOM RIM BELL (DRUM) | @@ -69,22 +69,22 @@ its own way the engines are named. P_E0..P_E7 (CC98 115..122) are the engine's E | 71 | MORPH | 0..127 | 0 | | | 72 | C.LEN | 0..64 | 0 | OFF 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 ... | | 73 | DRIFT | 0..127 | 127 | | -| 74 | IMAGE | 0..127 | 0 | (ANALOG PHASE WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 74 | IMAGE | 0..127 | 0 | (ANALOG PHASE WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 74 | TIME | 0..2 | 1 | KEY LOCK TEMPO (MATH) | | 74 | LYRIC | 0..25 | 0 | TEXT W1 W2 W3 W4 W5 W6 W7 W8 W9 W10 W11 W12 W13 W14 W15 W16 S1 S2 S3 S4 S5 S6 S7 S8 TEXT FIXED (VOICE) | | 75 | DUST | 0..127 | 127 | | | 76 | CHORD | 0..16 | 0 | OFF TRIAD 7TH ADD9 SUS2 SUS4 MAJ MIN 7 MAJ7 MIN7 POWER POP JAZZ SOUL DREAM QUART | | 77 | VOICING | 0..3 | 0 | CLOSE LEAD OPEN +BASS | -| 78 | DEPTH | 0..127 | 127 | (ANALOG PHASE VOICE WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 78 | DEPTH | 0..127 | 127 | (ANALOG PHASE VOICE WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 78 | ALGO B | 0..127 | 127 | (MATH) | | 79 | STRUM | 0..127 | 0 | | | 80 | VEL | 0..127 | 127 | | | 81 | ROTATE | -32..32 | 0 | | | 82 | PITCH | -24..24 | 0 | | -| 83 | IMAGE | 0..127 | 127 | (ANALOG PHASE MATH VOICE WHEEL STRING WEST FM6 ADD ANIMAL) | +| 83 | IMAGE | 0..127 | 127 | (ANALOG PHASE MATH VOICE WHEEL STRING WAVE WEST FM6 ADD ANIMAL) | | 83 | KICK | 0..127 | 127 | (DRUM) | | 83 | - | 0..127 | 127 | (EXT) | -| 84 | SNARE | 0..127 | 127 | (ANALOG PHASE MATH WHEEL STRING DRUM WEST FM6 ADD ANIMAL EXT) | +| 84 | SNARE | 0..127 | 127 | (ANALOG PHASE MATH WHEEL STRING WAVE DRUM WEST FM6 ADD ANIMAL EXT) | | 84 | CONS | 0..127 | 127 | (VOICE) | | 85 | CLAP | 0..127 | 127 | | | 86 | HH CL | 0..127 | 127 | | @@ -167,6 +167,14 @@ Each engine's EDIT values as its preset 1 shows them (a mode may rename one: DES | STRING 8 | 120 | BODY | 0..127 | 40 | | | STRING 8 | 121 | SIZE | 0..127 | 40 | | | STRING 8 | 122 | BOW | 0..127 | 0 | | +| WAVE 9 | 115 | A | 0..23 | 0 | SINE FM2 FMR TRISY SAWSQ DRIVE RING FOLD ODD PULSE STEP BITS FORMT NOISE SINTR SATUR U1 U2 U3 U4 U5 U6 U7 U8 | +| WAVE 9 | 116 | POS | 0..127 | 0 | | +| WAVE 9 | 117 | WARP | 0..5 | 0 | OFF SYNC BEND MIRROR QUANT FM | +| WAVE 9 | 118 | AMT | 0..127 | 0 | | +| WAVE 9 | 119 | B | 0..23 | 0 | SINE FM2 FMR TRISY SAWSQ DRIVE RING FOLD ODD PULSE STEP BITS FORMT NOISE SINTR SATUR U1 U2 U3 U4 U5 U6 U7 U8 | +| WAVE 9 | 120 | MIX | 0..127 | 0 | | +| WAVE 9 | 121 | DETUNE | 0..127 | 0 | | +| WAVE 9 | 122 | SUB | 0..127 | 0 | | | DRUM 10 | 115 | MORPH | 0..127 | 64 | | | DRUM 10 | 116 | TUNE | 0..127 | 64 | | | DRUM 10 | 117 | TONE | 0..127 | 64 | | diff --git a/web/editor.html b/web/editor.html index 8470eea9..e0631e8f 100644 --- a/web/editor.html +++ b/web/editor.html @@ -1626,7 +1626,7 @@ function makeMockDevice(opt = {}) { E("MIDI", ["USB", "TRS"], 0), D("REL", F.PCT, 0, 100, 30), /* G_DREL (was SYNC): DUCK's release */ E("ROUTE", ["CH1-6", "SEL"], 0), D("CPU", F.INT, 0, 0, 0), D("SLOT", F.INT, 1, 4, 1), D("DJ FILT", F.BIPCT, -64, 63, 0), E("LOAD", NGO, 0), E("SAVE", NGO, 0), /* (0.9.1) G_DJF 17 (was NAME, "--"): the master DJ FILTER */ E("ENG", ["ANALOG", "-", "PHASE", "MATH", "-", "VOICE", "-", "WHEEL", - "STRING", "-", "DRUM", "WEST", "FM6", "ADD", "ANIMAL", "EXT"], 0), D("CLIP", F.PCT, 0, 100, 0), /* G_CLIP (was SET); 0.8.3 ANIMAL; snd5 STRING 8 ADD 13 */ + "STRING", "WAVE", "DRUM", "WEST", "FM6", "ADD", "ANIMAL", "EXT"], 0), D("CLIP", F.PCT, 0, 100, 0), /* G_CLIP (was SET); 0.8.3 ANIMAL; snd5 STRING 8 ADD 13 */ E("CLEAR SEQ", NGO, 0), E("INIT", NGO, 0), E("TYPE", ["ROOM", "SPRING", "SHIMR", "RESO", "CLOUD"], 0), /* G_RTYPE (id 24, was G_DRCH): the reverb's model */ D("PUNCH", F.PCT, 0, 100, 0), D("DUCK", F.PCT, 0, 100, 0), /* G_PUNCH, G_DUCK (JIANT; were G_DRLVL, G_DRREV) */ @@ -1648,6 +1648,7 @@ function makeMockDevice(opt = {}) { E("RIGHT", ["=L", "x1/2", "x2/3", "x3/4", "x4/3", "x3/2", "x2"], 0), /* (V10.49) G_DRTIME 72: DLY 3 KNOB 4, the right echo as a ratio of TIME */ ]; const NONE = D("-", F.INT, 0, 0, 0); + const WAVEF = ["SINE", "FM2", "FMR", "TRISY", "SAWSQ", "DRIVE", "RING", "FOLD", "ODD", "PULSE", "STEP", "BITS", "FORMT", "NOISE", "SINTR", "SATUR", "U1", "U2", "U3", "U4", "U5", "U6", "U7", "U8"]; /* (WAVE) core.h N_WAVEF */ const RATIO = [".5", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "14", "16"]; const P = (name, e, env = [10, 70, 90, 60], mono = 0, pat = 0, xp = 0, mod = []) => ({ name, e, env, mono, pat, xp, mod }); /* mod (V10.6i): the preset's movement, [parameter, value] pairs (core.h preset_t.mod; tools/preset_mods_js.py) */ /* xp (0.8.5): @@ -1776,10 +1777,37 @@ function makeMockDevice(opt = {}) { P("SHOEGAZE", [5, 110, 50, 30, 55, 100, 90, 70], [40, 64, 127, 112], 0, 5, 0, [[10, 5], [9, 30], [15, 20]]), P("SQUEAL", [5, 80, 96, 16, 70, 110, 12, 30], [0, 64, 127, 80], 0, 4, 0, [[10, 4], [9, -11], [15, 30], [49, 6], [50, 17], [51, 40]]), P("EBOW", [5, 127, 44, 40, 50, 20, 64, 90], [20, 64, 67, 100], 0, 5, 0, [[9, 84], [13, 1], [12, 80], [49, 7], [50, 16], [51, 25]])] }, - /* 9: reserved (PHYS, retired in TONIC: src/engines.c ENG_PHYS_GONE; its sounds load as ANALOG) */ - { name: "-", titles: ["-", "-"], edit: [D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0), - D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0), D("-", F.INT, 0, 127, 0)], - presets: [] }, + /* 9: WAVE (src/eng_wave.c; generated from it, tools/preset_mods_js.py): BYTE's wavetables, A and B (16 factory, U1..U8 + a user's), POS through eight frames. PHYS's number (retired in TONIC): an old PHYS sound still loads as ANALOG */ + { name: "WAVE", titles: ["WAVE", "OSC B"], edit: [E("A", WAVEF, 0), D("POS", F.PCT, 0, 127, 0), + E("WARP", ["OFF", "SYNC", "BEND", "MIRROR", "QUANT", "FM"], 0), D("AMT", F.PCT, 0, 127, 0), E("B", WAVEF, 0), + D("MIX", F.PCT, 0, 127, 0), D("DETUNE", F.PCT, 0, 127, 0), D("SUB", F.PCT, 0, 127, 0)], + presets: [P("INIT WAVE", [0, 0, 0, 0, 0, 0, 0, 0], [0, 64, 100, 30], 0, 0, 0, []), + P("FM KEYS", [1, 40, 0, 0, 0, 0, 0, 0], [0, 70, 60, 40], 0, 6, 0, [[64, 0], [66, 60], [67, 0], [69, 30], [49, 16], [50, 3], [51, 30]]), + P("SAW PAD", [4, 20, 0, 0, 3, 50, 40, 0], [80, 90, 100, 95], 0, 5, 0, [[9, 12], [49, 1], [50, 3], [51, 20]]), + P("SYNC LEAD", [3, 30, 1, 60, 0, 0, 12, 0], [2, 70, 100, 40], 1, 4, 0, [[49, 6], [50, 3], [51, 40], [38, 10]]), + P("SUB BASS", [7, 30, 2, 40, 0, 0, 0, 80], [0, 60, 90, 20], 1, 2, 0, [[38, 8]]), + P("BIT TABLE", [11, 64, 4, 50, 13, 30, 0, 0], [0, 75, 80, 40], 1, 3, 0, [[10, 4], [9, -8], [49, 1], [50, 3], [51, 40]]), + P("FM BELL", [0, 0, 5, 70, 2, 0, 0, 0], [0, 88, 0, 70], 0, 7, 0, [[49, 3], [50, 3], [51, 30]]), + P("FORMANT", [12, 50, 0, 0, 8, 40, 20, 0], [30, 80, 90, 60], 0, 5, 0, [[9, 6], [49, 1], [50, 3], [51, 35]]), + P("REESE", [4, 8, 0, 0, 0, 0, 90, 50], [0, 70, 110, 25], 1, 2, 0, [[38, 8], [113, 76], [114, 30], [10, 1], [9, 20], [13, 0], [14, 14], [49, 1], [50, 3], [51, 16]]), + P("ACID BASS", [3, 6, 0, 0, 0, 0, 0, 30], [0, 60, 100, 15], 1, 2, 0, [[38, 12], [113, 46], [114, 100], [64, 0], [66, 76], [67, 0], [69, 20], [49, 16], [50, 3], [51, 50], [52, 16], [53, 30], [54, 40]]), + P("FM GROWL", [5, 27, 5, 30, 2, 0, 0, 40], [0, 70, 110, 20], 1, 2, 0, [[38, 6], [64, 0], [66, 75], [67, 30], [69, 30], [49, 16], [50, 15], [51, 40], [10, 1], [9, -5], [13, 0], [14, 0], [52, 1], [53, 15], [54, 16], [55, 1], [56, 3], [57, 8]]), + P("808 BOOM", [5, 6, 0, 0, 0, 0, 0, 30], [0, 100, 0, 50], 1, 2, 0, [[64, 0], [66, 68], [67, 0], [69, 10], [49, 16], [50, 1], [51, 36], [52, 16], [53, 3], [54, 40]]), + P("WOBBLE", [7, 40, 0, 0, 0, 0, 0, 60], [0, 70, 110, 20], 1, 2, 0, [[113, 96], [10, 0], [9, -8], [13, 0], [14, 20], [49, 1], [50, 3], [51, 40]]), + P("SWEEP PAD", [7, 0, 0, 0, 0, 0, 40, 0], [90, 90, 110, 100], 0, 5, 0, [[64, 115], [66, 0], [67, 127], [69, 105], [49, 16], [50, 3], [51, 63], [9, 10], [52, 1], [53, 3], [54, 14]]), + P("MORPH PAD", [4, 30, 0, 0, 8, 64, 50, 0], [70, 90, 110, 95], 0, 5, 0, [[10, 1], [9, -2], [13, 0], [14, 0], [11, -1], [49, 1], [50, 17], [51, 30], [52, 1], [53, 3], [54, -20]]), + P("GLASS PAD", [2, 62, 0, 0, 0, 40, 20, 0], [40, 90, 100, 90], 0, 5, 0, [[9, 30], [49, 1], [50, 17], [51, 30], [52, 3], [53, 3], [54, 8]]), + P("PWM STRNG", [9, 80, 0, 0, 0, 0, 0, 0], [50, 90, 110, 80], 0, 5, 0, [[9, 45], [49, 1], [50, 3], [51, 36]]), + P("SUPERSAW", [4, 0, 0, 0, 0, 0, 127, 20], [20, 90, 110, 70], 0, 5, 0, [[64, 60], [66, 100], [67, 40], [69, 70], [49, 16], [50, 3], [51, 40], [74, 90]]), + P("SHIMMER", [14, 40, 3, 20, 0, 0, 30, 0], [80, 100, 110, 110], 0, 5, 0, [[64, 110], [66, 0], [67, 127], [69, 110], [49, 16], [50, 3], [51, 50], [9, 30], [52, 1], [53, 15], [54, 20], [74, 80]]), + P("DARK DRONE", [8, 30, 0, 0, 0, 0, 60, 60], [100, 100, 127, 110], 0, 5, 0, [[113, 60], [114, 40], [10, 0], [9, 4], [13, 0], [14, 16], [49, 1], [50, 3], [51, 30]]), + P("FM PLUCK", [1, 0, 0, 0, 0, 0, 0, 0], [0, 85, 0, 60], 0, 6, 0, [[64, 0], [66, 70], [67, 0], [69, 40], [49, 16], [50, 3], [51, 63], [52, 3], [53, 3], [54, 20], [7, 40]]), + P("METAL PLK", [2, 90, 1, 0, 0, 0, 0, 0], [0, 82, 0, 55], 0, 6, 0, [[64, 0], [66, 72], [67, 0], [69, 40], [49, 16], [50, 3], [51, 30], [52, 16], [53, 15], [54, 30]]), + P("YAH LEAD", [12, 20, 0, 0, 8, 30, 10, 0], [5, 80, 110, 40], 1, 4, 0, [[38, 15], [64, 65], [66, 75], [67, 30], [69, 40], [49, 16], [50, 3], [51, 45], [9, 88], [12, 70], [13, 1]]), + P("CHIME", [6, 100, 0, 0, 0, 120, 0, 0], [0, 100, 0, 95], 0, 7, 0, [[64, 0], [66, 80], [67, 0], [69, 60], [49, 16], [50, 17], [51, -50]]), + P("NOISE RISE", [13, 0, 0, 0, 7, 50, 0, 0], [60, 90, 127, 90], 1, 3, 0, [[64, 112], [66, 0], [67, 127], [69, 90], [49, 16], [50, 3], [51, 63], [52, 16], [53, 1], [54, 40]]), + P("HYPER SAW", [4, 0, 0, 0, 0, 0, 100, 0], [10, 90, 110, 70], 0, 5, 0, [[74, 127]])] }, { name: "DRUM", titles: ["KIT", "KIT 2"], edit: [D("MORPH", F.PCT, 0, 127, 64), D("TUNE", F.PCT, 0, 127, 64), D("TONE", F.PCT, 0, 127, 64), D("DECAY", F.PCT, 0, 127, 64), D("NOISE", F.PCT, 0, 127, 64), D("FM ENV", F.PCT, 0, 127, 0), D("FOLD", F.PCT, 0, 127, 0), D("DRIVE", F.PCT, 0, 127, 0)], @@ -2014,7 +2042,7 @@ function makeMockDevice(opt = {}) { } function setEngine(ei) { if (ei % ENG.length === 1) { fm4Load(0); return; } /* DIGITAL (retired): its first preset, as FM6 (ui.c set_engine_of) */ - if ([4, 9].includes(ei % ENG.length)) ei = 0; /* PHYS SAMPLE (retired, core.h eng_gone): ANALOG; (snd5) 8 STRING 13 ADD */ + if (ei % ENG.length === 4) ei = 0; /* SAMPLE (retired, core.h eng_gone): ANALOG; (snd5) 8 STRING 13 ADD; 9 WAVE (PHYS's) */ st.engine = ei % ENG.length; for (let i = 0; i < 8; i++) st.p[P_E0 + i] = ENG[st.engine].edit[i].def; applyPreset(0); @@ -2568,7 +2596,7 @@ function enumShown(d) { /* the order the device shows its engines in (src/engines.c ENGINE_ORDER): the lists here follow it, the protocol keeps the engine numbers. engineOrder(names): the indices of names in that order, "-" (a reserved number) left out; a name the list does not know (another firmware) follows in index order */ -const ENGINE_ORDER = ["DRUM", "ANALOG", "PHASE", "FM6", "VOICE", "ANIMAL", "MATH", "LOFI", "WHEEL", "WEST", "NOISE", "STRING", "ADD", "EXT", "SAMPLE", "DIGITAL"]; /* (V10.6d: the power-on parts first; LOFI an older firmware's MATH) */ /* (0.9.9: DRUM-X, VOICE, +const ENGINE_ORDER = ["DRUM", "ANALOG", "PHASE", "FM6", "VOICE", "ANIMAL", "MATH", "LOFI", "WHEEL", "WEST", "NOISE", "STRING", "ADD", "WAVE", "EXT", "SAMPLE", "DIGITAL"]; /* (V10.6d: the power-on parts first; LOFI an older firmware's MATH) */ /* (0.9.9: DRUM-X, VOICE, ANIMAL first, as the parts at power-on; DIGITAL, FELUCCA_FM4 builds only, last; was ANALOG FM6 DIGITAL PHASE LOFI VOICE WHEEL NOISE DRUM ANIMAL, the order PROGRAM CHANGE still numbers the sounds in: engines.c ENGINE_PC_ORDER) */ function engineOrder(names) { diff --git a/web/test_web.mjs b/web/test_web.mjs index bbe8db76..5b609c90 100644 --- a/web/test_web.mjs +++ b/web/test_web.mjs @@ -183,7 +183,7 @@ async function editorMock() { const rq = async (r, o) => link.request(r, o); const info = E.parse[E.CMD.INFO](await rq(E.req.info())); ok(info.nengines === 16 && info.engines[15] === "EXT" && info.engines[1] === "-" && info.engines[12] === "FM6" && info.engines[13] === "ADD" && info.engines[14] === "ANIMAL" - && info.engines[5] === "VOICE" && info.engines[6] === "-" && info.engines[7] === "WHEEL" && info.engines[8] === "STRING" && info.engines[9] === "-" && info.engines[10] === "DRUM" && info.engines[11] === "WEST" && info.pcount === 123 && info.pe0 === 115 && info.engines[4] === "-", + && info.engines[5] === "VOICE" && info.engines[6] === "-" && info.engines[7] === "WHEEL" && info.engines[8] === "STRING" && info.engines[9] === "WAVE" && info.engines[10] === "DRUM" && info.engines[11] === "WEST" && info.pcount === 123 && info.pe0 === 115 && info.engines[4] === "-", "editor: INFO"); let descs = 0; for (let i = 0; i < info.pcount; i++) if (E.parse[E.CMD.DESC](await rq(E.req.desc(0, i))).label) descs++; @@ -291,8 +291,8 @@ async function editorMock() { ok(!prefs.favorites[info.nengines][31] && !E.devicePresetRows(info, names, prefs).some((r) => r.user), "editor: erased slot disappears and loses star"); { /* the lists in the device's order (engines.c ENGINE_ORDER, 0.9.9): DRUM VOICE ANIMAL first, "-" never; the numbers stay */ const shown = E.engineOrder(info.engines).map((i) => info.engines[i]); - ok(shown.join() === "DRUM,ANALOG,PHASE,FM6,VOICE,ANIMAL,MATH,WHEEL,WEST,STRING,ADD,EXT" && - E.engineOrder(info.engines).join() === "10,0,2,12,5,14,3,7,11,8,13,15", + ok(shown.join() === "DRUM,ANALOG,PHASE,FM6,VOICE,ANIMAL,MATH,WHEEL,WEST,STRING,ADD,WAVE,EXT" && + E.engineOrder(info.engines).join() === "10,0,2,12,5,14,3,7,11,8,13,9,15", "editor: engines listed DRUM ANALOG PHASE FM6 VOICE ANIMAL MATH WHEEL WEST (V10.6d; indices kept)"); ok(E.engineOrder(["ANALOG", "X", "-", "DRUM", "FM6"]).join() === "3,0,4,1", "editor: an unknown engine follows the known ones"); ok(E.engineOrder(["ANALOG", "DIGITAL", "FM6", "DRUM"]).join() === "3,0,2,1", "editor: DIGITAL (FELUCCA_FM4 builds) after the others"); @@ -300,7 +300,7 @@ async function editorMock() { await rq(E.req.uiSet(3, 0)); prefs = await E.readDevicePreferences(rq, info, names, prefs); const rows = E.devicePresetRows(info, names, prefs).filter((r) => !r.user), eng = [...new Set(rows.map((r) => r.engine))]; - ok(eng.join() === "10,0,2,12,5,14,3,7,11,8,13,15", "editor: device presets in the device's engine order (DRUM first; snd5: STRING ADD last)"); + ok(eng.join() === "10,0,2,12,5,14,3,7,11,8,13,9,15", "editor: device presets in the device's engine order (DRUM first; snd5: STRING ADD last; WAVE before EXT)"); } const none = await E.readDevicePreferences(() => { throw new Error("unexpected request"); }, { uiCaps: 0 }, []); ok(none === null, "editor: old firmware receives no unsupported preference requests"); @@ -399,16 +399,16 @@ async function editorMock() { } async function editorSamplePresets() { - /* (JIANT) SAMPLE and PHYS are retired (core.h eng_gone; GRAIN's 8 and SLICE's 13 are STRING and ADD since snd5): their - * numbers named "-", no presets; picking one gives ANALOG; SAMPLE's preset 4 (once PERC) still gives DRUM's kit */ + /* (JIANT) SAMPLE is retired (core.h eng_gone; GRAIN's 8 and SLICE's 13 are STRING and ADD since snd5; PHYS's 9 WAVE's): + * its number named "-", no presets; picking it gives ANALOG; SAMPLE's preset 4 (once PERC) still gives DRUM's kit */ const C = E.CMD; const { rq, done } = attachMock(); const info = E.parse[C.INFO](await rq(E.req.info())); - ok([4, 9].every((e) => info.engines[e] === "-"), "JIANT: SAMPLE PHYS retired: their numbers are \"-\""); + ok(info.engines[4] === "-" && info.engines[9] === "WAVE", "JIANT: SAMPLE retired: its number is \"-\"; 9 is WAVE (PHYS's, retired in TONIC)"); const names = E.parse[C.NAMES](await rq(E.req.names(4))); const g = E.parse[C.PRESET](await rq(E.req.preset(9, 0))); const s = E.parse[C.PRESET](await rq(E.req.preset(4, 1))); - ok(!names.names.length && g.engine === 0 && s.engine === 0, " no presets; a PHYS or SAMPLE preset asked for: ANALOG"); + ok(!names.names.length && g.engine === 9 && s.engine === 0, " no presets; a SAMPLE preset asked for: ANALOG; 9's: WAVE's"); await rq(E.req.preset(10, 0)); const kitD = E.parse[C.DESC](await rq(E.req.desc(0, info.pe0))); ok(kitD.label === "MORPH" && kitD.max === 127 && kitD.def === 64, @@ -426,8 +426,8 @@ function mockTables() { { const m0 = E.makeMockDevice({ auto: false }), ph = m0.tables.ENG[9], dr = m0.tables.ENG[10]; m0.stop(); - ok(ph.name === "-" && ph.presets.length === 0, - "editor: engine 9 reserved (PHYS retired in TONIC), no presets"); + ok(ph.name === "WAVE" && ph.edit.map((d) => d.label).join() === "A,POS,WARP,AMT,B,MIX,DETUNE,SUB" && ph.presets.length === 26, + "editor: engine 9 WAVE (PHYS's number, retired in TONIC): A POS WARP AMT B MIX DETUNE SUB, 26 presets"); ok(dr.name === "DRUM" && dr.edit.map((d) => d.label).join() === "MORPH,TUNE,TONE,DECAY,NOISE,FM ENV,FOLD,DRIVE" && dr.presets.length === 11 && dr.presets.slice(0, 9).every((p) => p.pat === 12) && dr.presets[1].name === "909 CLUB" && dr.presets[9].name === "HIP HOP" && dr.presets[9].pat === 14 && dr.presets[10].name === "LATIN PERC" && dr.presets[10].pat === 12,