# \[Please Help Me\] Ultrasonic Theremin - Error With OSC

**URL:** <https://in-thread.sonic-pi.net/t/please-help-me-ultrasonic-theremin-error-with-osc/6199>\
**Category:** Support, Help & Resources\
**Created:** [December 6, 2021, 10:52am UTC](https://in-thread.sonic-pi.net/t/please-help-me-ultrasonic-theremin-error-with-osc/6199 "2021-12-06T10:52:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chadi](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/chadi/32/2161_2.png) [@chadi](https://in-thread.sonic-pi.net/u/chadi)\
**Post date:** [December 6, 2021, 10:52am UTC](https://in-thread.sonic-pi.net/t/please-help-me-ultrasonic-theremin-error-with-osc/6199/1 "2021-12-06T10:52:56Z")

</div>

# 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

 ![Python Script, OSC and Sonic Pi](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/3/3aa45425a634816c502ca55096c1d58b1f1f64db.jpeg)

### Sonic Pi

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

### Python

```ruby
>>> %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!

---

<div class="post-metadata">

**Author:** ![ethancrawford](https://avatars.discourse-cdn.com/v4/letter/e/a88e4f/32.png) [@ethancrawford](https://in-thread.sonic-pi.net/u/ethancrawford)\
**Post date:** [December 6, 2021, 11:50am UTC](https://in-thread.sonic-pi.net/t/please-help-me-ultrasonic-theremin-error-with-osc/6199/2 "2021-12-06T11:50:47Z")

</div>

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:

> [@No sound from Raspi when running Theremin project](https://in-thread.sonic-pi.net/t/no-sound-from-raspi-when-running-theremin-project/4338):
>
> Whilst the upgrade to 3.2.2 allowed me to get ‘AV’ (ass opposed to HDMI) audio out of my Pi2 when playing the various samples included with the program my attempts to get output from the theremin project: [https://projects.raspberrypi.org/en/projects/ultrasonic-theremin/6](https://projects.raspberrypi.org/en/projects/ultrasonic-theremin/6) have hit stony ground. I am sure I must be missing an Elephant somewhere but as I am a beginner with Python and SonicPi, I know not where he lurks. The cue screen in Sonic Pi tells me the Python script appears to be sending…

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