Puzzle: what does "((x * 299 + 41) & 511) > 294" compute? Bonus points for explaining how it works.
-
-
@raphlinus@hhpapazian A loop count of 7 makes sense because of 7 white keys. 294 is chosen wisely to grab the black keys inbetween -
@NilsSchneider@hhpapazian Yup, you got it. (x*7+1)%12 > 6 is a more concise equivalent formula, but modulo is slower. - 1 more reply
New conversation -
-
-
@raphlinus@hhpapazian So far, 299%512 gets your error variable for a Bresenham line sampler. It causes 7 loops inside one octave (12 notes)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@raphlinus@hhpapazian The 41 can be ignored and is only an offset to get the starting note rightThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.