i tried that already, but it ended up consuming more cycles than just doing "conta % pitch" ....

things just had to be tricky...

just to let you guys know, i also found out that the reminder of any number divided by 2^n could be calculated as

*num & (2^n - 1)*, and so i changed the code to only give pitch prescalers which were powers of 2, but that had the side effect of providing

veryinaccurate frequencies (it would yield 300 hz instead of 350 hz, which is really quite noticeable..)

another alternative i explored was considering

*A % B* as

*A - B * (A/B)*... i tried precomputing

*1/B* before and storing the value in another variable, say

*C*... so technically i could do

*A - B*(A*C)*......but the problem with this is that it always gave 0 as a result.. since 1/B would always give 0 in integer math...