Howdy, Stranger!

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

Supported by

a few suggestions and questions

edited September 2011 in OpenSesame
Hi Sebastian,

I have just taken a test drive of OS. It has lots of potential. The GUI programming environment is pretty intuitive, making it is easy for many folks to be up and running quickly. Inline coding provides useful flexibility. Here are some suggestions and questions:

Would it be possible to at a function to read the header of audio files to grab the parameters (sampling rate, channels) to play them back as recorded? Currently it uses what I assume are pygame defaults. I am pretty sure QT4 can take care of this. Values could be set manually using the mixer.

synth_inline_example: Generates an error upon start up complaining about a missing response module. I could not find documentation about one in the inline-code portion of the web site.

Expanding on the above, it would be great if you could include an example, perhaps an expanded version of the above, in which parameters (text, sound file names) are read from an external text file (which is why I looked to the inline example to begin with) and used in the experiment itself. In particular, which tasks should be placed in the "prepare" phase, and can there be more than one "prepare" phase?

Comments

  • edited 6:38PM

    Hi Mark,

    Thank you for your interest in OpenSesame!

    synth_inline_example: Generates an error upon start up complaining about a missing response module. I could not find documentation about one in the inline-code portion of the web site.

    It was still using the old system, but it's strange that it didn't work for you. openexp.response should be deprecated, but still functional. At any rate, I fixed it so the example should work now: synth_inline_example.opensesame.

    In particular, which tasks should be placed in the "prepare" phase, and can there be more than one "prepare" phase?

    It's probably a good idea to add some more documentation about that. The basic idea is simple: Every item has a prepare phase and the idea is that all the time-consuming stuff is done there. For example, generating a sound would be done in the prepare phase, so that during the run phase you would only have to play it back. And the same with preparing and showing a sketchpad. This way you prevent timing issues during the run phase. There's some info about it in the feedback documentation (link), because it's also an issue there.

    But your question is a bit too broad :-) If you ask about a specific task I could tell you, but the general rule of thumb is to put the preparatory stuff in the prepare phase.

    Would it be possible to at a function to read the header of audio files to grab the parameters (sampling rate, channels) to play them back as recorded? Currently it uses what I assume are pygame defaults. I am pretty sure QT4 can take care of this. Values could be set manually using the mixer.

    Something along those lines could probably be done, yes. Right now it simply opens the mixer at 48Khz, and if samples don't match that they will be played back at an incorrect speed. So, room for improvement there.

    Expanding on the above, it would be great if you could include an example, perhaps an expanded version of the above, in which parameters (text, sound file names) are read from an external text file.

    That's certainly possible with a bit of inline code, but wouldn't it be more sensible to handle that type of stuff with variables in the loop table? Is there a specific reason why you would want to read variables from an external source?

    Kindest regards,
    Sebastiaan

  • edited 6:38PM

    Perhaps I do not appreciate the power of the loop table. I understand the use of the loop, setting cycles, but only so far as the example code lays them out. Let's say I have a 300-trial exp with a different pair of visual and audio stimuli presented on each trial. I have about six parameters that index each trial on various dimensions. I want all of this information saved with the participant's response on each trial for analysis. Reading from the text file simplifies coding the exp, which amounts to no more than reading and writing variable assignments. I am having difficulty understanding how to integrate this with OS. Thanks.

  • edited 6:38PM

    In the loop you can create a table, where each row corresponds to a trial and each column corresponds to a variable. During every cycle, the loop selects (randomly or sequentially, depending on the order setting) one row from the table and uses this to set the independent variables for that cycle.

    Does this make any sense? Have you taken a look at the tutorial? Following the tutorial gives you some hands on experience with loops and loggers: tutorial [PDF].

  • edited 6:38PM

    Thanks, Sebastiaan. I had not realized I could copy a tab-delimited file (table) into those fields. My focus was on understanding how to set up an exp using the code, not the GUI. I generally prefer not to embed such information (i.e., table values) in the program itself, but it does have some advantages.

    One last question, pertaining to an item above. To alter the sampling rate, can I just add a call to the mixer in a prepare phase and omit a corresponding run phase, since the latter is not needed? That is, it is not needed because I do would not need to customize anything else.

    Keep up the good work, and thank you very much for responding to my queries.

  • edited 6:38PM

    I usually recommend the loop table, particularly to users that are not very experienced programmers. But of course you can also work out your own system with reading a text file and setting variables in a script. In that case you could use numpy.loadtxt() in combination with the OpenSesame functions for setting variables:

    You can change the samplerate of the mixer. It's not the epitome of elegance, but this will do the trick (best placed in the prepare phase of an inline_script at the top of the experiment):

    import pygame
    print "Before:", pygame.mixer.get_init()
    pygame.mixer.quit()
    pygame.mixer.init(frequency=22050) # Use your preferred samplerate
    print "After:", pygame.mixer.get_init()

    Hope this helps!

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