[open] PyO in OpenSesame
I would like to use Pyo (0.7.7) for sound presentation/manipulation in OpenSesame (2.9.7) via the Inline_Script item. As OpenSesame uses PsychoPy and Psychopy (in turn) utilizes Pyo, I figured it should work. So I decided to run the Pyo examples from within OpenSesame to get a first impression.
This is the code i used:
import sys sys.path.append("/Library/python/2.7/site-packages/") sys.path.append ("/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7") from pyo import * s = Server(duplex=0).boot() s.start() a = Sine(440) a.out() time.sleep(1) a.stop()
However, OpenSesame crashes as soon as s.start() is called. Interestingly, this code (without the time.sleep(1) and the a.stop() line) correctly generates a sound if written line-by-line in the debug window in OpenSesame.
What am I missing? Is it because Pyo is already implemented in PsychoPy? Does PsychoPy provide full functionality of the Pyo features? I hope you can help me because Pyo is a wonderful module with lots of interesting features for DSP. Currently. it's running on MacOS X (10.11), but Windows is also available. So both experiences are welcome :-).