pyo is a Python module written in C to help digital signal processing script creation.

Overview

Pyo - Python DSP module

pyo is a Python module written in C to help digital signal processing script creation.

pyo is a Python module containing classes for a wide variety of audio signal processing types. With pyo, user will be able to include signal processing chains directly in Python scripts or projects, and to manipulate them in real time through the interpreter. Tools in pyo module offer primitives, like mathematical operations on audio signal, basic signal processing (filters, delays, synthesis generators, etc.), but also complex algorithms to create sound granulation and others creative audio manipulations. pyo supports OSC protocol (Open Sound Control), to ease communications between softwares, and MIDI protocol, for generating sound events and controlling process parameters. pyo allows creation of sophisticated signal processing chains with all the benefits of a mature, and widely used, general programming language.

Systems : macOS (10.10+), linux, Windows (XP, Vista, 7, 8, 10)

Python versions : 2.7 (up to 1.0.1), 3.5 (up to 1.0.1), 3.6, 3.7, 3.8, 3.9.

For more resources, informations and documentation, visit the PYO OFFICIAL WEB SITE.

How to install pre-built packages on any platform using pip: INSTALL Instructions.

How to get pyo running from sources on macOS and linux: COMPILE Instructions.

pyo was awarded second prize in the Lomus 2012 Free Software Competition.

You want to help the development of pyo ? Go to the pyo features market and make a donation for the feature you want to promote. You can also submit new features on the mailing-list ( [email protected] ).

Radio Pyo

If you want to listen to scripts rendered in real-time, just connect to Radio Pyo !

You want to have your script played on the radio ? Download the template radiopyo_template.py, follow the rules and post it on the mailing-list !

Software using Pyo as audio engine

Cecilia 5 : An audio signal processing environment.

PsychoPy : An open-source application to allow the presentation of stimuli and collection of data for a wide range of neuroscience, psychology and psychophysics experiments.

Soundgrain : A graphical interface where users can draw and edit trajectories to control granular sound synthesis.

Zyne : A modular soft synthesizer.

Pyo Synth : Pyo Synth is an open source application that makes the manipulation of pyo scripts easier by letting you control it with a midi keyboard.

Examples

pyo is fully integrated to Python and very simple to use.

Play a sound:

>>> from pyo import *
>>> s = Server().boot()
>>> s.start()
>>> sf = SfPlayer("path/to/your/sound.aif", speed=1, loop=True).out()

Granulate an audio buffer:

>> env = HannTable() >>> pos = Phasor(freq=snd.getRate()*.25, mul=snd.getSize()) >>> dur = Noise(mul=.001, add=.1) >>> g = Granulator(snd, env, [1, 1.001], pos, dur, 24, mul=.1).out()">
>>> s = Server().boot()
>>> s.start()
>>> snd = SndTable("path/to/your/sound.aif")
>>> env = HannTable()
>>> pos = Phasor(freq=snd.getRate()*.25, mul=snd.getSize())
>>> dur = Noise(mul=.001, add=.1)
>>> g = Granulator(snd, env, [1, 1.001], pos, dur, 24, mul=.1).out()

Generate melodies:

>>> s = Server().boot()
>>> s.start()
>>> wav = SquareTable()
>>> env = CosTable([(0,0), (100,1), (500,.3), (8191,0)])
>>> met = Metro(.125, 12).play()
>>> amp = TrigEnv(met, table=env, mul=.1)
>>> pit = TrigXnoiseMidi(met, dist='loopseg', x1=20, scale=1, mrange=(48,84))
>>> out = Osc(table=wav, freq=pit, mul=amp).out()

Donation

This project is developed by Olivier Bélanger on his free time to provide a fully integrated Python dsp module for sound exploration and music composition. If you feel this project is useful to you and want to support it and it's future development please consider donating money. I only ask for a small donation, but of course I appreciate any amount.

Support via PayPal

