Search the Legacy Support Archive (up to v2020)
  1. Read-only archive (2005–2024). Posting is closed. Need help with MediaLab or DirectRT 2027? Email service@empirisoft.com.

    All words · “exact phrase” · -leave out

    Advanced search

Combining image, sound and TTL

  1. #1

    Combining image, sound and TTL

    I am having trouble setting up the following in direct RT:
    • An image displays on the screen for 6 seconds; the moment the image is displayed, a TTL signal is sent
    • During the 6 seconds the image is displayed, a 50 ms white noise plays once, at a random position during those 6 seconds
    • Concomitantly with the start of the white noise playing, another TTL signal is sent (it has to be in sync with the start of the white noise).
    Is something like this possible in DirectRT?

    Thanks!

  2. #2
    jarvis24 Blair Jarvis, Administrator
    Interesting--normally it's tough to time events within the fixed timing of other events, but this might work. Take a look at the attached revision of the standard sendTTL sample. The work-around is to create multiple versions of your white noise file--each with variable onset delays (e.g., 1 sec initial of silence, 2sec, 3sec, etc.). That way you can use compound screens to achieve the six total seconds. To achieve randomness, you can then simply randomize the trials. Anyways try it out and let me know if this is in the ballpark.

    -Blair

  3. #3
    jarvis24 Blair Jarvis, Administrator
    [edited from a related support email]

    I have programmed an experiment in which we show participants a series of muted video clips. Some of the videos are paired with a startle sound that is meant to scare the participants a bit. The videos are in AVI format and are playing fine. The startle sound is a windows media sound file, and is also played without a problem by DirectRT.

    Unfortunately I have stumbled into a problem. As soon as the startle sound file plays, the movie stops playing. This is a problem because I want to play the startle sound at different points. For instance, for a 9 second video, sometimes the startle will come at the 5th second, for other participants it may come at the 6th or 7th, but the movie should continue playing after the startle sound (which is very brief, about 500 miliseconds). How could I bypass this problem? Is it because directRT uses Windows media to play the movie and the sound files? Any help would be greatly appreciated.


    You may be able to do this by playing the sound first if you create multiple versions of the sound file--each with varying lengths of silence to start, and with time values of "0,0,0" so there is no delay between the onset of the sound file and of the video. See if the response and sample above help.

  4. #4
    The file you sent did the trick. Thank you! Mugur

    Interesting--normally it's tough to time events within the fixed timing of other events, but this might work. Take a look at the attached revision of the standard sendTTL sample. The work-around is to create multiple versions of your white noise file--each with variable onset delays (e.g., 1 sec initial of silence, 2sec, 3sec, etc.). That way you can use compound screens to achieve the six total seconds. To achieve randomness, you can then simply randomize the trials. Anyways try it out and let me know if this is in the ballpark.

    -Blair