Articles Hierarchy

Articles Home » RPI » Python and Sonic Sound

Python and Sonic Sound

its long i play Python and Sound,
but there was a forum question regarding a old tutorial
what used a ultrasonic sensor by a python program and send data to Sonic Pi (manual) for play
music like a THEREMIN
/ a smart search would have helped all /

now i am not interested in the hardware part.
but first i test SONIC Pi code and found its old / not working
later i tested some python code with random notes and
made a PYGAME window to use the mouse to play it.
you see a window (with black background)
when click or press and drag get a print of sound settings send to SONIC
left --> right is the NOTE / pitch higher
up --> down is louder
update 8.3.2018,
in v.03 added some show to mark the note by a bar in the window,
with 80 notes times 8 pix is 640 window
and color ( yellow to red ) by amp
just adding up / over again.
update 15.04.2018
(made the v 0.4 rev )
test and not run: needed a
pip3 install python-osc
i hate that, the python3 import is
from pythonosc import osc_message_builder
from pythonosc import udp_client

why not same name??

both applications: PYTHON3 IDLE and SONIC Pi must be in run mode

code here
sound sample here
play video youtube

for a ultrasonic version that might work see here
for keyboard version see here

new: 2018-04-18
an other question from 4um is regarding PD
pure data

sudo apt install -y puredata
and try from command line
pd -v
or Desktop

no idea what this is and how to get out ONE TONE

i can play with the slider and get sound,
but in main window have that input warning??
and a terrible ch-ch-ch sound repeating
but anyhow i want try to get the python udp message i send to Sonic Pi:

PD code file
just proof of concept!

cd projects
mkdir l2ork
cd l2ork
sudo dpkg -i pd-l2ork-armv7l-20170119.deb
sudo apt-get update && sudo apt-get -f install

The following packages will be REMOVED:

... no that does not work