I’m building off Robin Newman’s awesome Dual Ultrasonic Theramin
I’m using a single sensor and have divided the osc data stream into various ranges (3 - 30, 31-40, 41-55)
using if statements eg, (if b>2 and b>31) but it tends to throw timing exceptions.
Is there a more efficient way to check if the received distance reading is within a defined range (range 3, 30) similar to ruby’s ‘include?’ method?
Any and all replies appreciated!
footnote: sonic pi was my introduction to code and programming - thank you Sam Aaron!