Dear all, Just a follow-up: I have solved the immediate issue by modifying the SinGrating2D class to include a boolean parameter, which allows the necessary resetting of the phase reference time when set (for example by a controller): class SinGrating2D(LuminanceGratingCommon): ... parameters_and_defaults = VisionEgg.ParameterDefinition({ 'reset_t0_time':(True, ve_types.Boolean, "for controlling initial phase"), ... }) ... def draw(self): ... if p.t0_time_sec_absolute is None and not p.ignore_time: p.t0_time_sec_absolute = VisionEgg.time_func() if p.reset_t0_time: p.reset_t0_time = False p.t0_time_sec_absolute = VisionEgg.time_func() ... But, I would still be interested in knowing why the solution originally suggested using the t0_time_sec_absolute parameter does not work. Thanks, Lyle ----- Original Message ----- From: Lyle Graham To: visionegg@xxxxxxxxxxxxx Sent: Tuesday, November 08, 2005 2:21 PM Subject: [visionegg] Constraining SinGrating2D phase with t0_time_sec_absolute = None Dear all, I am trying to constrain the starting phase of a grating. According to an earlier suggestion from Andrew, and following the source code for Gratings.py, I tried adding a controller for the t0_time_sec_absolute parameter: grating_stimulus = SinGrating2D() grating_t0_time_sec_absolute_controller = EvalStringController(during_go_eval_string='None', between_go_eval_string='None', eval_frequency=VisionEgg.FlowControl.Controller.TRANSITIONS) viewport = Viewport( screen=screen, stimuli=[grating_stimulus] ) p = Presentation(viewports=[viewport],check_events=1) p.add_controller(grating_stimulus,'t0_time_sec_absolute', grating_t0_time_sec_absolute_controller) p.run_forever() Note that when I used the ConstantController instead of the EvalStringController, that is: initial_controller=ConstantController(during_go_value=None,...) I got the following error: File "C:\Program Files\SurfVision\SurfVisionStimulusSuiteTCP\SurfVisionVisualStimuliSuiteTCP.py", line 103, in ? eval_frequency=VisionEgg.FlowControl.Controller.TRANSITIONS)) File "C:\PROGRA~1\Python\lib\site-packages\VisionEgg\FlowControl.py", line 874, in __init__ raise ValueError("Must specify during_go_value") ValueError: Must specify during_go_value In any event, with the EvalStringController I get the following error: File "C:\Program Files\SurfVision\SurfVisionStimulusSuiteTCP\SurfVisionVisualStimuliSuiteTCP.py", line 194, in ? p.add_controller(grating_stimulus,'t0_time_sec_absolute', grating_t0_time_sec_absolute_controller) File "C:\PROGRA~1\Python\lib\site-packages\VisionEgg\FlowControl.py", line 177, in add_controller raise TypeError("Attempting to control parameter '%s' of type %s with controller that returns type %s"%( TypeError: Attempting to control parameter 't0_time_sec_absolute' of type Real with controller that returns type None Thanks very much for any suggestions. Lyle Lyle J. Graham Laboratory of Neurophysics and Physiology, CNRS UMR 8119 www.neurophys.biomedicale.univ-paris5.fr/~graham UFR Biomédicale de l'Université René Descartes 45 rue des Saint-Pères, 75006 Paris Tel: 33 1 42 86 20 92 (Secrétariat: 33 1 42 86 21 38) Fax: 33 1 49 27 90 62 ------------------------------------------------------------------------------ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.362 / Virus Database: 267.12.8/162 - Release Date: 11/5/2005