mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-05 12:24:42 +01:00
V10.24: redesigned EUCLID, MUTATE, PRESETS, TOOLS; SCL > SCENE multitimbral mode
EUCLID: lanes as concentric rings in heat colours, VARY's turns under the ring. MUTATE: the anchor's pattern above, the one playing below (changed steps lit), an arc to the next mutation. PRESETS: engines and presets in two columns, OCT+ keeps the sound browsed to, OCT- brings back the one before. TOOLS: KNOB 1 the scope, KNOB 2 the action, OCT+ held a second does it. SCENE: one key plays every track given a role (KEEP CHORD ARP BASS LEAD), REC records each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
This commit is contained in:
15 files changed
+2440
-2003
No files matched your search
@@ -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.23" /* (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: OCT- deletes the row picked (DELETE ROW?). (2026-10-31) V10.3: TIMELINE: the lines between lanes soft (the block's colour, darker), the rows' edges stronger. (2026-10-31) V10.2: TIMELINE keeps the black line between lanes (only the rows touch); SAVE composes first: TIMELINE SECTIONS PROJECTS ARRANGE TOOLS USER PRESETS. (2026-10-30) V10.1: TIMELINE blocks fill the lanes (no black gaps between rows or tracks). (2026-10-30) JIANT FM V10: add15-beta6 as the new base (TIMELINE, VAR, ADD, official V16 both ways); the version history before it: the git log of the add15 line (codex/add15-private) */
|
||||
#define FELUCCA_VERSION "V10.24" /* (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: OCT- deletes the row picked (DELETE ROW?). (2026-10-31) V10.3: TIMELINE: the lines between lanes soft (the block's colour, darker), the rows' edges stronger. (2026-10-31) V10.2: TIMELINE keeps the black line between lanes (only the rows touch); SAVE composes first: TIMELINE SECTIONS PROJECTS ARRANGE TOOLS USER PRESETS. (2026-10-30) V10.1: TIMELINE blocks fill the lanes (no black gaps between rows or tracks). (2026-10-30) JIANT FM V10: add15-beta6 as the new base (TIMELINE, VAR, ADD, official V16 both ways); the version history befoLine truncated
|
||||
#endif
|
||||
#if FELUCCA_OTA && !FELUCCA_FLASH
|
||||
#error "FELUCCA_OTA needs FELUCCA_FLASH"
|
||||
|
||||
@@ -250,8 +250,10 @@ static const param_desc_t CLEN_DESC = {"C.LEN", F_ENUM, 0, 64, 0, N_CLEN, 0};
|
||||
static const param_desc_t DXIMG_DESC = {"IMAGE", F_INT, 0, 127, 0, 0, 0}; /* (0.6.48) P_DXIMG */
|
||||
/* (V10.6) SEQ > EUCLID / MODES' knobs (ui_euclid.c: ids ID_EU0 + EK_*, the views of the selected track's settings) */
|
||||
#define ID_EU0 0xF0u
|
||||
#define ID_SC0 0xE8u /* (V10.25) SCL > SCENE's four (ui_scene.c sc_desc) */
|
||||
#define ID_MU0 0xE4u /* (V10.16) SEQ > MUTATE's four (EK_U0 + 0..3) */
|
||||
static const param_desc_t *eu_desc(uint32_t k, int16_t **valp);
|
||||
static const param_desc_t *sc_desc(uint32_t k, int16_t **valp); /* (V10.25) ui_scene.c */
|
||||
static const char *const N_CHRD[] = {"OFF", "TRIAD", "7TH", "ADD9", "SUS2", "SUS4", "MAJ", "MIN", "7", "MAJ7", "MIN7",
|
||||
"POWER", 0};
|
||||
static const char *const N_CVOI[] = {"CLOSE", "LEAD", "OPEN", "+BASS", 0};
|
||||
@@ -541,7 +543,7 @@ enum { GR_NONE, GR_ADSR, GR_LFO, GR_STEPS, GR_ARP, GR_SCALE, GR_FX, GR_ROLL, GR_
|
||||
GR_SLCR, GR_MOD, GR_PATS, GR_SONG, GR_TOOLS, GR_CHANCE, GR_MOTION, GR_EVENTS, GR_DXSND, GR_MSEQ, GR_SLPIT,
|
||||
GR_FMOP, GR_FMOP2, GR_FMENV,
|
||||
GR_COMP, GR_EUCLID, GR_MORPH, GR_DXIMG, GR_FUGUE, GR_SHAPE, GR_PUNCH, GR_BUSES, GR_FOCUS, GR_STAGE,
|
||||
GR_LYRIC, GR_GCOMP, GR_LIVE }; /* (p2, main 0.9.11) GLO > LIVE: MANO, RIELES (ui_live.c); the enum's last */ /* (0.8.5) EDIT > WORDS: VOICE's lyric (sing.c) */ /* (0.8.5:
|
||||
GR_LYRIC, GR_GCOMP, GR_LIVE, GR_SCENE }; /* (p2, main 0.9.11) GLO > LIVE: MANO, RIELES (ui_live.c); the enum's last */ /* (0.8.5) EDIT > WORDS: VOICE's lyric (sing.c) */ /* (0.8.5:
|
||||
* LENTE's EDIT > FOCUS, ENV > STAGE) */ /* (0.6.99) FX > PUNCH: the punch-in lane */ /* (JIANT 0.6.39) SEQ > COMP: the step components (ui_input.c comp_*, ui_graph.c graph_comp) */ /* (JIANT 0.6.10, from Felucca 1.5: FM6's operator pages, ui_fm6op.c) */
|
||||
|
||||
typedef struct {
|
||||
@@ -624,6 +626,8 @@ static const page_t PAGES[] = {
|
||||
{"SCL", FAM_SCL, SC_TRACK, GR_SCALE, {P_ROOT, P_SCALE, P_QUANT, ID_ALLTR}}, /* (JIANT: ROOT, SCALE every melodic track's;
|
||||
* 0.7.6: ALL TR, the global, where TRANS was: SCL 2 gone) */
|
||||
{"CHORD", FAM_SCL, SC_TRACK, GR_NONE, {P_CHRD, P_CVOI, P_CSTR, 0xFF}}, /* (0.6.81) a key plays a chord (seq.c) */
|
||||
{"SCENE", FAM_SCL, SC_TRACK, GR_SCENE, {ID_SC0, ID_SC0 + 1u, ID_SC0 + 2u, ID_SC0 + 3u}}, /* (V10.25) the multitimbral
|
||||
* mode: SCENE, TRACK, ROLE, CHORD (ui_scene.c) */
|
||||
{"EDIT 1", FAM_EDIT, SC_ENGINE, GR_NONE, {P_E0, P_E1, P_E2, P_E3}},
|
||||
{"EDIT 2", FAM_EDIT, SC_ENGINE, GR_NONE, {P_E4, P_E5, P_E6, P_E7}},
|
||||
{"WORDS", FAM_EDIT, SC_TRACK, GR_LYRIC, {P_VLANG, P_VLYR, P_E0, 0xFF}}, /* (0.8.5) VOICE: LANG LYRIC POS, OCT+ TYPE
|
||||
@@ -799,6 +803,8 @@ static const param_desc_t *page_desc(const page_t *pg, uint32_t slot, int16_t **
|
||||
return eu_desc(id - ID_EU0, valp);
|
||||
if (id >= ID_MU0 && id < ID_MU0 + 4u) /* (V10.16) MUTATE's */
|
||||
return eu_desc(id - ID_MU0 + 8u, valp);
|
||||
if (id >= ID_SC0 && id < ID_SC0 + 4u) /* (V10.25) SCENE's */
|
||||
return sc_desc(id - ID_SC0, valp);
|
||||
*valp = &TSEL->p[id];
|
||||
if (id == P_APRATE && TSEL->p[P_APSYNC]) /* (0.6.9) AUTO PAN on the tempo: a division */
|
||||
return &AP_BEAT;
|
||||
|
||||
+68
-4
@@ -253,9 +253,10 @@ 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;
|
||||
int32_t nt[KB_CH + 1], r = (int32_t)root;
|
||||
if (!mode || mode > CD_POW || e->oneshot || (e->keys && e->keys(t, 0) >= 0) || t->p[P_VOICE] != V_POLY) {
|
||||
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;
|
||||
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;
|
||||
}
|
||||
@@ -367,7 +368,18 @@ static void arp_remove(track_t *t, uint32_t note)
|
||||
|
||||
static void rec_note(track_t *t, uint32_t note, uint32_t vel);
|
||||
static void rec_release(track_t *t, uint32_t note);
|
||||
static int rec_on(const track_t *t) { return ((song.rec >> trk_index(t)) & 1u) && song.playing && !chain.running; }
|
||||
/* (V10.25) SCENE (SCL > SCENE, ui_scene.c): the keys play every track given a role at once, from the one key: CHORD the
|
||||
* key's chord of the scale (its CHORD type, TRI if off), ARP that chord into the track's arp, BASS the key an octave
|
||||
* down, LEAD an octave up; KEEP: the track as it is (its sequence plays on, the keys do not reach it). Armed, REC
|
||||
* records every track with a role into its own steps. The roles are the session's (RAM) */
|
||||
enum { SC_KEEP, SC_CHORD, SC_ARP, SC_BASS, SC_LEAD, SC_N };
|
||||
static uint8_t scn_on, scn_role[NTRK] = {SC_KEEP, SC_LEAD, SC_KEEP, SC_ARP, SC_BASS, SC_CHORD};
|
||||
static uint32_t scn_keys; /* the keys down that play the scene (their key-up too) */
|
||||
static int rec_on(const track_t *t)
|
||||
{
|
||||
uint32_t i = trk_index(t); /* (not modulo: the internal parts past NTRK never record) */
|
||||
return (((song.rec >> i) & 1u) || (scn_on && song.rec && i < NTRK && scn_role[i])) && song.playing && !chain.running;
|
||||
}
|
||||
static int pfx_rec_ok(void) { return song.rec && song.playing && !chain.running; } /* (pfx.c: the punch-in lane) */
|
||||
|
||||
#include "motion.c"
|
||||
@@ -1158,6 +1170,48 @@ 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)
|
||||
{
|
||||
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) */
|
||||
}
|
||||
static void scene_key(uint32_t k, int on)
|
||||
{
|
||||
uint32_t i, j, n, mc;
|
||||
uint8_t o[KB_CH + 1];
|
||||
for (i = 0; i < trk_live && i < NTRK; i++) {
|
||||
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);
|
||||
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++)
|
||||
rec_note(t, o[j], 100);
|
||||
in_norec = (uint8_t)(on && n > 1u);
|
||||
for (j = 0; j < n; j++) {
|
||||
if (midi_local_held(t, o[j]))
|
||||
continue;
|
||||
if (on) {
|
||||
input_on(t, o[j], 100);
|
||||
mo_key(t, 0x09u | (0x90u | mc) << 8 | (uint32_t)o[j] << 16 | 100u << 24);
|
||||
} else {
|
||||
input_off(t, o[j]);
|
||||
mo_key(t, 0x08u | (0x80u | mc) << 8 | (uint32_t)o[j] << 16);
|
||||
}
|
||||
}
|
||||
in_norec = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* (the keys' block is RAM code: SCENE's call goes through a pointer, out of the direct calls' +-4 MiB reach check;
|
||||
* a key event, not every block) */
|
||||
static void (*volatile scene_fp)(uint32_t, int) = scene_key;
|
||||
|
||||
#ifdef FM1_INPUT_LAT
|
||||
/* the press latency stats (hal/fm1_input.h fm1_in_stat, console `inp`): from the first scan that saw
|
||||
* key k closed to its note-on here, and to the note's first sample leaving the DMA (kb_out_tick:
|
||||
@@ -1221,6 +1275,11 @@ static void keyboard_block(void)
|
||||
kb_oct[k] = (int8_t)(!song.grid && drum_track(&trk[kb_trk[k]]) ? song.octave : 0); /* (0.8.5) */
|
||||
if (kb_note[k] == KB_SILENT)
|
||||
continue;
|
||||
if (scn_on && !song.grid) { /* (V10.25) SCENE: every track with a role */
|
||||
scn_keys |= 1u << k;
|
||||
scene_fp(k, 1);
|
||||
continue;
|
||||
}
|
||||
key_on(k, &trk[kb_trk[k]]);
|
||||
#ifdef FM1_INPUT_LAT
|
||||
kb_lat(k);
|
||||
@@ -1235,6 +1294,11 @@ static void keyboard_block(void)
|
||||
lv.kb &= ~(1u << k);
|
||||
continue;
|
||||
}
|
||||
if ((scn_keys >> k) & 1u) { /* (V10.25) a SCENE key: its notes on every role */
|
||||
scn_keys &= ~(1u << k);
|
||||
scene_fp(k, 0);
|
||||
continue;
|
||||
}
|
||||
key_off(k, &trk[kb_trk[k] % NTRK]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -787,9 +787,15 @@ static uint32_t lock_id(uint32_t k)
|
||||
}
|
||||
|
||||
static void ev_enter(void);
|
||||
static uint8_t br_armed;
|
||||
static uint32_t tl_t0; /* (V10.24) TOOLS: OCT+ held since (0: not), its action and track */
|
||||
static uint8_t tl_kind, tl_trk;
|
||||
#define TL_HOLD 900u /* (ms: held this long, it is done; no dialog) */
|
||||
static const uint8_t TL_SC[6] = {0, 1, 2, 2, 3, 3}; /* (V10.24) TOOLS' actions' scopes: TRACK SOUND SONG SYSTEM */ /* (V10.24) PRESETS: an UNDO mark taken at the browse's first turn */
|
||||
static void page_entered(void)
|
||||
{
|
||||
const page_t *pg = cur_page();
|
||||
br_armed = 0;
|
||||
ui.knob_ms = fm1_ms; /* (0.9.0) HUD: the knob row whole again on a new page */
|
||||
if (!ui.home && pg->fam == FAM_FX && fx_trk_k(ui.page) < 0 && pg->graph != GR_BUSES)
|
||||
ui.fxmod = (uint8_t)fx_mod_of(ui.page); /* (FX: the effect shown, BUSES' tile lit) */
|
||||
|
||||
@@ -1570,10 +1570,14 @@ static void draw_columns(void)
|
||||
draw_act_column(3, "CLEAR", T_MID, ICON_X_MOTION_DEL);
|
||||
return;
|
||||
}
|
||||
if (cur_page()->graph == GR_TOOLS) {
|
||||
static const char *const labels[] = {"PAT", "SOUND", "ROW", "SONG"};
|
||||
static const uint8_t icons[] = {ICON_AUTO, ICON_AUTO, ICON_X_SONG, ICON_X_SONG}; /* ROW, SONG: the song's */
|
||||
for (c = 0; c < 4u; c++) draw_act_column(c, labels[c], VAL(c), icons[c]);
|
||||
if (cur_page()->graph == GR_TOOLS) { /* (V10.24) KNOB 1 the scope, KNOB 2 the action; OCT+ held */
|
||||
static const char *const SC[4] = {"TRACK", "SOUND", "SONG", "SYSTEM"};
|
||||
static const char *const AC[6] = {"CLEAR", "INIT", "DEL ROW", "CLEAR", "NEW", "CPU"};
|
||||
uint32_t a = ui.act ? ui.act - 1u : 0u;
|
||||
text_column(0, "SCOPE", ui.act ? SC[TL_SC[a]] : "--", ui.act ? VAL(0u) : T_DIM);
|
||||
text_column(1, "ACTION", ui.act ? AC[a] : "--", ui.act ? VAL(1u) : T_DIM);
|
||||
empty_column(2);
|
||||
text_column(3, "DO", "OCT+", ui.act && act_ready() ? T_ACCENT : T_DIM);
|
||||
return;
|
||||
}
|
||||
if (cur_page()->scope == SC_TRK) { /* LEVEL PAN REV of the selected track, the DJ FILTER */
|
||||
|
||||
+126
-35
@@ -23,7 +23,11 @@ static uint8_t eu_z[NTRK][EU_ZN]; /* (V10.16) each track's
|
||||
static uint32_t eu_s, eu_ms;
|
||||
enum { EK_HITS, EK_STEPS, EK_ROT, EK_K4, EK_M0, EK_U0 = EK_M0 + EU_M, EK_N = EK_U0 + 4 };
|
||||
static const uint8_t EU_MX[4] = {5, 100, 2, 3}; /* (V10.16) MUTATE's settings' tops */
|
||||
static void eu_anchor(uint32_t k) { memcpy(eu_z[k % NTRK], (uint8_t *)&eu[k % NTRK] + EU_Z0, EU_ZN); }
|
||||
static uint16_t eu_zs[NTRK]; /* (V10.24) the anchor's seed (OCT- returns to it too) */
|
||||
static uint8_t eu_za[NTRK][64] __attribute__((section(".pool"))); /* (V10.24) the anchor's steps as generated (a kit: the
|
||||
* lanes' bits; a melody: the first note, 0 none), MUTATE's picture */
|
||||
static void eu_anchor(uint32_t k) { memcpy(eu_z[k % NTRK], (uint8_t *)&eu[k % NTRK] + EU_Z0, EU_ZN); eu_zs[k % NTRK] = eu[k % NTRK].seed; }
|
||||
static uint32_t eu_val(const track_t *t, const step_t *s) { return drum_track(t) ? step_lanes(s) & 0xFFu : s->time == ST_NOTE && s->n ? s->note[0] : 0u; }
|
||||
|
||||
static uint32_t eu_rnd(void) { eu_s ^= eu_s << 13; eu_s ^= eu_s >> 17; eu_s ^= eu_s << 5; return eu_s; }
|
||||
static uint32_t eu_ch(uint32_t pct) { return eu_rnd() % 100u < pct; }
|
||||
@@ -250,6 +254,10 @@ static void eu_gen(uint32_t k, uint32_t hand)
|
||||
if (drum_track(t)) eu_drums(t, e, e->lane % (NLANE + 1u)); else eu_melody(k, t, e);
|
||||
load_end(t);
|
||||
pat_sig[k % NTRK] = ~steps_sig(t); /* (the user's steps now) */
|
||||
if (e->seed == eu_zs[k % NTRK] && !memcmp((uint8_t *)e + EU_Z0, eu_z[k % NTRK], EU_ZN)) { /* (V10.24) the anchor's */
|
||||
uint32_t i;
|
||||
for (i = 0; i < 64u; i++) eu_za[k % NTRK][i] = (uint8_t)eu_val(t, &t->step[i]);
|
||||
}
|
||||
ui.force = 1;
|
||||
}
|
||||
|
||||
@@ -319,7 +327,7 @@ static void eu_mutate(uint32_t k, eu_t *e)
|
||||
eul_t *L = al ? &e->a : &e->l[dr ? sl - 1u : 0u];
|
||||
int32_t d = (int32_t)(1u + p / 40u);
|
||||
if (e->mu[2] != 1u) memcpy((uint8_t *)e + EU_Z0, eu_z[k], EU_ZN);
|
||||
if (e->mu[2] == 2u && (e->flip ^= 1u) == 0u) { eu_gen(k, 0); return; } /* (PULSE: the anchor's turn) */
|
||||
if (e->mu[2] == 2u && (e->flip ^= 1u) == 0u) { e->seed = eu_zs[k]; eu_gen(k, 0); return; } /* (PULSE: the anchor's turn) */
|
||||
eu_s ^= fm1_ms * 2654435761u + k;
|
||||
e->seed = (uint16_t)(eu_rnd() | 1u);
|
||||
if ((w == 1u || w == 3u) && L->n) { /* RHYTHM */
|
||||
@@ -357,7 +365,7 @@ static void eu_oct(int up, int mu)
|
||||
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
|
||||
if (mu) {
|
||||
if (up) eu_mutate(song.sel, e);
|
||||
else { memcpy((uint8_t *)e + EU_Z0, eu_z[song.sel], EU_ZN); eu_gen(song.sel, 1); }
|
||||
else { memcpy((uint8_t *)e + EU_Z0, eu_z[song.sel], EU_ZN); e->seed = eu_zs[song.sel]; eu_gen(song.sel, 1); }
|
||||
ui_message(up ? "MUTATED" : "ANCHOR");
|
||||
return;
|
||||
}
|
||||
@@ -369,59 +377,142 @@ static void eu_oct(int up, int mu)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------- the graph --- */
|
||||
/* the pattern as it is: a ring of its steps (DRUM: the lane picked) at the left; DRUM: the eight lanes as rows (HITS /
|
||||
* STEPS) at the right; melodic: the key in the ring and the notes as a roll at the right, where the key came from */
|
||||
/* (V10.24, the user's pick A) DRUM: the lanes as concentric rings (BD outside), each a cycle of its own STEPS at the turn
|
||||
* playing, its hits in its heat (few violet, many yellow); the lane picked bright, the others dimmed (ALL: all bright);
|
||||
* the lanes' names and HITS at the right. Melodic: the ring of the melody's cycle, the key in it, the notes as a roll.
|
||||
* Under the ring VARY's turns (A A' A'' B), the one playing marked */
|
||||
static void eu_ring(const track_t *t, int32_t cx, int32_t cy, int32_t rad, uint32_t lane, uint32_t n, uint32_t now, uint16_t col, int lit)
|
||||
{
|
||||
uint32_t len = (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP), base, i;
|
||||
n = n && n < len ? n : len;
|
||||
base = now != ~0u ? now / n * n : 0u;
|
||||
if (base + n > len) base = len - n; /* (a lane whose STEPS do not divide the pattern: its last n) */
|
||||
now = now != ~0u ? now - base : ~0u;
|
||||
for (i = 0; i < n; i++) {
|
||||
uint32_t a = i * 65536u / n + 49152u;
|
||||
int32_t x = cx + ((rad * og_cos(a)) >> 15), y = cy + ((rad * og_sin(a)) >> 15), r;
|
||||
const step_t *s = &t->step[base + i];
|
||||
uint32_t hit = lane < NLANE ? (step_lanes(s) >> lane) & 1u : s->time == ST_NOTE && s->n;
|
||||
uint32_t acc = lane < NLANE && hit && ((step_accents(s) >> lane) & 1u);
|
||||
if (!hit) { if (lit) cv_rect(x, y, 1, 1, T_DIM); continue; }
|
||||
r = acc ? 3 : n > 24u ? 1 : 2;
|
||||
cv_rect(x - r, y - r, 2 * r + 1, 2 * r + 1, i == now && lit ? T_TEXT : col);
|
||||
if (lit && lane < NLANE && (step_lmode(s, lane) == LM_X2 || step_lmode(s, lane) == LM_X4))
|
||||
cv_frame(x - r - 2, y - r - 2, 2 * r + 5, 2 * r + 5, col);
|
||||
}
|
||||
}
|
||||
/* (V10.24, the user's pick A) SEQ > MUTATE: the anchor's pattern (grey) above, the one playing below, the steps a
|
||||
* mutation changed in the accent; at the right an arc fills to the next mutation (the bars left in it); OCT+ / OCT- */
|
||||
static void eu_strip(const track_t *t, const uint8_t *za, int32_t y0, int32_t hh, uint32_t len, uint32_t now, int anchor)
|
||||
{
|
||||
int32_t cw = 180 / (int32_t)len, i, j;
|
||||
uint32_t dr = drum_track(t) != 0, lo = 127, hi = 0, v;
|
||||
cw = cw < 2 ? 2 : cw;
|
||||
for (i = 0; !dr && i < (int32_t)len; i++) /* (a melody: its range, of both rows) */
|
||||
for (j = 0; j < 2; j++) {
|
||||
v = j ? za[i] : eu_val(t, &t->step[i]);
|
||||
if (v) { lo = v < lo ? v : lo; hi = v > hi ? v : hi; }
|
||||
}
|
||||
if (hi < lo + 6u) { lo = hi >= 6u ? hi - 6u : 0u; hi = lo + 6u; }
|
||||
for (i = 0; i < (int32_t)len && i * cw < 182; i++) {
|
||||
uint32_t a = za[i], c = anchor ? a : eu_val(t, &t->step[i]);
|
||||
int32_t x = 4 + i * cw;
|
||||
uint16_t col = anchor ? T_MID : c != a ? T_ACCENT : T_THEME;
|
||||
if (dr)
|
||||
for (j = 0; j < (int32_t)NLANE; j++) {
|
||||
if ((c >> j) & 1u) cv_rect(x, y0 + j * hh / 8, cw - 1, hh / 8 - 1, anchor ? T_MID : ((a >> j) & 1u) ? T_THEME : T_ACCENT);
|
||||
else if (!anchor && ((a >> j) & 1u)) cv_rect(x, y0 + j * hh / 8 + hh / 16 - 1, cw - 1, 1, T_DIM); /* (a hit gone) */
|
||||
}
|
||||
else if (c)
|
||||
cv_rect(x, y0 + hh - 3 - (int32_t)((c - lo) * (uint32_t)(hh - 4) / (hi - lo)), cw - 1, c != a && !anchor ? 4 : 3, col);
|
||||
if (!anchor && (uint32_t)i == now) cv_rect(x, y0 + hh + 2, cw - 1, 1, T_TEXT);
|
||||
}
|
||||
}
|
||||
static void graph_mutate(const track_t *t, const eu_t *e)
|
||||
{
|
||||
int32_t h = (int32_t)graph_h(), hh = (h - 44) / 2, cx = 210, cy = h / 2 - 4, i;
|
||||
uint32_t len = (uint32_t)clamp(t->p[P_SLEN], 1, 64), now = song.playing ? t->seq_idx % len : ~0u;
|
||||
uint32_t ev = e->mu[0] ? 1u << (e->mu[0] - 1u) : 0u, q = ev ? ((bar_n % ev) * 4u + beat_n % 4u) * 64u / (ev * 4u) : 0u;
|
||||
char b[8];
|
||||
cv_text(4, 2, &AF_X, "ANCHOR", T_DIM);
|
||||
eu_strip(t, eu_za[song.sel % NTRK], 12, hh, len, now, 1);
|
||||
cv_text(4, 18 + hh, &AF_X, "NOW", T_TEXT);
|
||||
eu_strip(t, eu_za[song.sel % NTRK], 28 + hh, hh, len, now, 0);
|
||||
for (i = 0; i < 64; i++) { /* the arc to the next mutation */
|
||||
uint32_t a = (uint32_t)i * 1024u + 49152u;
|
||||
int32_t x = cx + ((20 * og_cos(a)) >> 15), y = cy + ((20 * og_sin(a)) >> 15);
|
||||
cv_rect(x - 1, y - 1, 2, 2, ev && song.playing && (uint32_t)i <= q ? T_ACCENT : T_DIM);
|
||||
}
|
||||
cv_text_in(cx - 18, cy - 9, 36, &AF_X, ev ? "NEXT" : "OFF", T_DIM, T_SURF);
|
||||
if (ev) { b[0] = 0; fmt_int(b, (int32_t)(song.playing ? ev - bar_n % ev : ev)); cv_text_in(cx - 18, cy + 2, 36, &AF_X, b, T_TEXT, T_SURF); }
|
||||
cv_text(4, h - 10, &AF_X, "OCT+ MUTATE", T_ACCENT);
|
||||
cv_text_r(234, h - 10, &AF_X, "OCT- ANCHOR", T_THEME, T_SURF);
|
||||
}
|
||||
static void graph_euclid(const track_t *t)
|
||||
{
|
||||
static const char *const LN[NLANE + 1] = {"ALL", "BD", "SD", "CP", "CH", "OH", "TM", "RS", "CB"};
|
||||
static const char *const NN[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"};
|
||||
static const char *const TN[4] = {"A", "A'", "A''", "B"};
|
||||
const eu_t *e = eu_of(song.sel);
|
||||
uint32_t dr = drum_track(t) != 0, len = (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP), sl = e->lane % (NLANE + 1u), lane = (sl + NLANE) % (NLANE + 1u), i, n;
|
||||
int32_t h = (int32_t)graph_h(), cy = h / 2, cx = 64, rad = h / 2 - 12 < 54 ? h / 2 - 12 : 54;
|
||||
uint32_t now = song.playing ? t->seq_idx % len : ~0u, t_base = 0, t_now = now;
|
||||
uint32_t dr = drum_track(t) != 0, len = (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP), sl = e->lane % (NLANE + 1u), lane = (sl + NLANE) % (NLANE + 1u), i, n, tn, cyc;
|
||||
int32_t h = (int32_t)graph_h(), cy = h / 2 - 5, cx = 64, rad = h / 2 - 17 < 54 ? h / 2 - 17 : 54;
|
||||
uint32_t now = song.playing ? t->seq_idx % len : ~0u, t_now = now;
|
||||
char b[12];
|
||||
n = dr ? (sl ? e->l[lane].n : e->a.n) : e->l[0].n; /* (V10.21) the ring: one cycle (the lane's, ALL's STEPS, the
|
||||
* melody's), the turn playing (VARY's turns, a longer pattern) */
|
||||
n = n && n < len ? n : len;
|
||||
if (cur_page()->id[0] == ID_MU0) { graph_mutate(t, e); return; }
|
||||
if (e->mu[0]) { /* (V10.16) MUTATE on: the bars to the next one */
|
||||
uint32_t ev = 1u << (e->mu[0] - 1u);
|
||||
str_cpy(b, "MUT ", sizeof b);
|
||||
fmt_int(b + 4, (int32_t)(song.playing ? ev - bar_n % ev : ev));
|
||||
cv_text(2, 2, &AF_X, b, T_ACCENT);
|
||||
cv_text(4, 2, &AF_X, b, T_ACCENT);
|
||||
}
|
||||
{
|
||||
uint32_t base = now != ~0u ? now / n * n : 0u;
|
||||
if (base + n > len) base = len - n; /* (a lane whose STEPS do not divide the pattern: its last n) */
|
||||
t_base = base;
|
||||
t_now = now; /* (the roll: the whole pattern) */
|
||||
now = now != ~0u ? now - base : ~0u;
|
||||
}
|
||||
for (i = 0; i < n; i++) { /* the ring */
|
||||
uint32_t a = i * 65536u / n + 49152u;
|
||||
int32_t x = cx + ((rad * og_cos(a)) >> 15), y = cy + ((rad * og_sin(a)) >> 15), r;
|
||||
const step_t *s = &t->step[t_base + i];
|
||||
uint32_t hit = dr ? (step_lanes(s) >> lane) & (sl ? 1u : 0xFFu) : s->time == ST_NOTE && s->n; /* (ALL: any) */
|
||||
uint32_t acc = dr ? (step_accents(s) >> lane) & (sl ? 1u : 0xFFu) : 0u, gh = dr && sl && hit && step_lmode(s, lane) == LM_GHOST;
|
||||
r = !hit ? 1 : gh ? 2 : acc ? 5 : n > 24u ? 3 : 4;
|
||||
cv_rrect(x - r, y - r, 2 * r + 1, 2 * r + 1, r, !hit ? T_DIM : gh ? T_MID : dr ? T_ACCENT : T_THEME, T_SURF);
|
||||
if (hit && dr && sl && (step_lmode(s, lane) == LM_X2 || step_lmode(s, lane) == LM_X4))
|
||||
cv_frame(x - r - 2, y - r - 2, 2 * r + 5, 2 * r + 5, T_ACCENT);
|
||||
if (i == now) cv_frame(x - 7, y - 7, 15, 15, T_TEXT);
|
||||
if (dr) { /* VARY's turns: of the lanes' least common length */
|
||||
for (cyc = 1, i = 0; i < NLANE; i++) {
|
||||
uint32_t a = cyc, c = e->l[i].n;
|
||||
if (!e->l[i].h || !c) continue;
|
||||
while (c) { uint32_t x = a % c; a = c; c = x; }
|
||||
cyc = cyc / a * e->l[i].n > 64u ? 64u : cyc / a * e->l[i].n;
|
||||
}
|
||||
tn = eu_turns(cyc < 2u ? 16u : cyc, e->m[3]);
|
||||
} else
|
||||
tn = eu_turns(e->l[0].n ? e->l[0].n : 16u, e->vary);
|
||||
if (tn > 1u) { /* the turns, under the ring */
|
||||
uint32_t tp = now != ~0u ? now / (len / tn ? len / tn : 1u) % tn : 0u;
|
||||
for (i = 0; i < tn; i++) {
|
||||
int32_t x = cx - (int32_t)tn * 13 + 4 + (int32_t)i * 26;
|
||||
const char *nm = tn == 2u ? TN[i * 3u] : TN[i];
|
||||
cv_text_in(x - 4, h - 12, 22, &AF_X, nm, i == tp ? T_ACCENT : T_DIM, T_SURF);
|
||||
if (i == tp) cv_rect(x, h - 3, 14, 1, T_ACCENT);
|
||||
}
|
||||
}
|
||||
if (dr) {
|
||||
cv_text_in(cx - 30, cy - 8, 60, &AF_M, LN[sl], T_ACCENT, T_SURF);
|
||||
uint32_t nl = 0, k = 0;
|
||||
int32_t gap;
|
||||
for (i = 0; i < NLANE; i++) nl += e->l[i].h != 0u || (sl && i == lane);
|
||||
gap = (rad - 10) / (int32_t)(nl > 1u ? nl - 1u : 1u);
|
||||
gap = gap > 12 ? 12 : gap;
|
||||
for (k = 0; k < 2u; k++) /* the rings: the picked lane last, over the others */
|
||||
for (i = 0; i < NLANE; i++) {
|
||||
uint32_t r = 0, j, nn = e->l[i].n ? e->l[i].n : 1u, lit = !sl || i == lane;
|
||||
uint16_t c = heat_col(48 + (int32_t)(e->l[i].h * 200u / nn));
|
||||
if ((!e->l[i].h && !(sl && i == lane)) || (sl && (i == lane) != (k == 1u)) || (!sl && k)) continue;
|
||||
for (j = 0; j < i; j++) r += e->l[j].h != 0u || (sl && j == lane);
|
||||
eu_ring(t, cx, cy, rad - (int32_t)r * gap, i, nn, now, lit ? c : ux_mix(c, T_SURF, 68), (int)lit);
|
||||
}
|
||||
cv_text_in(cx - 20, cy - 5, 40, &AF_X, LN[sl], T_ACCENT, T_SURF);
|
||||
for (i = 0; i < NLANE; i++) { /* the lanes */
|
||||
int32_t y = 6 + (int32_t)i * (h - 12) / NLANE, rh = (h - 12) / NLANE - 2;
|
||||
uint32_t on = sl ? i == lane : e->l[i].h != 0u; /* (ALL: the lanes it plays) */
|
||||
uint32_t on = sl ? i == lane : e->l[i].h != 0u, nn = e->l[i].n ? e->l[i].n : 1u; /* (ALL: the lanes it plays) */
|
||||
uint16_t c = on ? T_TEXT : e->l[i].h ? T_MID : T_DIM;
|
||||
if (sl && on) cv_rect(136, y, 98, rh, T_RAISE);
|
||||
cv_rect(136, y, 3, rh, on ? T_ACCENT : T_DIM);
|
||||
cv_text(144, y + (rh - 8) / 2, &AF_X, LN[i + 1u], c); /* (V10.21: the lanes' names; LN[0] is ALL) */
|
||||
cv_rect(136, y, 2, rh, sl && on ? T_ACCENT : T_SURF);
|
||||
cv_text(144, y + (rh - 8) / 2, &AF_X, LN[i + 1u], c);
|
||||
b[0] = 0; fmt_int(b, e->l[i].h); str_cpy(b + str_len(b), "/", 2); fmt_int(b + str_len(b), e->l[i].n);
|
||||
cv_text_r(230, y + (rh - 8) / 2, &AF_X, b, c, sl && on ? T_RAISE : T_SURF);
|
||||
cv_text_r(230, y + (rh - 8) / 2, &AF_X, b, e->l[i].h ? heat_col(48 + (int32_t)(e->l[i].h * 200u / nn)) : T_DIM, sl && on ? T_RAISE : T_SURF);
|
||||
}
|
||||
return;
|
||||
}
|
||||
n = e->l[0].n;
|
||||
eu_ring(t, cx, cy, rad, NLANE, n, now, T_THEME, 1);
|
||||
str_cpy(b, NN[e->root % 12u], sizeof b); /* the key, in the ring: its root, its scale */
|
||||
cv_text_in(cx - 30, cy - 14, 60, &AF_M, b, T_TEXT, T_SURF);
|
||||
for (i = 1; i < sizeof SCALE_MASK / sizeof SCALE_MASK[0] && SCALE_MASK[i] != e->mask; i++) {}
|
||||
|
||||
+10
-1
@@ -62,6 +62,8 @@ static void lz_uline(int32_t x, int32_t y, const aafont_t *f, const char *s, uin
|
||||
/* the height ADSR and LFO are drawn on: 100 px, or (MENU > LARGE's strip: draw_graph) the strip's ~ 56 */
|
||||
static int32_t graph_ht = 100;
|
||||
#include "ui_organic.c" /* JIANT FM's organic line art (drawn by code) */
|
||||
static uint16_t heat_col(int32_t v);
|
||||
#include "ui_scene.c" /* (V10.25) SCL > SCENE: the multitimbral page */
|
||||
#include "ui_euclid.c" /* (V10.6) SEQ > EUCLID / MODES: the generator, its graph */
|
||||
#include "ui_fm6op.c" /* (0.6.10, from Felucca 1.5) EDIT > OPERATOR, OP ENV, OPERATOR 2 */
|
||||
static uint16_t heat_col(int32_t v);
|
||||
@@ -1368,7 +1370,7 @@ static uint32_t graph_signature(void)
|
||||
if (pg->graph == GR_SLPIT)
|
||||
h ^= (sl_ui_step + 1u) * 40503u;
|
||||
if (pg->graph == GR_TOOLS) /* (0.6.12) the action picked, the song's row */
|
||||
h ^= ui.act * 7919u + ui.song_row * 104729u;
|
||||
h ^= ui.act * 7919u + ui.song_row * 104729u + (tl_t0 ? (fm1_ms - tl_t0 + 1u) / 40u + 1u : 0u) * 2654435761u;
|
||||
if (pg->graph == GR_SLOTS) { /* (a checksum over each slot; the project, the music's section, the song) */
|
||||
for (i = 0; i < 4u; i++)
|
||||
h ^= (uint32_t)graph_project_used(i) << (20u + i);
|
||||
@@ -1412,6 +1414,10 @@ static uint32_t graph_signature(void)
|
||||
if (pg->graph == GR_MORPH) /* (0.6.45) the wave, MORPH */
|
||||
h = (h ^ ((uint32_t)t->p[P_MORPH] << 16 | (uint32_t)t->p[P_E0] << 8 | (uint32_t)t->p[P_E1] |
|
||||
(uint32_t)t->p[P_E2] << 24)) * 16777619u;
|
||||
if (pg->graph == GR_SCENE) { /* (V10.25) the roles, the track picked, the last key */
|
||||
for (i = 0; i < NTRK; i++) h = (h ^ scn_role[i] ^ (uint32_t)drum_track(&trk[i]) << 4 ^ (uint32_t)trk[i].p[P_CHRD] << 8) * 16777619u;
|
||||
h = (h ^ scn_on ^ (uint32_t)sc_trk << 2 ^ (uint32_t)last_note << 8) * 16777619u;
|
||||
}
|
||||
if (pg->graph == GR_EUCLID) { /* (V10.6) the pattern, the lane, the key, the step playing */
|
||||
h = (h ^ steps_sig(t) ^ (uint32_t)t->p[P_SLEN] << 24) * 16777619u;
|
||||
h = (h ^ eu[song.sel % NTRK].lane ^ (uint32_t)eu[song.sel % NTRK].src << 4 ^ (uint32_t)eu[song.sel % NTRK].root << 8 ^
|
||||
@@ -2029,6 +2035,9 @@ static void draw_graph(void)
|
||||
} else if (pg->graph == GR_LIVE) { /* (p2) GLO > LIVE: the rails, MANO's board (ui_live.c) */
|
||||
cv_oy = 0;
|
||||
graph_live();
|
||||
} else if (pg->graph == GR_SCENE) { /* (V10.25) SCL > SCENE: the six tracks' roles */
|
||||
cv_oy = 0;
|
||||
graph_scene();
|
||||
} else if (pg->graph == GR_EUCLID) { /* (V10.6) SEQ > EUCLID / MODES: the ring, the lanes or the notes */
|
||||
cv_oy = 0;
|
||||
graph_euclid(t);
|
||||
|
||||
+57
-11
@@ -1356,6 +1356,10 @@ static void edit_param(uint32_t slot, int32_t steps)
|
||||
return;
|
||||
}
|
||||
if (pg->graph == GR_BROWSE) { /* KNOB 1: one preset, KNOB 2: the next / previous engine */
|
||||
if (slot < 2u && !br_armed) { /* (V10.24) the sound before the browse: OCT- brings it back */
|
||||
undo_mark();
|
||||
br_armed = 1;
|
||||
}
|
||||
if (slot == 0u) {
|
||||
preset_step(steps);
|
||||
} else if (slot == 1u) {
|
||||
@@ -1369,8 +1373,13 @@ static void edit_param(uint32_t slot, int32_t steps)
|
||||
}
|
||||
if (pg->graph == GR_TOOLS) { /* (0.6.25) TOOLS: a list, any knob (and PRESETS) moves the
|
||||
* pick down / up; OCT+ does it (its dialog first) */
|
||||
ui.act = steps < 0 && ui.act <= 1u ? 0u : (uint8_t)clamp((int32_t)ui.act + (steps > 0 ? 1 : -1), 1, 6); /* (left
|
||||
* past the first: none picked) */
|
||||
int32_t a = ui.act ? (int32_t)ui.act - 1 : 0, sc = TL_SC[a]; /* (V10.24) KNOB 1 the scope (its first), the */
|
||||
if (slot == 0u && ui.act) { /* others the action (across the scopes) */
|
||||
sc = clamp(sc + (steps > 0 ? 1 : -1), 0, 3);
|
||||
for (a = 0; TL_SC[a] != sc; a++) {}
|
||||
} else if (ui.act)
|
||||
a = clamp(a + (steps > 0 ? 1 : -1), 0, 5);
|
||||
ui.act = (uint8_t)(a + 1);
|
||||
return;
|
||||
}
|
||||
if (pg->graph == GR_SLOTS && save_on() && save_level() == SV_PROJ) { /* (0.8.5) SAVE > PROJECT's SECTIONS: KNOB 1
|
||||
@@ -1430,6 +1439,10 @@ sect:
|
||||
*vp = (int16_t)v;
|
||||
excite_turn(TSEL, vp, was);
|
||||
}
|
||||
if (vp >= sc_v && vp < sc_v + 3) { /* (V10.25) SCENE's SCENE TRACK ROLE */
|
||||
sc_put((uint32_t)(vp - sc_v), v);
|
||||
return;
|
||||
}
|
||||
if (vp >= eu_v && vp < eu_v + EK_N) { /* (V10.6) EUCLID / MODES: the setting, the pattern again */
|
||||
eu_put((uint32_t)(vp - eu_v), v);
|
||||
return;
|
||||
@@ -1458,6 +1471,21 @@ sect:
|
||||
}
|
||||
|
||||
|
||||
/* (V10.24) SAVE > TOOLS: OCT+ pressed on the picked action: held TL_HOLD it is done (no dialog) */
|
||||
static void tools_arm(void)
|
||||
{
|
||||
uint32_t c = act_col();
|
||||
if (!c--) return;
|
||||
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
|
||||
if (!act_ready()) { /* nothing there to clear or delete */
|
||||
ui_message(c == 2u ? "NOTHING TO DELETE" : "NOTHING TO CLEAR");
|
||||
return;
|
||||
}
|
||||
tl_kind = (uint8_t)(c == 0u ? CF_CLEAR_SEQ : c == 1u ? CF_INIT_SOUND : c == 2u ? CF_DEL_ROW : c == 4u ? CF_INIT_SYS :
|
||||
c == 5u ? CF_CPU_TEST : CF_CLEAR_SONG);
|
||||
tl_trk = (uint8_t)(c == 2u ? ui.song_row : song.sel);
|
||||
tl_t0 = fm1_ms | 1u;
|
||||
}
|
||||
/* OCT+ on an action page: the picked action. A load stays picked (browse and load again); the others
|
||||
* are dropped once done. Flash writes only while stopped; over the user's data: the dialog */
|
||||
static void act_do(void)
|
||||
@@ -1483,16 +1511,8 @@ static void act_do(void)
|
||||
ev_oct();
|
||||
return;
|
||||
}
|
||||
if (cur_page()->graph == GR_TOOLS) {
|
||||
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
|
||||
if (!act_ready()) { /* nothing there to clear or delete */
|
||||
ui_message(c == 2u ? "NOTHING TO DELETE" : "NOTHING TO CLEAR");
|
||||
return;
|
||||
}
|
||||
confirm_open(c == 0u ? CF_CLEAR_SEQ : c == 1u ? CF_INIT_SOUND : c == 2u ? CF_DEL_ROW : c == 4u ? CF_INIT_SYS :
|
||||
c == 5u ? CF_CPU_TEST : CF_CLEAR_SONG, c == 2u ? ui.song_row : song.sel);
|
||||
if (cur_page()->graph == GR_TOOLS) /* (V10.24) OCT+ held: tools_arm, on the press */
|
||||
return;
|
||||
}
|
||||
if (cur_page()->graph == GR_SONG) { /* (0.8.5) SAVE > PROJECT's ARRANGE: OCT+ adds a row after the
|
||||
* last (its section and bars), the new one selected; PLAY plays */
|
||||
chain_row_t *r;
|
||||
@@ -1792,6 +1812,10 @@ static void presets_turn(int32_t s)
|
||||
ui_message(b);
|
||||
return;
|
||||
}
|
||||
if (!ui.home && cur_page()->graph == GR_BROWSE && !br_armed) { /* (V10.24) as KNOB 1 there */
|
||||
undo_mark();
|
||||
br_armed = 1;
|
||||
}
|
||||
preset_step(s);
|
||||
}
|
||||
|
||||
@@ -2285,6 +2309,20 @@ static void ui_input_frame(void)
|
||||
layer_oct_open(pressed); /* (OCT± with a SET layer's button down: it opens now) */
|
||||
oct = oct_taps(pressed, ui.menu || ui.confirm || act_cols() || name_on() || layer_set_open());
|
||||
oct = layer_oct(pressed, oct); /* (a SET layer's OCT-: put back) */
|
||||
if (!ui.home && !ui.menu && !ui.confirm && !ui.ly && cur_page()->graph == GR_TOOLS && ((pressed >> panel.btn[B_OCTUP]) & 1u))
|
||||
tools_arm();
|
||||
if (tl_t0) { /* (V10.24) TOOLS: OCT+ held TL_HOLD does the action */
|
||||
if (!((fm1_in.buttons >> panel.btn[B_OCTUP]) & 1u) || cur_page()->graph != GR_TOOLS || ui.home) {
|
||||
if ((int32_t)(fm1_ms - tl_t0) < (int32_t)TL_HOLD) ui_message("HOLD OCT+ TO DO IT");
|
||||
tl_t0 = 0;
|
||||
} else if ((int32_t)(fm1_ms - tl_t0) >= (int32_t)TL_HOLD) {
|
||||
uint8_t a = ui.act;
|
||||
confirm_open(tl_kind, tl_trk);
|
||||
ui.act = a;
|
||||
tl_t0 = 0;
|
||||
oct |= 2u; /* (the dialog's OK, below, this frame) */
|
||||
}
|
||||
}
|
||||
layer_masks(); /* seq.c: keys pressed with a layer's button are its own */
|
||||
live_frame(); /* (p2) GLO > LIVE: MANO's keys, OCT- held, the modifiers */
|
||||
{ /* (0.6.67) a button held + SELECT (rule 5): its dice (HOME the generator, GEN; EDIT the sound, SEQ the sequence,
|
||||
@@ -2622,6 +2660,14 @@ static void ui_input_frame(void)
|
||||
break;
|
||||
if (live_page()) /* (p2) LIVE: OCT- RETURN / held BYPASS, OCT+ COMMIT */
|
||||
break; /* (ui_live.c live_frame) */
|
||||
if (!ui.home && !ui.menu && !ui.confirm && cur_page()->graph == GR_BROWSE) { /* (V10.24) PRESETS: OCT+ keeps
|
||||
* the sound, OCT- the one before the browse */
|
||||
if (!br_armed) ui_message(b == B_OCTUP ? "TURN KNOB 1 TO BROWSE" : "NOTHING TO GO BACK TO");
|
||||
else if (b == B_OCTUP) ui_message("SOUND KEPT");
|
||||
else ui_message(undo_sound(song.sel) ? "NOTHING TO GO BACK TO" : "SOUND BEFORE");
|
||||
br_armed = 0;
|
||||
break;
|
||||
}
|
||||
if (!ui.home && !ui.menu && !ui.confirm && cur_page()->graph == GR_EUCLID) { /* (V10.6) EUCLID / MODES: */
|
||||
eu_oct(b == B_OCTUP, cur_page()->id[0] == ID_MU0); /* OCT+ a new variation, OCT- the one before;
|
||||
* (V10.16) MUTATE: a mutation now, back to the anchor */
|
||||
|
||||
@@ -92,8 +92,8 @@ static const ng_t CG_ENV[] = {{"TRACKS", 0}, {"ENV", 0}, {"STAGE", 0}};
|
||||
static const nv_t CE_LFO[] = {NV("MOD", 0, 0, 0), NV("LFO", 0, 1, 1), NV("LFO 2", 0, 1, 1), NV("LFO DEST", 0, 1, 1),
|
||||
NV("MSEQ", 0, 2, 2), NV("MSEQ 2", 0, 2, 2)}; /* (0.9.18: LFO 2, PHASE) */
|
||||
static const ng_t CG_LFO[] = {{"MOD", 0}, {"LFO", 0}, {"MSEQ", 0}};
|
||||
static const nv_t CE_SCL[] = {NV("SCL", 0, 0, 0), NV("CHORD", 0, 1, 1)};
|
||||
static const ng_t CG_SCL[] = {{"KEY", 0}, {"CHORD", 0}};
|
||||
static const nv_t CE_SCL[] = {NV("SCL", 0, 0, 0), NV("CHORD", 0, 1, 1), NV("SCENE", 0, 2, 2)}; /* (V10.25 SCENE) */
|
||||
static const ng_t CG_SCL[] = {{"KEY", 0}, {"CHORD", 0}, {"SCENE", 0}};
|
||||
static const nv_t CE_ARP[] = {NV("ARP", 0, 0, 2), NV("ARP 2", 0, 0, 2)};
|
||||
static const ng_t CG_ARP[] = {{"ARP", 0}};
|
||||
enum { SV_LIB, SV_PROJ, SV_SOUND };
|
||||
|
||||
+61
-24
@@ -57,26 +57,43 @@ static void graph_lib(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* (V10.24, the user's pick A) TOOLS by scope: at the left a picture of what the action takes (the steps, the sound's
|
||||
* wave, the song's rows, everything), at the right the scope's actions; under them a bar fills while OCT+ is held */
|
||||
static void graph_lz_tools(void)
|
||||
{
|
||||
static const char *const WHAT[6] = {"CLEAR SEQ", "INIT SOUND", "DELETE ROW", "CLEAR SONG", "NEW PROJECT", "CPU TEST"};
|
||||
static const char *const ON[6] = {"STEPS + AUTO", "ENGINE DEFAULT", "", "ALL ROWS", "EVERYTHING", "HEAVY SONG"};
|
||||
uint32_t c;
|
||||
uint32_t a = ui.act ? ui.act - 1u : 0u, sc = TL_SC[a], c, n = 0, h = graph_h(), i;
|
||||
int32_t hold = tl_t0 ? (int32_t)(fm1_ms - tl_t0) * 232 / (int32_t)TL_HOLD : 0;
|
||||
uint16_t col = !ui.act ? T_DIM : sc == 0u ? T_THEME : sc == 1u ? T_ACCENT : sc == 2u ? T_MID : T_TEXT;
|
||||
char b[12];
|
||||
for (c = 0; c < 6u; c++) {
|
||||
int32_t y = 1 + (int32_t)c * 23;
|
||||
cv_frame(4, 4, 76, 76, col); /* the picture */
|
||||
if (sc == 0u)
|
||||
for (i = 0; i < 16u; i++) /* the track's steps */
|
||||
cv_rect(10 + (int32_t)(i % 8u) * 8, 14 + (int32_t)(i / 8u) * 30, 6, 24, TSEL->step[i].time == ST_NOTE ? col : T_DIM);
|
||||
else if (sc == 1u)
|
||||
for (i = 0; i < 64u; i++) /* a wave */
|
||||
cv_rect(10 + (int32_t)i, 42 + ((24 * og_sin(i * 2048u)) >> 15), 1, 2, col);
|
||||
else if (sc == 2u)
|
||||
for (i = 0; i < 4u; i++) /* the song's rows */
|
||||
cv_rect(10, 12 + (int32_t)i * 16, 64, 12, i < chain_config.count ? col : T_DIM);
|
||||
else
|
||||
cv_text_in(4, 38, 76, &AF_M, "ALL", col, T_SURF);
|
||||
for (c = 0; c < 6u; c++) { /* the scope's actions */
|
||||
int32_t y = 4 + (int32_t)n * 26;
|
||||
int sel = ui.act == c + 1u;
|
||||
uint16_t bg = sel ? T_TINT : T_RAISE;
|
||||
cv_rect(4, y, 232, 21, bg);
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 21, AL_V, "tools row text centred up/down");
|
||||
cv_text_on(12, y + CAP_IN(M, 21), &AF_M, WHAT[c], sel ? T_TEXT : T_MID, bg);
|
||||
if (c == 2u) { /* (the row ARRANGE has picked) */
|
||||
str_cpy(b, "ROW ", sizeof b);
|
||||
fmt_int(b + 4, (int32_t)ui.song_row + 1);
|
||||
}
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 21, AL_V, "tools row text centred up/down");
|
||||
cv_text_r(230, y + CAP_IN(X, 21), &AF_X, c == 2u ? b : ON[c], sel ? T_MID : T_DIM, bg);
|
||||
uint16_t bg = sel ? T_TINT : T_SURF;
|
||||
if (TL_SC[c] != sc) continue;
|
||||
n++;
|
||||
cv_rect(88, y, 148, 24, bg);
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 12, AL_V, "tools row text centred up/down");
|
||||
cv_text_on(94, y + CAP_IN(M, 14), &AF_M, WHAT[c], sel ? T_TEXT : T_MID, bg);
|
||||
if (c == 2u) { str_cpy(b, "ROW ", sizeof b); fmt_int(b + 4, (int32_t)ui.song_row + 1); }
|
||||
cv_text(94, y + 15, &AF_X, c == 2u ? b : ON[c], sel ? T_MID : T_DIM);
|
||||
}
|
||||
cv_rect(4, (int32_t)h - 20, 232, 6, T_RAISE); /* OCT+ held: the bar */
|
||||
if (hold > 0) cv_rect(4, (int32_t)h - 20, hold > 232 ? 232 : hold, 6, col);
|
||||
cv_text_in(4, (int32_t)h - 11, 232, &AF_X, ui.act ? "HOLD OCT+ TO DO IT" : "TURN A KNOB TO PICK", T_DIM, T_SURF);
|
||||
}
|
||||
/* PROJECT: the sections, the arrangement's chips, the song's strip (ar: ARRANGE, its rows picked) */
|
||||
static void graph_proj(int ar)
|
||||
@@ -267,18 +284,36 @@ static void graph_sound(void)
|
||||
cv_frame(x, y, 35, 15, T_THEME);
|
||||
}
|
||||
}
|
||||
/* (V10.24, the user's pick A) PRESETS in two columns: at the left the engines (their being, how many presets), the
|
||||
* selected track's lit; at the right the list (LIST's) around the sound, its engine named only when another's. KNOB 1
|
||||
* plays each as it passes; OCT+ keeps it, OCT- brings back the sound from before the browse (ui_input.c br_undo) */
|
||||
static void graph_lz_presets(void)
|
||||
{
|
||||
uint32_t total, cur = preset_pos(&total), e, k, i, first;
|
||||
lz_track_being();
|
||||
uint32_t total, cur = preset_pos(&total), e, k, i, first, r, rc = 0, rows = (graph_h() - 2u) / 15u;
|
||||
rows = rows > 9u ? 9u : rows;
|
||||
for (r = 0; r < NENG_SHOWN; r++) if (eng_vis(r) == TSEL->eng_req) rc = r;
|
||||
first = rc < rows / 2u ? 0u : rc - rows / 2u;
|
||||
if (first + rows > NENG_SHOWN) first = NENG_SHOWN > rows ? NENG_SHOWN - rows : 0u;
|
||||
for (r = first; r < NENG_SHOWN && r < first + rows; r++) {
|
||||
int32_t y = 2 + (int32_t)(r - first) * 15;
|
||||
int sel = r == rc;
|
||||
char n[4];
|
||||
e = eng_vis(r);
|
||||
lz_mini_being(e, 9, y + 7, 3, sel ? bg_col(230) : ux_mix(bg_col(120), T_SURF, 45));
|
||||
cv_clip_text(21, y + CAP_IN(X, 14), &AF_X, ENGINES[e]->name, sel ? T_TEXT : T_DIM, T_SURF, 46);
|
||||
n[0] = 0; fmt_int(n, (int32_t)preset_shown(e));
|
||||
cv_text_r(82, y + CAP_IN(X, 14), &AF_X, n, sel ? T_MID : T_DIM, T_SURF);
|
||||
if (sel) cv_rect(0, y + 2, 2, 10, T_ACCENT);
|
||||
}
|
||||
cv_rect(86, 2, 1, (int32_t)rows * 15 - 2, T_DIM);
|
||||
if (!total) {
|
||||
cv_text_in(88, 63, 148, &AF_X, "NO FAVORITES", T_MID, T_SURF);
|
||||
return;
|
||||
}
|
||||
first = cur < 4u ? 0u : cur - 4u;
|
||||
if (total > 9u && first + 9u > total)
|
||||
first = total - 9u;
|
||||
for (i = first; i < total && i < first + 9u; i++) {
|
||||
first = cur < rows / 2u ? 0u : cur - rows / 2u;
|
||||
if (total > rows && first + rows > total)
|
||||
first = total - rows;
|
||||
for (i = first; i < total && i < first + rows; i++) {
|
||||
int32_t y = 2 + (int32_t)(i - first) * 15;
|
||||
int sel = i == cur;
|
||||
uint16_t bg = sel ? T_TINT : T_SURF;
|
||||
@@ -293,15 +328,17 @@ static void graph_lz_presets(void)
|
||||
en = ENGINES[e]->name;
|
||||
}
|
||||
if (sel)
|
||||
cv_rect(88, y, 148, 14, bg);
|
||||
cv_rect(90, y, 146, 14, bg);
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 14, AL_V, "sound preset row centred up/down");
|
||||
cv_free_text(94, y + CAP_IN(X, 14), &AF_X, nm, sel ? T_TEXT : T_MID, bg, 84);
|
||||
cv_free_text(96, y + CAP_IN(X, 14), &AF_X, nm, sel ? T_TEXT : T_MID, bg, 92);
|
||||
if (favorite_has(e, k)) {
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 14, AL_V, "sound preset star centred up/down");
|
||||
cv_text_on(182, y + CAP_IN(S, 14), &AF_S, "*", T_ACCENT, bg); /* (a favourite; 0.8.5 no icons) */
|
||||
cv_text_on(226, y + CAP_IN(S, 14), &AF_S, "*", T_ACCENT, bg); /* (a favourite; 0.8.5 no icons) */
|
||||
}
|
||||
if (e != TSEL->eng_req) { /* (another engine's: LIST crosses engines) */
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 14, AL_V, "sound preset row centred up/down");
|
||||
cv_text_r(220, y + CAP_IN(X, 14), &AF_X, eng_abbr(en), T_DIM, bg);
|
||||
}
|
||||
GFX_HOOK_ALIGN(0, y, 0, y + 14, AL_V, "sound preset row centred up/down");
|
||||
cv_text_r(232, y + CAP_IN(X, 14), &AF_X, eng_abbr(en), T_DIM, bg);
|
||||
}
|
||||
}
|
||||
/* the lens's panel for the SAVE page shown */
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only
|
||||
* JIANT V10.25: SCL > SCENE, the multitimbral mode's page (seq.c scene_key plays it). Included by ui_graph.c.
|
||||
* KNOB 1 SCENE OFF / ON (on: the keys play every track with a role), KNOB 2 the TRACK, KNOB 3 its ROLE (KEEP CHORD ARP
|
||||
* BASS LEAD), KNOB 4 its CHORD (the chord CHORD and ARP play; OFF: a triad of the scale). A role sets its track up:
|
||||
* ARP turns the track's arp on (UP) if it was off, CHORD BASS LEAD turn it off, CHORD makes the voice POLY. A kit
|
||||
* keeps its sequence (KEEP): the keys do not reach it. The graph: six columns, each track's role and the notes the
|
||||
* last key played makes on it */
|
||||
static uint8_t sc_trk = 5; /* the track KNOB 2 picked (T6) */
|
||||
static int16_t sc_v[4];
|
||||
static param_desc_t sc_d;
|
||||
static const char *const SC_ROLE[SC_N] = {"KEEP", "CHORD", "ARP", "BASS", "LEAD"};
|
||||
static const param_desc_t *sc_desc(uint32_t k, int16_t **valp)
|
||||
{
|
||||
static const char *const ONOFF[2] = {"OFF", "ON"};
|
||||
static const char *const TN[NTRK] = {"T1", "T2", "T3", "T4", "T5", "T6"};
|
||||
track_t *t = &trk[sc_trk % NTRK];
|
||||
k &= 3u;
|
||||
if (k == 3u) { /* the picked track's own CHORD */
|
||||
*valp = &t->p[P_CHRD];
|
||||
return track_desc(t, P_CHRD);
|
||||
}
|
||||
sc_d.fmt = F_ENUM; sc_d.min = 0; sc_d.def = 0; sc_d.unit = 0;
|
||||
if (k == 0u) { sc_d.label = "SCENE"; sc_d.max = 1; sc_d.names = ONOFF; sc_v[0] = scn_on; }
|
||||
else if (k == 1u) { sc_d.label = "TRACK"; sc_d.max = NTRK - 1; sc_d.names = TN; sc_v[1] = sc_trk; }
|
||||
else { sc_d.label = "ROLE"; sc_d.max = drum_track(t) ? 0 : SC_N - 1; sc_d.names = SC_ROLE; sc_v[2] = drum_track(t) ? 0 : scn_role[sc_trk % NTRK]; }
|
||||
*valp = &sc_v[k];
|
||||
return &sc_d;
|
||||
}
|
||||
static void sc_setup(uint32_t i) /* track i set up for its role */
|
||||
{
|
||||
track_t *t = &trk[i % NTRK];
|
||||
uint32_t r = scn_role[i % NTRK];
|
||||
if (drum_track(t) || r == SC_KEEP) return;
|
||||
if (r == SC_ARP) { if (!t->p[P_AMODE]) t->p[P_AMODE] = AM_UP; }
|
||||
else t->p[P_AMODE] = AM_OFF;
|
||||
if (r == SC_CHORD) t->p[P_VOICE] = V_POLY;
|
||||
}
|
||||
static void sc_put(uint32_t k, int32_t v)
|
||||
{
|
||||
uint32_t i, need = 0;
|
||||
if (k == 0u) {
|
||||
scn_on = (uint8_t)(v != 0);
|
||||
for (i = 0; scn_on && i < NTRK; i++) {
|
||||
sc_setup(i);
|
||||
need |= (uint32_t)(i >= trk_live && scn_role[i] && !drum_track(&trk[i]));
|
||||
}
|
||||
ui_message(!scn_on ? "SCENE OFF: KEYS PLAY ONE TRACK" : need ? "SCENE: T5 T6 ASLEEP (MENU > 6 TRACKS)" : "SCENE: KEYS PLAY THE ROLES");
|
||||
} else if (k == 1u)
|
||||
sc_trk = (uint8_t)clamp(v, 0, NTRK - 1);
|
||||
else if (k == 2u && !drum_track(&trk[sc_trk % NTRK])) {
|
||||
scn_role[sc_trk % NTRK] = (uint8_t)clamp(v, 0, SC_N - 1);
|
||||
sc_setup(sc_trk);
|
||||
}
|
||||
ui.force = 1;
|
||||
}
|
||||
static void graph_scene(void)
|
||||
{
|
||||
uint32_t i, j, n, h = graph_h();
|
||||
int32_t cw = 38, x0 = 6, y0 = 30, yh = (int32_t)h - y0 - 16;
|
||||
uint8_t o[KB_CH + 1];
|
||||
for (i = 0; i < NTRK; i++) {
|
||||
track_t *t = &trk[i];
|
||||
int32_t x = x0 + (int32_t)i * cw;
|
||||
uint32_t r = drum_track(t) ? SC_KEEP : scn_role[i];
|
||||
uint16_t c = r == SC_KEEP ? T_DIM : r == SC_CHORD ? T_THEME : r == SC_ARP ? T_MID : r == SC_BASS ? T_ACCENT : T_TEXT;
|
||||
char b[3] = {'T', (char)('1' + i), 0};
|
||||
cv_text_in(x, 2, cw - 4, &AF_X, b, i == sc_trk ? T_TEXT : T_DIM, T_SURF);
|
||||
cv_text_in(x - 2, 14, cw, &AF_X, drum_track(t) ? "KIT" : SC_ROLE[r], c, T_SURF);
|
||||
if (i == sc_trk) cv_frame(x - 3, 0, cw - 1, 25, T_ACCENT);
|
||||
if (i >= trk_live) continue;
|
||||
if (r == SC_KEEP) { /* its own sequence: the steps, dim */
|
||||
for (j = 0; j < 16u; j++)
|
||||
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 */
|
||||
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);
|
||||
}
|
||||
}
|
||||
cv_text_in(4, (int32_t)h - 11, 232, &AF_X, scn_on ? "SCENE ON: A KEY PLAYS EVERY ROLE" : "SCENE OFF: KNOB 1 TURNS IT ON",
|
||||
scn_on ? T_ACCENT : T_DIM, T_SURF);
|
||||
}
|
||||
+1
-1
@@ -785,7 +785,7 @@ int main(void)
|
||||
{ /* NEW PROJECT (SAVE > TOOLS 5): GENRE back to EXPLORE */
|
||||
gen_reset();
|
||||
gp.genre = 5;
|
||||
go_title("TOOLS"); tools_pick(5); press(B_OCTUP); press(B_OCTUP);
|
||||
go_title("TOOLS"); tools_pick(5); tools_hold(); /* (V10.24: OCT+ held) */
|
||||
bad += gcheck("NEW PROJECT: GENRE back to EXPLORE", gp.genre == GEN_EXPLORE && msg_is("NEW PROJECT"));
|
||||
}
|
||||
/* ---- the screen: HOME + SELECT opens GEN, the knobs set, SELECT pages, OCT+ makes, OCT- is done */
|
||||
|
||||
+13
-2
@@ -628,7 +628,7 @@ static void eng(uint32_t e) { set_engine_of(TSEL, e); }
|
||||
#define E_FM (FELUCCA_FM4 ? ENGI_DIGITAL : ENGI_FM6)
|
||||
|
||||
enum { S_HOME, S_HOME_IDLE, S_MESSAGE, S_MESSAGE_KEY, S_MESSAGE_NOFILE, S_PRESETS, S_PRESETS_NOFAV, S_USER, S_PHRASES, S_PROJECT, S_TOOLS,
|
||||
S_SONG_EMPTY, S_SONG, S_STEP, S_PATTERN, S_CHANCE, S_COMP, S_COMP_TRIG, S_COMP_ECHO, S_MUTATE, S_MORPH, S_DXIMG, S_DXSEND, S_PFLASH, S_PFLASH_HOME, S_FUGUE, S_MOTION, S_DRUM, S_DRUM_HAND, S_DRUM_CYM, S_MIXER, S_MIXER_PAN,
|
||||
S_SONG_EMPTY, S_SONG, S_STEP, S_PATTERN, S_CHANCE, S_COMP, S_COMP_TRIG, S_COMP_ECHO, S_MUTATE, S_EUMUTATE, S_SCENE, S_MORPH, S_DXIMG, S_DXSEND, S_PFLASH, S_PFLASH_HOME, S_FUGUE, S_MOTION, S_DRUM, S_DRUM_HAND, S_DRUM_CYM, S_MIXER, S_MIXER_PAN,
|
||||
S_ENV, S_ENVDEST, S_LFO, S_MOD, S_FX, S_SLICER, S_SLBUS, S_SLPITCH, S_DLY, S_SCL, S_SHIFT, S_ARP, S_VOICE, S_GLOBAL, S_SYSTEM,
|
||||
S_EDIT_ANALOG, S_EDIT_DIGITAL, S_OP_ENV, S_EDIT_WHEEL, S_EDIT_SAMPLE, S_EDIT_GRAIN,
|
||||
S_ALG1, S_ALG2, S_ALG3, S_ALG4, S_ALG5, S_ALG6, S_ALG7, S_ALG8, S_OP_LEVEL,
|
||||
@@ -666,7 +666,7 @@ enum { S_HOME, S_HOME_IDLE, S_MESSAGE, S_MESSAGE_KEY, S_MESSAGE_NOFILE, S_PRESET
|
||||
S_TOAST_ENV, S_TOAST_MUTATE, S_TOAST_MUTATE_HINT, S_TOAST_MOTION, S_TOAST_MOTION_LOCKS, S_TOAST_PUNCH, S_TOAST_AUTO_LIST,
|
||||
S_TOAST_AUTO_LIST_DRUM, S_TOAST_PATTERN, S_TOAST_FM6_OP, S_TOAST_ANALOG, S_COUNT };
|
||||
static const char *const S_NAME[S_COUNT] = {"home", "home_idle", "message", "message_key", "message_nofile", "presets", "presets_nofav", "user",
|
||||
"phrases", "project", "tools", "song_empty", "song", "step", "pattern", "chance", "comp", "comp_trig", "comp_echo", "euclid", "morph", "dx_image", "dx_send", "page_flash", "page_flash_home", "fugue", "motion", "drum",
|
||||
"phrases", "project", "tools", "song_empty", "song", "step", "pattern", "chance", "comp", "comp_trig", "comp_echo", "euclid", "euclid_mutate", "scene", "morph", "dx_image", "dx_send", "page_flash", "page_flash_home", "fugue", "motion", "drum",
|
||||
"drum_hand", "drum_cym", "mixer", "mixer_pan", "env", "env_dest", "lfo", "mod", "fx", "slicer", "slbus", "slpitch", "dly", "scl", "shift", "arp",
|
||||
"voice", "global", "system", "edit_analog", FELUCCA_FM4 ? "edit_digital" : "edit_fm6", "op_env", "edit_wheel", "edit_voice",
|
||||
"edit_noise", "alg_1", "alg_2", "alg_3", "alg_4", "alg_5", "alg_6", "alg_7", "alg_8", "op_level", "fm6_alg_01", "fm6_alg_05", "fm6_alg_22", "fm6_alg_32", "drumx", "drumx_hit", "dx_sound", "dx_sound2", "confirm_seq", "confirm_project", "confirm_user", "confirm_pattern",
|
||||
@@ -1125,6 +1125,17 @@ static void setup(int s)
|
||||
song.sel = 0; set_engine_of(TSEL, ENGI_DRUM); go_title("EUCLID");
|
||||
eu_put(EK_HITS, 5);
|
||||
break;
|
||||
case S_EUMUTATE: /* (V10.24) SEQ > MUTATE: the anchor above, a mutation below */
|
||||
song.sel = 0; set_engine_of(TSEL, ENGI_DRUM); go_title("EUCLID");
|
||||
eu_put(EK_HITS, 5);
|
||||
eu[0].mu[0] = 2; eu[0].mu[1] = 70; eu[0].mu[3] = 3;
|
||||
eu_mutate(0, &eu[0]);
|
||||
go_title("MUTATE");
|
||||
break;
|
||||
case S_SCENE: /* (V10.25) SCL > SCENE on: the six tracks' roles, a C4 played */
|
||||
song.sel = 0; scn_on = 1; sc_trk = 5; last_note = 60;
|
||||
go_title("SCENE");
|
||||
break;
|
||||
case S_CHANCE: go_page(GR_CHANCE); step_set_chance(&TSEL->step[0], 65); break;
|
||||
case S_COMP: /* (0.6.39) an ARP NOTES step: UP-DN x6 over two octaves */
|
||||
case S_COMP_TRIG: /* .. a TRIG 3:4 */
|
||||
|
||||
+109
-44
@@ -178,6 +178,9 @@ static void ui_power_on(void)
|
||||
sing_init(); /* (0.9.0: as felucca_init, VOICE's English generator words) */
|
||||
memset(trk, 0, sizeof trk);
|
||||
memset(&song, 0, sizeof song);
|
||||
scn_on = 0; scn_keys = 0; /* (V10.25: SCENE off at power-on, its roles the defaults) */
|
||||
memset(eu, 0, sizeof eu); /* (EUCLID / MUTATE: the session's, none at power-on) */
|
||||
{ static const uint8_t R0[NTRK] = {SC_KEEP, SC_LEAD, SC_KEEP, SC_ARP, SC_BASS, SC_CHORD}; memcpy(scn_role, R0, sizeof R0); sc_trk = 5; }
|
||||
memset(&chain, 0, sizeof chain);
|
||||
chain_defaults(&chain_config);
|
||||
live.mode = 0; /* (0.6.81: PLAY the loop, as at power-on; a DICE ALL leaves SONG) */
|
||||
@@ -1894,11 +1897,18 @@ static void go_title(const char *title)
|
||||
ui.page = (uint8_t)i;
|
||||
page_entered();
|
||||
}
|
||||
static void tools_pick(uint32_t n) /* (0.6.25) TOOLS: the n-th action picked (KNOB 1 down the list) */
|
||||
static void tools_pick(uint32_t n) /* (0.6.25) TOOLS: the n-th action picked */
|
||||
{
|
||||
uint32_t k;
|
||||
ui.act = 0;
|
||||
for (k = 0; k < n; k++) turn(EN_K1, 1);
|
||||
ui.act = (uint8_t)n;
|
||||
frame();
|
||||
}
|
||||
static void tools_hold(void) /* (V10.24) TOOLS: OCT+ held a second (the action done), let go */
|
||||
{
|
||||
fm1_in.buttons |= 1u << panel.btn[B_OCTUP];
|
||||
host_pressed |= 1u << panel.btn[B_OCTUP];
|
||||
frames(1000);
|
||||
fm1_in.buttons &= ~(1u << panel.btn[B_OCTUP]);
|
||||
frame();
|
||||
}
|
||||
static int test_init_system(void)
|
||||
{
|
||||
@@ -1914,8 +1924,8 @@ static int test_init_system(void)
|
||||
motion_capture(&trk[1], P_LEVEL, 40);
|
||||
sig0 = steps_sig(&trk[0]);
|
||||
go_title("TOOLS"); tools_pick(5); press(B_OCTUP);
|
||||
ok2 = ui.confirm == CF_INIT_SYS && trk[0].step[2].n == 1u;
|
||||
press(B_OCTUP);
|
||||
ok2 = !ui.confirm && trk[0].step[2].n == 1u && msg_is("HOLD OCT+ TO DO IT"); /* (V10.24: a tap does nothing) */
|
||||
tools_hold();
|
||||
ok2 &= !ui.confirm && msg_is("NEW PROJECT") && chain_config.count == 0u;
|
||||
for (k = 0; k < NTRK; k++)
|
||||
ok2 &= seq_is_empty(&trk[k]) && !motion_count(&trk[k]) && trk[k].eng_req == trk_def_engine(k);
|
||||
@@ -1934,9 +1944,8 @@ static int test_init_system(void)
|
||||
trk[0].step[2] = (step_t){{60}, 1, ST_NOTE, 0, 100};
|
||||
song.g[G_BPM] = 97;
|
||||
sig0 = steps_sig(&trk[0]);
|
||||
go_title("TOOLS"); tools_pick(6); press(B_OCTUP);
|
||||
ok2 = ui.confirm == CF_CPU_TEST;
|
||||
press(B_OCTUP);
|
||||
go_title("TOOLS"); tools_pick(6); tools_hold();
|
||||
ok2 = 1;
|
||||
ok2 &= !ui.confirm && msg_is("CPU TEST: PRESS PLAY") && song.g[G_BPM] == 160 && song.g[G_RTYPE] == 4;
|
||||
for (k = 0; k < trk_live; k++) {
|
||||
kit += drum_track(&trk[k]);
|
||||
@@ -2006,41 +2015,34 @@ static int test_actions(void)
|
||||
press(B_OCTDN);
|
||||
bad += check("0.9.2 PATTERNS: OCT- back to the SEQ page it is over (was HOME; the octave stays)",
|
||||
!ui.home && cur_page()->fam == FAM_SEQ && cur_page()->graph != GR_PATS && song.octave == 2);
|
||||
/* TOOLS: CLRSQ and INIT are picked, not done, by their knobs */
|
||||
/* TOOLS (V10.24): KNOB 1 the scope, KNOB 2 the action; OCT+ held does it, a tap says so */
|
||||
my_steps(t);
|
||||
go_title("TOOLS");
|
||||
bad += check("TOOLS: nothing picked, OCT+ dark", act_cols() == 15u && act_col() == 0u && oct_leds_seen(0) == 1u);
|
||||
turn(EN_K1, 3);
|
||||
bad += check("KNOB 1 picks CLEAR, the steps stay; OCT+ breathes", ui.act == 1u && !seq_is_empty(t) &&
|
||||
oct_leds_seen(0) == (1u | OCT_BREATH));
|
||||
{
|
||||
char a[16], b[16];
|
||||
foot_hint(a, b);
|
||||
bad += check("..the footer: OCT+ CLEAR / OCT- CANCEL", str_eq(a, "OCT+ CLEAR") && str_eq(b, "OCT- CANCEL"));
|
||||
}
|
||||
turn(EN_K1, -1);
|
||||
bad += check("KNOB 1 left drops it", ui.act == 0u);
|
||||
turn(EN_K1, 1); turn(EN_K1, 1); /* (0.9.2: KNOB 1; PRESETS a sound there, rule 3) */
|
||||
bad += check("(0.6.25) TOOLS is a list: KNOB 1 moves the pick down (INIT SOUND), any knob too", ui.act == 2u);
|
||||
turn(EN_K3, -1);
|
||||
bad += check(" .. and up", ui.act == 1u);
|
||||
turn(EN_K1, -1);
|
||||
turn(EN_K1, 1);
|
||||
bad += check("a knob picks CLEAR SEQ (TRACK), the steps stay; OCT+ breathes", ui.act == 1u && !seq_is_empty(t) &&
|
||||
oct_leds_seen(0) == (1u | OCT_BREATH));
|
||||
turn(EN_K1, 1);
|
||||
bad += check("KNOB 1 the scope: SOUND (INIT SOUND)", ui.act == 2u);
|
||||
turn(EN_K1, 1);
|
||||
bad += check(" .. SONG (DELETE ROW first)", ui.act == 3u);
|
||||
turn(EN_K2, 1);
|
||||
bad += check("KNOB 2 the action: CLEAR SONG", ui.act == 4u);
|
||||
turn(EN_K1, -1); turn(EN_K1, -1);
|
||||
press(B_OCTDN);
|
||||
bad += check("OCT- cancels the pick (still on TOOLS)", ui.act == 0u && !ui.home && !seq_is_empty(t));
|
||||
turn(EN_K1, 1);
|
||||
press(B_OCTUP);
|
||||
bad += check("TOOLS CLEAR first asks confirmation", ui.confirm == CF_CLEAR_SEQ && !seq_is_empty(t));
|
||||
press(B_OCTUP);
|
||||
bad += check("OCT+ clears the pattern, the pick dropped", seq_is_empty(t) && msg_is("T1 CLEARED") && str_eq(ui.msg2, "SEQ+REC: ALL TRACKS") && ui.act == 0u);
|
||||
turn(EN_K1, 1);
|
||||
bad += check("TOOLS CLEAR: a tap does nothing, says hold", !ui.confirm && !seq_is_empty(t) && msg_is("HOLD OCT+ TO DO IT"));
|
||||
tools_hold();
|
||||
bad += check("OCT+ held: the pattern cleared, no dialog", seq_is_empty(t) && !ui.confirm && msg_is("T1 CLEARED"));
|
||||
tools_pick(1);
|
||||
bad += check("nothing to clear: OCT+ dark", oct_leds_seen(0) == 1u);
|
||||
turn(EN_K2, 1);
|
||||
tools_pick(2);
|
||||
t->p[P_E0] = (int16_t)(t->p[P_E0] + 1);
|
||||
press(B_OCTUP);
|
||||
bad += check("TOOLS INIT first asks confirmation", ui.confirm == CF_INIT_SOUND);
|
||||
press(B_OCTUP);
|
||||
bad += check("KNOB 2 INIT, OCT+: SOUND INIT", msg_is("SOUND INIT") && ui.act == 0u);
|
||||
tools_hold();
|
||||
bad += check("INIT SOUND held: SOUND INIT", msg_is("SOUND INIT"));
|
||||
ui.act = 0;
|
||||
press(B_OCTDN);
|
||||
bad += check("OCT- with nothing picked: HOME", ui.home);
|
||||
/* the dialogs and the menu */
|
||||
@@ -3452,9 +3454,7 @@ static int test_chain(void)
|
||||
bad += check("SONG: + ADD, then END the last row (full: END right after row 16)", ui.song_row == CHAIN_ROWS);
|
||||
bad += check("SONG append row stays bounded at 16", chain_config.count == CHAIN_ROWS && chain_valid(&chain_config));
|
||||
go_title("TOOLS"); tools_pick(4); press(B_OCTUP);
|
||||
bad += check("CLEAR SONG requires explicit confirmation", ui.confirm == CF_CLEAR_SONG && chain_config.count == CHAIN_ROWS);
|
||||
press(B_OCTDN);
|
||||
bad += check("cancel preserves the full song", chain_config.count == CHAIN_ROWS);
|
||||
bad += check("CLEAR SONG wants OCT+ held: a tap leaves the full song", !ui.confirm && chain_config.count == CHAIN_ROWS);
|
||||
{ uint32_t n0 = chain_config.count, pg0 = ui.page;
|
||||
go_title("ARRANGE"); frame();
|
||||
ui.song_row = 0; chain_config.row[0].slot = 0;
|
||||
@@ -3464,7 +3464,7 @@ static int test_chain(void)
|
||||
bad += check("SONG: SECT left of A asks DELETE ROW?, OCT+ deletes it", ok && chain_config.count == n0 - 1u);
|
||||
ui.page = (uint8_t)pg0; ui.force = 1; frame();
|
||||
}
|
||||
tools_pick(4); press(B_OCTUP); press(B_OCTUP);
|
||||
go_title("TOOLS"); tools_pick(4); tools_hold();
|
||||
bad += check("confirmed CLEAR SONG keeps musical steps", !chain_config.count && !ui.song_row);
|
||||
return bad;
|
||||
}
|
||||
@@ -4852,9 +4852,9 @@ static int test_bughunt_ui(void)
|
||||
ok &= !ui.confirm && msg_is("NOTHING TO CLEAR");
|
||||
tools_pick(4);
|
||||
ok &= act_ready();
|
||||
press(B_OCTUP);
|
||||
bad += check("TOOLS: DELETE ROW / CLEAR SONG / CLEAR PAT with nothing there: NOTHING TO ..; a song: its dialog",
|
||||
ok && ui.confirm == CF_CLEAR_SONG);
|
||||
tools_hold();
|
||||
bad += check("TOOLS: DELETE ROW / CLEAR SONG / CLEAR PAT with nothing there: NOTHING TO ..; a song: held, cleared",
|
||||
ok && !chain_config.count);
|
||||
/* 7: REC works in the layers, as PLAY: it arms the track (PLAY starts); the layer stays, no page */
|
||||
ok = 1;
|
||||
{
|
||||
@@ -11872,13 +11872,16 @@ static int test_lz_key(void)
|
||||
ui_power_on(); frame();
|
||||
press(B_SCL); frame();
|
||||
ok = pd_on() && lz_fam() == LZ_KEY && pd_level() == 0u && str_eq(cur_page()->title, "SCL") && lz_tab_lit(0) &&
|
||||
lz_tabs() == 2u && lz_crumb_is("SCL \xB7 KEY \xB7 SCL") && lz_count_is("1/2");
|
||||
lz_tabs() == 3u && lz_crumb_is("SCL \xB7 KEY \xB7 SCL") && lz_count_is("1/3"); /* (V10.25: SCENE third) */
|
||||
frames(320); press(B_SCL); frame();
|
||||
ok &= pd_level() == 1u && str_eq(cur_page()->title, "CHORD") && lz_tab_lit(1) && lz_crumb_is("SCL \xB7 CHORD \xB7 CHORD");
|
||||
frames(320); press(B_SCL); frame();
|
||||
ok &= pd_level() == 2u && str_eq(cur_page()->title, "SCENE");
|
||||
frames(320); press(B_SCL); frame();
|
||||
ok &= pd_level() == 0u && str_eq(cur_page()->title, "SCL");
|
||||
turn(EN_SELECT, 3); frame();
|
||||
ok &= str_eq(cur_page()->title, "CHORD"); /* (SCL's chain ends there: not into ARP) */
|
||||
turn(EN_SELECT, 4); frame();
|
||||
ok &= str_eq(cur_page()->title, "SCENE"); /* (SCL's chain ends there: not into ARP) */
|
||||
turn(EN_SELECT, -1); frame();
|
||||
frames(320); press(B_ARP); frame();
|
||||
ok &= pd_level() == 2u && str_eq(cur_page()->title, "ARP") && lz_tab_lit(0) && lz_tabs() == 1u &&
|
||||
lz_crumb_is("ARP \xB7 ARP \xB7 ARP") && lz_count_is("1/2");
|
||||
@@ -13019,6 +13022,66 @@ 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.25) SCL > SCENE: one key plays every track given a role (T6 CHORD a triad, T5 BASS an octave down, T2 LEAD an
|
||||
* octave up, T4 ARP the chord into its arp); the kit and KEEP tracks are not reached; the key up ends them all; REC
|
||||
* records every role's track */
|
||||
static uint32_t trk_gates(uint32_t p)
|
||||
{
|
||||
uint32_t i, n = 0;
|
||||
for (i = 0; i < NVOICE; i++) n += trk[p].v[i].gate != 0;
|
||||
return n;
|
||||
}
|
||||
static int test_scene(void)
|
||||
{
|
||||
int bad = 0, ok;
|
||||
uint32_t i;
|
||||
ui_power_on();
|
||||
song.sel = 0;
|
||||
go_title("SCENE"); frame();
|
||||
trks_put(1); /* (6 TRACKS: T5 T6 awake) */
|
||||
set_engine_of(&trk[0], ENGI_DRUM);
|
||||
for (i = 1; i < NTRK; i++) set_engine_of(&trk[i], ENGI_ANALOG);
|
||||
for (i = 0; i < 60u; i++) events_block(CTL); /* (the engines faded in) */
|
||||
turn(EN_K1, 1);
|
||||
ok = scn_on == 1u;
|
||||
turn(EN_K2, -1); /* (T6 -> T5: BASS) */
|
||||
ok &= sc_trk == 4u && scn_role[4] == SC_BASS;
|
||||
bad += check("SCENE page: KNOB 1 ON, KNOB 2 the track, its role shown", ok);
|
||||
key_down(white(7)); /* (C4 or so) */
|
||||
for (i = 0; i < 4u; i++) events_block(CTL);
|
||||
ok = trk_gates(5) == 3u && trk_gates(4) == 1u && trk_gates(1) == 1u && trk[3].arp_phys > 0u && trk_gates(0) == 0u && trk_gates(2) == 0u;
|
||||
bad += check("SCENE: one key, T6 a triad, T5 the bass, T2 the lead, T4 its arp; the kit and T3 (KEEP) not", ok);
|
||||
key_up(white(7));
|
||||
for (i = 0; i < 4u; i++) events_block(CTL);
|
||||
bad += check("SCENE: the key up ends every role", trk_gates(5) == 0u && trk_gates(4) == 0u && trk_gates(1) == 0u && !trk[3].arp_phys);
|
||||
turn(EN_K1, -1);
|
||||
bad += check("SCENE OFF: a key plays the selected track again", !scn_on);
|
||||
trks_put(0);
|
||||
return bad;
|
||||
}
|
||||
/* (V10.24) SAVE > PRESETS: KNOB 1 plays each sound as it passes; OCT- brings back the one from before the browse, OCT+
|
||||
* keeps it */
|
||||
static int test_presets_back(void)
|
||||
{
|
||||
int ok;
|
||||
int16_t p0;
|
||||
uint32_t e0, pr0;
|
||||
ui_power_on();
|
||||
song.sel = 4;
|
||||
e0 = TSEL->eng_req; pr0 = TSEL->preset; p0 = TSEL->p[P_E1];
|
||||
go_title("PRESETS"); frame();
|
||||
turn(EN_K1, 1); turn(EN_K1, 1);
|
||||
ok = TSEL->preset != pr0 || TSEL->eng_req != e0;
|
||||
press(B_OCTDN);
|
||||
ok &= TSEL->eng_req == e0 && TSEL->preset == pr0 && TSEL->p[P_E1] == p0 && msg_is("SOUND BEFORE") && !ui.home;
|
||||
turn(EN_K1, 1);
|
||||
pr0 = TSEL->preset;
|
||||
press(B_OCTUP);
|
||||
ok &= TSEL->preset == pr0 && msg_is("SOUND KEPT");
|
||||
press(B_OCTDN);
|
||||
ok &= TSEL->preset == pr0; /* (kept: nothing to go back to) */
|
||||
return check("PRESETS: OCT- the sound before the browse, OCT+ keeps it (V10.24)", ok);
|
||||
}
|
||||
/* (V10.23) STRING's EXCITE into FDBK: EDIT 2's four knobs become the amp's with values heard at once (GAIN was STRETCH's 0:
|
||||
* "the modes don't take until a knob goes up"), and back out STRETCH BODY SIZE BOW as they were left */
|
||||
static int test_string_excite(void)
|
||||
@@ -13044,6 +13107,8 @@ int main(void)
|
||||
int bad = 0;
|
||||
bad += test_comp_cards();
|
||||
bad += test_string_excite();
|
||||
bad += test_presets_back();
|
||||
bad += test_scene();
|
||||
bad += test_large_face();
|
||||
bad += test_lz_home();
|
||||
bad += test_lz_edit();
|
||||
|
||||
+1887
-1873
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user