Examples to send changing data to OSC receiver listening on UDP port 2222.
These examples are intended to be simple and easy to understand. They sacrifice perfection for ease of understanding.
There are four examples:
- osc-random.py - sends random integers every second
- osc-stocks.py - sends stock quotes every 15 seconds
- osc-wav.py - plays a
.wav
file and sends the current sample (left and right channel) - osc-pyaudio.py - plays a
.wav
file and sends the current sample (left and right channel) -- NOT WORKING
These examples use Python 3 and several additional Python packages. If you are using the command line and pip
for package management, the following will install the prerequisites for you.
# for OSC communication with MAX/MSP
pip install python-osc
# for osc-stocks
pip install googlefinance
# for osc-wav
pip install sounddevice
pip install scipy
# pya.py
pip install pyaudio
pip install wave
The .wav
file examples take the name of a .wav
file as their single parameter.
python osc-wav.py science.wav