Howdy, Stranger!

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

Supported by

[solved] Measuring accurate timing for moving stimuli (in a for loop)

edited December 2014 in OpenSesame

Hi!

First of all, I must say that Opensesame is a fantastic platform and you guys are doing an amazing job in promoting better experiment building in the field of cognitive science.

As for my question:
I'm building an experiment in which participants see moving stimuli on the screen (on top of a constant background picture) and needs to respond to the direction of the movement. I'm presenting the stimuli in a for loop with an inline code i wrote. Before running the experiment I wanted to make sure that the measure of reaction times is as accurate as possible and wrote this small test to make sure that the timing of the loop is constant.

some info: both 'scatter' and 'arrow' pictures are .png files with transparent background; also i'm running on Legacy because the other back-ends seems to not work with this type of stimuli.

start_time = self.time()

for i in range(0,150):
    my_canvas.clear()
    my_canvas.image(scatter,x=x ,y=y)
    my_canvas.image(arrow,x=x+0.3*i, y=y)
    my_canvas.show()

end_time = self.time()

I ran this test for 2 types of stimuli, 4 times each and got these results for the (end_time - start_time)
stimuli 1:
1440
1438
1438
1435

stimuli 2:
1443
1427
1427
1425

As you can see, the results show that the timing is not that exact and i'm concerned that it will reflect on the measurement of the Reaction times in my actual experiment.

Any thoughts on how to improve this?
Thanks!
Yoni

Comments

  • edited 6:24PM

    Hi Yoni,

    In principle, it should be feasible to have constant durations. To find out what's going on here, you could start by looking at the timestamps of each individual canvas presentation. This will tell you, for example, whether the problem is an occasional dropped frame, or that display presentation doesn't lock to the refresh (in which case you get frame durations that are impossible given your monitor's refresh rate), etc.

    Something like this:

    l = []
    for i in range(0,150):
        my_canvas.clear()
        my_canvas.image(scatter,x=x ,y=y)
        my_canvas.image(arrow,x=x+0.3*i, y=y)
        t = my_canvas.show()
        l.append(t)
    print l
    

    My guess is that OpenSesame just doesn't keep up, because you're not preparing anything, but redrawing each canvas on the fly. This can cause dropped frames and unpredictable jitter. There's a good chance that switching to the psycho back-end will solve the problem, because PsychoPy is a bit more efficient for these things. If not, you may have to optimize the script a bit.

    Cheers!
    Sebastiaan

  • edited 6:24PM

    Thank you very much!
    I used psychoPy (turns out I had to update my opensesame vervion) and it works perfectly.

    Yoni

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