Howdy, Stranger!

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

Supported by

[open] Using Video as Stimuli: how to bind key responses and sound onset to specific frames

edited May 2014 in OpenSesame

Hi there,

First of all thanks for putting out this great program! Quick question: in PsychoPy it is possible to start recording keypresses at certain frames. My experiment uses a paradigm where I need a 'beep' played at a certain frame (the first after an edit) and the participant will then press a button, the RT time of which also needs to be recorded. How do I anchor the keypress, the recording, and the sound to a certain frame?

Regards,
Marnix

Comments

  • edited 7:15PM

    So anyone used video as stimuli before in Opensesame? I was hoping to solve it in the PSychoPy builder but the latency is so big it is nigh unusable, so I'll need to rerun the experiment in OpenSesame anyhow. I am guessing it must be really easy to do, I just have 0 computer skills. You'd be really helping me out if you culd answer my question! :)

  • edited 7:15PM

    Hi Marnix,

    There are a few video-player plug-ins available for OpenSesame, the best developed of which is probably the media_player_gst plug-in by @dschreij. You can find the installation instructions in the readme, here:

    Assuming that you're using the media_player_gst, the easiest thing to do is probably to set the duration to 'keypress'. This way you can easily collect the response, response time, etc, from the start of the video. (I actually experience some issues with this on my Linux system, but they might be Linux specific. If you experience trouble as well, please post a detailed description here.)

    To get the response time relative to a specific frame, you simply subtract a value (based on the frame number and duration) from the regular response time during the analysis. So you do this during data analysis, and not during the experiment itself.

    Regarding the beep: The easiest solution would be to embed the sound in the video itself. Is that what you're planning to do? Otherwise, you'll have to do things in parallel, which makes the experiment slightly more complex (but it's possible too).

    Cheers!
    Sebastiaan

  • edited July 2014

    Hi Sebastiaan,

    Thank you for your response! I think your suggestions are great and I added them to the mix. I have however two small problems I kept running into (and by now, I have tried for weeks already fiddling with all the settings/possible solutions I could think of):

    • The video does not run in full screen mode, and when it does, it is so laggy or . This is funny since in windowed mode it works fine (and thats what I do now, so its not a major issue).

    • More importantly, I keep having a problem of having key response/time being duplicated. At first, the first and second response would apparently be exactly the same, while the rest of the responses would be perfect (i.e. 1280 ms, 1280 ms, 3245 ms, 5431 ms etc) whereas with some fiddling, this will change the order of which response is duplicated (for instance 1280ms, 1344 ms, 1344ms, 4356ms, 6785ms, etc.). Adding reset feedback buttons does nothing to prevent this. When I remade the experiment in the exact same manner it now doesn't register the first keyresponse! I am at a bit of a loss here since it seems quite random, and the sequences are exactly the same save the video file being used.

    I can upload a picture if this would help with the output. Cheers and thank you very much!

  • edited 7:15PM

    Hi Marnix,

    The video does not run in full screen mode, and when it does, it is so laggy or . This is funny since in windowed mode it works fine (and thats what I do now, so its not a major issue).

    This is because some back-ends use OpenGL when running in fullscreen mode, which can, in some cases, slow things down. You should be able to work around this by switching to the legacy back-end, or by setting "Use OpenGL" to no in the xpyriment back-end (under back-end settings).

    More importantly, I keep having a problem of having key response/time being duplicated. At first, the first and second response would apparently be exactly the same, while the rest of the responses would be perfect (i.e. 1280 ms, 1280 ms, 3245 ms, 5431 ms etc) whereas with some fiddling, this will change the order of which response is duplicated (for instance 1280ms, 1344 ms, 1344ms, 4356ms, 6785ms, etc.).

    Could you describe in a bit more detail how you are collecting responses, or post some informative screenshots? I.e. what does your trial sequence look like, how do you collect and log the responses, etc

    Cheers!
    Sebastiaan

  • edited 7:15PM

    Hi Sebastiaan, Thank you for your Help!

    The data response is the space bar on a wireless usb keyboard. The video is displayed on an External Monitor connected to my laptop, and the USB keyboard is also connected to the laptop. Of course, I am not using the keyboard during data gathering! ;)

    So, the first setup is this:
    image

    and here is the logger
    image

    This is the outcome:
    image

    As you can see, 2 and 3 are the same, and they are in every trial.

    So I tried to remove the text in the beginning, and I get this:
    image

    it doesnt measure the 1st keypress.

    I tried to make a completely new one:

    image

    and I get this Error:

    image

    What I noticed from the last time screwing around with it, is when I used the standard logger which automatically detects and logs the variables, is that it would log the text display as the first item logged, not the 1st keypress in the video. But I have no idea how to change that.

    Thank you again! And I think by now I owe you a beer if you ever go to Amsterdam ;)

  • edited 7:15PM

    Hi Marnix,

    It looks like the logger sometimes precedes the media_player_vlc item. Since OpenSesame works sequentially, this means that you log before collecting a response. This probably explains your duplication issue, because the response variable will still have the value from the previous response.

    You also have multiple logger items. This is not necessary and leads to repetition of column headers in your data file.

    So basically: Use the same logger item in all your sequences, and have it be the last item in every sequence.

    Does that resolve your issue?

    Cheers,
    Sebastiaan

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