mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 04:44:33 +01:00
Juan: "Habría que implementar el OTT en el generador para los géneros más
electrónicos".
GEN (gen.c gen_ott, after the mix and the FX; RESOUND too):
- GOTT, a genre each, the drums and the bass at DEPTH 40 .. 60:
- 40: HOUSE, DEEP HOUSE, MINIMAL (its sub alone, 1 dB up);
- 44: TECH HOUSE, TRIBAL (drums only), REGGAETON, IDM GLITCH (drums
only), TECHNO ROCK (its synth 80s);
- 48 .. 54: DRUM & BASS, ELECTRO, BREAKBEAT, DEMBOW, ELECTRO METAL,
HIP HOP's trap, drill and pluggnb, HARD TECHNO, EBM, BAILE FUNK;
- 60: HARD BASS, PHONK, DUBSTEP.
MOOD DANCE adds 4.
- In most of them, one seed in two, the lead goes hard at 60 .. 78. When
the lead is a riff already up front (GAIN 6), the texture takes it.
Pads never. Three tracks at most.
- Per role TIME, UP/DN and X-OVER: the drums TIME 44 and a little less
upward, the bass X-OVER 26 (its sub whole), the lead X-OVER 55.
- None on the acoustic and organic genres (cumbia, jazz, neo classic,
dream pop, shoegaze, kraut, metalcore, IDM ambient and weird), on
HIP HOP's boom bap and lofi, on TECHNO ROCK's rock, on EXPLORE, nor
at MOOD CALM.
- Each OTT track's LEVEL comes down by the depth squared (gen_peak:
every piece under -1 dBFS with the trims as they were). No draw from
the piece's random streams: every other choice is as it was, and the
seed is still deterministic.
- RESOUND sets the genre's OTT, or clears it, on the tracks it gives
sounds. A track RESOUND does not touch keeps its OTT.
- Not per section: the sections do not store OTT.
FX > OTT, a much more extreme law (Juan via the coordinator; this
replaces the alignment to BYTE d9feaf71; BYTE v1.1b5 has no commit yet):
- Up at 0.97 dB a dB toward -18 dBFS, at most +36 dB, faded out under
-66 dBFS (a -46 dBFS band gets +27 dB).
- 20:1 over -22 dBFS, at most -36 dB.
- Both bands driven together into dsp.c's soft clip, +9 dB at the full
weight: dense and saturated, never a hard clip, never past -0.3 dBFS.
- DEPTH squared to 70, then a cubic to 100 (weight 30: 0.09, 60: 0.36,
70: 0.49, 80: 0.85, 90: 0.98).
- TIME 48 by default (~32 ms back, 1 ms up), so it pumps with the kick.
- Each block's band peaks are read first, so a hit after quiet is not
boosted by the quiet's gain, and a gain going down takes effect at
once. Still a gain per block, then the ramp.
- DEPTH 0 is still not run (bit-exact). Under the overload guard, half
the weight.
- ott_test: at DEPTH 100 a -46 dBFS sine comes out at -10.0 dBFS and a
-6 dBFS sine at -7.7 dBFS (from the rms), 2.3 dB apart.
- Stored TIME is kept less its default: a V10.8.71 file's TIME comes out
24 lower (its default 72 loads as the new default 48).
DIST TYPE gets JIANT BYTE's formula effects (origin/main DIST_EQ; on
BYTE's formula machine there, fixed code here):
- 6 RING, 7 STEPS, 8 XOR, 9 WOB, 10 SFOLD, 11 SAT. They are cases of
the shaper (dist_shape, in RAM); deq_k gives each block's constant.
- They use BYTE's input scale, TONE stage and blend; there is no low cut
and no make-up. NOISE moves the input as BYTE's does, at FM's NOISE
depth.
- SOFT .. AMP keep 0 .. 5, and old projects sound the same.
- Within 1.5 % of the formulas in floating point (dist_eq_test). The
output is a quarter inside so the TONE poles fit in 32 bits (BYTE's
can wrap).
- BYTE's GATE, LPF, LFO.F, HPF and RND are left out: the flash.
- The SENDS have no drive of their own in FM (SENDS' DIST is the track's
DIST), so there is no separate send SAT / SFOLD.
HOME > VISUAL: every frame the UI paces is drawn. V10.8.67 left out
every other or third frame by the animation's ticks, unevenly (3 to 7
drawn a second, gaps of 150 .. 400 ms). Now each frame draws less:
- past 65 % load, the first picture alone and 300 points (copies as the
budget holds them); past 80 %, 150 points;
- the animation frozen: the picture is kept and not drawn again (it was
never drawn at FREEZE);
- ui.force is cleared after a VISUAL frame (it was left set).
Host (tests/vis_cadence_test.c), frames a second and work a second,
V10.8.71 -> V10.8.72:
- idle: 66 -> 66;
- 69 % now / 66 % average: 6.7 (gaps 150 ms), 0.6 ms -> 20 (50 ms), 0.4 ms;
- 82 % / 50 %: 6.8 (350 ms), 0.7 ms -> 20 (50 ms), 0.4 ms;
- 82 % / 79 %: 3.3 (400 ms), 0.3 ms -> 10 (100 ms), 0.2 ms.
Off the page nothing of it runs.
MOOD CALM's rows checked: V10.8.68's message said "longer sections,
slower RADIO", but its code is BYTE 09ec6b57's, where Juan asked "CALM's
pieces too long". CALM -50 rows: HOUSE x 12, PARTS 356 bars against
MID's 624, SONG 490 against 1140; the radio loops 9 bars against 17.
Left as it is; gen_entry_test pins the direction.
Flash (V10.8.71: 176 B free; this work ~2.7 KB):
- more enum lists packed in PNE (str_nth): FM6's ALG and SLOT, MATH's
BYTE and FLOAT, VOICE's LYRIC LANG THEME LOOP, ARP MODE, SCALE,
ENGINE, KEY MAP, EXT's MODE, STRING's EXCITE, WHEEL's PERC. name_of
reads packed lists; descdump is identical but for DIST TYPE.
- BTAPP_FN / UH_SEG functions are now seen by size_fns.py; 13 per-key,
per-step and per-half-buffer sound functions built for size.
- the shaper's soft clip one copy in RAM (dist_sclip, bit-exact).
Image 12 B free, BT 36 B free, RAM .data+.bss 1048 B free, pool spare
8224 B, RAM code 40384 of 42496 B (headroom 2112). audio.c is V23's.
REPIN=keep; a plain build passes.
CPU (tests/cpu_lines_test.py), each scene's worst block, core 0/core 1,
V10.8.71 -> V10.8.72:
101 79/44 -> 78/44 102 62/28 -> 62/28 103 81/14 -> 85/14 (TRIBAL: OTT drums)
104 46/14 -> 50/14 (BREAKBEAT: drums, bass) 105 66/41 -> 66/41
106 53/36 -> 52/36 107 58/11 -> 62/11 (HARD BASS: drums, bass)
108 51/29 -> 51/29 0c 70/58 -> 70/58
The GEN scenes with OTT pay ~4 % on core 0, mostly ott_block's flash
lines (the first OTT track). DIST at 127 on all six tracks of 101: SOFT
81/46, WOB 81/46, SAT 82/47, RING 84/46 (CL_DTYPE).
gen_peak: 270 pieces, 0 over -1 dBFS (loudest stem -2.5, mix -1.1).
gen_test's mix pass and the rest hold.
Tests:
- ott_test: the law, the curve, GEN's OTT, RESOUND;
- tests/dist_eq_test.c and tests/vis_cadence_test.c are new, in CI;
- app_contract: DIST TYPE's DESC;
- gen_entry: MID recorded again, CALM's direction;
- cpu_lines_test.c: CL_DTYPE;
- the local workflow: all 23 steps pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
299 lines
19 KiB
C
299 lines
19 KiB
C
// Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant). All rights reserved.
|
|
/* (V10.7.66, Hollusion's ideas) GEN while it plays: the piece waits for the bar it plays to end (OCT+ mid-bar changes
|
|
* nothing yet); KEY KEEP keeps the first melodic track's key and mode; ENTRY BUILD brings the new piece in a track a bar
|
|
* (the kit first), the others the piece before until their bar, all of it the new piece in the end. Built and run by CI
|
|
* (voice-user-check.yml) */
|
|
#define UI_TEST_NO_MAIN 1
|
|
#include "ui_test.c"
|
|
|
|
static void blk(void) { static int32_t o[2 * CTL]; mix_block(o, CTL); frames(32); } /* (transport_req: the next block) */
|
|
static void bars(uint32_t n) /* play on until n more bars started */
|
|
{
|
|
static int32_t o[2 * CTL];
|
|
uint32_t b0 = bar_n, i;
|
|
for (i = 0; i < 200000u && bar_n - b0 < n; i++) { mix_block(o, CTL); if (!(i & 7u)) frame(); }
|
|
frames(64);
|
|
}
|
|
static uint32_t xsig(void)
|
|
{
|
|
uint32_t h = 2166136261u, k, i;
|
|
for (k = 0; k < NTRK; k++) {
|
|
h = (h ^ steps_sig(&trk[k])) * 16777619u;
|
|
for (i = 0; i < sizeof trk[k].p; i++) h = (h ^ ((const uint8_t *)trk[k].p)[i]) * 16777619u;
|
|
}
|
|
for (i = 0; i < sizeof song.g; i++) h = (h ^ ((const uint8_t *)song.g)[i]) * 16777619u;
|
|
return h;
|
|
}
|
|
int main(void)
|
|
{
|
|
int bad = 0, ok, mid_ok = 1;
|
|
uint32_t k, s0[NTRK], mel = 0;
|
|
ui_power_on();
|
|
{ /* (V10.8.40) MOOD MID: the pieces V10.8.39's, byte for byte (from power-on: the tracks' values and steps, the
|
|
* song's, the kit; a checksum of 8 seeds in EXPLORE, RANDOM and HOUSE; V10.8.39's own, the same tool) */
|
|
static const uint32_t MID[3] = {0xce3b95dcu, 0xc1183dd2u, 0x9d6d2e23u}; /* (V10.8.72 recorded again: GEN's OTT, its tracks' LEVEL taken back, five genres' trims; V10.8.70: JIANT BYTE's grich, the call and response and EXPLORE's cut back, HOUSE and METALCORE trimmed; V10.8.69: JIANT BYTE's song plans (gsong), its sections' timbre moving, gen_post without the call and response, the kits' punch back; V10.8.68: JIANT BYTE 09ec6b57 / 77f2b602's generator, the kits shorter and less driven, EXPLORE's field and voices; V10.8.51: a genre's headroom, GTRIM; V10.8.48: the envelopes by role, the filter types; V10.8.47: JAZZ's hats; V10.8.46 recorded again: a part never still; V10.8.45: the envelopes' rules; V10.8.42 too; V10.8.41: the generator rewritten genre by genre:
|
|
* this version's own pieces, recorded with GEN_MID=1; a change to the generator records them again) */
|
|
uint32_t md, hs = 0, r, i;
|
|
for (r = 1; r <= NGENRE; r++) if (str_eq(GENRE[r - 1u].name, "HOUSE")) hs = r;
|
|
for (md = 0; md < 3u; md++) {
|
|
uint32_t h = 2166136261u;
|
|
for (r = 0; r < 8u; r++) {
|
|
gp.genre = (uint8_t)(md == 0u ? GEN_EXPLORE : md == 1u ? 0u : hs);
|
|
gp.form = 0; gp.seed = (uint16_t)(100u + r * 37u); grd.on = 0; grd.mood = 0;
|
|
gen_make();
|
|
for (k = 0; k < NTRK; k++)
|
|
for (i = 0; i < sizeof trk[k].p + sizeof trk[k].step; i++)
|
|
h = (h ^ (i < sizeof trk[k].p ? ((const uint8_t *)trk[k].p)[i] : ((const uint8_t *)trk[k].step)[i - sizeof trk[k].p])) * 16777619u;
|
|
for (i = 0; i < sizeof song.g; i++) h = (h ^ ((const uint8_t *)song.g)[i]) * 16777619u;
|
|
for (i = 0; i < sizeof dx_kit; i++) h = (h ^ ((const uint8_t *)dx_kit)[i]) * 16777619u;
|
|
}
|
|
if (getenv("GEN_MID")) printf(" MID[%u] 0x%08xu\n", md, h);
|
|
mid_ok &= h == MID[md];
|
|
}
|
|
ui_power_on();
|
|
}
|
|
gp.genre = 1; gp.form = 0; gp.key = 0; gp.entry = 0;
|
|
gen_press(); frames(64); /* a piece to start from, stopped: made at once */
|
|
for (k = 0; k < NTRK; k++) s0[k] = steps_sig(&trk[k]);
|
|
transport_req = 1; blk();
|
|
bars(1);
|
|
{ /* mid-bar: asked, nothing yet; the bar's end: the new piece */
|
|
static int32_t o[2 * CTL];
|
|
uint32_t i;
|
|
for (i = 0; i < 40u; i++) mix_block(o, CTL);
|
|
gen_press(); frames(64);
|
|
ok = gen_wait && steps_sig(&trk[0]) == s0[0];
|
|
bars(1);
|
|
{ static int32_t o2[2 * CTL]; mix_block(o2, CTL); frames(32); } /* (it plays again from the next block) */
|
|
for (k = 0, i = 0; k < trk_live; k++) i |= steps_sig(&trk[k]) != s0[k];
|
|
ok &= !gen_wait && i && song.playing;
|
|
bad += check("GEN while it plays: OCT+ waits for the bar's end, then the new piece (it plays on)", ok);
|
|
}
|
|
{ /* KEY KEEP */
|
|
uint32_t r;
|
|
transport_req = 1; blk(); /* (stop) */
|
|
for (mel = 0; mel < trk_live && ENGINES[trk[mel].eng_req]->oneshot; mel++) {}
|
|
trk[mel].p[P_ROOT] = 5; trk[mel].p[P_SCALE] = 1; /* (F, a mode of seven) */
|
|
gp.key = 1;
|
|
for (r = 0, ok = 1; r < 4u; r++) {
|
|
gen_press(); frames(64);
|
|
for (k = 0; k < trk_live; k++)
|
|
if (!ENGINES[trk[k].eng_req]->oneshot) ok &= trk[k].p[P_ROOT] % 12 == 5 && trk[k].p[P_SCALE] == 1;
|
|
}
|
|
gp.key = 0;
|
|
bad += check("KEY KEEP: four new pieces, every melodic track in F and the same mode", ok);
|
|
}
|
|
{ /* ENTRY BUILD */
|
|
uint32_t nb = 0, n0;
|
|
gp.entry = 1;
|
|
transport_req = 1; blk(); /* (play) */
|
|
bars(1);
|
|
for (k = 0; k < NTRK; k++) s0[k] = steps_sig(&trk[k]);
|
|
gen_press(); frames(64);
|
|
bars(1); blk(); /* (the piece made at the bar's end, playing again) */
|
|
ok = gst_old != 0;
|
|
for (k = 0; k < trk_live; k++)
|
|
if (!((gst_old >> k) & 1u)) ok &= ENGINES[trk[k].eng_req]->oneshot || k == 0u; /* (the kit first) */
|
|
else ok &= steps_sig(&trk[k]) == s0[k]; /* (the others: the piece before) */
|
|
n0 = (uint32_t)__builtin_popcount(gst_old);
|
|
while (gst_old && nb < 12u) { bars(1); nb++; }
|
|
ok &= !gst_old && nb == n0 && song.playing;
|
|
gp.entry = 0;
|
|
bad += check("ENTRY BUILD: the kit first, a track a bar, the others the piece before until theirs", ok);
|
|
if (!ok) printf(" n0 %u nb %u old %x\n", n0, nb, gst_old);
|
|
}
|
|
{ /* (V10.7.66, the owner: "combinations of two seeds") a piece two seeds crossed: named A+B, not A's alone nor B's,
|
|
* the same three again the same piece */
|
|
#define XSIG xsig() /* (V10.8.41: every track's steps and values and the song's: a mix can fall on parts that write no step) */
|
|
uint32_t ha, hb, hx, hy;
|
|
uint16_t a, b2, mx;
|
|
transport_req = 2; blk(); /* (stop) */
|
|
gp.entry = 0; gp.key = 0; gp.sig = 0;
|
|
gen_press(); frames(64);
|
|
a = gp.seed; b2 = gp.seed2; mx = gp.mix;
|
|
ok = mx != 0u && str_len(gp.last) > 6u && gp.last[str_len(gp.last) - 5u] == '+';
|
|
gen_make(); /* (the piece as made, its CPU fit aside) */
|
|
hx = XSIG;
|
|
gp.mix = 0; gp.seed = a; gen_make(); ha = XSIG;
|
|
gp.seed = b2; gen_make(); hb = XSIG;
|
|
gp.seed = a; gp.seed2 = b2; gp.mix = mx; gen_make(); hy = XSIG;
|
|
ok &= hx != ha && hx != hb && hx == hy;
|
|
ok &= (a > b2 ? a - b2 : b2 - a) >= 1500u; /* (V10.7.67: the two far apart) */
|
|
if (!ok) printf(" cross: %s mix %x s2 %u %x %x %x %x\n", gp.last, mx, b2, hx, ha, hb, hy);
|
|
bad += check("GEN: two seeds crossed (A+B, neither alone, the same three the same piece)", ok);
|
|
}
|
|
{ /* (V10.8.39, the owner) RADIO: a loop's 32 bars (over 110 BPM) played, the next piece made on the bar line and
|
|
* played on, and again; off: the piece stays. MOOD: RANDOM's genres slower CALM than DANCE, the middle the piece
|
|
* as ever; a DANCE radio's tempo the nearest its genre has to the piece before */
|
|
uint32_t h0, r, n, sc = 0, sd = 0;
|
|
uint16_t sd0;
|
|
gp.genre = 1; gp.form = 0; gp.entry = 0; gp.key = 0; gp.sig = 0; gp.mix = 0;
|
|
gen_press(); frames(64);
|
|
h0 = dice_print(); sd0 = gp.seed;
|
|
transport_req = 1; blk();
|
|
bars(40);
|
|
ok = song.playing && dice_print() == h0 && !grd.rn; /* (off: nothing) */
|
|
transport_req = 2; blk();
|
|
grd.on = 1;
|
|
transport_req = 1; blk();
|
|
bars(14); /* (V10.8.45, the owner: half: 16 bars over 110 BPM, were 32) */
|
|
ok &= song.playing && dice_print() == h0 && !grd.rn; /* (its 15th bar: still the piece) */
|
|
bars(3); blk();
|
|
ok &= song.playing && grd.rn == 1u && gp.seed != sd0 && dice_print() != h0;
|
|
h0 = dice_print();
|
|
for (n = 0; n < 40u && grd.rn < 2u; n++) bars(1);
|
|
blk();
|
|
ok &= song.playing && grd.rn == 2u && n >= 15u && dice_print() != h0;
|
|
if (!ok) printf(" radio: playing %u rn %u seed %u (was %u)\n", (unsigned)song.playing, grd.rn, gp.seed, sd0);
|
|
bad += check("RADIO: off nothing; on, the next piece after the loop's 16 bars, playing on, twice", ok);
|
|
{ /* (V10.8.43, BYTE's) a STOP right on the piece's last bar stops: no next piece made, nothing playing (it
|
|
* made the next piece and played it) */
|
|
uint32_t rn;
|
|
for (n = 0; n < 40u && (bar_n & 15u) != 15u; n++) bars(1);
|
|
frames(8);
|
|
h0 = dice_print(); rn = grd.rn; sd0 = gp.seed;
|
|
ok = song.playing && grd.arm;
|
|
transport_req = 2; blk(); frames(200);
|
|
ok &= !song.playing && !grd.arm && grd.rn == rn && gp.seed == sd0 && dice_print() == h0;
|
|
frames(500);
|
|
ok &= !song.playing && dice_print() == h0;
|
|
if (!ok) printf(" radio stop: playing %u arm %u rn %u (%u) bar %u\n", (unsigned)song.playing, grd.arm, grd.rn, rn, (unsigned)bar_n);
|
|
bad += check("RADIO: a STOP on the loop's last bar stops (no next piece, nothing playing)", ok);
|
|
}
|
|
gp.form = 2; gp.sig = 0; /* (a song: its END the next piece's cue) */
|
|
transport_req = 2; blk();
|
|
gen_press(); frames(64);
|
|
ok = chain_config.count > 0u && !grd.rn;
|
|
h0 = dice_print();
|
|
if (live.mode) chain_play_ui(); else transport_req = 1;
|
|
blk();
|
|
for (n = 0; n < 400u && !grd.rn; n++) { bars(1); song_poll(); } /* (the next row staged: the main loop's) */
|
|
blk();
|
|
ok &= grd.rn == 1u && song.playing && dice_print() != h0;
|
|
if (!ok) printf(" radio song: rows %u bars waited %u playing %u rn %u\n", chain_config.count, n, (unsigned)song.playing, grd.rn);
|
|
bad += check("RADIO: a song's last row ended, the next song made and playing", ok);
|
|
{ /* (V10.8.43) the song's last bar, STOP: the song stops, no next song (its own END alone goes on: chain.fin) */
|
|
uint32_t rn;
|
|
for (n = 0; n < 400u && !(chain.running && chain.row + 1u >= chain.config.count && chain.remaining <= 1u); n++) { bars(1); song_poll(); }
|
|
frames(64);
|
|
sd0 = gp.seed; rn = grd.rn;
|
|
ok = song.playing && grd.arm;
|
|
transport_req = 2; blk(); song_poll(); frames(500); song_poll(); frames(64);
|
|
ok &= !song.playing && !grd.arm && grd.rn == rn && gp.seed == sd0;
|
|
if (!ok) printf(" song stop: playing %u arm %u rn %u (%u) row %u/%u rem %u fin %u\n", (unsigned)song.playing, grd.arm, grd.rn, rn, chain.row, chain.config.count, chain.remaining, chain.fin);
|
|
bad += check("RADIO: a STOP on a song's last bar stops (no next song)", ok);
|
|
}
|
|
transport_req = 2; blk();
|
|
grd.on = 0; gp.form = 0; gp.genre = 0;
|
|
for (r = 0; r < 24u; r++) {
|
|
gp.seed = (uint16_t)(100u + r * 37u);
|
|
grd.mood = -50; gen_make(); sc += (uint32_t)song.g[G_BPM];
|
|
grd.mood = 50; gen_make(); sd += (uint32_t)song.g[G_BPM];
|
|
}
|
|
grd.mood = 0;
|
|
ok = sd > sc + 24u * 20u;
|
|
printf(" MOOD: RANDOM's mean tempo CALM %u, DANCE %u BPM\n", sc / 24u, sd / 24u);
|
|
bad += check("MOOD: RANDOM's pieces over 20 BPM slower CALM than DANCE", ok);
|
|
grd.on = 1; grd.mood = 50; gp.genre = 0;
|
|
for (r = 0, ok = 1; r < 12u; r++) {
|
|
int32_t b0 = song.g[G_BPM];
|
|
gp.seed = (uint16_t)(900u + r * 53u);
|
|
grd.rn = 1;
|
|
gen_make();
|
|
ok &= song.g[G_BPM] == clamp(b0, gs.g->bpm_lo, gs.g->bpm_hi);
|
|
}
|
|
grd.on = 0; grd.mood = 0; grd.rn = 0;
|
|
bad += check("MOOD DANCE on the radio: each piece's tempo the nearest its genre has to the one before", ok);
|
|
{ /* (V10.8.40, the owner: "CALM changes nothing audible, everything still has drums") MOOD in every GENRE mode
|
|
* (EXPLORE, RANDOM, HOUSE), 24 seeds each (MID: main's first lines). CALM -50: no sound of the kit but the closed
|
|
* hat left (every other lane's level 0), that one down, the kit shorter and its filter closing; -25: the
|
|
* kick and the rest under MID's, still there. DANCE +50: every piece a kick that sounds, on every beat, its
|
|
* level whole, the drum track over MID's; +25: on the bar's first and third beats */
|
|
uint32_t md, hs = 0, i, l, okc = 1, okh = 1, okd = 1, okq = 1;
|
|
for (r = 1; r <= NGENRE; r++) if (str_eq(GENRE[r - 1u].name, "HOUSE")) hs = r;
|
|
for (md = 0; md < 3u; md++) {
|
|
for (r = 0; r < 24u; r++) {
|
|
track_t *t;
|
|
int16_t lv0, e3, fc, ln[8];
|
|
uint32_t len, kb = 0, k2 = 0, k1 = 0;
|
|
gp.genre = (uint8_t)(md == 0u ? GEN_EXPLORE : md == 1u ? 0u : hs);
|
|
gp.form = 0; gp.seed = (uint16_t)(100u + r * 37u); grd.on = 0;
|
|
grd.mood = 0; gen_make();
|
|
t = &trk[gs.trk_of[RL_DRUM]];
|
|
lv0 = t->p[P_LEVEL]; e3 = t->p[P_E3]; fc = t->p[P_FCUT];
|
|
for (l = 0; l < 8u; l++) ln[l] = t->p[P_LN0 + l];
|
|
if (gs.act[RL_DRUM]) {
|
|
grd.mood = -25; gen_make(); t = &trk[gs.trk_of[RL_DRUM]];
|
|
okq &= !gs.act[RL_DRUM] || (t->p[P_LN0] < ln[0] && t->p[P_LN0] > 0 && (md == 1u || (t->p[P_LN1] < ln[1] && t->p[P_E3] < e3 && t->p[P_FCUT] < fc))); /* (V10.8.41: RANDOM's
|
|
* genre moves with the mood: its kick's level alone compared) */
|
|
grd.mood = -50; gen_make(); t = &trk[gs.trk_of[RL_DRUM]];
|
|
if (gs.act[RL_DRUM]) {
|
|
for (l = 0; l < 8u; l++) okc &= l == DV_HATC ? t->p[P_LN0 + l] <= 80 : t->p[P_LN0 + l] == 0;
|
|
okc &= t->p[P_E3] < 40 && t->p[P_FCUT] <= 80 && t->p[P_LEVEL] < 100;
|
|
}
|
|
}
|
|
grd.mood = 50; gen_make(); t = &trk[gs.trk_of[RL_DRUM]];
|
|
len = (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP);
|
|
for (i = 0, k1 = 0; i < len; i += 4u) { kb += t->step[i].time == ST_NOTE && (t->step[i].hit & 1u); if (!(i & 15u)) k1 += t->step[i].time == ST_NOTE && (t->step[i].hit & 1u); }
|
|
okd &= gs.act[RL_DRUM] && (ghalf() ? k1 == (len + 15u) / 16u : kb == (len + 3u) / 4u) && t->p[P_LN0] > 0; /* (V10.8.68, BYTE 77f2b602:
|
|
* DANCE's drums under the rest: no longer its kick at 127, the drum
|
|
* track over MID's) */
|
|
(void)lv0;
|
|
grd.mood = 25; gen_make(); t = &trk[gs.trk_of[RL_DRUM]];
|
|
len = (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP);
|
|
for (i = 0, k1 = 0; i < len; i += 8u) { k2 += t->step[i].time == ST_NOTE && (t->step[i].hit & 1u); if (!(i & 15u)) k1 += t->step[i].time == ST_NOTE && (t->step[i].hit & 1u); }
|
|
okh &= gs.act[RL_DRUM] && (ghalf() ? k1 == (len + 15u) / 16u : k2 == (len + 7u) / 8u);
|
|
}
|
|
}
|
|
grd.mood = 0; gp.genre = 0;
|
|
bad += check("MOOD MID: EXPLORE's, RANDOM's and HOUSE's pieces the recorded ones byte for byte", mid_ok);
|
|
bad += check("MOOD CALM -25: the kick, the snare, the kit's decay and filter under MID's, still there", okq);
|
|
bad += check("MOOD CALM -50: every piece's kit silent but a low, short, dark closed hat (EXPLORE, RANDOM, HOUSE)", okc);
|
|
bad += check("MOOD DANCE +25: every piece its drums, the kick on the bar's first and third beats (a half-time's, a break's: its one)", okh);
|
|
bad += check("MOOD DANCE +50: a kick on every beat (a half-time's, a break's: the bar's one), heard", okd);
|
|
}
|
|
}
|
|
{ /* (V10.8.72, checked: V10.8.68's message said CALM "longer sections, slower RADIO"; its code is BYTE 09ec6b57's,
|
|
* the owner there: "CALM's pieces too long, each part drags") the direction pinned: MOOD CALM -50's SONG and
|
|
* PARTS rows fewer bars than MID's (the same seeds), DANCE's not fewer; a CALM radio's loop half a MID one's */
|
|
uint32_t f, md, r, j, bm[3], hs = 0;
|
|
int okr = 1;
|
|
for (r = 1; r <= NGENRE; r++) if (str_eq(GENRE[r - 1u].name, "HOUSE")) hs = r;
|
|
for (f = 1; f <= 2u; f++) {
|
|
static const int8_t MD[3] = {0, -50, 50};
|
|
for (md = 0; md < 3u; md++) {
|
|
bm[md] = 0;
|
|
for (r = 0; r < 12u; r++) {
|
|
gp.genre = (uint8_t)hs; gp.form = (uint8_t)f; gp.seed = (uint16_t)(100u + r * 37u); grd.on = 0; grd.mood = MD[md];
|
|
gen_make();
|
|
for (j = 0; j < chain_config.count; j++) bm[md] += chain_config.row[j].bars;
|
|
}
|
|
}
|
|
printf(" rows' bars, HOUSE x 12, %s: MID %u, CALM %u, DANCE %u\n", f == 1u ? "PARTS" : "SONG", bm[0], bm[1], bm[2]);
|
|
okr &= bm[1] * 10u <= bm[0] * 7u && bm[2] >= bm[0];
|
|
}
|
|
grd.mood = 0; gp.form = 0; gp.genre = 0;
|
|
bad += check("MOOD CALM -50: a piece's rows shorter than MID's (BYTE 09ec6b57, the owner's), DANCE's not", okr);
|
|
}
|
|
{ /* a CALM radio's loop: half a MID one's bars */
|
|
uint32_t n, r0, nm[2], md;
|
|
for (md = 0; md < 2u; md++) {
|
|
gp.genre = 1; gp.form = 0; grd.mood = (int8_t)(md ? -50 : 0); grd.on = 0;
|
|
gen_press(); frames(64);
|
|
grd.on = 1; transport_req = 1; blk();
|
|
r0 = grd.rn;
|
|
for (n = 0; n < 80u && grd.rn == r0; n++) bars(1);
|
|
r0 = grd.rn;
|
|
for (n = 0; n < 80u && grd.rn == r0; n++) bars(1);
|
|
nm[md] = n;
|
|
transport_req = 2; blk();
|
|
grd.on = 0; grd.rn = 0;
|
|
}
|
|
grd.mood = 0; gp.genre = 0;
|
|
printf(" the radio's loop: MID %u bars, CALM %u\n", nm[0], nm[1]);
|
|
bad += check("MOOD CALM: the radio's loop half as long as MID's", nm[1] * 2u <= nm[0] + 1u && nm[1] * 2u + 2u >= nm[0]);
|
|
}
|
|
printf(bad ? "gen-entry: %d FAILED\n" : "gen-entry: all ok\n", bad);
|
|
return bad != 0;
|
|
}
|