marioslideshow - Beat Analyzer
Give it a song, get back the exact moments to cut on — and a picture to prove it found them
- audio
- beats
- bpm
- beat_preview
- beat_json
Editing to music by eye is guesswork - you drop a transition, watch it land half a beat late, nudge it, repeat. MarioBeatAnalyzer (display "marioslideshow - Beat Analyzer") removes the guessing: feed it your soundtrack and it detects the actual beat positions and BPM, hands you a structured beats object plus the raw numbers, and draws a preview image of where it thinks the beats fall. It's the timing backbone of the MSCH Nodes slideshow suite - the node that turns "cut on the beat" from a hope into a graph connection.
How it works
Under the hood it runs onset/beat tracking (librosa does the heavy lifting - it's a real pack dependency, not a hand-rolled threshold) on the audio window, returning the time in seconds of every detected beat and the estimated tempo. The outputs split the result four ways so you can use whichever is convenient: beats (the MARIO_BEATS object that plugs into the Director and the one-node slideshow), bpm as a plain FLOAT, beat_json as text you can eyeball or export, and beat_preview as an IMAGE showing the waveform with detected beats marked - which is how you sanity-check the analysis without trusting it blindly.
Audio comes in via the audio AUDIO socket, or a path in audio_file if you'd rather type a file location (leave audio_file empty when AUDIO is connected).
The controls that matter
Beat detection is never perfect, and the node gives you three levers for its mistakes:
tempo_hint(default 0 = auto-estimate). The single most important troubleshooting tool. Detectors routinely lock onto half or double the real tempo - a 128 BPM song read as 64 or 256 - and telling it the BPM snaps the grid back. If the preview shows beats landing on every other beat, set this.beat_offset_seconds(±1 s). Real pipelines have latency: you may find the visual cut feels late or early even with correct beats because of playback/encoding offset. This nudges the whole beat list.max_seconds(default 180, up to 600) bounds how much of the audio gets analyzed - handy for a long mix where you only care about the first three minutes.
Wiring it
The intended flow in the advanced slideshow pipeline is audio → MarioBeatAnalyzer → MarioSlideshowDirector → Renderer. The analyzer's beats feeds the Director's optional beats input so shot durations snap to real onsets. A clean habit: connect the same audio separately to the renderer for the audible soundtrack - the analyzer doesn't pass audio through, it only reads it.
Install
Ships in the unified MSCH Nodes pack - no separate repo. ComfyUI Manager search "MSCH Nodes" / msch-comfyui-nodes, or:
cd ComfyUI/custom_nodes
git clone https://github.com/mariobilly/msch-comfyui-nodes.git
cd msch-comfyui-nodes
python -m pip install -r requirements.txt
Restart ComfyUI. librosa is the reason this node is part of the pack's heavy dependency set, so expect a chunky pip install the first time.
Gotchas
The author's own docs are blunt: "Inspect detected timing because beat detection can choose half/double tempo or miss events." That's not a bug disclaimer - it's the nature of onset detection on music with soft drums or tempo changes. Make beat_preview part of your routine: look at it once before rendering a long video, fix half/double tempo with tempo_hint, and only reach for beat_offset_seconds when cuts feel systematically early or late rather than randomly off. And if your song has no clear percussive beat at all, no amount of hinting will manufacture one - pick a different track or switch the Director to Seconds timing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_file | STRING | Leave empty when AUDIO is connected. | |
| tempo_hint | FLOAT | 00–300 | 0 estimates tempo. Set BPM to correct half/double-tempo detection. |
| beat_offset_seconds | FLOAT | 0.00-1–1 | — |
| max_seconds | FLOAT | 1802–600 | — |
| audioopt | AUDIO | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| beats | MARIO_BEATS | — |
| bpm | FLOAT | — |
| beat_preview | IMAGE | — |
| beat_json | STRING | — |