-- desire — bass RHYTHMICS study (#31)
--
-- PLN, 2026-07-29: "i gotta solve desire bassline is not great rythmics coulld be
-- cooler more nto more ete_a_mauerpark or insouciance or haunted_house i guess."
--
-- This file is a BENCH, not a patch. desire.tidal is untouched: paste one d4 at a
-- time over the real one and listen. Pitch design is held constant throughout —
-- aeolian, +2 root (D), doubled at "[24,36]" — because the key was measured
-- (corr=0.903) and is not what he is unhappy with. Only the rhythm moves.
--
-- ============================================================================
-- WHAT THE CURRENT LINE ACTUALLY DOES
-- ============================================================================
--
--   $ note (scale "aeolian" "0 . 0*<1 2> . <0 3> . 0*<1 1 4>" + 2 - "[24,36]")
--
-- The `.` splits the bar into FOUR EQUAL groups. Each group is the same note (0)
-- either once or burst into 2/4 copies. So:
--
--   * every onset lands on a quarter-note grid — no syncopation, no offset;
--   * nothing ever rests — all four beats always sound;
--   * pitch is static (one `<0 3>` alternation in the whole bar);
--   * the ONLY thing that varies is density, via `*<n>`, on a repeated note.
--
-- That is a metronome with a stutter. It is not a riff, and no amount of filter
-- movement will make it one. The diagnosis is mechanical, not a matter of taste.
--
-- ============================================================================
-- THE GRAMMAR THE THREE REFERENCES SHARE (and desire has none of)
-- ============================================================================
--
-- Read from live/midi/nova/techno/ete_a_mauerpark.tidal (d4 "Basse Germanique")
-- and live/midi/nova/beatober/oct_16_haunted_house_insouciance.tidal (d4 "Basse
-- convaincante"). Six mechanisms, and they are the same six in both:
--
-- 1. UNEVEN DURATIONS via `@`. The bar is not divided evenly.
--      insouciance:  note "<c3 ...>@5 ef3 d3 <ef3 ...>"     -> 5:1:1:1 of 8
--      mauerpark:    note "[g4 c ef@14]"                    -> 1:1:14 of 16
--    One long note holds the harmony; short notes carry the motion.
--
-- 2. THE PITCH PATTERN *IS* THE RHYTHM PATTERN. Both put the rhythm inside
--    `note "..."`, so a new note is a new onset. desire keeps them separate —
--    a static degree with density stacked on top — which is why it reads as
--    "the same note, faster" instead of as a line.
--
-- 3. CALAGE. `(0.125 <~)` in mauerpark (and `(0.125 ~>)` on insouciance's d7):
--    the whole line is displaced an eighth so it pushes against the kick instead
--    of doubling it. desire sits exactly on the grid.
--
-- 4. ACCENT FOLLOWS RHYTHM. insouciance: `|* gain ("1@5 0.95 0.98 0.95" * 1.1)`
--    — the SAME 5:1:1:1 weighting as the notes. desire has a flat `gain 1.15`.
--
-- 5. SPACE. mauerpark rests inside the phrase (`[c ef d@13 ~]`) and drops whole
--    bars (`mask "<t!2 f t f f t t> f t@14"`). desire never stops.
--
-- 6. THE PHRASE IS LONGER THAN THE BAR. Both run a 4-bar `<a b c d>` and
--    mauerpark adds `slow 2` on top. desire's alternations resolve inside one bar,
--    so there is nothing to wait for.
--
-- ============================================================================
-- FOUR PROPOSALS. A, B and C each isolate ONE mechanism, on purpose — so what
-- you hear is attributable. D is the combination. Try them in order.
-- ============================================================================


-- --- A --- WEIGHT: long root, three movers. (mechanism 1 + 4)
-- Same eight-unit bar as insouciance's bass: the root holds 5/8, then three
-- quick degrees walk. Nothing is displaced and nothing rests yet, so if THIS
-- already fixes it, the problem was only the even grid.
d4 $ gF2 $ gM3
  $ midiOn "^45" (# crush 6)
  $ note (scale "aeolian" "0@5 0 <2 3> <1 0>" + 2 - "[24,36]")
  # "bassWarsaw" # voice 0.05
  # lpf (range 300 1800 "^32") # resonance 0.2
  |* gain ("1@5 0.94 0.98 0.92" * 1.15)


-- --- B --- GESTURE: two pickups into a long hold, displaced. (1 + 2 + 3 + 6)
-- Mauerpark's actual shape: 16 units, of which the last note holds 14. The
-- 4-bar alternation gives the phrase somewhere to go, and the eighth-note
-- pull-back is what stops it doubling the kick. This is the biggest change of
-- the four — expect it to feel like a different track, which is the point.
d4 $ gF2 $ gM3
  $ midiOn "^45" (# crush 6)
  $ (0.125 <~)
  $ note (scale "aeolian"
      "<[0 3 0@14] [0 <2 4> 0@14] [3 0 2@14] [0 3 <0 -3>@13 ~]>"
      + 2 - "[24,36]")
  # "bassWarsaw" # voice 0.05
  # lpf (range 300 1800 "^32") # resonance 0.2
  # gain 1.15


-- --- C --- SPACE: keep the current figure, but let it breathe. (5 + 6)
-- The minimal-risk option, and the one to reach for if A and B both feel like
-- too much six days out. Identical vocabulary to what is in desire today — the
-- only additions are rests and a bar that drops out every fourth time round.
d4 $ gF2 $ gM3
  $ midiOn "^45" (# crush 6)
  $ mask "<t t t [t@3 ~]>"
  $ note (scale "aeolian" "0 . ~ 0*<1 2> . <0 3> . ~ 0*<1 2>" + 2 - "[24,36]")
  # "bassWarsaw" # voice 0.05
  # lpf (range 300 1800 "^32") # resonance 0.2
  # gain 1.15


-- --- D --- ALL SIX. Weight + gesture + calage + accent + space + 4-bar phrase.
-- The `ply` on ^45 replaces the old crush-only gesture with a roll that fires
-- ONLY on the short notes (insouciance's trick: the ply pattern carries the same
-- weighting as the notes, so the long root is never chopped).
d4 $ gF2 $ gM3
  $ midiOn "^45" (ply "1@5 1 <1!3 2> 2" . (# crush 6))
  $ (0.125 <~)
  $ someCyclesBy "^33" (mask "<t!3 [t@5 ~]>")
  $ note (scale "aeolian"
      "<[0@5 0 <2 3> <1 0>] [0@5 3 2 0] [0@5 0 <2 4> 3] [0@3 ~ 0 <3 2> <1 -3>]>"
      + 2 - "[24,36]")
  # "bassWarsaw" # voice 0.05
  # lpf (range 300 1800 "^32") # resonance 0.2
  |* gain ("1@5 0.94 0.98 0.92" * 1.15)


-- ============================================================================
-- NOTE ON CONTROLS: every proposal keeps d4's mapped controls exactly as desire
-- has them — ^45 (B3 gesture) and ^32 (the lpf knob) — so none of these changes
-- the surface, and none needs a remap before the gig. D repurposes what ^45 DOES
-- (crush -> ply+crush) but not which control it is.
--
-- VERIFY before pasting:  python3 tools/silent-eval.py --seeded study/desire_bass_rhythm.tidal
-- (all four d4s are declared here, so the harness checks each one emits events.)
--
-- MEASURED (silent-eval, 64 cycles, seeded; events halved for the "[24,36]" double):
--
--     current desire d4   ~5.5 onsets/bar   all on the quarter grid, no rests
--     A  weight            4.0 onsets/bar   even count, uneven DURATIONS
--     B  gesture           3.0 onsets/bar   sparsest — two pickups and a hold
--     C  space             4.5 onsets/bar   same vocabulary, rests added
--     D  all six           5.75 onsets/bar  as busy as today, but weighted+displaced
--
-- Worth reading before you listen: D is *denser* than what desire has now, and A
-- and B are much sparser. If the complaint were "too busy" the fix would just be
-- fewer notes — it isn't, and D is the control that proves it. What is missing is
-- WHERE the notes fall and HOW LONG they last, not how many there are.
