f_hue_processor — Bpatcher Spec
Last updated: 2026-07-05 (previous doc dated 2026-05-25 described a superseded rslider-based implementation — see Loose Threads)Status: Working, with a known open UI bug (see Loose Threads)
Concept
Hue-selective processing. Isolates a flat-topped hue band — centered on hue_center, extending hue_lower degrees below and hue_upper degrees above, with a edge_falloff-degree smoothstep at each boundary — and applies saturation, luminance, and hue-rotation adjustments only within that band. A low-saturation gate (smoothstep(0.05, 0.15, S)) suppresses the effect on near-gray pixels regardless of hue, avoiding hue-selection noise in desaturated regions.
Parameters
| Name | Type | Range | Default | Description |
|---|---|---|---|---|
hue_center | float | 0–360 | 120.0 | Hue band center, in degrees |
hue_lower | float | 0–180 | 36.0 | Flat-top extent below center, in degrees |
hue_upper | float | 0–180 | 156.0 | Flat-top extent above center, in degrees |
edge_falloff | float | 0–90 | 10.0 | Smoothstep falloff width at each boundary, in degrees — 0=hard edge |
sat_amt | float | -1–1 | 0.0 | -1=full desaturate, 0=unchanged, 1=full boost, within the band |
lum_shift | float | -1–1 | 0.0 | Additive luminance shift within the band |
hue_shift | float | -180–180 | 0.0 | Hue rotation within the band, in degrees |
bypass | toggle | 0/1 | 0 | Bypass processing |
Signal Chain
texture in → jit.gl.pix (HSV decode → flat-top hue-band mask → HSV re-encode)
→ texture outParameters routed via the standard route <params...> pattern generated by tools/build_patcher.py — correction (2026-10-12 maintenance audit): hue_center/hue_lower/hue_upper are not "plain live.dial floats routed like any other param." The shipped definition.py marks them type: "internal" with no route token — they are driven via the jsui pair (hue_rslider.js → hue_range.js → attruis), and that wiring is the mechanism behind the band-drag bug below. The saturation/lum/hue adjustment params are routed normally.
Loose Threads
HANDOFF.md still lists an open bug: "f_hue_processor bugs (hue_lower/hue_upper missing UI path)."Pinned down by the 2026-10-12 maintenance audit (now a formal task,.specify/f_hue_processor/T001): the bug is a UI-wiring disagreement, not shader math. The rslider'sondragfiresoutput()→hue_range.js→ drives the pix, but the parameter-enabledhue_lower/hue_upperlive.numboxes'param_connectpath goes to the pix directly, whilemsg_floaton inlets 0/1 deliberately suppressesoutput()(a loop-back guard) — so dragging the band and typing in the numboxes follow two different routes that don't stay in agreement. The codebox's band math itself is correct (and is the precedentf_dither_grainreuses).- The underlying hue model changed from whatever the 2026-05-25 doc described to the current
hue_center+hue_lower/hue_upper(asymmetric flat-top) +edge_falloffmodel — worth being aware of if cross-referencing any older notes or muscle memory about this module's dial layout.
References
Hue-band selective processing via HSV round-trip with an asymmetric flat-top band (hue_center + hue_lower/hue_upper + edge_falloff) is an original construction; no external source was consulted. The band math (mod(hue - hue_c + 0.5, 1.0) - 0.5, two smoothstep shoulders, saturation gate) is the precedent f_dither_grain reuses (its ADR-4).
The band params are driven via the jsui pair (hue_rslider.js -> hue_range.js), not the standard route -- see Notes for the open band-drag UI bug (now a formal task, .specify/f_hue_processor/T001).
See docs/f-reference/f_hue_processor.md (this file) for the full parameter reference and the bug investigation.
Source File
package/patchers/f_hue_processor.maxpat