Howdy, Stranger!

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

Supported by

[open] multisensory timing

edited March 2014 in OpenSesame

Hi all,

I'm making an audiovisual temporal order judgement task and I've run into some timing issues. I am currently working on a 60Hz LCD and my experiment will eventually run on a 120 Hz LCD (to which I will adapt the current SOA's).

First an array of dots is presented that all have the same color. Then, one of them changes color and a sound is played at different SOA's from the color change (-166, -116, -50, -33, -16, 0, 16, 33, 50, 116, 166 ms).

Each array is built up of 49 dots or "stim"s, the piece of code below is the part where one of the stims is assigned a color change and is then presented, with a preceding, following or simultaneous sound, depending on the SOA. I'm using time_audio to get a time stamp of the audio presentation and time_viz to get a time stamp of the visual presentation:

    # Flip the color of the target 
stim, x, y, col = l_stim[0]
col = col_t
stim.setColor(col)
l_stim[0] = stim, x, y, col

# Draw all stimuli (doesn't show it yet)
for stim,x,y,col in l_stim:
    stim.draw()

# Play a sound and show the target color change
if SOA == -166 or SOA == -116 or SOA == -50 or SOA == -33 or SOA == -16:
    my_synth.play()
    time_audio = self.time()
    self.sleep(abs(SOA))
    win.flip()
    time_viz = self.time()

elif SOA == 166 or SOA == 116 or SOA == 50 or SOA == 33 or SOA == 16:
    win.flip()
    time_viz = self.time()
    self.sleep(abs(SOA))
    my_synth.play()
    time_audio = self.time()

else:
    my_synth.play()
    time_audio = self.time()
    win.flip()
    time_viz = self.time()

Using these time stamps I've checked the real SOA (time_audio - time_viz) vs. the programmed SOA. In trials with a negative and 0 SOA (when the audio stimulus comes before the visual stimulus or should be presented simultaneously) there is a relatively constant error of about 5 ms:

Instead of -166, -116, -50, -33, -16, 0 the values that I'm getting for time_audio - time_viz are (rounded to 1 ms) -171,5, -121,0, -55,2, -38,3, -21,6 and -4,6. I looks to me like the presentation of the visual stimulus is delayed.

Questions:

1.- Am I getting the time stamp corresponding to the actual presentation of the stimuli, or am I getting something else with this script?

2.- Can I avoid this issue with better programming?

Many thanks in advance for any pointers!

Cheers,
Raquel

Comments

  • edited 8:14PM

    Hi Raquel,

    In general, audio timing is a bit more difficult than visual timing! For your visual timing: win.flip() blocks until the vertical refresh starts, so the timestamp time_viz gives you almost the exact moment of the start of the vertical refresh.

    With audio, that's a bit trickier! Depending on your sound card, there can be delays up to tens of milliseconds between calling my_synth.play() and the actual sound playback. This issue has been discussed before, and a solution has been found in this setup.

    To answer your questions directly: 1) most likely they are not, and 2) no, this is more of a hardware issue. The only way to resolve it via your code, is to measure the delay between calling my_synth.play() and the sound onset. If this is a stable delay (with a low variation), you could let the system sleep for a bit to compensate for this. But please refer to the forum thread and the report I link to.

    Good luck!

  • edited 8:14PM

    Hi Edwin,

    Thanks for your reply. Its very useful, but somewhat bad news as I have my first sub's tomorrow... Do you know of any way I can measure the delay using code or is it only possible using an external device?

    Cheers,
    Raquel

  • edited 8:14PM

    Hi Raquel,

    Usually, these kind of things are measured using an oscilloscope. You simply cannot do it just by code, the oscilloscope is there to measure when the sound is actually produced. Some oscilloscopes can be interfaced with using the serial port on your computer. So the way to test the delay would be to compare time between a trigger sent via the serial port with the onset of the sound according to the oscilloscope.

    Probably best to check with the department's technician, or via the link to the setup that I gave in my previous post.

    Good luck!

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