Expand description
Main Milkdrop engine implementation.
The update() orchestrator lives here; the three heavyweight per-frame
phases that used to dominate the file are split into sibling modules,
each adding its own impl MilkEngine block:
wave_phaseโevaluate_custom_wavesshape_phaseโevaluate_custom_shapesstate_syncโupdate_render_state_from_evaluator
That split keeps engine.rs focused on the lifecycle (new, load_preset,
update, public getters) and supports preset transitions, where two engine
instances drive the wave/shape paths in parallel.
Modulesยง
- morph ๐
- Smart boolean interpolation of motion params across a preset transition.
- preset_
slot ๐ - Per-preset state bundle.
- shape_
phase ๐ - Custom-shape (
shapecode_N) phase of the engine update loop. - state_
sync ๐ - Mirror a slotโs evaluator context into its
RenderState. - transition_
state ๐ - Engine-side preset transition state.
- wave_
phase ๐ - Custom-wave (
wavecode_N) phase of the engine update loop.
Structsยง
- Engine
Config - Engine configuration.
- Frame
Profile - Per-phase wall-clock breakdown for one
MilkEngine::updatecall. Populated whenEngineConfig::profileistrue; exposed byMilkEngine::last_profile()for the bench tool and any future overlay. - Milk
Engine - Main Milkdrop visualization engine.
Enumsยง
- Progress
Source - Source for the MD2
progressuniform. - Quality
Preset - Quality preset for engine configuration.
Constantsยง
- SPECTRUM_
FFT_ ๐SIZE - FFT window size used to expose
value1/value2spectrum bins towavecode_Nper-point equations whenb_spectrumis set. Power of 2, large enough to give a reasonable bin density without ballooning the analyzer cost. Matches the standard MD2 FFT size.
Functionsยง
- tick_
slot_ ๐evaluator - Advance one slotโs per-frame state: push the shared audio levels +
time + frame into its evaluator context, then run its per-frame
equations. Called once for
currentand (during transitions) once forfading_outeach frame.