lisp-gui-examples
lisp-gui-examples copied to clipboard
Wrong formula for frequency->position
https://github.com/goober99/lisp-gui-examples/blob/90a76681ed27c378abc6a47ad563c72c114bed88/examples/racket/bleep.rkt#L41-L43
Taking the relevant portion from the racket example:
(/ (- (log freq) min-freq) (+ frequency-scale *min-position*))
should instead be:
(+ *min-position* (/ (- (log freq) min-freq) frequency-scale))
The bug can't be noticed in the example because *min-position* is always 0, so the wrong formula still gives the "correct" result. If *min-position* was >0, then the bug would be immediately apparent (all results would be abnormally small).
I have not checked the other language examples.