Howdy, Stranger!

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

Supported by

Sampler unable to select certain values from the loop

Hello,

recently I've been trying to create an experiment in OpenSesame. Its goal was to measure reaction time based on visual and auditory stimuli. I made a loop with two columns: one named "stimuli", where, in total, I have put 40 values such as "cat, dog, forest, water, cat1.wav, dog1.wav, forest1.wav, water1.wav", and the latter named "type", where I have put values "text" next to regular values, and "sound" next to values that end with "1.wav". The loop is composed in such a way because it is supposed to randomly show words and play sounds (e.g. 3 written words in a row, 1 spoken word, or 1 spoken word, 1 written word, 2 spoken words in a row. etc.) Were I to create a loop where regular values are in one column, and "1.wav" values are in another column, the program would play written word / spoken word / written word / spoken word alternately, such pattern would make the experiment too predictable (even in loop's order set to random). I have both sketchpad (for written words) and sampler (for spoken words) inserted into sequence (which is inserted into the loop itself). The thing is, when I try to run the experiment, it crashes the moment the sampler tries to play a value from the loop other than the ones that have 1.wav in them.

The problem is, the sampler finds it difficult to filter out non-1.wav value names. It is worth mentioning that both sktechpad and sampler have a{stimuli} variable written into them (textline element for sketchpad and sound file for sampler), whereas this doesn't happen to be a problem in the sketchpad, since it ignores 1.wav values by simply putting [type] == "text" into sketchpad's Show if statement, unfortunately Show if doesn't exist in sampler's settings. Furthermore, sequence's Run if statements either don't work correctly, or I possess expired information regarding Run if command writing. I should also mention that every time the sampler chooses a value with 1.wav in its name, the sound is played correctly, so it seems that my files in the file pool work just fine.

Is there any way (preferably without the inline script) to make it work?


Best regards.

Comments

  • edited January 26

    Hi @simon3,

    Could you provide the error you are getting from the console when it crashes? Also, if you could provide your experiment file, that would be really helpful to better understand the nature of the problem here. 

    Claire

  • Hi,

    thanks for responding. Sometimes the problem won't trigger instantly because the loop might choose values with 1.wav. That said, an error will eventually occur after a few tries.

    Traceback (most recent call last):
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libqtopensesame\misc\process.py", line 132, in run
        exp.run()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\experiment.py", line 351, in run
        self.items.execute(self.var.start)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 89, in execute
        self.run(name)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 105, in run
        self[name].run()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\sequence.py", line 48, in run
        self.experiment.items.run(_item)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 105, in run
        self[name].run()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\loop.py", line 347, in run
        self.experiment.items.execute(self._item)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 88, in execute
        self.prepare(name)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 122, in prepare
        self[name].prepare()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\sequence.py", line 88, in prepare
        self.experiment.items.prepare(_item)
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\item_store.py", line 122, in prepare
        self[name].prepare()
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libopensesame\sampler.py", line 69, in prepare
        self.sampler = OpenExpSampler(self.experiment, sample)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\openexp\sampler.py", line 36, in Sampler
        return cls(experiment, *arglist, **kwdict)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\openexp\_sampler\psycho.py", line 72, in __init__
        self._data, self._samplerate = sf.read(src)
                                       ^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\soundfile.py", line 285, in read
        with SoundFile(file, 'r', samplerate, channels,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\soundfile.py", line 658, in __init__
        self._file = self._open(file, mode_int, closefd)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\soundfile.py", line 1216, in _open
        raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
    soundfile.LibsndfileError: Error opening 'brantelot': System error.
    


  • Hi @simon3,

    It is indeed as if the sampler item is still looking for an audio file from the "stimuli" variable, even if it doesn't show up in the experiment i.e., if you explicitly add a "run if" statement in the sequence item. 

    I've run into this problem before, and a simple workaround I found to deal with the sampler's need to have a file to play even when it's not supposed to play any sound was to provide a dummy audio file ("none.wav" of 0-s duration) associated with the non-audio stimuli. 

    You would then have 3 columns : stimuli, type and filename, and use the "run if" statements for the items you want to show or not show depending on their type.

    Let me know if this solution works for you!

    Claire

  • Works just as intented.

    Thank you very much for your help!


    Cheers!

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