Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] PyO in OpenSesame

edited October 2015 in OpenSesame

Dear coders/researchers,

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 :-).

Cheers,

Malte

Comments

  • edited 12:32PM

    Hi Malte,

    PyO looks very nice. Please let me know how this works for you, because it could be something to use by default in OpenSesame. (The PyGame sound module is quite poor.)

    What might happen in your case is that the pygame sound mixer causes trouble. This would explain why the code works when entering it in the debug window, but not when embedded in an experiment.

    If, in the debug window, you enter the following lines before anything else, does s.start() freeze as well?

    import pygame
    pygame.mixer.init()
    

    Cheers,
    Sebastiaan

  • edited 12:32PM

    Hi Sebastiaan,

    thanks for the quick reply. The s.start()-command from PyO still works (from the debug) window when pygame is imported first and the mixer is initialized before any PyO-related commands are given.

    Is it possible to try this the other way around by *disabling" the pygame mixer before calling the PyO commands?

    Moreover, I noticed in the debug window that another mixer had been initialized. The line reads : openexp.sampler._legacy.init_sound(): mixer already initialized. This mixer seems to be rooted in the legacy backend, right? Might that be a hint?

    Or have you any other suspects in mind?

    Thanks in advance,

    Malte

  • edited 12:32PM

    Hi Sebastiaan, hi all,

    any ideas on how to tackle the problem with Pyo? I get the same problem on a Windows (7) machine: the s.start() command works from the debug window but freezes OS when run from an inline script item. I have not tried it on linux yet, which might be an alternative for me. Changing the backends (as part of a desperate attempt to fix it :-)) has no effect either.

    I read here that PsychoPy uses Pyo as sound library. Is that where the problem is rooted? I will try to find hints in the PsychoPy documentation, but perhaps you have an idea if that might be the case.

    As a rather quick & dirty workaround: Is it possible to (temporarily) disable all modules/processes etc. that OpenSesame natively uses to present sounds? All sound presentation should be handled by Pyo in my experiment, so that would cause no problem.

    I really hope that Pyo will work from within OS.

    Thanks a lot in advance!

    Cheers,

    Malte

  • edited 12:32PM

    Hi all,

    Got the same problem on debian linux. First tried it with psychopy, which results in a freeze of opensesame (pygame works correctly with psychopy) and then directly through pyo which ends the experiment when it reaches the pyo code.

    Anyone solved this problem already?

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games