Skip to content

MilkDrop: mash-ups from the library (#579, part 2) - #610

Merged
CaYatur merged 4 commits into
mainfrom
milkdrop/mashup-579
Sep 23, 2026
Merged

CaYatur merged 4 commits into
mainfrom
milkdrop/mashup-579

Conversation

@CaYatur

@CaYatur CaYatur commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

The second half of #579: mash-ups of the presets in the user's library. The generator came in #609.

What it does

The generator card gets a Mash-up from Your Library block. A preset is built out of six parts of others, each taken whole from one preset:

Part What it holds
Look Decay, gamma, echo, the four flags, main wave, borders, motion vectors
Motion The equations, plus zoom/rot/cx/cy/dx/dy/warp/sx/sy and the warp animation
Waves The custom waves
Shapes The custom shapes
Warp The warp shader
Composite The composite shader, plus the blur ranges b1n…b1ed, which set GetBlur's scale
  • Line mapping. Every key belongs to exactly one part; the list was counted from the corpus (86 header keys). Lines are copied as they are, numbers included. Version lines are rewritten from the presets that give the shaders.
  • Choosing donors. New Mash-up draws each part from the presets the MilkDrop panel's list shows, so its search and filter apply, and only from presets with that part.
  • "None". Warp and composite come out "none" 12% of the time, so the look's fixed pipeline still gets a turn.
  • Editing. One part can be drawn again, or all six can start from the preset on screen. An unsaved preview is never in the list and never gives a part.
  • History and id. ◀ ▶ step through a recipe history and skip a recipe whose preset was deleted. The id comes from the recipe (md_mix1_…), so saving twice leaves one file.

Clean room: the behaviour was described in our own words first, and MilkDrop 2's mash-up code was not opened.

Measured on the whole 10,332-preset corpus

Scripts outside the repo.

  • Part tests. They agree with the parser for every preset and part, at 13.5 µs a test.
  • One-preset round trip. A mash-up of one preset is that preset again for all 10,332. Only 5 files get different version lines, all malformed or old headers.
  • Mixed donors. In 5,000 random mash-ups every part equals its donor's, parameters split by part, and the version lines match the shaders.
  • Engine. 300 random mash-ups ran in the engine (214 with a warp shader, 221 with a composite one) with no new shader or equation failure.
  • Isolated copy with 40 corpus presets.
    • A search left 20 presets in the list; 6 mash-ups drew 14 of them and nothing outside.
    • The visualizer drew the mash-up.
    • Drawing one part again changed only that part, and ◀ went back.
    • Saving twice left one file.
    • The English UI has no Turkish.

Found on the way:

  • Blur keys mistaken for a shader. The composite part's blur ranges were first counted as shader lines, which gave 308 MilkDrop 1 presets version lines for a composite shader they don't have. Fixed before this PR.
  • A duplicated key. One corpus file writes the same key twice. Our parser keeps the last value, and the part test follows it. Which value MilkDrop 2 keeps is left to MilkDrop: fidelity follow-ups after #560 #580.
  • Names that didn't stay names in English. The interface splits text at " · " and translates the pieces.
    • A mash-up saved as "Karışım · …" would read "Blend · …".
    • One generated word pair ("Dingin Halkalar") is a builtin preset's name ("Still Rings").
    • Mash-up names now use ": ", and the ring nouns changed. A test runs every generated word pair and a mash-up name through the English translation.

Tests

20 new tests: 10 for the module, 9 for the panel with a fake DOM (the search is typed into the MilkDrop panel's real search box), and 1 that runs generated and mash-up names through the English translation. 23 of 23 mutations are caught; a 24th was equivalent, and its branch was removed. npm test passes 2167/2167. Smoke passes, and the user-data checksums were unchanged.

Not done: MIDI/OSC or web-remote actions that generate or mix.

Refs #579

A preset built out of six parts of others: look, motion, waves, shapes,
warp shader, and composite shader with the blur ranges.

- Every key belongs to exactly one part (86 header keys counted from the
  corpus). Parts come whole and their lines are copied as they are;
  version lines are rewritten from the presets giving the shaders.
- Part tests pick candidates without parsing and agree with the parser
  on all 10,332 corpus presets.
- A one-preset mash-up is that preset again for the whole corpus; in
  5,000 random mash-ups every part equals its donor's. 300 random
  mash-ups ran in the engine with no new shader or equation failure.

Written from a description of the behaviour in our own words; MilkDrop
2's mash-up code was not opened.

Refs #579
- New Mash-up draws each part from the presets the MilkDrop panel's list
  shows (search and filter apply), only from presets with that part.
  Warp and composite are sometimes "none", so the look's fixed pipeline
  still gets a turn.
- One part can be drawn again, or all six can start from the preset on
  screen; an unsaved preview never gives a part.
- A recipe history steps back through mash-ups and skips a recipe whose
  preset was deleted. The id comes from the recipe, so saving twice
  leaves one file.
- Every new string has an English entry.

Refs #579
The interface splits text at " · " and translates the pieces:
"Karismim · ..." (layer blend) read "Blend · ..." and the generated pair
"Dingin Halkalar" is a builtin preset's name ("Still Rings"). Mash-up
names use ": " and the ring nouns are now Cemberler/Circles. A test runs
every generated word pair and a mash-up name through the English
translation; the card's wiring test requires the mash-up module.

Refs #579
@CaYatur
CaYatur merged commit 23fbf9b into main Sep 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant