A line, snapped to a scale
A full run of every step:
run: 1 2 3 4 5 6 7 8
Quantize snaps each value to the nearest in an allowed set — so the same run bends onto the chord tones:
chord-tones: { op: quantize, allowed: [1, 3, 5, 8] } # → 1 1 3 3 5 5 8 8
…or onto a pentatonic:
pentatonic: { op: quantize, allowed: [1, 2, 3, 5, 6] }
The melody bends to fit; the set of allowed notes is the context you project it through. Same idea as choosing a scale for a phrase — here it filters which notes a line is even allowed to land on.