V10.27: testers' fixes: CHORD voicing, MENU knobs, TAPE WOW wobble, slower LFO/PLAYHEADS/STRUM

- The CHORD page drew every degree with chord_build, writing VOICING LEAD's last
  chord: a key then played another inversion. The screen peeks now.
- MENU: KNOB k edits its own card's row (all four edited the selected row).
- TAPE WOW: a warped record's random, smoothed pitch drift (~+-45 cents at 100);
  the old swing was ~4 cents. Its own random source (the hiss's was stuck at 0).
- LFO RATE 8BAR / 16BAR; PLAYHEADS RATE 1/8 / 1/16; STRUM past 64 up to ~1 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
This commit is contained in:
Claude committed 2026-11-01 15:14:42 +00:00
1 parent 5db7ffcd21
commit ac5f9b9970
14 files changed
+1928 -1843

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@
#define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */
#endif
#ifndef FELUCCA_VERSION
#define FELUCCA_VERSION "V10.26" /* (2026-11-02) V10.26: SCENE starts with every track KEEP (OFF, as before); OCT+ on SCENE dices the roles (each role one track at most: never two doing the same, never two playing chords), OCT- all KEEP; turned ON with none set, it dices; a role picked by hand that another track has sends that one to KEEP. (2026-11-02) V10.25: SEQ > STRETCH's NUDGE in two modes: OCT- the whole sequence a step (blue, as before), OCT+ the cursor step's MICRO timing (red, 64ths of a step; PRESETS moves the cursor), MICRO back on a knob (a tester's ask). (2026-11-02) V10.24: the user's picks from the redesign mock: SEQ > EUCLID the lanes as concentric rings (heat colours, VARY's turns under the ring); SEQ > MUTATE the anchor above, the pattern playing below (changed steps lit), an arc to the next mutation; SAVE > PRESETS two columns (the engines, their presets), OCT+ keeps the sound browsed to, OCT- brings back the one before; SAVE > TOOLS by scope (KNOB 1 TRACK SOUND SONG SYSTEM, KNOB 2 the action), OCT+ held a second does it (no dialog); SCL > SCENE, the multitimbral mode: one key plays every track given a role (KEEP CHORD ARP BASS LEAD; the kit keeps its sequence), REC records each into its own steps. (2026-11-01) V10.23: STRING FDBK heard (its BLOOM level was applied twice, -15 dB); EXCITE into / out of FDBK keeps each side's EDIT 2 knobs (GAIN no longer starts at STRETCH's 0), FDBK's defaults audible. (2026-11-01) V10.22: testers' asks: ENV > ENV 2 (a second ADSR, MOD SRC ENV2, any DEST), FILTER TYPE LP24 (4 poles), ANALOG WAVE PLS3 (three pulses, SHAPE the width). (2026-11-01) V10.21: EUCLID's lane rows named right (they were one off: ALL's name on BD's row); the ring shows one cycle (the lane's, ALL's, the melody's) and the turn playing, its playhead going round; PROX's page says the phone, not the hand. (2026-11-01) V10.20: PROX smooth: the RSSI reading fixed on word 0 as the level (V10.18's widest range picked a noisy byte: a random sample and hold), the median of nine and ~0.3 s; FAR and NEAR too close (under 4 levels) refused. (2026-10-31) V10.19: the PROX page redraws when a reading arrives (all-zero words left it on NOT CONNECTED) and shows the link as seen: L (link), the RSSI hook's packets / the good packets. (2026-10-31) V10.18: PROX finds the RSSI reading that moves (the four RSSI words of each packet, twelve readings, the widest range on the link; kept once FAR / NEAR is stored), the page shows the four words. (2026-10-31) V10.17: SAVE > SECTIONS KNOB 2 ERASE (the section empty again, RAM and flash; the music stays). (2026-10-31) V10.16: SEQ > EUCLID's VARY in four turns (A A' A'' B, each moved anew, the motif answered); SEQ > MUTATE (EVERY 1..16 bars, AMOUNT, MODE ORBIT / DRIFT / PULSE, WHAT GROOVE / RHYTHM / FEEL / ALL; OCT+ a mutation now, OCT- back to the anchor). (2026-10-31) V10.15: VOICE's English dictionary in the Bluetooth segment (without it: the letter rules). (2026-10-31) V10.14: PROX, a modulation source from the Bluetooth signal (a hand near the antenna), calibrated on MENU > SYSTEM > BLUETOOTH ON + OCT+ (OCT- FAR, OCT+ NEAR). (2026-10-31) V10.13: BLE-MIDI in and out (what a central sends plays as USB-MIDI, MIDI OUT goes to it too); ABOUT's credits in the Bluetooth segment (the app slot had 128 B free). (2026-10-31) V10.12: MENU > SYSTEM > BLUETOOTH OFF / ON: a BLE-MIDI peripheral "JIANT FM-1" (advertising, connectable; MIDI not routed yet), Optimist's stack in the Bluetooth segment at 0xEA000 (written by the update loader from the package's bt.bin), live RF calibration, a boot guard. (2026-10-31) V10.11: the supplies set up as stock V15 does (the DC-DC on, hal/fm1_power.h from Melodee), the radio's prerequisite; 0xEA000..0xFBFFF reserved for the Bluetooth segment. (2026-10-31) V10.10: the radio's calibration kept: the update loader keeps the stock VM sector (0xE8000: RF trims, BT address) but its record's 256 B; VM_READ (editor 80) reads that area for web/btcheck. (2026-10-31) V10.9: MENU > LARGE shows the animations (HOME: the six tracks' creatures in the strip; EDIT: the engine's). (2026-10-31) V10.8: testers' fixes: GEN parts set OFF stay off; GEN keeps its GENRE between visits; SEQ > STEP KNOB 4 VEL (1..127, then ACC SLD A+S); delay 1/4D 1/8D 1/16D; less pitch wobble from the generators (no macro on PITCH, pitched delay seldom, octaves); STOP TO EDIT says SONG PLAYS. (2026-10-31) V10.7: SEQ > EUCLID on a kit: LANE ALL first (DENSITY: a whole usable kit), a lane picked writes that lane alone; EDIT + PRESETS jumps between engines; the kit's SEQ dice plays in every genre; EUCLID's HITS exact (VARY moved them only); REC held alone and let go: UNDO (again: REDO). (2026-10-31) V10.6: SEQ > EUCLID and MODES (a euclidean pattern generator, melodies in the key) in MUTATE's place; MUTATE and SEQ TOOLS' RANDOM COOK BEAT gone. (2026-10-31) V10.5: automation thinned (a recording at the stop, the 64 when full) into holds and RAMPs. (2026-10-31) V10.4: ARRANGE / TIMELINE:Line truncated
#define FELUCCA_VERSION "V10.27" /* (2026-11-02) V10.27: testers' fixes: the CHORD page no longer writes VOICING LEAD's last chord (a key played another inversion after the page was shown: chord_peek); MENU: KNOB k edits its card's row (all four edited the selected row); TAPE WOW wobbles like a warped record (a smoothed random drift, ~+-45 cents at 100; its noise source was stuck at 0: the hiss and drift were dead); slower: LFO RATE 8BAR 16BAR, PLAYHEADS 1/8 1/16, STRUM past 64 up to ~1 s. (2026-11-02) V10.26: SCENE starts with every track KEEP (OFF, as before); OCT+ on SCENE dices the roles (each role one track at most: never two doing the same, never two playing chords), OCT- all KEEP; turned ON with none set, it dices; a role picked by hand that another track has sends that one to KEEP. (2026-11-02) V10.25: SEQ > STRETCH's NUDGE in two modes: OCT- the whole sequence a step (blue, as before), OCT+ the cursor step's MICRO timing (red, 64ths of a step; PRESETS moves the cursor), MICRO back on a knob (a tester's ask). (2026-11-02) V10.24: the user's picks from the redesign mock: SEQ > EUCLID the lanes as concentric rings (heat colours, VARY's turns under the ring); SEQ > MUTATE the anchor above, the pattern playing below (changed steps lit), an arc to the next mutation; SAVE > PRESETS two columns (the engines, their presets), OCT+ keeps the sound browsed to, OCT- brings back the one before; SAVE > TOOLS by scope (KNOB 1 TRACK SOUND SONG SYSTEM, KNOB 2 the action), OCT+ held a second does it (no dialog); SCL > SCENE, the multitimbral mode: one key plays every track given a role (KEEP CHORD ARP BASS LEAD; the kit keeps its sequence), REC records each into its own steps. (2026-11-01) V10.23: STRING FDBK heard (its BLOOM level was applied twice, -15 dB); EXCITE into / out of FDBK keeps each side's EDIT 2 knobs (GAIN no longer starts at STRETCH's 0), FDBK's defaults audible. (2026-11-01) V10.22: testers' asks: ENV > ENV 2 (a second ADSR, MOD SRC ENV2, any DEST), FILTER TYPE LP24 (4 poles), ANALOG WAVE PLS3 (three pulses, SHAPE the width). (2026-11-01) V10.21: EUCLID's lane rows named right (they were one off: ALL's name on BD's row); the ring shows one cycle (the lane's, ALL's, the melody's) and the turn playing, its playhead going round; PROX's page says the phone, not the hand. (2026-11-01) V10.20: PROX smooth: the RSSI reading fixed on word 0 as the level (V10.18's widest range picked a noisy byte: a random sample and hold), the median of nine and ~0.3 s; FAR and NEAR too close (under 4 levels) refused. (2026-10-31) V10.19: the PROX page redraws when a reading arrives (all-zero words left it on NOT CONNECTED) and shows the link as seen: L (link), the RSSI hook's packets / the good packets. (2026-10-31) V10.18: PROX finds the RSSI reading that moves (the four RSSI words of each packet, twelve readings, the widest range on the link; kept once FAR / NEAR is stored), the page shows the four words. (2026-10-31) V10.17: SAVE > SECTIONS KNOB 2 ERASE (the section empty again, RAM and flash; the music stays). (2026-10-31) V10.16: SEQ > EUCLID's VARY in four turns (A A' A'' B, each moved anew, the motif answered); SEQ > MUTATE (EVERY 1..16 bars, AMOUNT, MODE ORBIT / DRIFT / PULSE, WHAT GROOVE / RHYTHM / FEEL / ALL; OCT+ a mutation now, OCT- back to the anchor). (2026-10-31) V10.15: VOICE's English dictionary in the Bluetooth segment (without it: the letter rules). (2026-10-31) V10.14: PROX, a modulation source from the Bluetooth signal (a hand near the antenna), calibrated on MENU > SYSTEM > BLUETOOTH ON + OCT+ (OCT- FAR, OCT+ NEAR). (2026-10-31) V10.13: BLE-MIDI in and out (what a central sends plays as USB-MIDI, MIDI OUT goes to it too); ABOUT's credits in the Bluetooth segment (the app slot had 128 B free). (2026-10-31) V10.12: MENU > SYSTEM > BLUETOOTH OFF / ON: a BLE-MIDI peripheral "JIANT FM-1" (advertising, connectable; MIDI not routed yet), Optimist's stack in the Bluetooth segment at 0xEA000 (written by the update loader from the package's bt.bin), live RF calibration, a boot guard. (2026-10-31) V10.11: the supplies set up as stock V15 does (the DC-DC on, hal/fm1_power.h from Melodee), the radio's prerequisite; 0xEA000..0xFBFFF reserved for the Bluetooth segment. (2026-10-31) V10.10: the radio's calibration kept: the update loader keeps the stock VM sector (0xE8000: RF trims, BT address) but its record's 256 B; VM_READ (editor 80) reads that area for web/btcheck. (2026-10-31) V10.9: MENU > LARGE shows the animations (HOME: the six tracks' creatures in the strip; EDIT: the engine's). (2026-10-31) V10.8: testers' fixes: GEN parts set OFF stay off; GEN keeps its GENRE between visits; SEQ > STEP KNOB 4 VEL (1..127, then ACC SLD A+S); delay 1/4D 1/8D 1/16D; less pitch wobble from the generators (no macro on PITCH, pitched delay seldom, octaves); STOP TO EDIT says SONG PLAYS. (2026-10-31) V10.7: SEQ > EUCLID on a kit: LANE ALL first (DENSITY: a whole usable kit), a lane picked writes that lane alone; EDIT + PRESETS Line truncated
#endif
#if FELUCCA_OTA && !FELUCCA_FLASH
#error "FELUCCA_OTA needs FELUCCA_FLASH"
+4 -3
View File
@@ -6,7 +6,7 @@
* chance roll; no components, locks or ratchets (those are the sequencer's). The settings are the section's (fg_set,
* project.c FUNC 'F' 'G'); the heads start with the transport and stop with it. Cost: a few operations a block a head */
#define FG_HEADS 3u
#define FG_NRATE 10u
#define FG_NRATE 12u /* (V10.27: 1/8 1/16 appended, a tester's) */
typedef struct {
uint8_t rate, dir; /* 0 OFF .. FG_NRATE - 1; FWD REV PING RND */
int8_t ivl; /* degrees, -14 .. 14 */
@@ -19,8 +19,9 @@ typedef struct {
} fg_head_t;
static fg_set_t fg_set[NTRK][FG_HEADS];
static fg_head_t fg_head[NTRK][FG_HEADS];
static const uint8_t FG_NUM[FG_NRATE] = {0, 1, 1, 1, 2, 1, 3, 2, 3, 4}, FG_DEN[FG_NRATE] = {1, 4, 3, 2, 3, 1, 2, 1, 1, 1};
static const char *const N_FGRATE[FG_NRATE] = {"OFF", "1/4", "1/3", "1/2", "2/3", "x1", "3/2", "x2", "x3", "x4"};
static const uint8_t FG_NUM[FG_NRATE] = {0, 1, 1, 1, 2, 1, 3, 2, 3, 4, 1, 1}, FG_DEN[FG_NRATE] = {1, 4, 3, 2, 3, 1, 2, 1, 1, 1, 8, 16};
static const char *const N_FGRATE[FG_NRATE] = {"OFF", "1/4", "1/3", "1/2", "2/3", "x1", "3/2", "x2", "x3", "x4", "1/8", "1/16"};
static const uint8_t FG_ORD[FG_NRATE] = {0, 11, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9}; /* (the knob: OFF, slowest first) */
static const char *const N_FGDIR[4] = {"FWD", "REV", "PING", "RND"};
enum { FG_FWD, FG_REV, FG_PING, FG_RND };
+18 -8
View File
@@ -265,14 +265,14 @@ static __attribute__((noinline)) void clip_block(uint32_t n)
* cents; a flutter ~7 Hz, ~3 samples), 0 at WOW 0 (no jump when it comes in), with a faint hiss; TAPE drives it x1 .. x4
* into the soft clip with a bias (even harmonics; made up at a mix's usual level, as CLIP), loses the highs (a one-pole
* down to ~7 kHz) and lifts the low end (a band about 60..100 Hz, up to ~+3 dB). Both knobs smoothed block to block */
#define TP_LEN 128u
#define TP_LEN 256u /* (V10.27: int16, as many bytes as 128 int32) */
#ifndef FM1_OPAQUE
#define FM1_OPAQUE(v) ((void)(v)) /* (the host: no reach to mind) */
#endif
static struct {
int32_t buf[2][TP_LEN];
int16_t buf[2][TP_LEN];
uint32_t w, ph_w, ph_d, ph_f;
int32_t d, wa, lp[2], b1[2], b2[2], noise;
int32_t d, wa, lp[2], b1[2], b2[2], noise, wob, wv1, wtgt, wcnt, wrnd; /* (V10.27) the wobble: where it drifts to, for how long */
int32_t drv, wow; /* the knobs smoothed (Q8: 0 .. 100 << 8) */
} tp __attribute__((section(".pool")));
static __attribute__((noinline)) void tape_block(uint32_t n)
@@ -295,8 +295,18 @@ static __attribute__((noinline)) void tape_block(uint32_t n)
tp.ph_d += 13u * n << 10;
tp.ph_f += 682u * n << 10;
wa = wv * 64 * 256 / 100; /* (p9b: x1.6 the wow; with the flutter ~105 samples of TP_LEN) */
d1 = ((wa * (32768 - sine_i(tp.ph_w + 0x40000000u))) >> 16) + ((wa * (32768 - sine_i(tp.ph_d))) >> 17) +
(((wv * 2304 / 100) * (32768 - sine_i(tp.ph_f))) >> 16); /* (p9b: thrice the flutter) */
if (!tp.wrnd) tp.wrnd = 0x2545F491; /* (V10.27: its own; the hiss's stays as it always played) */
if (--tp.wcnt <= 0) { /* (V10.27, a tester: "WOW barely heard, make it wobble like a
* vinyl") a warped record: the delay drifts to a new place at
* random every 0.1 .. 0.5 s, smoothed (~0.2 s), up to ~130
* samples at 100: ~+-40 cents, never twice the same */
tp.wtgt = (int32_t)((noise32(&tp.wrnd) >> 17) * (uint32_t)wv / 80u); /* (Q8 samples: 0 .. 40960, 160 samples) */
tp.wcnt = 70 + (int32_t)(noise32(&tp.wrnd) >> 23);
}
tp.wv1 += (tp.wtgt - tp.wv1) >> 5; /* (two one-poles: a smooth swell, no corner) */
tp.wob += (tp.wv1 - tp.wob) >> 5;
d1 = ((wa * (32768 - sine_i(tp.ph_w + 0x40000000u))) >> 17) + ((wa * (32768 - sine_i(tp.ph_d))) >> 18) + tp.wob +
(((wv * 2304 / 100) * (32768 - sine_i(tp.ph_f))) >> 16); /* (p9b: thrice the flutter; V10.27: the swing halved) */
tp.d = d1;
for (i = 0; i < n; i++) {
int32_t x[2], d = d0 + (d1 - d0) * (int32_t)i / (int32_t)n, di = d >> 8, fr = d & 255;
@@ -306,10 +316,10 @@ static __attribute__((noinline)) void tape_block(uint32_t n)
tp.w = (tp.w + 1u) & (TP_LEN - 1u);
for (c = 0; c < 2u; c++) {
int32_t y = x[c], a, b;
tp.buf[c][tp.w] = y;
tp.buf[c][tp.w] = (int16_t)clamp(y >> 2, -32768, 32767);
if (wv) {
a = tp.buf[c][(tp.w - (uint32_t)di) & (TP_LEN - 1u)];
b = tp.buf[c][(tp.w - (uint32_t)di - 1u) & (TP_LEN - 1u)];
a = tp.buf[c][(tp.w - (uint32_t)di) & (TP_LEN - 1u)] * 4;
b = tp.buf[c][(tp.w - (uint32_t)di - 1u) & (TP_LEN - 1u)] * 4;
y = a + (((b - a) * fr) >> 8) + (int32_t)((noise32(&tp.noise) >> 28) - 8u) * wv / 50;
}
if (dv) {
+9 -4
View File
@@ -3,8 +3,8 @@
/* Parameter descriptors, formatting and the page table. */
static const char *const N_LWAVE[] = {"SIN", "TRI", "SAW", "SQR", "S&H"};
/* (JIANT 0.6.51) the LFO's RATE below 0: in time with the tempo, -1 the slowest (next to the slowest free rate) */
static const char *const N_LSYNC[12] = {"4BAR", "2BAR", "1BAR", "1/2", "1/4", "1/8D", "1/4T", "1/8", "1/8T", "1/16",
"1/16T", "1/32"};
static const char *const N_LSYNC[14] = {"4BAR", "2BAR", "1BAR", "1/2", "1/4", "1/8D", "1/4T", "1/8", "1/8T", "1/16",
"1/16T", "1/32", "8BAR", "16BAR"}; /* (V10.27: -13 8BAR, -14 16BAR, a tester's) */
static const char *const N_AMODE[] = {"OFF", "UP", "DN", "UPDN", "RND", "ORD", "REPEAT", /* (append-only: seq.c AM_*) */
"DNUP", "UP+8", "CONV", "DIVG", "PINKY", "THUMB", "WALK", "CHORD",
"TRNS"}; /* (JIANT: seq.c AM_TRNS) */
@@ -93,7 +93,7 @@ static const param_desc_t TP[P_COUNT] = {
[P_ED_PIT] = PD("PITCH", F_BIPCT, -64, 63, 0),
[P_ED_SHP] = PD("SHAPE", F_BIPCT, -64, 63, 0),
[P_ED_FX] = PE("LOOP", N_ONOFF, 0), /* (JIANT 0.4, P_ELOOP) ON: held, the ENV starts again at the sustain */
[P_LRATE] = PD("RATE", F_LFOHZ, -12, 127, 60), /* (JIANT 0.6.51) below 0 in time: 4BAR .. 1/32 (N_LSYNC) */
[P_LRATE] = PD("RATE", F_LFOHZ, -14, 127, 60), /* (JIANT 0.6.51) below 0 in time: 4BAR .. 1/32 (N_LSYNC) */
[P_LWAVE] = PE("WAVE", N_LWAVE, 0),
[P_LPHASE] = PD("PHASE", F_INT, -1, 127, 0), /* (JIANT 0.6.51) -1: FREE, never restarted by a note (0.9.18: nor its
* FADE); the pages show it as MODE TRIG / FREE and PHASE 0..127 */
@@ -393,8 +393,13 @@ static uint32_t name_of(const param_desc_t *d, int32_t v, uint32_t *k)
*k = n;
return (uint32_t)(clamp(v, d->min, d->max) - d->min) * n / (uint32_t)(d->max - d->min + 1);
}
/* (V10.27) the LFO's RATE turned: Hz down to its slowest, then 16BAR 8BAR (stored -14 -13: appended), 4BAR .. 1/32 */
static int32_t lrate_rank(int32_t v) { return v >= 0 ? v + 14 : v >= -12 ? v + 12 : v == -13 ? 12 : 13; }
static int32_t lrate_at(int32_t r) { return r >= 14 ? r - 14 : r <= 11 ? r - 12 : r == 12 ? -13 : -14; }
static int32_t param_turn(const param_desc_t *d, int32_t v, int32_t steps)
{
if (d == &TP[P_LRATE])
return lrate_at(clamp(lrate_rank(v) + steps, 0, 141));
const uint8_t *o = enum_order(d);
uint32_t k, i, w = (uint32_t)(d->max - d->min + 1);
if (d->fmt == F_PCTINV) steps = -steps; /* (right: more chance, less skipped) */
@@ -464,7 +469,7 @@ static void param_format(const param_desc_t *d, int32_t v, char *val, const char
case F_LFOHZ: {
uint32_t h = LFO_HZ_X100[v & 127];
if (v < 0) { /* (0.6.51) the LFO in time */
str_cpy(val, N_LSYNC[(uint32_t)(-v - 1) % 12u], 6);
str_cpy(val, N_LSYNC[(uint32_t)(-v - 1) % 14u], 6);
break;
}
if (h < 1000u)
+16 -7
View File
@@ -253,9 +253,9 @@ static uint32_t chord_build_mode(const track_t *t, uint32_t root, uint8_t *out,
static const int8_t SHP[6][4] = {{0, 4, 7, -1}, {0, 3, 7, -1}, {0, 4, 7, 10}, {0, 4, 7, 11}, {0, 3, 7, 10},
{0, 7, 12, -1}};
const engine_t *e = ENGINES[eng_idx(t->eng_req)];
uint32_t vc = (uint32_t)t->p[P_CVOI], n = 0, i, j, ti = trk_index(t) % NTRK, any = mode & 0x80u; /* (V10.25 SCENE: */
int32_t nt[KB_CH + 1], r = (int32_t)root; /* any voice) */
mode &= 0x7Fu;
uint32_t vc = (uint32_t)t->p[P_CVOI], n = 0, i, j, ti = trk_index(t) % NTRK, any = mode & 0x80u, peek = mode & 0x40u;
int32_t nt[KB_CH + 1], r = (int32_t)root; /* (V10.25 SCENE any: any voice; V10.27 peek: the screen's, */
mode &= 0x3Fu; /* LEAD's last chord not written: drawing changed the voicing) */
if (!mode || mode > CD_POW || e->oneshot || (e->keys && e->keys(t, 0) >= 0) || (t->p[P_VOICE] != V_POLY && !any)) {
out[0] = (uint8_t)root;
return 1;
@@ -325,6 +325,7 @@ static uint32_t chord_build_mode(const track_t *t, uint32_t root, uint8_t *out,
for (i = 0, j = 0; i < n && j < KB_CH; i++)
if (nt[i] >= 0 && nt[i] <= 127) out[j++] = (uint8_t)nt[i];
if (!j) out[j++] = (uint8_t)root;
if (peek) return j;
for (i = 0; i < j; i++) chord_last[ti][i] = out[i];
chord_nlast[ti] = (uint8_t)j;
return j;
@@ -333,7 +334,15 @@ static uint32_t chord_build(const track_t *t, uint32_t root, uint8_t *out)
{
return chord_build_mode(t, root, out, (uint32_t)t->p[P_CHRD]);
}
static uint32_t chord_gap(const track_t *t) { return (uint32_t)clamp(t->p[P_CSTR], 0, 127) * (FS / 2000u); } /* (~0.5 ms a step) */
static uint32_t chord_peek(const track_t *t, uint32_t root, uint8_t *out) /* (V10.27) the screen's: no voicing state */
{
return t->p[P_CHRD] ? chord_build_mode(t, root, out, (uint32_t)t->p[P_CHRD] | 0x40u) : chord_build(t, root, out);
}
static inline __attribute__((always_inline)) uint32_t chord_gap(const track_t *t) /* (~0.5 ms a step to 64 (32 ms); V10.27, a tester: past it up to ~1 s) */
{
uint32_t v = (uint32_t)clamp(t->p[P_CSTR], 0, 127);
return v <= 64u ? v * (FS / 2000u) : 64u * (FS / 2000u) + (v - 64u) * (v - 64u) * 11u;
}
/* ------------------------------------------------------------- arp --- */
static void arp_add(track_t *t, uint32_t note)
@@ -1171,13 +1180,13 @@ static void key_off(uint32_t k, track_t *t)
}
/* (V10.25) SCENE: key k down (on) or up on every track with a role; the notes again from the key at the key-up */
static uint32_t scn_notes(const track_t *t, uint32_t r, uint32_t root, uint8_t *o)
static uint32_t scn_notes(const track_t *t, uint32_t r, uint32_t root, uint8_t *o, int pk)
{
if (r == SC_BASS || r == SC_LEAD) {
o[0] = (uint8_t)clamp((int32_t)root + (r == SC_BASS ? -12 : 12), 0, 127);
return 1;
}
return chord_build_mode(t, root, o, (t->p[P_CHRD] ? (uint32_t)t->p[P_CHRD] : CD_TRI) | 0x80u); /* (whatever its voice) */
return chord_build_mode(t, root, o, (t->p[P_CHRD] ? (uint32_t)t->p[P_CHRD] : CD_TRI) | 0x80u | (pk ? 0x40u : 0u));
}
static void scene_key(uint32_t k, int on)
{
@@ -1187,7 +1196,7 @@ static void scene_key(uint32_t k, int on)
track_t *t = &trk[i];
if (!scn_role[i] || drum_track(t))
continue;
n = scn_notes(t, scn_role[i], kb_map(t, k), o);
n = scn_notes(t, scn_role[i], kb_map(t, k), o, 0);
mc = trk_midi_ch(i);
if (on && n > 1u && rec_on(t) && !t->p[P_AMODE]) /* (a chord: into one step, as key_on) */
for (j = 0; j < n; j++)
+1 -1
View File
@@ -1493,7 +1493,7 @@ static void draw_columns(void)
const fg_set_t *f = &fg_set[song.sel % NTRK][fg_ui % FG_HEADS];
fmt_int(val, (int32_t)(fg_ui % FG_HEADS) + 2);
hot_gauge_column(0, "HEAD", val, (int32_t)(fg_ui % FG_HEADS) * 500);
gauge_column(1, "RATE", N_FGRATE[f->rate % FG_NRATE], f->rate ? VAL(1u) : T_DIM, (int32_t)f->rate * 1000 / 9);
gauge_column(1, "RATE", N_FGRATE[f->rate % FG_NRATE], f->rate ? VAL(1u) : T_DIM, (int32_t)f->rate * 1000 / (FG_NRATE - 1));
gauge_column(2, "DIR", N_FGDIR[f->dir & 3u], f->rate ? VAL(2u) : T_DIM, (int32_t)(f->dir & 3u) * 333);
val[0] = f->ivl > 0 ? '+' : 0;
fmt_int(val + (f->ivl > 0), f->ivl);
+7 -8
View File
@@ -1222,7 +1222,11 @@ static void edit_param(uint32_t slot, int32_t steps)
fg_set_t *f = &fg_set[song.sel % NTRK][fg_ui % FG_HEADS];
int32_t d = steps > 0 ? 1 : -1;
if (slot == 0u) fg_ui = (uint8_t)clamp((int32_t)fg_ui + d, 0, FG_HEADS - 1);
else if (slot == 1u) f->rate = (uint8_t)clamp((int32_t)f->rate + d, 0, FG_NRATE - 1);
else if (slot == 1u) { /* (V10.27: over FG_ORD, 1/16 1/8 after OFF) */
uint32_t r;
for (r = 0; r < FG_NRATE && FG_ORD[r] != f->rate; r++) {}
f->rate = FG_ORD[clamp((int32_t)r + d, 0, FG_NRATE - 1)];
}
else if (slot == 2u) f->dir = (uint8_t)clamp((int32_t)f->dir + d, 0, 3);
else f->ivl = (int8_t)clamp((int32_t)f->ivl + d, -14, 14);
return;
@@ -1775,13 +1779,8 @@ static void seq_entry(uint32_t pressed)
if (kb_sn[k] && kb_trk[k] == ti) { /* (0.6.83) SCL > CHORD: the chord the key sounds (seq.c key_on), */
nc = kb_sn[k]; /* all of it into the step, as live recording does */
memcpy(cn, kb_snd[k], KB_CH);
} else { /* (the key not in yet: built here, LEAD's memory as it was) */
uint8_t last[KB_CH], nl = chord_nlast[ti];
memcpy(last, chord_last[ti], KB_CH);
nc = chord_build(t, note, cn);
memcpy(chord_last[ti], last, KB_CH);
chord_nlast[ti] = nl;
}
} else /* (the key not in yet: built here, LEAD's memory untouched) */
nc = chord_peek(t, note, cn);
for (c = 0; c < nc && c < KB_CH; c++)
ent_note(t, st, cn[c]);
last_note = (uint8_t)note;
+1 -1
View File
@@ -308,7 +308,7 @@ static void graph_chord(const track_t *t)
for (d = 0; d < c; d++) {
uint8_t nt[8];
int32_t x = 14 + (int32_t)d * 31;
uint32_t n = chord_build(t, 48u + rt + deg[d], nt), k;
uint32_t n = chord_peek(t, 48u + rt + deg[d], nt), k;
cv_rect(x - 2, 18, 27, 100, d == 0u ? T_TINT : T_SURF);
for (k = 0; k < n && k < 8u; k++)
cv_rect(x, 112 - clamp((int32_t)nt[k] - 48, 0, 31) * 3, 23, 3, k == 0u ? T_ACCENT : T_THEME);
+11 -3
View File
@@ -256,7 +256,7 @@ static int32_t menu_scroll_max(void)
* panel MENU: the four tabs as tiles, each with its rows and their values (the tab shown framed); TAB: the tab's rows
* (the set's tinted with their knob's number, the selected one striped in the accent); ROW: the row's values as
* chips (the one set framed; COLOR: each palette's colours, live)
* The knobs, ALGORITHM, PRESETS, OCT-/+ as before (any knob or OCT-/+ the selected row's value; PRESETS its row, on MENU
* The knobs, ALGORITHM, PRESETS, OCT-/+ as before (V10.27: KNOB k its card's row; OCT-/+ the selected row's value; PRESETS its row, on MENU
* the tab). The drawing redone whole on a change (menu_sig) */
static int menu_large(void) { return (ui_prefs & PREF_LARGE) != 0u; }
static uint32_t menu_tab(void) { return MI_TAB[ui.menu_sel % MI_COUNT]; }
@@ -574,8 +574,16 @@ static void menu_input(uint32_t oct) /* oct: ui_input.c oct_tap
ui.mlv = 1; /* (the tab's rows) */
if ((s = panel_enc(EN_ALGO)) != 0)
menu_tab_go(s);
for (s = 0, k = 0; k < 4u; k++) /* KNOB 1..4, any of them */
s += panel_enc(EN_K1 + k);
for (s = 0, k = 0; k < 4u; k++) { /* (V10.27, a tester) KNOB k its card's row, as the cards and the */
int32_t sk = panel_enc(EN_K1 + k); /* rows' numbers show (was: any knob the selected row) */
uint32_t t = menu_tab(), r = mtab_first(t) + menu_set() * 4u + k;
if (!sk) continue;
if (r < mtab_first(t) + mtab_rows(t) && r < MI_VALUES) {
ui.menu_sel = (uint8_t)r;
menu_put(r, menu_step(r, sk));
ui.force = 1;
}
}
if (ui.menu_sel == MI_BT && up && bt_prox_ok()) { /* (V10.14) BLUETOOTH ON: OCT+ opens PROX's page */
ui.menu = 3;
ui.force = 1;
+1 -1
View File
@@ -97,7 +97,7 @@ static void graph_scene(void)
if (t->step[j].time == ST_NOTE) cv_rect(x + 2, y0 + (int32_t)j * yh / 16, cw - 10, 2, T_DIM);
continue;
}
n = scn_notes(t, r, last_note, o); /* the last key's notes on it, by pitch */
n = scn_notes(t, r, last_note, o, 1); /* the last key's notes on it, by pitch */
for (j = 0; j < n; j++) {
int32_t y = y0 + yh - 4 - (clamp(o[j], 36, 96) - 36) * (yh - 6) / 60;
cv_rect(x + 2 + (r == SC_ARP ? (int32_t)j * 7 : 0), y, r == SC_ARP ? 6 : cw - 10, 3, c);
+2 -2
View File
@@ -380,8 +380,8 @@ static void track_lfo_tick(track_t *t)
if (r < 0) { /* (JIANT 0.6.51) in time: 4BAR .. 1/32 (params.c N_LSYNC), on
* the transport's grid while it plays (PHASE its offset), free
* while it is stopped */
static const uint16_t U[12] = {384, 192, 96, 48, 24, 18, 16, 12, 8, 6, 4, 3}; /* 1/24 of a quarter */
uint32_t len = beat_samples() * U[(uint32_t)(-r - 1) % 12u] / 24u;
static const uint16_t U[14] = {384, 192, 96, 48, 24, 18, 16, 12, 8, 6, 4, 3, 768, 1536}; /* 1/24 of a quarter */
uint32_t len = beat_samples() * U[(uint32_t)(-r - 1) % 14u] / 24u;
if (len < 64u)
len = 64u;
if (song.playing)
+3 -3
View File
@@ -147,8 +147,8 @@ int main(void)
}
printf("tape: WOW 0: the period %.3f .. %.3f samples; WOW 100: %.3f .. %.3f (%.1f cents)\n", mn[0], mx[0], mn[1],
mx[1], 1200 * log2(mx[1] / mn[1]));
ck("3. WOW 100: the period swings a few cents (2 .. 30), WOW 0 steady (under 1 cent)",
1200 * log2(mx[1] / mn[1]) > 2 && 1200 * log2(mx[1] / mn[1]) < 30 && 1200 * log2(mx[0] / mn[0]) < 1);
ck("3. WOW 100: the period swings (V10.27: a warped record, 20 .. 120 cents), WOW 0 steady (under 1 cent)",
1200 * log2(mx[1] / mn[1]) > 20 && 1200 * log2(mx[1] / mn[1]) < 120 && 1200 * log2(mx[0] / mn[0]) < 1);
}
{
int32_t d2max = 0, d2tone = 0;
@@ -166,7 +166,7 @@ int main(void)
}
printf("tape: 0 -> 100 -> 0 in one block: the second difference at most %d (the tone's own %d)\n", d2max, d2tone);
ck(" WOW and TAPE turned 0 -> 100 -> 0 in one block: no click (the second difference within 6 x the tone's own: p9b's drive)",
d2max <= 6 * d2tone + 8);
d2max <= 7 * d2tone + 8); /* (V10.27: 7 x: the wobble raises the pitch ~50 cents, the curvature with it; no click) */
}
/* ---- 4. a project keeps them ---- */
{
+54 -2
View File
@@ -282,8 +282,14 @@ static void hold(uint32_t label) /* held 0.8 s, then let go */
fm1_in.buttons &= ~(1u << panel.btn[label]);
frame();
}
static uint32_t menu_tab(void);
static uint32_t mtab_first(uint32_t t);
static int raw_knob; /* (V10.27) turn(): the knob as named, no MENU mapping */
static void turn(uint32_t role, int32_t s)
{
if (ui.menu == 1 && role >= EN_K1 && role <= EN_K4 && !raw_knob) /* (V10.27) MENU: KNOB k its card's row; a knob in the
* older tests: the selected row's own */
role = EN_K1 + (ui.menu_sel - mtab_first(menu_tab())) % 4u;
host_enc[panel.enc[role]] += s * panel.dir[role];
frame();
host_ticks += 200000u; /* (no knob acceleration between the turns) */
@@ -2581,7 +2587,19 @@ static int test_menu_tabs(void)
ok &= ui.menu_sel == MI_USB;
turn(EN_K4, 1); ok &= (ui_prefs & PREF_USB_FIXED) && fx_usb_fixed;
turn(EN_K2, -1); ok &= !(ui_prefs & PREF_USB_FIXED) && !fx_usb_fixed;
bad += check("MENU: any of KNOB 1..4 changes the selected row's value in any tab, the menu stays", ok && ui.menu == 1);
bad += check("MENU: the selected row's knob changes its value in any tab, the menu stays", ok && ui.menu == 1);
{ /* (V10.27, a tester: "the 4 knobs move the same parameter") KNOB k its card's row (the rows' numbers 1..4) */
uint32_t a0 = click_mode, l0 = click_lvl;
ui.menu_sel = MI_LOWCUT; ui.force = 1; frame();
raw_knob = 1;
turn(EN_K3, 1);
ok = ui.menu_sel == MI_CLICK && click_mode != a0 && click_lvl == l0;
turn(EN_K4, 1);
ok &= ui.menu_sel == MI_CLKLVL && click_lvl != l0;
raw_knob = 0;
click_mode = a0; click_lvl = l0;
bad += check("MENU: KNOB 1..4 each its own card's row, the row picked with it (V10.27)", ok && ui.menu == 1);
}
/* OCT+ / OCT-: the next / previous value on every kind of row (as the knobs: stopping at the ends; COLOR wraps) */
ok = 1;
@@ -5330,7 +5348,7 @@ static int test_step_rec(void)
{ /* (0.6.84) STRUM: recorded whole into the one step where the key went down (its later notes no longer fall into
* the next step), and the sequencer strums the chord back, low to high */
uint32_t i, used = 0, kr = 7, b2, first = 0, later = 0;
t->p[P_CSTR] = 127; /* (~63 ms apart) */
t->p[P_CSTR] = 64; /* (~32 ms apart; V10.27: past 64 up to ~1 s) */
for (i = 0; i < NSTEP; i++) step_clear(&t->step[i]);
while (t->seq_pos < step_samples(t, div_samples((uint32_t)t->p[P_SDIV]), t->seq_idx) * 2u / 5u)
events_block(CTL); /* (just before the middle of a step: a strum would cross it) */
@@ -13023,6 +13041,38 @@ static int test_comp_cards(void)
return check("COMP / COMP 2 / COMPS: every value of the four cards whole, in the four skins and LARGE", bad == 0 && n > 1000u);
}
/* (V10.27, a tester: "really slow LFOs, slower playheads and strum") the LFO's RATE: Hz, then 16BAR 8BAR 4BAR .. 1/32;
* PLAYHEADS' RATE 1/16 1/8 after OFF; STRUM past 64 up to ~1 s */
static int test_slower(void)
{
int ok;
track_t t;
ok = param_turn(&TP[P_LRATE], 0, -1) == -14 && param_turn(&TP[P_LRATE], -14, -1) == -13 &&
param_turn(&TP[P_LRATE], -13, -1) == -1 && param_turn(&TP[P_LRATE], -1, 1) == -13 && param_turn(&TP[P_LRATE], -14, 1) == 0 &&
param_turn(&TP[P_LRATE], -12, -1) == -12;
memset(&t, 0, sizeof t);
t.p[P_CSTR] = 40; ok &= chord_gap(&t) == 40u * (FS / 2000u);
t.p[P_CSTR] = 127; ok &= chord_gap(&t) > FS * 9u / 10u;
ok &= FG_ORD[1] == 11u && FG_DEN[11] == 16u;
return check("SLOWER: LFO 16BAR 8BAR before 4BAR, PLAYHEADS 1/16 1/8, STRUM to ~1 s (V10.27)", ok);
}
/* (V10.27, a tester: "a key plays a different chord after playing others") the CHORD page drew every degree's chord
* with chord_build, which wrote LEAD's last chord: the screen changed the next key's voicing. The screen peeks now */
static int test_chord_peek(void)
{
uint8_t a[KB_CH + 1], b[KB_CH + 1];
uint32_t na, nb, i;
ui_power_on();
song.sel = 4; set_engine_of(TSEL, ENGI_ANALOG);
TSEL->p[P_QUANT] = QN_SNAP; TSEL->p[P_CHRD] = 1; TSEL->p[P_CVOI] = 1; TSEL->p[P_VOICE] = V_POLY; /* (TRIAD, LEAD) */
for (i = 0; i < 40u; i++) events_block(CTL);
key_down(7); events_block(CTL); key_up(7); events_block(CTL);
key_down(12); events_block(CTL); na = kb_sn[12]; memcpy(a, kb_snd[12], sizeof a); key_up(12); events_block(CTL);
key_down(7); events_block(CTL); key_up(7); events_block(CTL);
go_title("CHORD"); frames(200); /* (the page draws all seven degrees' chords) */
key_down(12); events_block(CTL); nb = kb_sn[12]; memcpy(b, kb_snd[12], sizeof b); key_up(12); events_block(CTL);
return check("CHORD LEAD: the CHORD page on screen does not change the next key's chord (V10.27)", na == nb && !memcmp(a, b, na));
}
/* (V10.25) SEQ > STRETCH's NUDGE: OCT- the whole sequence a step (blue), OCT+ the cursor step's MICRO timing (red) */
static int test_nudge_micro(void)
{
@@ -13151,6 +13201,8 @@ int main(void)
bad += test_presets_back();
bad += test_scene();
bad += test_nudge_micro();
bad += test_chord_peek();
bad += test_slower();
bad += test_large_face();
bad += test_lz_home();
bad += test_lz_edit();
+1800 -1799
View File
File diff suppressed because it is too large. Load diff