mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 12:54:29 +01:00
CLOUD ("always late, a strange delay; it does not follow the tempo"): the send straight into the network too (the bloom
with the note), half the grains read just behind the write, the others 1, 2 or 3 sixteenths of the tempo back, the tail
x2 (was x3: SIZE high clipped); its comments as the code is.
DIST's NOISE (FX > DIST's KNOB 4, 0..127, a track's; the project's 'D' 'N' block, an older project 0): low-passed white
noise moves the drive's gain before the shaper and TONE's corner (sidebands round every partial; silence stays silent,
the level as it was); not on AMP, not in the presets or the editor's protocol yet. track_dist one copy in the RAM code;
pk_step and perf_kpress (called through a pointer) back in the flash for its room.
CHORUS MIX (FX > CHORUS's KNOB 4, 0..100, global, in the 'D' 'N' block): at 0 the chorus as it was (bit for bit); towards
100 a part's dry goes down by its CHORUS send and the ensemble becomes its first voice alone, in the middle: MIX 100 and
the send whole, a vibrato. RATE and DEPTH as they were (they reach a slow deep wobble).
The generator (docs/GENERATOR-STUDY.es.md 5.3, its section 10 on main): the mix (GMIX: the lead up in REGGAETON, DREAM
POP, DUBSTEP; the arp up in HARD BASS, CUMBIA, ELECTRO METAL, METALCORE, BAILE FUNK, DUBSTEP), a hook its delay or its
reverb (not both high), a club's stab half its reverb, its arp's release short, its kick's DUCK 30..50; a piece's own
colour (the melodic parts' cutoff 79 / 85 / 91 %); EXPLORE the lead / arp dialogue and the contrast section's own
progression on one chord too.
tests: dist_noise_test, chorus_mix_test (in CI), ui_test (the two knobs, a project keeps them), reverb_test's reference.
Layout re-recorded (REPIN=keep).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
50 lines
2.4 KiB
C
50 lines
2.4 KiB
C
/* SPDX-License-Identifier: GPL-3.0-only
|
|
* Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
|
|
* (V10.8.36) FX > CHORUS's MIX (fx.c cho_mix): at 0 the chorus as it was; towards 100 a part's dry goes down by what
|
|
* it sends, the ensemble becomes one voice in the middle: at 100 with the send whole, a vibrato alone (the pitch
|
|
* moves, no dry under it). */
|
|
#define main hostsim_main
|
|
#include "hostsim.c"
|
|
#undef main
|
|
#include <math.h>
|
|
static double rms(const int32_t *a, uint32_t n) { double e = 0; for (uint32_t i = 0; i < n; i++) e += (double)a[i] * a[i]; return sqrt(e / n); }
|
|
int main(void)
|
|
{
|
|
int fails = 0, mix;
|
|
static int32_t wl[3][CTL * 400], wr[3][CTL * 400];
|
|
for (mix = 0; mix <= 100; mix += 50) {
|
|
uint32_t b, i;
|
|
host_tracks_init();
|
|
song.g[G_CRATE] = 40; song.g[G_CDEPTH] = 60; song.g[G_CSTER] = 0; song.g[G_WIDTH] = 0;
|
|
cho_mix = (int16_t)mix;
|
|
for (b = 0; b < 800; b++) {
|
|
for (i = 0; i < CTL; i++) {
|
|
fxq_c[i] = (int32_t)(8000 * sin(2 * M_PI * 440.0 * (b * CTL + i) / 44100.0));
|
|
fxq_d[i] = fxq_r[i] = 0;
|
|
}
|
|
memset(fx_sl, 0, sizeof fx_sl); memset(fx_sr, 0, sizeof fx_sr); /* (the mixer's: summed into) */
|
|
fx_run(CTL);
|
|
if (b >= 400)
|
|
for (i = 0; i < CTL; i++) {
|
|
wl[mix / 50][(b - 400) * CTL + i] = fx_wet[i] + fx_sl[i];
|
|
wr[mix / 50][(b - 400) * CTL + i] = fx_wet[i] + fx_sr[i];
|
|
}
|
|
}
|
|
}
|
|
{
|
|
double l0 = rms(wl[0], CTL * 400), l2 = rms(wl[2], CTL * 400), d = 0;
|
|
uint32_t i;
|
|
for (i = 0; i < CTL * 400; i++) d += fabs((double)wl[2][i] - wr[2][i]);
|
|
printf("wet level MIX 0 %.0f, MIX 100 %.0f (%+.1f dB); MIX 100 left - right %.0f\n", l0, l2, 20 * log10(l2 / l0), d);
|
|
if (d != 0) { printf("FAIL MIX 100 not one voice in the middle\n"); fails++; }
|
|
if (l2 < l0 * 0.5 || l2 > l0 * 2.5) { printf("FAIL MIX 100 level\n"); fails++; }
|
|
}
|
|
{ /* the dry's share: a part's pan gains (mix_part_m0's f) */
|
|
int32_t f0 = 4096 - ((0 * 127 * 165) >> 9), f1 = 4096 - ((100 * 127 * 165) >> 9), f2 = 4096 - ((50 * 64 * 165) >> 9);
|
|
printf("dry gain Q12: MIX 0 %d, MIX 100 send 127 %d, MIX 50 send 64 %d\n", f0, f1, f2);
|
|
if (f0 != 4096 || f1 < 0 || f1 > 8 || f2 < 3000 || f2 > 3100) fails++;
|
|
}
|
|
printf(fails ? "chorus mix test FAILED\n" : "chorus mix test passed\n");
|
|
return fails ? 1 : 0;
|
|
}
|