Comments
  • Want any help to build pyo wheels?

    Want any help to build pyo wheels?

    Hi - I'm involved in building a lot of wheels for the Python scientific stack - and I was talking to someone who needs pyo wheels for their binary install.

    Is there any chance of generating pyo wheels to install via pip / pypi?

    Do you want any help doing that? I have lots of experience doing that kind of thing.

    opened by matthew-brett 26
  • Error when installing on RPi 4

    Error when installing on RPi 4

    I am trying tot install Pyo on my new Raspberry Pi 4 with pip3. I get the following errors:

    src/engine/pyomodule.c:24:10: fatal error: sndfile.h: No such file or directory #include "sndfile.h" compilation terminated.

    opened by zappfinger 21
  • Pyo on Windows 10

    Pyo on Windows 10

    Pyo crashes python on s = Server().boot() on windows whenever a midi input device is connected. Also displays no error messages. Works perfectly fine on Ubuntu 18.04. Also it is unable to use asio host api. The only api that seems to be working is mme, which however crashes whenever there is a midi input

    `* Checking for any available audio input... *

    • Checking audio output hosts... *

    • Testing mme... *

    • Testing directsound... *

    • Testing asio... * Pyo can't find audio host 'asio'. Currently available hosts are: apis: mme windows directsound windows wasapi windows wdm-ks

    • Testing wasapi... * Portaudio error in Pa_OpenStream: Invalid device Portaudio error in Pa_CloseStream (pa_deinit): PortAudio not initialized Portaudio error in Pa_Terminate (pa_deinit): PortAudio not initialized

    • Testing wdm-ks... *

    Results

    Duplex mode OK! Initialize the Server with duplex=1 as argument.

    Host: mme ==> OK! Host: directsound ==> OK! Host: asio ==> OK! Host: wasapi ==> Failed... Host: wdm-ks ==> OK! Initialize the Server with the desired host given to winhost argument.

    Finished!`

    Let me know if you need any more info. Any help you can provide to fix this is greatly appreciated. Thanks :)

    opened by mehulsuresh 20
  • Error loading pyo from windows 10 with python 3.5 32bits

    Error loading pyo from windows 10 with python 3.5 32bits

    I'm trying to make it work on any python3 version, got stuck here.

    Traceback (most recent call last): File "02-sine-tone.py", line 7, in <module> from pyo import * File "C:\Python35-32\lib\site-packages\pyo.py", line 21, in <module> import pyolib.analysis as analysis File "C:\Python35-32\lib\site-packages\pyolib\analysis.py", line 32, in <module> from ._core import * File "C:\Python35-32\lib\site-packages\pyolib\_core.py", line 57, in <module> from _pyo import * ImportError: DLL load failed: The specified module could not be found.

    opened by carlitoselmago 18
  • pyo midi on OS X

    pyo midi on OS X

    I am trying to get midi working with Pyo on OS X. So far no luck. The samples I tried gave me a midi note in once, then nothing. The pm_list_devices() gives me a command prompt (>) BTW, I cannot use wxPython. I installed it for Python 3.5 (Anaconda) but get this error: This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

    Richard

    opened by zappfinger 16
  • Cannot import pyo on fresh install

    Cannot import pyo on fresh install

    I'm just beginning to grasp python, but am at the point where I've installed pyo through pip into python 3.9.10. (same for 3.8.9) However, by the looks of my error, there is a missing file _pyo in the .lib folder.

    I run only 'import pyo' and get the following error:

    Traceback (most recent call last): File "<tmp 1>", line 1, in import pyo File "C:\Users\Christopher\AppData\Roaming\Python\Python39\site-packages\pyo_init_.py", line 27, in from .lib import analysis as analysis File "C:\Users\Christopher\AppData\Roaming\Python\Python39\site-packages\pyo\lib\analysis.py", line 32, in from ._core import * File "C:\Users\Christopher\AppData\Roaming\Python\Python39\site-packages\pyo\lib_core.py", line 66, in from .._pyo import * ImportError: DLL load failed while importing _pyo: The specified module could not be found.

    Same error if I copy the first example script from your setup guide. http://ajaxsoundstudio.com/pyodoc/gettingstarted.html

    I tried looking for the '..pyo\lib_pyo.py' in github (https://github.com/belangeo/pyo/tree/master/pyo/lib) and its not there, so maybe there isn't supposed to be one, but at this point I'm at a loss and really don't want to give up this project I haven't even started.

    -I've set environment variables to my python modules & python scripts. -I've set pythonPath to the correct directory in my IDE (I'm using Pyzo). -I've reinstalled everything a few times.

    opened by xorap 14
  • SfPlayer and SfMarker tracebacks

    SfPlayer and SfMarker tracebacks

    Have tried with SfPlayer and SfMarker. Code:

    from pyo import *
    
    s = Server().boot()
    s.start()
    sf = SfMarkerLooper("/sample.wav", speed=[.999,1], mul=.3).out()
    s.gui(locals())
    

    Terminal Output:

    Traceback (most recent call last):
      File "fm_synth.py", line 5, in <module>
        sf = SfMarkerLooper("/sample.wav", speed=[.999,1], mul=.3).out()
      File "/Users/morganvisnesky/anaconda3/lib/python3.6/site-packages/pyolib/players.py", line 514, in __init__
        self._snd_size, self._dur, self._snd_sr, self._snd_chnls, _format, _type = sndinfo(path[0])
    TypeError: 'NoneType' object is not iterable
    

    Also getting this message every time i run a pyo script, but using pythonw filename.py at the terminal seems to allow everything to work with the exception of these sample related calls:

    "WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h."

    opened by vism2889 14
  • Can't start server

    Can't start server

    Hey, I compiled from source on arch and unable to boot server here's the message I got:

    ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

    Why is it asking for jack if I compiled without it? And if I run with jack the message is:

    ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave

    opened by kissetfall 12
  • No module named '_pyo' again

    No module named '_pyo' again

    On my Windows system I finally had pyo running. (Python3.7, wxPython installed) Now I wanted to try the funnysynth example and I get: C:\Python37\python.exe C:/Users/toosb/PycharmProjects/pyoo/funnysynth.py Traceback (most recent call last): File "C:/Users/toosb/PycharmProjects/pyoo/funnysynth.py", line 3, in from pyolib._wxwidgets import VuMeter, ControlSlider File "C:\Python37\lib\site-packages\pyolib_wxwidgets.py", line 25, in from ._core import rescale File "C:\Python37\lib\site-packages\pyolib_core.py", line 58, in from _pyo import * ModuleNotFoundError: No module named '_pyo'

    opened by zappfinger 11
  • an error in an example code of the doc

    an error in an example code of the doc

    an error in an example code of the doc:

    [job.start() for job in jobs]
    

    that should be:

    [job.run() for job in jobs]
    

    found here: How to improve performance of your pyo programs, under the subtitle of "Use the subprocess or multiprocessing modules"

    opened by Fusyong 11
  • Segfault when booting server (invalid port names)

    Segfault when booting server (invalid port names)

    Linux (Arch,5.3-rc-latest from git), latest pyo from pypi.

    I have no inputs available. Default (set to portaudio for some reason) wouldn't work at all, server wouldn't boot complaining about input channels < 2, both when running pulseaudio only and jack+pulseaudio. Setting duplex=0 didn't help. I did manage to get it to boot once by hard setting input channels in the jack config, but output didn't work.

    Setting audio='jack' and duplex=0 didn't work either. It now segfaults because it can't connect to input ports = 'system'. This was supposed to be partially fixed via #15, since pyo has no reason to connect to inputs when duplex=0, but the fix does not work for me.

    This is a problem, because:

    1. It is a common setup and having it be broken is a barrier for people trying out pyo as well as those who wish to distribute projects using pyo.
    2. duplex=0 doesn't work as intended.
    3. A segfault is not an acceptable failure mode.

    I've managed to work around the issue with:

    s = Server(duplex=0,audio='jack')
    s.setJackAuto(False,False)
    s.boot()
    ... connect to output programmatically or manually ...
    

    However, this is imo unsatisfactory, especially since it's not documented anywhere. I recall having this same issue when attempting to try out pyo many months back, and not having the time/motivation to debug at the time, concluded that it wasn't worth the time to do so just to try it out.

    This is not intended to be harsh, btw, although my LKML-influenced style might make it read that way ;) Please assume that I'm thrilled that someone took the time to create this.

    opened by paulie-g 10
  • In the last built _.ctrl() does not work properly on macOS

    In the last built _.ctrl() does not work properly on macOS

    I've just built the pyo package on macOS (13.1 arm and 10.4 intel) with the current version successfully (by fixing self.pos issue) but _.ctrl() does not work correctly. To reproduce run for instance pyo/examples/03-generators/02-band-limited-oscs.py; after start a sound is produced but the LFO controls freq and mul do not work. If you change e.g. freq the sound does not change unless you close the control window.

    opened by Bibiko 0
  • Installing on Win11, Py3.11.0

    Installing on Win11, Py3.11.0

    Hello. I strongly wish to try this beautiful module but I'm not able to install on Windows 11, under my version of Python which is the 3.11.0 I tried to follow the user guide to install but I have several errors with pip. How can I do? Many thanks. Gabe.

    opened by GabrieleBattaglia 7
  • Invalid sample rate when using ASIO driver

    Invalid sample rate when using ASIO driver

    I am trying to use the ASIO driver, as I need very low latency with audio being recorded straight in, and sent straight out again. However, when doing this, this error comes up:

    Portaudio error in Pa_OpenStream: Invalid sample rate

    Here is my code:

    from pyo import *
    pa_list_devices()
    s = Server(winhost="asio", sr=44100)
    s.boot()
    s.start()
    mic = Input().play().out()
    h = Harmonizer(mic).out()
    
    
    while True:
        pass
    

    I have tried with 44100, 48000, and many other sample rates. My settings show my microphone is 44100, 2 channel 16bit.

    opened by MiniMinnoww 1
  • Wxpython 4.2.0

    Wxpython 4.2.0

    I am using WXpython 4.2 , the Scope provide an error but the program is working. The error appears each time the scope box is resized. I read that pyo support Wxpython 4.0.7 but I do not succeed in going back to this release. ( Mac OS 12.6 ) Is it still the case or 4.2 is now supported ?

    Traceback (most recent call last): File "/Users/emmanuel/PycharmProjects/pythonProject2/venv/lib/python3.10/site-packages/pyo/lib/_wxwidgets.py", line 429, in OnPaint rec = wx.Rect(0, self.pos - self.knobHalfSize, w, self.knobSize - 1) TypeError: Rect(): arguments did not match any overloaded call: overload 1: too many arguments overload 2: argument 2 has unexpected type 'float' overload 3: argument 1 has unexpected type 'int' overload 4: argument 1 has unexpected type 'int' overload 5: argument 1 has unexpected type 'int' overload 6: argument 1 has unexpected type 'int'

    opened by Manu197-pn 2
  • SfPlayer doesn't work

    SfPlayer doesn't work

    I do not succeed in using SfPlayer. When I run the example or any other program I get the following error. I am using Mac OS 12.6. Python 3.1 It is working when loading the file in ram and reading the table.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "/Users/emmanuel/PycharmProjects/pythonProject2/venv/lib/python3.10/site-packages/pyo/examples/04-soundfiles/01-read-from-disk.py", line 24, in sf = SfPlayer(path, speed=[1, 0.995], loop=True, mul=0.4).out() File "/Users/emmanuel/PycharmProjects/pythonProject2/venv/lib/python3.10/site-packages/pyo/lib/players.py", line 118, in init SfPlayer_base( SystemError: <class '_pyo.SfPlayer_base'> returned a result with an exception set

    opened by Manu197-pn 1
  • Provide some information about

    Provide some information about "temp_libs" on Mac OS X when building wheels.

    When building a wheel on the darwin platform, setup.py expects various libraries to be in the non-existent folder temp_libs. It would be helpful to include some information about the intended use.

    The following works for me (Mac OS X 12.5.1):

    port install portaudio portmidi libsndfile liblo
    ln -s /opt/local/lib temp_libs
    python setup.py bdist_wheel
    

    Otherwise I get a rather cryptic error message

    error: can't copy 'temp_libs/liblo.7.dylib': doesn't exist or not a regular file
    

    (At least it was cryptic until I figured out that setup.py was looking for temp_libs.)

    opened by mforbes 1
Python audio and music signal processing library

madmom Madmom is an audio signal processing library written in Python with a strong focus on music information retrieval (MIR) tasks. The library is i

Institute of Computational Perception 1k Dec 26, 2022
Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.

Summary Pyroomacoustics is a software package aimed at the rapid development and testing of audio array processing algorithms. The content of the pack

Audiovisual Communications Laboratory 1k Jan 9, 2023
An audio digital processing toolbox based on a workflow/pipeline principle

AudioTK Audio ToolKit is a set of audio filters. It helps assembling workflows for specific audio processing workloads. The audio workflow is split in

Matthieu Brucher 238 Oct 18, 2022
PyAbsorp is a python module that has the main focus to help estimate the Sound Absorption Coefficient.

This is a package developed to be use to find the Sound Absorption Coefficient through some implemented models, like Biot-Allard, Johnson-Champoux and

Michael Markus Ackermann 8 Oct 19, 2022
nicfit 425 Jan 1, 2023
Scalable audio processing framework written in Python with a RESTful API

TimeSide : scalable audio processing framework and server written in Python TimeSide is a python framework enabling low and high level audio analysis,

Parisson 340 Jan 4, 2023
All-In-One Digital Audio Workstation and Plugin Suite

How to install Windows Mac OS X Fedora Ubuntu How to Build Debian and Ubuntu Fedora All Other Linux Distros Mac OS X Windows What is MusiKernel? MusiK

j3ffhubb 111 Sep 21, 2021
F.R.I.D.A.Y. ----- Female Replacement Intelligent Digital Assistant Youth

F.R.I.D.A.Y. Female Replacement Intelligent Digital Assistant Youth--Jarvis-- the virtual assistant made by python Overview This is a virtual assistan

JIB - Just Innovative Bro 4 Feb 26, 2022
A Simple Script that will help you to Play / Change Songs with just your Voice

Auto-Spotify using Voice Recognition A Simple Script that will help you to Play / Change Songs with just your Voice Explore the docs » Table of Conten

Mehul Shah 1 Nov 21, 2021
Oliva music bot help to play vc music

OLIVA V2 ?? Requirements ?? FFmpeg NodeJS nodesource.com Python 3.7+ PyTgCalls Commands ?? For all in group /play - reply to youtube url or song file

SOUL々H҉A҉C҉K҉E҉R҉ 2 Oct 22, 2021
This is an AI that runs in the terminal. It is a voice assistant that can do common activities and can also help in your coding doubts like

This is an AI that runs in the terminal. It is a voice assistant that can do common activities and can also help in your coding doubts like

OneBit 1 Nov 5, 2021
SolidMusic rewrite version, need help

Telegram Streamer Bot This is rewrite version of solidmusic, but it can't be deployed now, help me to make this bot running fast and good. If anyone w

Shohih Abdul 63 Jan 6, 2022
Python module for handling audio metadata

Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, MP4, Monkey's Audio, MP3, Musepack, Ogg Opus, Ogg FLAC, Ogg Speex, Ogg The

Quod Libet 1.1k Dec 31, 2022
Speech recognition module for Python, supporting several engines and APIs, online and offline.

SpeechRecognition Library for performing speech recognition, with support for several engines and APIs, online and offline. Speech recognition engine/

Anthony Zhang 6.7k Jan 8, 2023
:speech_balloon: SpeechPy - A Library for Speech Processing and Recognition: http://speechpy.readthedocs.io/en/latest/

SpeechPy Official Project Documentation Table of Contents Documentation Which Python versions are supported Citation How to Install? Local Installatio

Amirsina Torfi 870 Dec 27, 2022
Accompanying code for our paper "Point Cloud Audio Processing"

Point Cloud Audio Processing Krishna Subramani1, Paris Smaragdis1 1UIUC Paper For the necessary libraries/prerequisites, please use conda/anaconda to

Krishna Subramani 17 Nov 17, 2022
Telegram Voice-Chat Bot Written In Python Using Pyrogram.

Telegram Voice-Chat Bot Telegram Voice-Chat Bot To Play Music From Various Sources In Your Group Support All linux based os. Windows Mac Diagram Requi

TheHamkerCat 314 Dec 29, 2022
Mopidy is an extensible music server written in Python

Mopidy Mopidy is an extensible music server written in Python. Mopidy plays music from local disk, Spotify, SoundCloud, Google Play Music, and more. Y

Mopidy 7.6k Jan 5, 2023
Mina - A Telegram Music Bot 5 mandatory Assistant written in Python using Pyrogram and Py-Tgcalls

Mina - A Telegram Music Bot 5 mandatory Assistant written in Python using Pyrogram and Py-Tgcalls

null 3 Feb 7, 2022