mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-05 20:34:27 +01:00
V10.8.36: CLOUD starts with the note, DIST's NOISE a modulator, CHORUS MIX (chorus .. vibrato), the generator's mix, sounds and EXPLORE (the owner)
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
This commit is contained in:
13 files changed
+2507
-2289
No files matched your search
@@ -68,6 +68,10 @@ jobs:
|
||||
set -euo pipefail
|
||||
cc -O2 -w -Ibuild/gen -Ifirmware/src tests/regress.c -lm -o build/song-check/regress
|
||||
build/song-check/regress tests/golden.txt tests/cpu_baseline.txt | tee build/song-check/regress.log
|
||||
cc -O1 -w -Ibuild/gen -Ifirmware/src tests/dist_noise_test.c -lm -o build/song-check/dist-noise
|
||||
build/song-check/dist-noise | tee build/song-check/dist-noise.log
|
||||
cc -O1 -w -Ibuild/gen -Ifirmware/src tests/chorus_mix_test.c -lm -o build/song-check/chorus-mix
|
||||
build/song-check/chorus-mix | tee build/song-check/chorus-mix.log
|
||||
cc -O1 -w -Ibuild/gen -Ifirmware/src tests/west_test.c -lm -o build/song-check/west
|
||||
build/song-check/west | tee build/song-check/west.log
|
||||
for test in audio perform upreset; do
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */
|
||||
#endif
|
||||
#ifndef FELUCCA_VERSION
|
||||
#define FELUCCA_VERSION "V10.8.35" /* (2026-11-23) V10.8.21: SEQ > CLAY (the owner): DRONE CLAY, JIANT BYTE's drone and its four modulators (DEST SHAPE EUCLID AMOUNT; DECAY, STEP, SEED) on any track, kept with the project ('C' 'Y'), its pages' picture the modulators' telemetry. V10.7.77: GEN (the owner): DUBSTEP's wobble its rate moving (the wobble bass's LFO RATE automated half a bar each: 1/4 1/8 1/8T 1/16); CUMBIA villera one throw in two (a villera 'teclado': 92 .. 100, minor, the keyboard's lead up front). V10.7.76: DRUM-X MATH a wavetable (the owner: "harsh"): its t whole cycles of the hit's time (one shape evolving), interpolated between its samples; SOUND 3 draws it (four moments, cold to hot); hints trimmed (flash). V10.7.75: DRUM-X MATH (the owner): its RATIO (1/4 .. 16, 24, the inharmonic between) on SOUND 3's KNOB 4, COLOR read MOD AMT; MATH's RESTART the scope (its ramps' picture gone), ten more hints out (flash). V10.7.74: DRUM-X MATH (the owner): a sound's WAVE past BELL a MATH formula F01..F48 as its FM's modulator (COLOR its index; its t the hit's time, a sample in eight), kept with the project ('D' 'F'). V10.7.73: SCL > HARMONY its own tab (KEY CHORD HARMONY SCENE); the defaults once (the owner): LARGE off, CLICK REC, COUNT-IN 1 BAR. V10.7.72: GEN (the owner): MATH WEST STRING more (the archetypes' third options theirs, 25 %; a bass's one time in ten); GLO > GLOBAL the scope, its bars gone. V10.7.71: SCL > HARMONY's picture (the owner): the progression's chords as roman numerals in the key ("-" minor, "o" diminished), each its root's colour, the one playing lit; the obvious knobs' hints out (flash). V10.7.70: FX > PUNCH IN: KNOB 4 M4 (its ERASE PUNCH LANE's only), so OCT+ always the punch-in editor (an ERASE picked took it). V10.7.69: MATH FLOAT MORPH (the owner): ALGO B where CHIP was, MORPH A -> B where BEND was (between the ends B a sample in eight, interpolated: +12.5 % CPU); MATH's formulas (lofi_float, lofi_byte) their 14 divisions by a constant as multiplies (JIANT BYTE 0.16's build pass, tools/build.py const_divs: exact, less CPU a sample); the MACRO layer's dead branches out (flash). V10.7.68: EUCLID MODES > ROLE (MELODY CHORDS BASS ARP, was CHORD) on the harmony the other melodic tracks play, bar by bar (four bars when it changes), else SCL's key; a recorded melody EUCLID takes: its notes as they were; LFO / FX dice leftovers out (flash). V10.7.67: GEN and EUCLID MUTATE fuse two seeds (the owner: never one as it is; the second far from the first), A+B in the name; FX + OCT+ opens the punch-in editor again (as OCT+ on FX > PUNCH IN). V10.7.66: SCL > HARMONY (PROG LENGTH EVOLVE SKIP: every melodic sequence follows a progression); GEN 8 progressions more (neo-soul, jazz, IDM, progressive); EUCLID's melody CONTOUR RANGE MOTIF CHORD; macros FX > PUNCH IN's only (LFO's layer, HOME > ROUTES gone, MACROS in FX), GLO's layer says G4 UNDO; the PUNCH-IN EDITOR redone (the owner): a key WHAT (an effect, or PARAM: M1..M4, CUT PITCH TIMBRE VOLUME PAN DIST CHORUS DELAY REVERB VIBRATO on every track), HOW (an effect HOLD LATCH QUANT; PARAM HOLD RAMP UP RAMP DN SINE STUTTER S&H), AMOUNT (-100..+100 %; an effect its TARGET), TIME (1/16 .. 8 BARS); two slots A B; FX > PUNCH IN its knobs M1..M4 (PUNCH LANE: LEN RES); the layers MAP only (KNOBS STATE gone, ALGORITHM nothing held), the FX cards "M1 CUT"; FX + SELECT the FX pages (its dice gone). GENE while it plays waits for the bar to end (Hollusion); GENE 4: KEY NEW / KEEP (the first melodic track's key and mode kept), ENTRY ALL / BUILD (the new piece in a track a bar, the kit first); the old DIGITAL / NOISE / retired engines' conversions out (flash), the songs 7-8 notice out; voices past V10.6c's budget: tails first, FM6's quarter rate gone. V10.7.65: the PUNCH-IN EDITOR (the owner): OCT+ on FX > PUNCH IN opens it (the FX layer locked open; an ERASE picked on KNOB 4: OCT+ does it), DICE gone; the COMB / COMB- cut-off moved by the LFO and the ENV as the other filters; a key held and KNOB 1..4 its EFFECT (any, MOD a macro moved) TARGET (ALL SYN DRM T1..T6; MOD M1..M4) AMOUNT (MOD 1 BEAT .. 4 BARS) MODE (HOLD LATCH QUANT; MOD RAMP UP / DOWN SINE S&H), the mode said in the header; SELECT a slot (four, in the settings), OCT+ saves and plays it, OCT- leaves. V10.7.64: SCENE's LEADER PRESS (a key's note on every live track at once, each its own sound); SCENE on the live tracks only (it opened on T6, asleep with four: nothing heard, nothing drawn), every role with the key: a kit's DRUM loops its beat while a key is held, stopped too; the engines as the kit (the owner): FILTER TYPE CUT RES IMAGE (DIST the SENDS' only), PLAY POLY GLIDE UNISON VEL (the plain MORE gone, GL MODE off the panel), GAIN 0..+12 dB clean where a DRIVE was (ANALOG's MORE, WHEEL's COLOR; their DRIVE off the panel, kept), saved ('T' 'G'); FUGA's subject and answer on live tracks (the continuo after: with four tracks it began unheard); DUBSTEP's bass the wobble (a resonant low-pass on aLine truncated
|
||||
#define FELUCCA_VERSION "V10.8.36" /* (2026-11-23) V10.8.21: SEQ > CLAY (the owner): DRONE CLAY, JIANT BYTE's drone and its four modulators (DEST SHAPE EUCLID AMOUNT; DECAY, STEP, SEED) on any track, kept with the project ('C' 'Y'), its pages' picture the modulators' telemetry. V10.7.77: GEN (the owner): DUBSTEP's wobble its rate moving (the wobble bass's LFO RATE automated half a bar each: 1/4 1/8 1/8T 1/16); CUMBIA villera one throw in two (a villera 'teclado': 92 .. 100, minor, the keyboard's lead up front). V10.7.76: DRUM-X MATH a wavetable (the owner: "harsh"): its t whole cycles of the hit's time (one shape evolving), interpolated between its samples; SOUND 3 draws it (four moments, cold to hot); hints trimmed (flash). V10.7.75: DRUM-X MATH (the owner): its RATIO (1/4 .. 16, 24, the inharmonic between) on SOUND 3's KNOB 4, COLOR read MOD AMT; MATH's RESTART the scope (its ramps' picture gone), ten more hints out (flash). V10.7.74: DRUM-X MATH (the owner): a sound's WAVE past BELL a MATH formula F01..F48 as its FM's modulator (COLOR its index; its t the hit's time, a sample in eight), kept with the project ('D' 'F'). V10.7.73: SCL > HARMONY its own tab (KEY CHORD HARMONY SCENE); the defaults once (the owner): LARGE off, CLICK REC, COUNT-IN 1 BAR. V10.7.72: GEN (the owner): MATH WEST STRING more (the archetypes' third options theirs, 25 %; a bass's one time in ten); GLO > GLOBAL the scope, its bars gone. V10.7.71: SCL > HARMONY's picture (the owner): the progression's chords as roman numerals in the key ("-" minor, "o" diminished), each its root's colour, the one playing lit; the obvious knobs' hints out (flash). V10.7.70: FX > PUNCH IN: KNOB 4 M4 (its ERASE PUNCH LANE's only), so OCT+ always the punch-in editor (an ERASE picked took it). V10.7.69: MATH FLOAT MORPH (the owner): ALGO B where CHIP was, MORPH A -> B where BEND was (between the ends B a sample in eight, interpolated: +12.5 % CPU); MATH's formulas (lofi_float, lofi_byte) their 14 divisions by a constant as multiplies (JIANT BYTE 0.16's build pass, tools/build.py const_divs: exact, less CPU a sample); the MACRO layer's dead branches out (flash). V10.7.68: EUCLID MODES > ROLE (MELODY CHORDS BASS ARP, was CHORD) on the harmony the other melodic tracks play, bar by bar (four bars when it changes), else SCL's key; a recorded melody EUCLID takes: its notes as they were; LFO / FX dice leftovers out (flash). V10.7.67: GEN and EUCLID MUTATE fuse two seeds (the owner: never one as it is; the second far from the first), A+B in the name; FX + OCT+ opens the punch-in editor again (as OCT+ on FX > PUNCH IN). V10.7.66: SCL > HARMONY (PROG LENGTH EVOLVE SKIP: every melodic sequence follows a progression); GEN 8 progressions more (neo-soul, jazz, IDM, progressive); EUCLID's melody CONTOUR RANGE MOTIF CHORD; macros FX > PUNCH IN's only (LFO's layer, HOME > ROUTES gone, MACROS in FX), GLO's layer says G4 UNDO; the PUNCH-IN EDITOR redone (the owner): a key WHAT (an effect, or PARAM: M1..M4, CUT PITCH TIMBRE VOLUME PAN DIST CHORUS DELAY REVERB VIBRATO on every track), HOW (an effect HOLD LATCH QUANT; PARAM HOLD RAMP UP RAMP DN SINE STUTTER S&H), AMOUNT (-100..+100 %; an effect its TARGET), TIME (1/16 .. 8 BARS); two slots A B; FX > PUNCH IN its knobs M1..M4 (PUNCH LANE: LEN RES); the layers MAP only (KNOBS STATE gone, ALGORITHM nothing held), the FX cards "M1 CUT"; FX + SELECT the FX pages (its dice gone). GENE while it plays waits for the bar to end (Hollusion); GENE 4: KEY NEW / KEEP (the first melodic track's key and mode kept), ENTRY ALL / BUILD (the new piece in a track a bar, the kit first); the old DIGITAL / NOISE / retired engines' conversions out (flash), the songs 7-8 notice out; voices past V10.6c's budget: tails first, FM6's quarter rate gone. V10.7.65: the PUNCH-IN EDITOR (the owner): OCT+ on FX > PUNCH IN opens it (the FX layer locked open; an ERASE picked on KNOB 4: OCT+ does it), DICE gone; the COMB / COMB- cut-off moved by the LFO and the ENV as the other filters; a key held and KNOB 1..4 its EFFECT (any, MOD a macro moved) TARGET (ALL SYN DRM T1..T6; MOD M1..M4) AMOUNT (MOD 1 BEAT .. 4 BARS) MODE (HOLD LATCH QUANT; MOD RAMP UP / DOWN SINE S&H), the mode said in the header; SELECT a slot (four, in the settings), OCT+ saves and plays it, OCT- leaves. V10.7.64: SCENE's LEADER PRESS (a key's note on every live track at once, each its own sound); SCENE on the live tracks only (it opened on T6, asleep with four: nothing heard, nothing drawn), every role with the key: a kit's DRUM loops its beat while a key is held, stopped too; the engines as the kit (the owner): FILTER TYPE CUT RES IMAGE (DIST the SENDS' only), PLAY POLY GLIDE UNISON VEL (the plain MORE gone, GL MODE off the panel), GAIN 0..+12 dB clean where a DRIVE was (ANALOG's MORE, WHEEL's COLOR; their DRIVE off the panel, kept), saved ('T' 'G'); FUGA's subject and answer on live tracks (the continuo after: with four tracks it began unheard); DUBSTEP's bass the wobble (a resonant low-pass on aLine truncated
|
||||
#endif
|
||||
#if FELUCCA_OTA && !FELUCCA_FLASH
|
||||
#error "FELUCCA_OTA needs FELUCCA_FLASH"
|
||||
|
||||
+52
-12
@@ -193,7 +193,15 @@ static __attribute__((noinline)) void dist_amp(track_t *t, int32_t *b, uint32_t
|
||||
* at 1: the low cut and the clip at once), the blend eased a block at a time and ramped across it; at 0 out of the
|
||||
* chain once the blend is down */
|
||||
static int32_t dist_w[NTRK]; /* the blend the last block ended at, Q12 */
|
||||
static void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
/* (V10.8.36, the owner: "the distortion's NOISE only a fade of volume; it should modulate tone and gain") DIST's NOISE
|
||||
* (FX > DIST's KNOB 4, params.c ID_DNZ; the project's 'D' 'N'): low-passed white noise moves the drive's gain before the
|
||||
* shaper and its TONE's corner: sidebands round every partial, at any level; nothing is added (silence stays silent,
|
||||
* the level as it was). Not on AMP (its own loop, in the RAM) */
|
||||
int16_t dnz_v[NTRK];
|
||||
int16_t cho_mix; /* (V10.8.36) FX > CHORUS's MIX, 0..100 (params.c ID_CMIX; mix_part_m0) */
|
||||
static uint32_t dnz_r[NTRK];
|
||||
static int32_t dnz_lp[NTRK];
|
||||
static __attribute__((noinline)) void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
{
|
||||
int32_t d = t->p[P_DIST], i, g, k, mk, b0 = softclip(2400), w0, w1, dw, full;
|
||||
uint32_t type = (uint32_t)t->p[P_DTYPE], ti = (uint32_t)(t - trk) % NTRK;
|
||||
@@ -224,11 +232,18 @@ static void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
return;
|
||||
}
|
||||
{ /* (0.7.9) the state in registers through the block */
|
||||
int32_t hp = t->dist_hp, l1 = t->dist_lp1, l2 = t->dist_lp2;
|
||||
int32_t hp = t->dist_hp, l1 = t->dist_lp1, l2 = t->dist_lp2, nz = dnz_lp[ti], na = dnz_v[ti], g0 = g, k0 = k;
|
||||
uint32_t r = dnz_r[ti] | 1u;
|
||||
for (i = 0; i < (int32_t)n; i++) {
|
||||
int32_t x = b[i], y;
|
||||
hp += (x - hp + 64) >> 7; /* ~55 Hz low cut: keep the bass out of the clipper */
|
||||
x = clamp(x - hp, -230000, 230000); /* (x >> 2) * g fits 32 bits; the clip is flat out there */
|
||||
if (na) { /* (V10.8.36) NOISE: the gain and the tone's corner moved */
|
||||
r ^= r << 13; r ^= r >> 17; r ^= r << 5;
|
||||
nz += mulq15(((int32_t)r >> 16) - nz, 6000);
|
||||
g = g0 + ((((g0 * na) >> 7) * nz) >> 13);
|
||||
k = clamp(k0 + ((nz * na) >> 8), 2500, 32767);
|
||||
}
|
||||
y = type == DT_SOFT ? softclip((((x >> 2) * g) >> 10) + 2400) - b0 : dist_shape(t, type, x, g, d);
|
||||
l1 += mulq15(y - l1, k); /* two poles: tames the fizz */
|
||||
l2 += mulq15(l1 - l2, k);
|
||||
@@ -238,6 +253,8 @@ static void track_dist(track_t *t, int32_t *b, uint32_t n)
|
||||
t->dist_hp = hp;
|
||||
t->dist_lp1 = l1;
|
||||
t->dist_lp2 = l2;
|
||||
dnz_lp[ti] = nz;
|
||||
dnz_r[ti] = r;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1200,10 +1217,12 @@ static __attribute__((noinline)) void rev_spring_side(uint32_t n, int32_t wd)
|
||||
* RESO (3) four combs tuned to the song's scale (ROOT and SCALE: its I III V VII from C3), a sympathetic string
|
||||
* each: whatever is sent rings in the key. SIZE their sustain (to ~0.995), DAMP their brightness, MOD the
|
||||
* voicing open (the V and VII an octave up), PRE as ever. In ROOM's comb memory
|
||||
* CLOUD (4) a granular cloud: the send recorded (half rate, ~0.74 s) and read by up to six grains, each from a
|
||||
* random point of the last SIZE of it, 70 .. 380 ms long, faded in and out, at the pitch of the note or
|
||||
* (MOD: the more, the oftener) an octave up / down or a fifth up; RATE their density, DAMP the tone,
|
||||
* WIDE them left and right. SIZE full: FREEZE (the line stops being written: the cloud holds) */
|
||||
* CLOUD (4) a granular cloud: the send recorded (half rate, ~0.74 s) and read by up to twelve grains, 90 .. 280 ms
|
||||
* long, faded in and out, (V10.8.36) half of them from just behind the write, the others 1, 2 or 3
|
||||
* sixteenths of the tempo back; at the pitch of the note or (MOD: the more, the oftener) an octave up /
|
||||
* down or a fifth up; RATE their density, DAMP the tone, WIDE them left and right; the send goes
|
||||
* straight into the network too (the bloom starts with the note). PRE is AIR here (the grains' pitch).
|
||||
* SIZE: the network's decay and the tail fed back; full: FREEZE (the line stops being written) */
|
||||
static uint32_t scale_mask(const track_t *t); /* seq.c */
|
||||
static int32_t shim_fb[CTL]; /* (SHIMMER's line: rev_x, at the top) */
|
||||
/* (0.6.12) AIR (G_RPRE on SHIMMER and CLOUD, -24..24 st): the pitch moved, the tone with it. A semitone count as a
|
||||
@@ -1346,7 +1365,8 @@ static uint32_t cl_rand(void) { fx.cl_rng = fx.cl_rng * 1664525u + 1013904223u;
|
||||
/* CLOUD (G_RTYPE 4, JIANT 0.5, made wet in 0.5.1): a granular wash. The input and the cloud's own tail fed back
|
||||
* (SIZE: the tail ~0.09, the grains ~0.43: the wash builds on itself) are written at half rate into a 0.74 s line;
|
||||
* up to 12 overlapping
|
||||
* grains (RATE: their density; 45 .. 140 ms long, triangle windows) read it from anywhere behind the write, MOD of
|
||||
* grains (RATE: their density; 90 .. 280 ms long, triangle windows) read it from behind the write (V10.8.36: near it
|
||||
* or sixteenths back, cl_spawn), MOD of
|
||||
* them an octave up, down or a fifth up; each grain panned at random (WIDE: how far, left and right). The grains go
|
||||
* through ROOM's network (SIZE its decay, DAMP its tone; MOD chorusing it, WIDE its combs apart): the grains are not
|
||||
* heard dry, they bloom into a tail around the sound. SIZE full freezes the line (the cloud holds) */
|
||||
@@ -1370,7 +1390,13 @@ static void cl_spawn(int32_t gap, int32_t wd, uint32_t ar)
|
||||
* across the write, a click each) */
|
||||
back = inc > 32768u ? (uint32_t)(umul64(cl_g[k].len, inc - 32768u) >> 16) : 0u; /* (faster than
|
||||
* the line is written: started that much further back) */
|
||||
cl_g[k].pos = ((fx.cl_w >> 1) - 200u - back - cl_rand() % (CL_LEN - 6000u - back)) << 16;
|
||||
{ /* (V10.8.36, the owner: "always late, a strange delay") where it reads from: near the write head most often (the cloud starts with the note), else a
|
||||
* 16th or a few behind it (the repeats on the tempo's grid, not anywhere in the last 0.47 s) */
|
||||
uint32_t r = cl_rand(), q = r & 7u, s16 = beat_samples() >> 3, off = 48u + back + ((r >> 3) & 127u);
|
||||
off += ((q * q) >> 4) * s16; /* 0 0 0 0 1 1 2 3 sixteenths (the line at half rate) */
|
||||
if (off > CL_LEN - 6000u) off = 48u + back;
|
||||
cl_g[k].pos = ((fx.cl_w >> 1) - off) << 16;
|
||||
}
|
||||
cl_g[k].inc = inc + (cl_rand() % 129u) - 64u; /* (the line at half rate; each grain
|
||||
* a few cents off: a chorused shimmer, not one pitch) */
|
||||
cl_g[k].age = 0;
|
||||
@@ -1475,6 +1501,9 @@ static __attribute__((noinline)) void rev_cloud(const int32_t *rev_in, int32_t *
|
||||
* was, x2 at its output: 6 dB more room before ROOM's lines bend) */
|
||||
if (air > 0) /* (AIR up: the grains' highs lifted) */
|
||||
g[i] += ((m - fx.cl_lp) * air) / 24;
|
||||
out[i] += g[i] >> 1; /* (the grains themselves, under the bloom) */
|
||||
g[i] += rev_in[i] >> 3; /* (V10.8.36) the send straight into the network too: the bloom
|
||||
* starts with the note, the grains come into it */
|
||||
t[i] = 0;
|
||||
if (wd) { /* the grains' own place, left and right (a side) */
|
||||
int32_t sd = ((l - r) * wd) >> 9;
|
||||
@@ -1491,7 +1520,7 @@ static __attribute__((noinline)) void rev_cloud(const int32_t *rev_in, int32_t *
|
||||
else
|
||||
rev_room(g, t, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
out[i] += t[i] * 3 + (g[i] >> 1); /* the bloom (+3.5 dB, 0.5.1), the grains themselves under it */
|
||||
out[i] += t[i] * 2; /* (V10.8.36: x2, was x3: SIZE high clipped) the bloom */
|
||||
shim_fb[i] = t[i]; /* (the tail into the line, next block) */
|
||||
}
|
||||
}
|
||||
@@ -1628,11 +1657,13 @@ static __attribute__((noinline)) void cho_lfo(uint32_t ph, int32_t depth, int32_
|
||||
r[1] = ((420 << 8) + ((osc_sine(ph + 0x55555555u) + 32768) * depth >> 8)) << 6;
|
||||
r[2] = ((540 << 8) + ((osc_sine(ph + 0xAAAAAAAAu) + 32768) * depth >> 8)) << 6;
|
||||
}
|
||||
static inline int32_t cho_ens(const int16_t *buf, uint32_t w, const int32_t *r, int32_t *sd)
|
||||
static inline int32_t cho_ens(const int16_t *buf, uint32_t w, const int32_t *r, int32_t *sd, int32_t wo)
|
||||
{
|
||||
int32_t a = cho_tap(buf, w, r[0] >> 6), b = cho_tap(buf, w, r[1] >> 6), c = cho_tap(buf, w, r[2] >> 6);
|
||||
*sd = a - b;
|
||||
return ((a + b + c) * 21845) >> 15; /* (x2 / 3 each: the sum at x2, as the one tap was) */
|
||||
return (a * (65535 - 2 * wo) + (b + c) * wo) >> 15; /* (x2 / 3 each: the sum at x2, as the one tap was; V10.8.36:
|
||||
* wo the other two's share, 21845 the ensemble, 0 (MIX 100) the
|
||||
* first tap alone: one voice, a vibrato) */
|
||||
}
|
||||
|
||||
/* process the three buses for one block; sends in, wet stereo-equal out */
|
||||
@@ -2053,6 +2084,8 @@ static inline __attribute__((always_inline)) void fx_buses(const int32_t *cho_in
|
||||
int32_t cho = sys_load != LOAD_ECO && cho_run; /* (0.6.30) LOAD ECO: no chorus */
|
||||
int32_t cs = song.g[G_CSTER], cw = 80 + wd / 2; /* (0.6.9) the chorus's side: 0 as before, - to mono, + ~2x */
|
||||
cw = cs >= 0 ? cw + cs * 2 : (cw * (64 + cs)) >> 6;
|
||||
int32_t cwo = (100 - cho_mix) * 21845 / 100; /* (V10.8.36) CHORUS MIX: towards one voice, in the middle */
|
||||
cw = cw * (100 - cho_mix) / 100;
|
||||
#ifndef FX_REST_OFF /* (tests/fx_rest_test.c: the reference without it) */
|
||||
if (!any && fx.primed && fx_rest(wet, n, cinc, cdepth, cw, dmix)) { /* (cpu5) at rest: not run */
|
||||
fx.db_t = 0; fx.db_a = 0; /* (snd2: the tail gone, THROW's band with it) */
|
||||
@@ -2093,6 +2126,7 @@ static inline __attribute__((always_inline)) void fx_buses(const int32_t *cho_in
|
||||
/* .. and the chorus's DEPTH, its width and the delay's MIX glide across the block (a quarter of the way) */
|
||||
dcd = fx_glide(fx.cd_cur, cdepth, n);
|
||||
dcw = fx_glide(fx.cw_cur, cw, n);
|
||||
if (cho_mix && !dcw) fx.cw_cur = cw; /* (V10.8.36: the glide's last steps, so that MIX 100 is the middle alone) */
|
||||
ddm = fx_glide(fx.dm_cur, dmix, n);
|
||||
dly_wow_adv(n, &wm, &dwm);
|
||||
if (tone_set(&rtn, song.g[G_RFILT], 121, 50, 14, 79, 1600, 1)) { /* (JIANT) the reverb's tone: FILT < 0 a low-pass (~12 kHz ..
|
||||
@@ -2147,7 +2181,7 @@ static inline __attribute__((always_inline)) void fx_buses(const int32_t *cho_in
|
||||
cdr[0] = (ce[0] - cr[0]) >> clg; cdr[1] = (ce[1] - cr[1]) >> clg; cdr[2] = (ce[2] - cr[2]) >> clg;
|
||||
}
|
||||
cr[0] += cdr[0]; cr[1] += cdr[1]; cr[2] += cdr[2];
|
||||
y += cho_ens(cho_buf, fx.cho_w, cr, &sd);
|
||||
y += cho_ens(cho_buf, fx.cho_w, cr, &sd, cwo);
|
||||
sd = (sd * fx.cw_cur) >> 7;
|
||||
side += sd;
|
||||
}
|
||||
@@ -2501,6 +2535,12 @@ static inline __attribute__((always_inline)) void mix_part(track_t *t, uint32_t
|
||||
dgl = ((4096 - (mp_pan[ti] > 0 ? mp_pan[ti] >> 2 : 0)) - gl) >> CTL_LOG2;
|
||||
dgr = ((4096 + (mp_pan[ti] < 0 ? mp_pan[ti] >> 2 : 0)) - gr) >> CTL_LOG2;
|
||||
int32_t c = t->p[P_CHOR] * 258, d = t->p[P_DLY] * 258, r = t->p[P_REV] * 258, pk = t->peak;
|
||||
if (cho_mix && c) { /* (V10.8.36, the owner) CHORUS MIX: the part's dry down by what it
|
||||
* sends to the chorus (MIX 100 and the send whole: the chorus
|
||||
* alone, a vibrato) */
|
||||
int32_t f = 4096 - ((cho_mix * t->p[P_CHOR] * 165) >> 9);
|
||||
gl = (gl * f) >> 12; gr = (gr * f) >> 12; dgl = (dgl * f) >> 12; dgr = (dgr * f) >> 12;
|
||||
}
|
||||
int32_t xmax = c > d ? c : d, *ol = c1 ? c1_mix.l : mix_l, *or_ = c1 ? c1_mix.r : mix_r;
|
||||
int32_t *sc = c1 ? c1_mix.c : send_c, *sd = c1 ? c1_mix.d : send_d, *sr = c1 ? c1_mix.rv : send_r;
|
||||
if (slicer_routes((uint32_t)(t - trk))) { /* (JIANT 0.6.3) into the SLICER's bus, not the dry mix */
|
||||
|
||||
+13
-4
@@ -1865,6 +1865,14 @@ static __attribute__((noinline)) void gen_mix(track_t *t, uint32_t r)
|
||||
t->p[P_DLY] = (int16_t)clamp((r == RL_LEAD || r == RL_ARP ? grr(25, 70) : r == RL_PAD && (g->pads == CS_DUB || g->pads == CS_SKANK) ? grr(55, 95) :
|
||||
r == RL_PAD ? grr(0, 30) : r == RL_DRUM ? grr(0, 10) : 0) * (40 + wet) / 100, 0, 127);
|
||||
if (r == RL_LEAD && t->p[P_REV] < 25 && t->p[P_DLY] < 20) t->p[P_DLY] = (int16_t)grr(25, 55);
|
||||
/* (V10.8.36, the mix pass's second: docs/GENERATOR-STUDY.es.md 5.3) a hook its delay or its reverb, not both high
|
||||
* (a riff's the delay, a held line's the reverb); a club's stab half its reverb (the off-beat clear); its arp a
|
||||
* pluck (the release short: it ran into its own delay) */
|
||||
if (r == RL_LEAD && t->p[P_REV] >= 25 && t->p[P_DLY] >= 20) t->p[g->lead >= LD_RIFF || g->lead == LD_HOOK ? P_REV : P_DLY] >>= 1;
|
||||
if (gclub()) {
|
||||
if (r == RL_PAD && g->pads == CS_STAB) t->p[P_REV] >>= 1;
|
||||
if (r == RL_ARP && t->p[P_REL] > 25) t->p[P_REL] = (int16_t)grr(15, 25);
|
||||
}
|
||||
t->p[P_HVEL] = (int16_t)(127 - clamp((HV[r] + HT[r] + HG[r]) * hum / 150, 0, 127)); /* (0.6.92: one amount) */
|
||||
t->p[P_HTIM] = t->p[P_HGAT] = 127;
|
||||
if (g->lead == LD_EBM) { /* (p7b, the owner's references measured: the bass's and the pads' brightness swings
|
||||
@@ -1882,7 +1890,8 @@ static __attribute__((noinline)) void gen_mix(track_t *t, uint32_t r)
|
||||
}
|
||||
if (r == RL_PAD || r == RL_ARP || r == RL_LEAD) /* (p6b: the owner's references all dark, their centroid 350 ..
|
||||
* 660 Hz: the melodic parts' cutoff 15 % down) */
|
||||
t->p[P_FCUT] = (int16_t)(t->p[P_FCUT] * 85 / 100);
|
||||
t->p[P_FCUT] = (int16_t)(t->p[P_FCUT] * (79 + (gs.root + gs.pn) % 3u * 6) / 100); /* (V10.8.36: the piece's own
|
||||
* colour: dark, as it was, or brighter, the three parts together) */
|
||||
if (r == RL_DRUM && (g->spec & GSP_HEAVY)) /* (p4b, the owner: EBM's drums industrial, distorted, simple;
|
||||
* V10.6p: phonk's and baile funk's too) */
|
||||
t->p[P_DIST] = (int16_t)grr(40, 60);
|
||||
@@ -2160,7 +2169,7 @@ static void gen_parts(void)
|
||||
* LOOP: the verse the genre's progression, the break it or the
|
||||
* drop's) */
|
||||
if (fam != HF_LOOP && ((form == FM_PARTS && k == 1u) || (form != FM_PARTS && k == 3u))) {
|
||||
if (pn > 1u && !gls.on && !glatin() && gch(80)) { /* (V10.8.34, the owner: "different parts within a song") the
|
||||
if ((pn > 1u || gx.on) && !gls.on && !glatin() && gch(80)) { /* (V10.8.36: EXPLORE's one chord too) */ /* (V10.8.34, the owner: "different parts within a song") the
|
||||
* contrast section its own progression, the family's grammar's (as
|
||||
* many chords as A's, A's qualities), from its predominant */
|
||||
for (i = 0; i < 6u && (gx_prog(fam), gs.pn != pn || !memcmp(gs.pdeg, pdeg, pn)); i++) {}
|
||||
@@ -2550,7 +2559,7 @@ static void gen_post(void)
|
||||
{ /* (V10.8.34, the owner: "call and response") a dialogue, a throw in two: where the lead speaks (two notes or
|
||||
* more in a half bar) the arp is silent, and answers in its gaps; not where the lead leaves it none */
|
||||
uint32_t ld = gs.trk_of[RL_LEAD], ar = gs.trk_of[RL_ARP], c = 0, kill = 0, busy = 0, j;
|
||||
if (ld < NTRK && ar < NTRK && gs.act[RL_LEAD] && gs.act[RL_ARP] && !gx.on && gch(50)) {
|
||||
if (ld < NTRK && ar < NTRK && gs.act[RL_LEAD] && gs.act[RL_ARP] && gch(50)) { /* (V10.8.36: EXPLORE's too) */
|
||||
uint32_t ll = dlen(&trk[ld]);
|
||||
len = dlen(&trk[ar]);
|
||||
for (k = 0; k < 2u; k++) /* (the first pass counts the lead's busy half bars) */
|
||||
@@ -3096,7 +3105,7 @@ static __attribute__((noinline)) void gen_make(void)
|
||||
song.g[G_RPRE] = (int16_t)(g->rtype == 3 ? grr(0, 4) : g->rtype == 2 || g->rtype == 4 ? grr(-12, 0) : grr(0, 30));
|
||||
song.g[G_CRATE] = (int16_t)grr(10, 60);
|
||||
song.g[G_CDEPTH] = (int16_t)grr(20, 80);
|
||||
song.g[G_DUCK] = (int16_t)(gs.act[RL_DRUM] ? (g->spec & GSP_PUMP ? grr(60, 80) : g->kick_mode == KM_SUSTAIN ? grr(30, 50) : grr(14, 30)) : 0); /* (V10.6n:
|
||||
song.g[G_DUCK] = (int16_t)(gs.act[RL_DRUM] ? (g->spec & GSP_PUMP ? grr(60, 80) : g->kick_mode == KM_SUSTAIN || gclub() ? grr(30, 50) : grr(14, 30)) : 0); /* (V10.6n:
|
||||
* hard bass pumped) */
|
||||
if (g->snd[GP_BASS] == SR_WOW && gs.act[RL_BASS] && gs.trk_of[RL_BASS] < NTRK) gwobble(&trk[gs.trk_of[RL_BASS]]);
|
||||
song.g[G_DREL] = (int16_t)(g->drum == DM_TECHNO || g->drum == DM_HARD || g->drum == DM_HBASS ? grr(15, 30) : grr(25, 45));
|
||||
|
||||
@@ -951,13 +951,13 @@ _Static_assert(sizeof GGRAM / sizeof GGRAM[0] == NGENRE, "GGRAM: a grammar a gen
|
||||
static const uint8_t GMIX[][3] = {
|
||||
GMX(0, 7, -2, 0, 5, 0), /* MINIMAL TECHNO */
|
||||
GMX(-3, 0, 0, 0, 7, 6), /* HARD TECHNO (V10.7.2: the bass +1.5 dB, V10.6z10's basses ~1.8 under) */
|
||||
GMX(-3, 7, 3, 7, 0, 6), /* HARD BASS */
|
||||
GMX(-3, 7, 3, 7, 4, 6), /* HARD BASS (V10.8.36: the arp +6 dB, 22 under the drums) */
|
||||
GMX(-1, 2, 1, 0, 7, 0), /* HOUSE */
|
||||
GMX(-2, 4, 2, 0, 7, 0), /* DEEP HOUSE (V10.7.2: the bass +1.5, z10's ~1.2 under) */
|
||||
GMX(-3, 1, -1, 0, 7, 0), /* TECH HOUSE (V10.7.2: the bass +1.5, z10's ~1.6 under) */
|
||||
GMX(-3, 4, 1, 0, 7, 5), /* TRIBAL */
|
||||
GMX(0, 1, 2, 2, 0, -2), /* CUMBIA */
|
||||
GMX(-1, 1, -5, 2, 5, 4), /* REGGAETON (V10.7.8, the owner's reference: the drums up front, the 808 up, the pad, the hook
|
||||
GMX(0, 1, 2, 2, 3, -2), /* CUMBIA (V10.8.36: the arp +4.5 dB, 21 under) */
|
||||
GMX(-1, 1, -5, 6, 5, 4), /* REGGAETON (V10.8.36: the hook +6 dB, 19 under the drums) (V10.7.8, the owner's reference: the drums up front, the 808 up, the pad, the hook
|
||||
* and the arp under them, the pad under the arp) */
|
||||
GMX(-3, 2, -2, 7, 7, 4), /* DEMBOW (V10.7.2: the marimba's riff and the chants' arp up: phonk's levels) */
|
||||
GMX(-3, 0, 1, 7, 7, 5), /* ELECTRO */
|
||||
@@ -971,16 +971,16 @@ static const uint8_t GMIX[][3] = {
|
||||
* other throws' FAT BASS as it was, at the level's top already) */
|
||||
GMX(0, 0, 4, 3, 2, 3), /* NEO CLASSIC */
|
||||
GMX(0, 0, 5, 1, 1, 2), /* FUGA */
|
||||
GMX(0, -2, -2, 4, -5, 1), /* ELECTRO METAL */
|
||||
GMX(0, -2, -2, 4, -2, 1), /* ELECTRO METAL (V10.8.36: the arp +4.5 dB, 21 under) */
|
||||
GMX(0, -1, 0, 3, 0, 1), /* TECHNO ROCK */
|
||||
GMX(-1, 4, -3, -1, 2, 3), /* DREAM POP */
|
||||
GMX(-1, 4, -3, 2, 2, 3), /* DREAM POP (V10.8.36: the voice +4.5 dB, 23 under the drums) */
|
||||
GMX(-4, 1, -2, 7, 7, 4), /* PHONK (V10.7.2: the drums -1.5, z10's DNA ~2 dB over the parts) */
|
||||
GMX(-3, 2, -3, 7, 4, 4), /* BAILE FUNK (V10.7.8: the 808 4.5 dB up, the chops under) */
|
||||
GMX(-3, 2, -3, 7, 7, 4), /* BAILE FUNK (V10.8.36: the arp +4.5 dB) (V10.7.8: the 808 4.5 dB up, the chops under) */
|
||||
GMX(0, 0, 0, 1, 0, -2), /* JAZZ */
|
||||
GMX(-3, -2, -1, 7, 5, 4), /* HIP HOP */
|
||||
GMX(-2, 5, -3, 2, 0, 3), /* (V10.7.63) DUBSTEP: the wobble up front */
|
||||
GMX(-2, 5, -3, 6, 4, 3), /* (V10.7.63) DUBSTEP: the wobble up front (V10.8.36: the lead and the arp +6 dB) */
|
||||
GMX(-1, 0, 4, -2, 0, 3), /* SHOEGAZE: the wall over everything, the voice back */
|
||||
GMX(0, -2, 0, 3, -5, 1), /* METALCORE: as ELECTRO METAL */
|
||||
GMX(0, -2, 0, 3, -2, 1), /* METALCORE: as ELECTRO METAL */
|
||||
};
|
||||
_Static_assert(sizeof GMIX / sizeof GMIX[0] == NGENRE, "GMIX: a mix a genre");
|
||||
/* (V10.6z10, the owner: "every throw of a genre the same song") each genre's groove DNA (GENRE's order, EXPLORE last):
|
||||
|
||||
+16
-2
@@ -677,6 +677,10 @@ static int16_t trks_ui;
|
||||
#define G_LOADP 0xFDu
|
||||
/* (0.7.6) a track page's slot holding the global ALL TR (G_STRN): SCL's KNOB 4, where TRANS was (page_desc) */
|
||||
#define ID_ALLTR 0xFCu
|
||||
#define ID_DNZ 0xE5u /* (V10.8.36) a track's DIST NOISE (fx.c dnz_v) */
|
||||
extern int16_t dnz_v[NTRK];
|
||||
#define ID_CMIX 0xE6u /* (V10.8.36) FX > CHORUS's MIX (fx.c cho_mix); both in MUTATE's old ids */
|
||||
extern int16_t cho_mix;
|
||||
#define ID_GAIN 0xDFu /* (V10.7.64) a track's GAIN (trk_gain) */
|
||||
static int16_t trk_gain[NTRK] __attribute__((section(".bss.tape"))); /* (V10.7.64, the owner: GAIN, not DRIVE)
|
||||
* 0..12 dB clean on the track's level (fx.c) */
|
||||
@@ -746,7 +750,7 @@ static const page_t PAGES[] = {
|
||||
* (0.7.6) FX's second page, at hand (was after SL PITCH) */
|
||||
{"TAPE", FAM_FX, SC_GLOBAL, GR_NONE, {ID_TAPE, ID_TWOW, 0xFF, 0xFF}},
|
||||
{"EQ", FAM_FX, SC_GLOBAL, GR_NONE, {ID_EQ0, ID_EQ0 + 1u, ID_EQ0 + 2u, ID_EQ0 + 3u}}, /* (p9) the master's EQ, last */ /* (0.9.9-snd8) the master's tape, after MASTER */
|
||||
{"DIST", FAM_FX, SC_TRACK, GR_NONE, {P_DIST, P_DTYPE, P_DTONE, 0xFF}}, /* JIANT: the drive's type and tone */
|
||||
{"DIST", FAM_FX, SC_TRACK, GR_NONE, {P_DIST, P_DTYPE, P_DTONE, ID_DNZ}}, /* (V10.8.36) NOISE */ /* JIANT: the drive's type and tone */
|
||||
{"AUTO PAN", FAM_FX, SC_TRACK, GR_NONE, {P_APDEP, P_APRATE, P_APSYNC, P_APWAVE}}, /* (JIANT 0.6.9) the track's pan swung */
|
||||
{"BUSES", FAM_FX, SC_GLOBAL, GR_BUSES, {G_DMIX, G_RSIZE, G_CDEPTH, G_SLDEP}}, /* (0.8.5) FX's lens: the buses' main values */
|
||||
{"DLY", FAM_FX, SC_GLOBAL, GR_NONE, {G_DTIME, G_DFDBK, G_DCOLOR, G_DMIX}},
|
||||
@@ -755,7 +759,7 @@ static const page_t PAGES[] = {
|
||||
* in DLY's TONE; G_DHPF stored, unused) */
|
||||
{"REVERB", FAM_FX, SC_GLOBAL, GR_NONE, {G_RTYPE, G_RSIZE, G_RDAMP, G_RPRE}}, /* TYPE: ROOM / SPRING */
|
||||
{"REVERB 2", FAM_FX, SC_GLOBAL, GR_NONE, {G_RMOD, G_RRATE, G_RFILT, G_RWIDE}}, /* JIANT: modulation, tone, width */
|
||||
{"CHORUS", FAM_FX, SC_GLOBAL, GR_NONE, {G_CRATE, G_CDEPTH, G_CSTER, 0xFF}}, /* (0.6.9: STEREO) */
|
||||
{"CHORUS", FAM_FX, SC_GLOBAL, GR_NONE, {G_CRATE, G_CDEPTH, G_CSTER, ID_CMIX}}, /* (V10.8.36) MIX */ /* (0.6.9: STEREO) */
|
||||
/* (0.6.81) the SLICER after the buses, before MASTER: DELAY, REVERB and CHORUS nearer at hand */
|
||||
{"SLICER", FAM_FX, SC_GLOBAL, GR_SLCR, {G_SLMODE, G_SLPAT, G_SLRATE, G_SLDEP}}, /* (0.6.3) one, on a bus */
|
||||
{"SL BUS", FAM_FX, SC_GLOBAL, GR_SLCR, {G_SLT1, G_SLT1 + 1, G_SLT1 + 2, G_SLT1 + 3}}, /* what goes in */
|
||||
@@ -967,6 +971,16 @@ static const param_desc_t *page_desc(const page_t *pg, uint32_t slot, int16_t **
|
||||
*valp = &trk_gain[(uint32_t)(TSEL - trk) % NTRK];
|
||||
return &TGAIN_DESC;
|
||||
}
|
||||
if (id == ID_CMIX) { /* (V10.8.36) FX > CHORUS's MIX: chorus .. vibrato */
|
||||
static const param_desc_t CMIX_DESC = {"MIX", F_PCT, 0, 100, 0, 0};
|
||||
*valp = &cho_mix;
|
||||
return &CMIX_DESC;
|
||||
}
|
||||
if (id == ID_DNZ) { /* (V10.8.36) FX > DIST's NOISE */
|
||||
static const param_desc_t DNZ_DESC = {"NOISE", F_PCT, 0, 127, 0, 0};
|
||||
*valp = &dnz_v[(uint32_t)(TSEL - trk) % NTRK];
|
||||
return &DNZ_DESC;
|
||||
}
|
||||
if (id == ID_ALLTR) { /* (0.7.6) SCL's KNOB 4: the global ALL TR on the track page */
|
||||
*valp = &song.g[G_STRN];
|
||||
return &GP[G_STRN];
|
||||
|
||||
@@ -130,6 +130,8 @@ typedef struct {
|
||||
* FUNC's 'M' 'X' block, the last, when not the defaults; absent: them */
|
||||
uint8_t tgain[NTRK]; /* (V10.7.64) each track's GAIN (params.c trk_gain, 0..12): FUNC's 'T' 'G'
|
||||
* block after the kit's, when one is set; absent: 0 */
|
||||
uint8_t dnz[NTRK + 1u]; /* (V10.8.36) each track's DIST NOISE (fx.c dnz_v, 0..127), then the CHORUS's MIX
|
||||
* (cho_mix, 0..100): FUNC's 'D' 'N' block, the last, when one is set; absent: 0 */
|
||||
uint8_t dx_gain; /* (V10.7.63) the kit's GAIN (eng_drum.c dx_gain, 0..12): FUNC's 'K' 'G' block
|
||||
* after LIFE's, when set; absent: 0 */
|
||||
uint8_t clay[NTRK][CLAY_NF]; /* (V10.8.21) DRONE CLAY (seq.c clay.c clay_pack, 0..127): FUNC's 'C' 'L' blocks
|
||||
@@ -616,6 +618,8 @@ static uint32_t proj_packed_size(const project_t *q)
|
||||
n += i < 8u ? 18u : 0u; /* (V10.7.74) DRUM-X's MATH modulators */
|
||||
for (t = 0; t < NTRK; t++) /* (V10.8.21) DRONE CLAY */
|
||||
if (q->clay[t][CL_ON]) n += 4u + CLAY_NF;
|
||||
for (t = 0; t <= NTRK; t++) /* (V10.8.36) DIST NOISE, CHORUS MIX */
|
||||
if (q->dnz[t]) { n += 2u + sizeof q->dnz; break; }
|
||||
return n;
|
||||
}
|
||||
static int proj_split_ok(const uint8_t *s)
|
||||
@@ -836,6 +840,10 @@ static int proj_pack(project_store_t *out, const project_t *q)
|
||||
b[pos++] = 'C'; b[pos++] = 'L'; b[pos++] = (uint8_t)i; b[pos++] = (uint8_t)CLAY_NF;
|
||||
memcpy(b + pos, q->clay[i], CLAY_NF); pos += CLAY_NF;
|
||||
}
|
||||
for (i = 0; i <= NTRK && !q->dnz[i]; i++) {}
|
||||
if (i <= NTRK) { /* (V10.8.36) DIST NOISE, CHORUS MIX (the last) */
|
||||
b[pos++] = 'D'; b[pos++] = 'N'; memcpy(b + pos, q->dnz, sizeof q->dnz); pos += sizeof q->dnz;
|
||||
}
|
||||
memcpy(b + PROJC_PFX_OFF, q->pfx_lane, sizeof q->pfx_lane);
|
||||
b[PROJC_PFX_OFF + sizeof q->pfx_lane] = q->pfx_ltgt > 2u ? 0u : q->pfx_ltgt;
|
||||
for (i = 0; i < 4u; i++)
|
||||
@@ -1213,6 +1221,11 @@ static int proj_unpack_c(project_t *q, const uint8_t *b)
|
||||
}
|
||||
pos = at + len;
|
||||
}
|
||||
memset(q->dnz, 0, sizeof q->dnz); /* (V10.8.36) DIST NOISE: as saved, else 0 */
|
||||
if (pos + 2u + sizeof q->dnz <= room && b[pos] == 'D' && b[pos + 1u] == 'N') {
|
||||
for (i = 0; i <= NTRK; i++) q->dnz[i] = b[pos + 2u + i] & 127u;
|
||||
pos += 2u + sizeof q->dnz;
|
||||
}
|
||||
proj_new_tracks(q, nt); /* (a FUNC of fewer tracks: the rest at power-on) */
|
||||
for (t = nt; t < NTRK; t++)
|
||||
memcpy(q->fm6[t], FM6_INIT, FM6_PACKED);
|
||||
@@ -1365,6 +1378,8 @@ static __attribute__((noinline)) void proj_master_put(project_t *p)
|
||||
for (k = 0; k < 4u; k++) p->lf[k] = (uint8_t)clamp(life_v[k], 0, 100); /* (V10.7.62) LIFE, the same */
|
||||
p->dx_gain = (uint8_t)clamp(dx_gain, 0, 12); /* (V10.7.63) the kit's GAIN, as the kit's TONE */
|
||||
for (k = 0; k < NTRK; k++) p->tgain[k] = (uint8_t)clamp(trk_gain[k], 0, 12); /* (V10.7.64) */
|
||||
for (k = 0; k < NTRK; k++) p->dnz[k] = (uint8_t)clamp(dnz_v[k], 0, 127); /* (V10.8.36) */
|
||||
p->dnz[NTRK] = (uint8_t)clamp(cho_mix, 0, 100);
|
||||
for (k = 0; k < NTRK; k++) clay_pack(clay[k], p->clay[k]); /* (V10.8.21) DRONE CLAY */
|
||||
for (k = 0; k < 4u; k++) p->eq[k] = (int8_t)eq_v[k];
|
||||
p->tp[0] = (uint8_t)tape_v[0]; p->tp[1] = (uint8_t)tape_v[1];
|
||||
@@ -1633,6 +1648,8 @@ static int project_restore_runtime(const project_t *input)
|
||||
for (k = 0; k < 4u; k++) life_v[k] = p->lf[k] > 100u ? 100 : p->lf[k]; /* (V10.7.62) LIFE */
|
||||
dx_gain = p->dx_gain > 12u ? 12 : p->dx_gain; /* (V10.7.63) the kit's GAIN */
|
||||
for (k = 0; k < NTRK; k++) trk_gain[k] = p->tgain[k] > 12u ? 12 : p->tgain[k]; /* (V10.7.64) */
|
||||
for (k = 0; k < NTRK; k++) dnz_v[k] = p->dnz[k] & 127; /* (V10.8.36) */
|
||||
cho_mix = p->dnz[NTRK] > 100u ? 100 : p->dnz[NTRK];
|
||||
for (k = 0; k < NTRK; k++) clay_unpack(p->clay[k], clay[k]); /* (V10.8.21) DRONE CLAY */
|
||||
memset(clay_dn, 0, sizeof clay_dn); memset(clay_nn, 0, sizeof clay_nn); /* (its notes: the load's all-off) */
|
||||
}
|
||||
@@ -1750,6 +1767,7 @@ static __attribute__((noinline)) void system_init(void) /* (snd8: out of its c
|
||||
life_v[0] = life_v[1] = life_v[2] = life_v[3] = 0; /* (V10.7.62) LIFE off */
|
||||
dx_gain = 0; /* (V10.7.63) the kit's GAIN */
|
||||
memset(trk_gain, 0, sizeof trk_gain); /* (V10.7.64) the tracks' GAIN */
|
||||
memset(dnz_v, 0, sizeof dnz_v); cho_mix = 0; /* (V10.8.36) DIST NOISE, CHORUS MIX */
|
||||
memset(clay, 0, sizeof clay); memset(clay_b0, 0, sizeof clay_b0); memset(clay_pq, 0, sizeof clay_pq); /* (V10.8.21) DRONE CLAY off */
|
||||
for (i = 0; i < 5u; i++) song.g[KEEP[i]] = kept[i];
|
||||
kept[0] = dice_secs;
|
||||
@@ -2102,6 +2120,8 @@ static uint32_t autosave_sig(void)
|
||||
h = as_mix(h, life_v, sizeof life_v); /* (V10.7.62) LIFE */
|
||||
h = as_mix(h, &dx_gain, sizeof dx_gain); /* (V10.7.63) the kit's GAIN */
|
||||
h = as_mix(h, trk_gain, sizeof trk_gain); /* (V10.7.64) the tracks' GAIN */
|
||||
h = as_mix(h, dnz_v, sizeof dnz_v); /* (V10.8.36) DIST NOISE */
|
||||
h = as_mix(h, &cho_mix, sizeof cho_mix);
|
||||
return as_mix(h, proj_name, sizeof proj_name);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/* 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;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only
|
||||
* Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
|
||||
* (V10.8.36) DIST's NOISE (fx.c track_dist, dnz_v): it modulates the drive (sidebands), adds nothing to silence and
|
||||
* keeps the level; at 0 the drive is bit for bit what it was. */
|
||||
#define main hostsim_main
|
||||
#include "hostsim.c"
|
||||
#undef main
|
||||
#include <math.h>
|
||||
static int32_t buf[2][4096];
|
||||
static double run(int nz, int type, int amp, double *side)
|
||||
{
|
||||
track_t *t = &trk[0];
|
||||
uint32_t b, i, n = 4096 / CTL;
|
||||
double e = 0, re = 0, im = 0, sre = 0, sim = 0;
|
||||
host_tracks_init();
|
||||
t->p[P_DIST] = 60; t->p[P_DTYPE] = (int16_t)type; t->p[P_DTONE] = 0;
|
||||
dnz_v[0] = (int16_t)nz;
|
||||
dist_w[0] = 0; dnz_lp[0] = 0; dnz_r[0] = 0;
|
||||
for (b = 0; b < n * 4u; b++) { /* four passes: the blend in, the filters settled */
|
||||
int32_t *o = buf[nz ? 1 : 0] + (b % n) * CTL;
|
||||
for (i = 0; i < CTL; i++)
|
||||
o[i] = (int32_t)(amp * sin(2 * M_PI * 220.0 * (b * CTL + i) / 44100.0));
|
||||
track_dist(t, o, CTL);
|
||||
}
|
||||
for (i = 0; i < 4096; i++) {
|
||||
double x = buf[nz ? 1 : 0][i], w = 2 * M_PI * i / 44100.0, hw = 0.5 - 0.5 * cos(2 * M_PI * i / 4096.0);
|
||||
e += x * x;
|
||||
x *= hw; /* (a Hann window: the partial's skirt out of the way) */
|
||||
re += x * cos(220 * w); im += x * sin(220 * w);
|
||||
sre += x * cos(300 * w); sim += x * sin(300 * w); /* between the partials: only the noise's sidebands */
|
||||
}
|
||||
(void)re; (void)im;
|
||||
*side = 10 * log10((sre * sre + sim * sim + 1e-9) / (e * 4096 + 1e-9)); /* against the whole signal */
|
||||
return sqrt(e / 4096);
|
||||
}
|
||||
int main(void)
|
||||
{
|
||||
int fails = 0, type;
|
||||
for (type = 0; type < 5; type++) {
|
||||
double s0, s1, sz, l0 = run(0, type, 12000, &s0), l1 = run(100, type, 12000, &s1), z0 = run(0, type, 0, &sz), z = run(100, type, 0, &sz);
|
||||
double d = 20 * log10(l1 / l0);
|
||||
printf("type %d: level %.0f -> %.0f (%+.2f dB), between partials %.1f -> %.1f dB, silence %.1f\n", type, l0, l1, d, s0, s1, z);
|
||||
if (z > z0) { printf("FAIL NOISE adds to silence (%.2f, without %.2f)\n", z, z0); fails++; }
|
||||
if (d < -3.0 || d > 3.0) { printf("FAIL level moved\n"); fails++; }
|
||||
if (s1 < s0 + 6) { printf("FAIL no sidebands\n"); fails++; }
|
||||
}
|
||||
{ /* NOISE 0: as before (the same samples twice) */
|
||||
double s; static int32_t keep[4096];
|
||||
run(0, 0, 12000, &s); memcpy(keep, buf[0], sizeof keep);
|
||||
run(0, 0, 12000, &s);
|
||||
if (memcmp(keep, buf[0], sizeof keep)) { printf("FAIL NOISE 0 not deterministic\n"); fails++; }
|
||||
}
|
||||
printf(fails ? "dist noise test FAILED\n" : "dist noise test passed\n");
|
||||
return fails ? 1 : 0;
|
||||
}
|
||||
+1
-1
@@ -110,7 +110,7 @@ static void ref_buses(const int32_t *cho_in, const int32_t *dly_in, const int32_
|
||||
for (k = 0; k < 3u; k++) cdr[k] = (ce[k] - cr[k]) >> clg;
|
||||
}
|
||||
for (k = 0; k < 3u; k++) cr[k] += cdr[k];
|
||||
y += cho_ens(ref_cho, rf.cho_w, cr, &sd);
|
||||
y += cho_ens(ref_cho, rf.cho_w, cr, &sd, 21845);
|
||||
(void)r;
|
||||
}
|
||||
rf.cho_w++;
|
||||
|
||||
+23
-2
@@ -4278,8 +4278,29 @@ static int test_layer(void)
|
||||
memset(dx_mot, 0, 4);
|
||||
}
|
||||
go_title("CHORUS");
|
||||
bad += check(" CHORUS page: CRT CDP STER (0.6.9)", cur_page()->fam == FAM_FX && cur_page()->id[0] == G_CRATE &&
|
||||
cur_page()->id[1] == G_CDEPTH && cur_page()->id[2] == G_CSTER && cur_page()->id[3] == 0xFFu);
|
||||
bad += check(" CHORUS page: CRT CDP STER (0.6.9), MIX (V10.8.36)", cur_page()->fam == FAM_FX && cur_page()->id[0] == G_CRATE &&
|
||||
cur_page()->id[1] == G_CDEPTH && cur_page()->id[2] == G_CSTER && cur_page()->id[3] == ID_CMIX);
|
||||
{ /* (V10.8.36) CHORUS's MIX and DIST's NOISE: their knobs, a project keeps them, an empty one has none */
|
||||
int ok;
|
||||
cho_mix = 0;
|
||||
turn(EN_K4, 3);
|
||||
ok = cho_mix > 0 && cho_mix <= 100;
|
||||
cho_mix = 70;
|
||||
go_title("DIST");
|
||||
ok &= cur_page()->id[3] == ID_DNZ;
|
||||
dnz_v[TSEL - trk] = 0;
|
||||
turn(EN_K4, 3);
|
||||
ok &= dnz_v[TSEL - trk] > 0;
|
||||
dnz_v[TSEL - trk] = 90;
|
||||
song.playing = 0;
|
||||
project_save(2);
|
||||
cho_mix = 0; dnz_v[TSEL - trk] = 0;
|
||||
project_load(2);
|
||||
bad += check(" CHORUS MIX and DIST NOISE: KNOB 4 turns them, a project keeps them (V10.8.36)",
|
||||
ok && cho_mix == 70 && dnz_v[TSEL - trk] == 90);
|
||||
cho_mix = 0; dnz_v[TSEL - trk] = 0;
|
||||
project_save(2);
|
||||
}
|
||||
/* chording: a key held before FX stays a note, its note-off arrives */
|
||||
ui_power_on();
|
||||
mo = mo_w;
|
||||
|
||||
+2262
-2258
File diff suppressed because it is too large.
Load diff
+3
-1
@@ -193,7 +193,9 @@ def build_loader():
|
||||
HOT_FNS = ("mix_block", "mix_part_m0", "fx_run0", "perf_begin", "perf_pre", "perf_block", "perf_master", "slicer_bus",
|
||||
"dly_lo", "dly_grain", "dly_grain_adv", "dly_wow_adv", "dly_line_clear", "dly_rate", "fx_rest",
|
||||
"rev_run", "rev_idle", "rev_room", "rev_spring", "rev_cloud", "rev_shimmer", # (V10.7.56: rev_spring_side, SPRING's WIDE, and rev_room_mod, ROOM's MOD / WIDE, from flash: the room)
|
||||
"rev_reso", "cho_admit", "dist_shape", "dist_amp", "pk_step", "perf_kpress") # (V10.7.65: the punch-in keys, packed)
|
||||
"rev_reso", "cho_admit", "dist_shape", "dist_amp",
|
||||
"track_dist") # (V10.8.36: one copy, with its NOISE; was inlined twice. pk_step and perf_kpress, V10.7.65's, back
|
||||
# in the flash for its room: both are called through a pointer, a key or a beat at a time) # (V10.7.65: the punch-in keys, packed)
|
||||
|
||||
|
||||
def share_strings(ir, keep=()):
|
||||
|
||||
Reference in new issue
Block a user