Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 16 of 16

Thread: TTL insertaion

  1. #1
    Join Date
    Jun 2006
    Posts
    18

    TTL insertion

    I'm trying to create a movie and then have a TTL signal be sent at a specific moment during the movie (e.g. when the filmed person says "welcome"). Is there any way I can embed a TTL in a movie? If not, perhaps I can create the movie so that I would want the TTL sent at a specific time (say at 10s after the movie begins). Is there any way a TTL can be sent after a specified period of time?

    Thanks!

  2. #2
    Join Date
    Nov 2005
    Posts
    3,328
    No. But you could send one at the onset of the movie and have it stop at a specified period of time--would that work for you? If so, just send the TTL signal before the movie and specify the duration in milliseconds. The movie will start in synch with the signal and the value at the port address will return to its pre-movie state after the specified time elapses.

  3. #3
    Join Date
    Jun 2006
    Posts
    18
    Unfortunately that won't work. We use TTLs for an EEG system and my EEG hardware only recognizes the start of a TTL... Is there any way to "hardcode" a TTL into a movie? Any other way around this? I imagine this could be useful for people who do work with psychophysiology and want to "time-lock" the response to a specific event in a movie.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,328
    Actually, it just occurred to me that you could do this the way you want. Show the movie with a time value of 0ms. THEN insert a blank stimulus "~" with a LOC value of "0,0,0" with a time value that corresponds to when you want the TTL signal to occur. THEN send the TTL signal. I think that ought to do it.

  5. #5
    Join Date
    Jun 2006
    Posts
    18
    OK. Let me see if I understand the logic. Let's say I want to show a 15 second movie, and I want a TTL sent at 9.8 seconds. To do this I would show the movie with a time of 0, and then send an empty stim with a time value of 9800 (the movie will still show because we didn't clear the previous screen, right?), ans then send a TTL at port 888 for say 5ms. Is this right? Also, will the movie play till the end of the 15 ms?

    Thanks!

  6. #6
    Join Date
    Nov 2005
    Posts
    3,328
    Yes, I expect that is how it would play out.

  7. #7
    Join Date
    Nov 2008
    Posts
    1

    Does the above really work?

    Hi. I discovered this thread while working on the same problem: trying to send a TTL during the display of a movie (.avi) stimulus----e.g., the movie we wish to display is about 6 seconds long and we wish to deliver a TTL to an external device during this 6-second clip. I've tried the suggested work-around but (a) the movie gets cut short or doesn't play at all and (b) the TTL is not successful... advice? thx in advance!
    cheers

  8. #8
    Join Date
    Nov 2005
    Posts
    3,328
    Thanks for the info--would you mind posting your input file so I can try running it here? Please zip and attach any necessary files to replicate the problem.

  9. #9
    Join Date
    Jun 2006
    Posts
    18

    Doesn't work for me either

    I have finally come around to trying this, and it didn't work for me either. It seems like the empty stim (~) is replacing the video so that the video only shows for a short period of time (a few milliseconds). I haven't yet tested whether the TTL will send (I'm not at my EEG machine right now). Obviously this won't for me. I've attached the file and I used as an example. I'd appreciate your help with this as soon as you can--I thought this work-around was going to work and we're setting to start running our study soon. Yikes!
    Attached Files Attached Files

  10. #10
    Join Date
    Nov 2005
    Posts
    3,328
    Can you attach the input and style files also--I'm just seeing the video and an instructional text file in the zip. Also, can you confirm the version of DirectRT and Windows that you are using? Another helpful test would be to run the identical input file but using a another text stimulus in place of the movie. e.g., ~text1 then ~text2 sort of thing. Would be useful to know if it's a problem specific to videos or if the initial text would also disappear.
    Last edited by jarvis24; 01-26-2009 at 01:26 PM.

  11. #11
    Join Date
    Jun 2006
    Posts
    18
    Not sure what happened there; I thought I attached everything. I've now attached the input file, a stim folder (with instructions and .avi file), and the style file.

    I'm using the latest V2006 version (2.0.28). I also tried using a ~text and it seemed to work, so perhaps this is something specific to .avi files (I've also attached the test with a text file). Please have a look and let me know.
    Attached Files Attached Files

  12. #12
    Join Date
    Nov 2005
    Posts
    3,328
    I see what you mean. I get the same thing running it here on XP with v2008. So short answer is that it looks like you can't do it. However, I'm going to check to see if the beta for v2010 can handle it.

    Update--the beta does not do it either. I will see if we can get it to work, but for now, there doesn't seem to be a quick solution.
    Last edited by jarvis24; 03-11-2009 at 05:01 PM.

  13. #13
    Join Date
    Jun 2006
    Posts
    18
    That's really too bad...

    Is there any way this option can be programmed in? I realize this is a difficult problem, so another option is that I can pay for Empirisoft's programming services to program this extra functionality into DRT. Is this possible? I REALLY want to do this project...

  14. #14
    Join Date
    Jun 2006
    Posts
    18
    Hi-- I think I have finally found a way to make this work, but I need to verify that DRT can handle this accurately. The first step is to get the exact time I need the TTL to be inserted in the movie, starting from the movie onset. Once I know this time, I can manually add a trigger code into my EEG program. So, for example, if I need a TTL of "101" at 5.987 after the onset of a specific movie with TTL code "100," I will simply add this TTL whenever I see a trigger code of 100. I think this is straightforward. The only way to make this work, though, is if I know the TTL that is sent at the onset of the movie (something I can now do with DRT) is accurately timed. That is, this solution will be screwed up if, for example, the TTL is sent and then the movie plays after a few hundred milliseconds because of processing delays. Can you please confirm that a TTL set at the onset of an .avi file will indeed be sent at time 0 of the movie. Do I need to make sure the movie is under a certain file size to ensure this will happen?

  15. #15
    Join Date
    May 2009
    Posts
    1

    related problem

    I have a related problem using DirectRT 2006. I plan to show a series of 15,000ms videos. On each trial, participants will have to make a response at some point during the middle of the video. However, I want the video to play for the full 15,000ms. I am looking to have two TTLs sent for each trial. I want one TTL sent when the video starts and another TTL when participants' make their response. In other words, I want to examine the data when the video starts (i.e., stimulus locked) and when participants make a response (i.e., response locked).

    Is there a work-around when the response in the video is not fixed?

  16. #16
    Join Date
    Nov 2005
    Posts
    3,328
    First, Mickeyi--yes, you should be able to count on the ttl signal and the movie signal being sent out simultaneously at the onset of the video--i.e., with no lag due to processing/loading of the video clip.

    Second, Jvanbavel, your second question regarding whether you could get a ttl signal to accompany the subject's response at some point *during* the movie can be answered, yes. Details are here:

    http://www.empirisoft.com/Support/showthread.php?t=273

    See in particular the sections on echoing ttl signals (revisions 2008.1.13 and 2008.1.18). Mickeyi helped us with the development of that feature so he may have some info to help you on this also if you need it.

Similar Threads

  1. TTL unsolved problems
    By mugur65 in forum MediaLab Older Versions: Troubleshooting
    Replies: 2
    Last Post: 06-22-2023, 03:27 AM
  2. TTL response accuracy
    By duindain in forum DirectRT Older Versions: General Questions
    Replies: 3
    Last Post: 08-04-2008, 05:04 PM
  3. Problems with TTL
    By mugur65 in forum MediaLab Older Versions: Troubleshooting
    Replies: 2
    Last Post: 04-27-2007, 12:49 PM
  4. TTL signal to Biopac
    By XeniasD in forum MediaLab Older Versions: Troubleshooting
    Replies: 1
    Last Post: 12-15-2006, 02:26 PM
  5. TTL signal to Biopac
    By XeniasD in forum Hardware: Troubleshooting
    Replies: 1
    Last Post: 12-15-2006, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •