Pack / Multiplexer

Shipping
pack

Combine N signals into one SignalBundle with lossless per-channel metadata

Signature

Inputs

  • in0Signal|SignalBundle
  • in1Signal|SignalBundle
  • in2Signal|SignalBundle
  • in3Signal|SignalBundle
  • in4Signal|SignalBundle
  • in5Signal|SignalBundle
  • in6Signal|SignalBundle
  • in7Signal|SignalBundle
  • in8Signal|SignalBundle
  • in9Signal|SignalBundle
  • in10Signal|SignalBundle
  • in11Signal|SignalBundle
  • in12Signal|SignalBundle
  • in13Signal|SignalBundle
  • in14Signal|SignalBundle
  • in15Signal|SignalBundle

Outputs

  • bundleSignalBundle

Description

Pack is a multiplexer (Mux): it gathers up to 16 independent inputs (in0 … in15) into a single SignalBundle — a multi-channel bus that travels as one wire. Each source signal is stored losslessly: every channel retains its own timestamps, sample rate, physical unit, and uncertainty (). Pack performs no resampling, alignment, or arithmetic; it is purely a structural aggregation.

Inputs may be scalar Signals or nested SignalBundles. Nested bundles are flattened in place, so packing two 3-channel bundles yields a 6-channel bundle rather than a bundle-of-bundles. Unwired ports are skipped; the output channel order follows the port index (in0 first, then in1, …), with flattened sub-channels inserted contiguously at their parent's position.

Because channels keep independent metadata, a single bundle can carry heterogeneous data — e.g. a signal at 48 kHz alongside a signal at 10 Hz — without forcing a common time base or unit. Pack is stateless: the output for a given set of inputs depends only on those inputs.

Use Pack to bus many strip-chart traces into one plotter input, to route a full sensor array through one edge, or as the inverse partner of unpack.

Mathematics

Examples

Busing four traces to one plot

Wire four signal_generator outputs into in0…in3. The bundle output carries all four as distinct channels, each with its own unit and sample rate, ready for a single multi-trace sink.

signal_generator (V, 48kHz) -> in0
signal_generator (V, 48kHz) -> in1
noise_generator  (V, 48kHz) -> in2
constant         (V)        -> in3
                             pack.bundle -> sink

Flattening nested bundles

Feed a pre-bundled 8-channel hardware_source into in0 and a single thermocouple Signal (in ) into in1. The result is a flat 9-channel bundle: the 8 hardware channels retain their order, followed by the temperature channel — no nesting, metadata intact.

Applications

  • Consolidating a multi-sensor DAQ array (strain, temperature, voltage) into one bus for synchronized logging and export.
  • Feeding several processed traces into a single multi-channel plotter or file sink without duplicating downstream wiring.
  • Assembling stereo or multi-channel audio from independently generated mono streams before an audio_output node.
  • Grouping related signals into a bus that is later split, reordered, or subset with unpack for modular graph design.

Neat

Because packing then unpacking is metadata-lossless, Pack/unpack pairs act as pure structural routing: heterogeneous units, sample rates, and uncertainties survive a full round trip unchanged.

Channel identity is positional, not name-based: flattening inserts a nested bundle's channels contiguously at its parent port's index, so wiring order deterministically fixes downstream unpack indices.

Known issues

With all 16 ports unwired the output is an empty (zero-channel) bundle; downstream nodes that assume at least one channel may error or produce no output.

Ordering is strictly by port index and flatten position — Pack never sorts or aligns by unit or sample rate, so a later unpack must track the exact wiring to address the intended channel.

See also

multiplexerbundleroutingmulti-channelstructuralstateless