Modulo

edited June 21 in General app discussion

Is there a module that returns the remainder of a division or allows a value to wrap around a limit?

Comments

  • I'm missing that too.

    The Graphic Modulator has a time input that could be used for the "wrap around" behavior though.

  • edited June 21

    You can scale the value up, Quantize (integer truncate), scale back down, and subtract from the original value. Works for non-negative values; be careful with pitch, which starts at -0.5. For example, add 0.5 to a pitch CV, then perform the above steps with a factor of 8. The result will be the note value (C2..B2) with the octave stripped. In this example, the output of Subtract is the "note", range 0 to 0.125. Adding 0.125 moves it up to start at middle C. Note that this generates the remainder after division by 0.125. The scale by 8 is actually the division, and the scale by 0.125 is multiplying by the divisor. (Please ignore the second pic; it has a typo, 0.128 not 0.125.)


Sign In or Register to comment.