This page covers input routing and LED/state bus transport used by UI/controller layers.
PadUI and PadUIGridDefined in private/src/PadUI.hpp.
PadUI binds:
(m_x, m_y),m_routeId),SmartGrid::SmartBusColor* for readback color,SmartGrid::MessageInBus* for interaction output.OnPress/OnRelease enqueue MessageIn events (PadPress, PadRelease) with timestamps.GetColor() reads current LED color from SmartBusColor.PadUIGrid is a lightweight factory that generates PadUI handles for a route.
MessageInBusDefined in private/src/MessageInBus.hpp.
CircularQueue<MessageIn, 16384>.MessageIn,BasicMidi (converted through MidiToMessageIn).SetRouteType(route, routeType).Pop(msg, timestamp) only emits messages where msg.Visible(timestamp) is true.ProcessMessages(processor, timestamp) calls processor->Apply(msg) in-order.MidiToMessageIn route typingRoute type controls how incoming MIDI packets are interpreted:
Param7, Param14),Both Wrld.Bldr and QuadLaunchpadTwister configure these route types during construction.
SmartBusGeneric and SmartBusColorDefined in private/src/SmartBus.hpp.
SmartBusGeneric<T> stores an atomic 2D grid of payloads.Put(...) detects cell changes and sets a changed flag.m_epoch increments when visible state changes.SmartBusColor is SmartBusGeneric<Color>, used for controller LED output state.
The bus iterator uses epoch comparison:
This keeps output processing efficient for mostly-static LED frames.
AbstractGrid::OutputToBus(SmartBusColor* bus):
This is the primary bridge from sequencer/controller state to UI/controller LED state.