[Please Help Me] Ultrasonic Theremin - Error With OSC

Sonic Pi Theremin

Everything was going well while doing the Sonic pi theremin project, until Sonic Pi isn’t receiving signals from the python program that read input from the Ultrasonic sensor.

My Problem

Sonic Pi isn’t receiving the OSC signals sent by the .py file.

Please help me make Sonic Pi listen to OSC messages


My development steps:

  • Sensor Working
  • Raspberry Pi reads from the sensor
  • [xx] Sonic Pi isn’t receiving the values from the sensor through OSC

Code and Outputs

Here are the outputs given by different programs

Python Script and Sonic Pi running together

Sonic Pi

Sonic pi is always printing a /live_loop/listen [] message

Python

>>> %Run 'Theremin 061221.py'
/usr/lib/python3/dist-packages/gpiozero/input_devices.py:855: PWMSoftwareFallback: For more accurate readings, use the pigpio pin factory.See https://gpiozero.readthedocs.io/en/stable/api_input.html#distancesensor-hc-sr04 for more info
  warnings.warn(PWMSoftwareFallback(
1.0
1.0
1.0
1.0
1.0
0.7332711538574859
0.7332711538574859
0.5237485108224927
0.41550541737038654
0.33291757614345896
0.10419382699230936
0.08012975629403173
0.08012975629403173
0.059087231713442635
0.059087231713442635
0.025646156009424884
0.025646156009424884
0.025646156009424884
0.025646156009424884
0.026987101223180616
0.04090509282391395
0.04090509282391395
0.04090509282391395
0.04090509282391395
0.04090509282391395
0.04090509282391395
0.04090509282391395
0.047269819712000755
0.07651831778277937
0.07651831778277937
0.1465739078911929
0.21370612429638186
0.5155514620759686
0.5617305731215038
1.0

Thank You people for your support!

Hello @chadi,

The short answer: the original theremin project (assuming this isn’t one that you designed from scratch) was built to work with a now outdated version of the Sonic Pi language.

At the least, you will need to update the lines where you use the osc function in Sonic Pi.
Please see the following for details:

if you still have issues after reading/having a go at that, feel free to ask questions again :slightly_smiling_face: