|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 5/14/2010 7:30:04 AM
Posts: 2,
Visits: 12
|
|
| Hello, Does anyone know how to send a signal to TMS with accurate timing during a video. I have a script to trigger TMS but i don't know how to stipulate the timing of the signal within the movie. Basically i have a 3sec movie in which i want to trigger TMS at the onset of a gaze shift within the movie (1sec into movie). Thank You.
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: 5/14/2012 4:43:58 PM
Posts: 728,
Visits: 2,932
|
|
That sure would be nice to do, and you would think that E-Prime could do it. But I am pretty sure that E-Prime makes this impossible. I am pretty sure that once you start playing a movie EP cannot perform any other action until the object that plays that movie completes its duration, and the movie cannot play past the duration of the object that plays it. Of course, I would be glad to hear from others on this.
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/2/2012 5:45:28 AM
Posts: 5,
Visits: 66
|
|
If you know at which framenumber the trigger has to be generated, I may have a solution ...
First set the duration of the MovieSlide at 0 .
Then Set Stop after in the general menu to No
Set End Movie Action in the same menue to Terminate
The movie will start, and immediatly the Slide will be exited ...
Then the current displayed frame may be monitored in a loop in inline-code :
CurrentFrame = MovieSlide.FramesDisplayed ...
This does not work in all versions, certainly in 2.0.8.90
The movie itself now 'runs' asynchronically with E-Prime, and to establish the moment the movie has endid, I use a trick :
FrameTimeoutCount = 10
SampleIntervalCounter = 0
GoOn = true
' Wait for movie to end ...
while GoOn
if PreviousFrameNumber = MovieSlide.FramesDisplayed then
SampleIntervalCounter = SampleIntervalCounter + 1
if SampleIntervalCounter = FrameTimeOutCount then GoOn = false
else SampleIntervalCounter = 0
end if
' at this point you may check for a pressed key or input external data or whatever ...
' in the task where I use this code, data will be input from a knob that is connected to an
' embedded system I develeoped with a PIC 18F4550, that sends analog data via USB to a DLL I developed also.
' This data is used to move a cursor on a slider on the E-Prime canvas while the movie is running ...
wend
' now continue the task ...
I hope this works for you ...
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/2/2012 5:45:28 AM
Posts: 5,
Visits: 66
|
|
Don't forget to add the next line after the while - wend-loop :
MovieSlide.Stop
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: 5/14/2012 4:43:58 PM
Posts: 728,
Visits: 2,932
|
|
David McFarlane (7/3/2009) I am pretty sure that E-Prime makes this impossible. I am pretty sure that once you start playing a movie EP cannot perform any other action until the object that plays that movie completes its duration, and the movie cannot play past the duration of the object that plays it.
For the record, I got this completely wrong (at least since 2.0.8.22), Eise got it right. I should have been more vigorous in checking my facts before posting -- that's why I keep telling people not to take my word for anything. I tested those facts just now and everything worked as Eise explained.
To add to Eise's explanation, if you really want the next object to start, say, 1000 ms into the movie, then you could set the movie Duration to 1000 (and Stop After to No, as before). Or if you want some inline code to start 1000 ms into the movie, you could play tricks with PreRelease, e.g., set Duration to 3000 and PreRelease to 2000. Or if you want some inline code to start immediately during the movie (say, to detect some signal from external equipment), either set Duration to 0 as before, or set PreRelease to the same as Duration -- each method has pros & cons, depending on your programming style.
But again, don't take my word for any of this .
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: 5/14/2012 4:43:58 PM
Posts: 728,
Visits: 2,932
|
|
Eise (5/10/2011) Don't forget to add the next line after the while - wend-loop
But please, *please* do NOT use While-Wend!!! While-Wend has been deprecated since the 1990s, and has been fully replaced by Do-Loop (see the E-Basic Help facility). While-Wend should never have been included in E-Basic -- it was kept in VBA (from which E-Basic is derived) only to allow migration of legacy VBA programs, but since E-Basic had no legacy programs to migrate, it should never have allowed While-Wend in the first place. So please, please everyone, get on board with current programming practices and use Do-Loop in your VBA/E-Basic code.
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/2/2012 5:45:28 AM
Posts: 5,
Visits: 66
|
|
Sorry, I did not know I would hit a nerve using while-wend 
I was not aware of the fact that it had been banned since I programmed in Basic (indeed about 20 years ago).
Since than I only used several assemblers, C, C++ and Delphi ...
I am supporting researchers with E-Prime since about 3 years now, only with tasks that need more in-depth system knowledge, and that's probably why I'm not preoccupied with the fact which parts of E-Basic to use or not to use I guess ...
One of the things that annoy me however, is the lame way OOP has been implemented in E-Prime, and the really poor documentation of quite a lot of subjects .
But, when one takes enough time to find out how, it's amazing what can be achieved 
|
|
|
|
|
Forum MVP
      
Group: Forum Members
Last Login: 5/14/2012 4:43:58 PM
Posts: 728,
Visits: 2,932
|
|
Eise (5/10/2011) One of the things that annoy me however, is the lame way OOP has been implemented in E-Prime,
You have to blame Microsoft for that, as E-Basic is simply derived from Microsoft Visual Basic for Applications (version 6, to be sure). So E-Basic merely inherits all the shortcomings of VBA. You might still blame PST for adopting VBA as their user platform (rather than something more elegant and rational such as C++; note that E-Prime is itself written in MS C++), but I think they wanted to choose a user platform that seemed more "friendly" to beginners and casual users while still having enough power for the power users. To that end, I begrudgingly admit that, IMO, they succceeded better than any of the competition.
and the really poor documentation of quite a lot of subjects .
But, when one takes enough time to find out how, it's amazing what can be achieved 
Indeed, I find E-Prime a product whose amazing design and potential remains hidden and under-used as a result of poor documentation. I have complained publicly myself for several years about the poor state of documentation for us powers users (IMO, the documentation for beginners is pretty good), to no avail. But if you want some pointers, please see my essays on "How to Solve E-Prime Puzzles" and "How to Learn E-Prime Programming" that I just posted on the E-Prime Google Group:
http://groups.google.com/group/e-prime/browse_thread/thread/5425e03968cab428
http://groups.google.com/group/e-prime/browse_thread/thread/b0ce54870b723fc3
That said, PST is pretty liberal with their technical support, and I have found some of the support staff to be very helpful. Basically, they seem to use tech support as a substitute for proper documentation, so you should contact them at the slightest puzzlement without hesitation. That will often get you over whatever hurdle you face at the moment, but it still leaves power users like me, who really do like to master the entire landscape of their tools, at a loss.
-- David McFarlane, Professional Faultfinder
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 11/4/2011 7:51:56 AM
Posts: 4,
Visits: 10
|
|
| Hi, maybe you can help me with my problem, too. I want to record a video of the facial expression of the test person participating in my E-Prime experiment. Do you know a video recording software, which can receive/import trigger signals of e-prime? So that I am able to know, which recorded facial expression is the reaction to which stimuli? Or other ideas how I could connect e-prime and a video recording program? Thanks!
|
|
|
|