PyEPL timing issue

From MallWiki

Jump to: navigation, search

Problem

The timing isn't working properly (i.e., the trials are presented faster than your code says)


Solution

You need to use "clk" rather than "clock" when calling the PresentationClock(). Then you can use "clk=clk" in you commands to ensure that the timing works the way you want it to.


Example

You want to display an item for 2 seconds, but the trial can finish earlier if a response is made.


First set up experiment

exp = Experiment()

video = VideoTrack("video")

keyboard = KeyTrack("key")

clk = PresentationClock()


Then present a single trial

bc = ButtonChooser(Key("1"), Key("2))

stim = Text("Press button 1 or 2)

ts, b, rt = stim.present(clk=clk, duration = 2000, bc=bc)