The old version I had of this used
withI to be smart about this and only operate on
note params, so it could be applied to complex ParamMaps/Patterns rather than just numeric patterns.
I'd really like to figure out how to use something like
fix to make this possible again, but in the meanwhile here's a little something that will let you do this similarly to using
let octceil by upper noteval = if noteval>upper then octceil by upper (noteval - by) else noteval
let octfloor by lower noteval = if noteval<lower then octfloor by lower (noteval + by) else noteval
let wramp lower upper p = ((octfloor 12 lower).(octceil 12 upper)) <$> p
d1 $ s "pluck" + note (wramp 10 25 ("[7 0 3 0]*4" + ((* 7) <$> (slow 4 $ (run 8)))))
I've called it
invert because what it does is much like the theoretical concept of "inversions" of chords, arpeggios, or other groups of pitches. I used to call it
clampoctaves, which I think is a bit more intuitive but it's also somewhat verbose. Perhaps clamp is better. Unclear!
Invert is probably bad though now that I think of it, because it's doing more than that.
It's constraining pitches to a range by...wrapping them. Maybe
wramp because it's wrapping and clamping?