what if I made a little visual programming language for my synthesizer 🤔
@aeva clamp(x, lo, hi) = med3(x, lo, hi) if lo <= hi
proof:
suppose x < lo. then x < lo <= hi so lo is the median.
suppose lo <= x <= hi. then x is the median.
finally, suppose hi < x. then lo <= hi < x so hi is the median.