mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-05 20:34:27 +01:00
- RADIO (BYTE 41fbf469): the next piece was asked for when the piece's last bar began, so a STOP in that bar made it and played it. Now the bar armed (grd.arm) and the piece made once it played through, or the song reached its own END (song_chain.c chain.fin, set in chain_tick, cleared at chain_start): a STOP stops. gen_entry_test: a STOP on a loop's last bar and on a song's last bar - GEN and SCL > HARMONY (BYTE c68c3aac; the owner: "GEN must not touch HARMONY"): gen_clean keeps its four values (a throw turned it off: system_init). HARMONY on at the throw: the piece on the key's tonic chord, every section's too (no contrast progression, no subdominant break), HARMONY supplying the movement; off: as before. harmony_test: throws alternately off and on, three forms - gen_sound: a chord, pad or texture part on a lead's preset loses that preset's fast pitch LFO (a slow drift at most; 5 of 3160 parts kept it); EXPLORE's own rule (gx_sound) as it was, its pieces byte for byte. gen_test's check back to none Not ported: BYTE 3321228e's per-block formula operators (FM has no formula VM: MATH is eng_lofi.c's switch) and its filter fast path (tf_run is pinned RAM code, 264 B over the limit to spare: a re-pin for CPU FM has not needed). Pages: every titled page is in a chain but FM4's OP1 ENV .. OP LEVEL (known, kept for ui_test). Layout recorded again with FELUCCA_REPIN=keep (chain_tick, the interrupt's, two bytes longer); the plain build passes. Image 583128 B of 584336 (1208 B free), RAM 97004, RAM code 32504 of 34816, pool spare 8480 B, BT segment 73564 of 73728. audio.c as V23's. MOOD MID's reference unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
73 lines
4.1 KiB
C
73 lines
4.1 KiB
C
// Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant). All rights reserved.
|
|
/* (V10.7.66, the owner) SCL > HARMONY: a progression every melodic sequence follows. A track repeating C plays the
|
|
* progression's roots (in its scale), chord by chord on LENGTH; SKIP's track does not move; a kit never; OFF as before;
|
|
* the project keeps it ('H' 'M'). Built and run by CI (voice-user-check.yml) */
|
|
#define UI_TEST_NO_MAIN 1
|
|
#include "ui_test.c"
|
|
|
|
int main(void)
|
|
{
|
|
int bad = 0, ok;
|
|
project_t p;
|
|
ui_power_on();
|
|
trk[1].p[P_ROOT] = 0; trk[1].p[P_SCALE] = 1; /* (C major) */
|
|
song.g[G_HPROG] = 1 + PR_50S; song.g[G_HLEN] = 2; song.g[G_HEVO] = 0; song.g[G_HSKIP] = 0;
|
|
gen_tick();
|
|
ok = hm_n == 4u;
|
|
bar_n = 0; beat_n = 0; ok &= hm_shift(&trk[1]) == 0; /* I */
|
|
bar_n = 1; ok &= hm_shift(&trk[1]) == 5; /* vi */
|
|
bar_n = 2; ok &= hm_shift(&trk[1]) == 3; /* IV */
|
|
bar_n = 3; beat_n = 3; ok &= hm_shift(&trk[1]) == 4; /* V (the bar's last beat still V) */
|
|
bar_n = 4; beat_n = 0; ok &= hm_shift(&trk[1]) == 0; /* round */
|
|
ok &= scale_steps(&trk[1], 60, hm_shift(&trk[1])) == 60;
|
|
bar_n = 1; ok &= scale_steps(&trk[1], 60, hm_shift(&trk[1])) == 69; /* (C up six scale steps: A) */
|
|
bad += check("HARMONY 50S: I vi IV V a bar each; C follows as C A F G", ok);
|
|
song.g[G_HLEN] = 0; bar_n = 0; beat_n = 1;
|
|
ok = hm_shift(&trk[1]) == 5; /* (1/4: a chord a beat) */
|
|
song.g[G_HSKIP] = 2; /* T2 skips */
|
|
ok &= hm_shift(&trk[1]) == 0 && hm_shift(&trk[0]) == 5;
|
|
song.g[G_HSKIP] = 0; song.g[G_HPROG] = 0;
|
|
ok &= hm_shift(&trk[1]) == 0;
|
|
bad += check("HARMONY: LENGTH 1/4 a chord a beat; SKIP T2 stays; OFF nothing", ok);
|
|
song.g[G_HPROG] = 1 + PR_JAZZ2; song.g[G_HLEN] = 3; song.g[G_HEVO] = 90; song.g[G_HSKIP] = 3;
|
|
project_capture(&p);
|
|
ok = !project_save(1);
|
|
song.g[G_HPROG] = 0; song.g[G_HLEN] = 2; song.g[G_HEVO] = 0; song.g[G_HSKIP] = 0;
|
|
project_load(1); frames(4);
|
|
ok &= song.g[G_HPROG] == 1 + PR_JAZZ2 && song.g[G_HLEN] == 3 && song.g[G_HEVO] == 90 && song.g[G_HSKIP] == 3;
|
|
bad += check("HARMONY kept with the project", ok);
|
|
{ /* SCL > HARMONY: its page and knobs */
|
|
song.g[G_HPROG] = 0;
|
|
go_title("HARMONY"); frames(32);
|
|
turn(EN_K1, 3); frames(32);
|
|
ok = str_eq(cur_page()->title, "HARMONY") && song.g[G_HPROG] == 3;
|
|
bad += check("SCL > HARMONY: the page, KNOB 1 the progression", ok);
|
|
}
|
|
{ /* (V10.8.43, BYTE's; the owner: "GEN must not touch HARMONY") throws alternately with HARMONY off (the piece its
|
|
* own progression, as ever) and on (its four values kept; the melodic parts on the key's tonic chord, every
|
|
* section's too: HARMONY supplies the movement, not twice) */
|
|
uint32_t k, i, prog = 0;
|
|
ok = 1;
|
|
for (k = 0; k < 96u; k++) {
|
|
ui_power_on();
|
|
gp.genre = (uint8_t)(1u + (k >> 1) % NGENRE); gp.seed = (uint16_t)(100u + (k >> 1)); gp.energy = 60; gp.form = (uint8_t)((k >> 1) % 3u);
|
|
gp.complex = 50; gp.swing = GA_AUTO; gp.human = 30; gp.mix = 0;
|
|
for (i = 0; i < GP_N; ++i) gp.amt[i] = GA_AUTO;
|
|
song.g[G_HPROG] = k & 1u ? 3 : 0; song.g[G_HLEN] = 3; song.g[G_HEVO] = 40; song.g[G_HSKIP] = 2;
|
|
gen_go();
|
|
if (k & 1u) {
|
|
ok &= song.g[G_HPROG] == 3 && song.g[G_HLEN] == 3 && song.g[G_HEVO] == 40 && song.g[G_HSKIP] == 2 &&
|
|
gs.pn == 1u && gs.pdeg[0] == 0u;
|
|
if (!(gs.pn == 1u && gs.pdeg[0] == 0u)) printf(" on: %s seed %u form %u pn %u deg %u\n", gs.g->name, gp.seed, gp.form, gs.pn, gs.pdeg[0]);
|
|
} else {
|
|
ok &= song.g[G_HPROG] == 0;
|
|
prog += gs.pn > 1u;
|
|
}
|
|
}
|
|
if (prog < 24u) printf(" off: a progression in %u of 48\n", prog);
|
|
bad += check("GEN leaves SCL > HARMONY alone: on, kept and the piece on the tonic chord; off, its own progression", ok && prog >= 24u);
|
|
}
|
|
printf(bad ? "harmony: %d FAILED\n" : "harmony: all ok\n", bad);
|
|
return bad != 0;
|
|
}
|