Howdy, Stranger!

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

Supported by

[open] How to presented a synth tone midway through a visual refresh.

edited November 2012 in OpenSesame

Hi all,

Sorry about the dodgy title. I'll attempt to clarify.

Let's use the following scenario. If I'm using a 60Hz monitor the refresh rate is around 16.6ms. Let's say, for example, I wanted to present a 7ms tone after 10ms of a sketchpad presentation (which is held to the screen for one frame, i.e. 16.6ms) how would I go about getting this degree of control?

At the moment by placing the tone before a sketchpad the tone is presented at the exact beginning of the following sketchpad presentation but I ideally would desire a little more flexibility. I'm guessing an inline script may need to be used but I'm quite unsure of how to go about it.

Thanks,

Boo.

Comments

  • edited 9:07AM

    Hi Boo,

    In theory, you could simply specify a 10ms duration in a sketchpad and have it followed by a synth item. But ... I'm afraid that the temporal precision of auditory stimuli is not sufficient to realistically get this type of temporal control. A useful benchmark can be found on the Expyriment wiki, but the results from that test are probably better than you would get with most (cheap) hardware.

    So the bottom line is that presenting auditory stimuli with millisecond precision control will be tricky. I'm not saying it's impossible (probably not), but it will require good hardware, a good Python module (not PyGame, which is used now), and lots of testing! A bit disappointing, I know.

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 9:07AM

    Thanks for the prompt reply.

    I was wondering if there might be a cheeky way around this issue in the following fashion. Would it be possible to create a, say, 10ms synth tone with volume at zero, present that and have it followed with the 7ms tone with actual volume during the same sketchpad?

    That way we'd get the 7ms tone effectively presented 10ms into the 16.6ms sktechpad. Does that make sense?

    Boo.

  • edited 9:07AM

    Hi Boo,

    That's a clever solution, but you still can't be sure of the timing: the benchmark Sebastiaan is referring to shows a latency of max. 20 ms, with a jitter of about 5 ms. So you still wouldn't be able to control the onset of your 'silent tone' and therefore you will not be able to precisely present the audible part of your tone :(

    Good luck, though!

    Edwin

  • edited 9:07AM

    I thought about it for a bit, and one way I can think of to get millisecond precision sound playback is by connecting a simple sound device to the serial port. For example, an Arduino-based sound generator, as here: http://arduino.cc/en/Tutorial/Tone

    I realize that this is a hassle to make, of course, unless you happen to have a good technical department at the uni. But it's an option, and likely to give more temporal accuracy than you would ever get using the soundcard of your PC.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.