Add MadMapper .mad file parsing for automated DMX layout#53
Merged
JoshuaBatty merged 8 commits intomasterfrom Mar 25, 2026
Merged
Add MadMapper .mad file parsing for automated DMX layout#53JoshuaBatty merged 8 commits intomasterfrom
JoshuaBatty merged 8 commits intomasterfrom
Conversation
Parse MadMapper v5 binary project files to derive fixture layout, pixel counts, and DMX universe assignments automatically instead of requiring manual configuration. When a .mad file is loaded via the Output tab, the app uses per-fixture DMX addressing from MadMapper as the single source of truth. Manual controls remain available when no project is loaded.
Split led_strip_view into manual and MadMapper paths. The MadMapper path uses normalised Y coordinates (-1 to +1) so rows are centered with equal padding top and bottom.
resolve_from_mad_project was being called every frame inside build_led_worker_input_state, allocating 6400 shader inputs and sorting fixtures each time. Cache the result on Model and only rebuild when the project changes (load/remove).
CoreAudio device enumeration was blocking the main thread for several milliseconds every second, causing a visible stutter. Now runs on a background thread with results polled via try_recv.
In MM6 files, pixelMapping appears after artnetUniverse rather than before. Changed field scanning from backward-only to bidirectional (nearest match within the fixture block window). Added MM6 test.
The MM6 file only contains 15 fixtures (Fixture-Line-16 is absent from the binary). Assert >= 15 until the MadMapper project is re-exported with all 16 fixtures.
MM5 stores fixture positions under 'positionUv', MM6 stores them under 'position' (the 'positionUv' entries in MM6 are all default 0.5,0.5). The parser now tries positionUv first, falls through to position when positionUv has the default value. Also filters position key matches by type tag to avoid false matches from non-fixture uses of the key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.madbinary project files to extract fixture layout, pixel counts, and DMX universe assignmentsDmxMap::PerFixture) alongside existing sequential packingrfd); manual controls hidden when a.madfile is activeconfig.jsonacross launchesTest plan
parse_known_project— 16 fixtures, 400px each, 6400 total, universes 0-43pixel_count_from_mapping— RGB step detection from pixel mapping stringposition_extraction— UV coordinates match known valuesfixtures_by_row_descending_y— sort order verifiedper_fixture_payloads_route_pixels_to_correct_universes— multi-fixture DMX routing.madfile via Output tab, verify fixture stats display, verify DMX output matches MadMapper universe assignments.madfile, verify manual controls reappear and work