How to program sonicpi into another program?

i wanna connect a sonar to RPi to detect the distance,and play different pitches according to it.So…how can i write such program?
maybe it sounds difficult… by the way; can i manage it by using “overtone”? and how?

Here’s an example I did last May based on an article in the MagPi magazine

1 Like

yeah…thank u very much.
to be honesty, i have just seen your article on

and it inspired me a lot.
now your reply really touched me !
toooooo much thanks.
1 Like