Well, the title says it all i guess: is there an audio counterpart for [mod], because I want to limit the phasor~ or line~ to a specific range, and for this I usually use a [mod] for control rate? Or would there be a simple way to build this out of other simpler objects?
-
-
[clip~]
-
But modulo folds back to zero and continues from there when its upper limit is exceeded, clip just, well, clips it off.
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
[wrap~] maybe?
-
Or: [expr~ $v1 % $v2] ?
-
here's a tutorial and a list of the [expr] family ([expr], [expr~], and [fexpr~])
http://crca.ucsd.edu/~syadegar/expr.html -
@hecanjog said:
Or: [expr~ $v1 % $v2] ?
[mod] handles negative numbers differently than [% ], so if you'd have to take an extra step to deal with it:
[sig~ 4] <-- mod argument
/ \
/ \
[expr~ $v1 % $v2] \
| \
[expr~ if($v1<0, $v2+$v1, $v1)] -
Thanx a lot mmb. I don't have negative's (it used to index tabread4~) so first expr~ was perfect. I really should take the time to read the tutorial alexandros linked, because it seems a powerful object. But then i still can't understand what [wrap~] can be used for though...
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
[wrap~] behaves sorta like a [mod] in that a steadily increasing input signal will result in an output signal that repeatedly slides from zero to one, and then jumps back to zero. It even takes of negative number correctly. However, unlike [mod], [wrap~] doesn't have any creation arguments so you're stuck between zero and one with just the [wrap~] object alone. So then I guess you would be stuck with trying to scale your input and outputs correctly just to make it behave.
Given that Maelstorm's idea is virtually the "[mod~]", and that you don't need floating points to index a table, you (and I) will probably find his idea way more intuitive.
-
It goes to show that I could use a good read of that tutorial as well.