Hi!<br><br>That was a good question, I think sorting where to use &quot;modular synth style&quot; signal flow and where to us &quot;plain code&quot; is a important part of ChucKing. Many things can be done both ways but if you do it the &quot;wrong&quot; way you&#39;ll end up with ugly code and high cpu costs.
<br><br>If there is still a need to round to a multiple of some number in a &quot;5.trunc(2);&quot; style it could be done using something like this;<br><br>fun float trunc(float input, float multiple)<br>&nbsp; {<br>&nbsp; return (input - input%multiple);
<br>&nbsp; }<br><br><br>which will always round down. If we really need the closest value we can use something like;<br><br><br>fun float trunc(float input, float multiple)<br>
&nbsp; {<br>
&nbsp; if ( input%multiple &lt; ( .5 * multiple)&nbsp; ) return (input - input%multiple);<br>&nbsp; else return (input - input%multiple + multiple);<br>
&nbsp; }<br>
<br><br>This would be overkill if we just want a series of tones that hits every multiple of 400Hz (in that case we&#39;d be much better off with simply generating that series directly like Ge said) but it&#39;s still a valid question in itself.
<br><br>Hope that helps.<br>Kas.<br>