[visionegg] Re: pseudorandom

Hi Richard,

As far as your first issue, you can get the FlowControl code to give you a frame number instead of time. Perhaps that helps?

def get_frame(f):
    print f

test_controller = FunctionController(during_go_func=get_frame,temporal_variables=Controller.FRAMES_SINCE_GO)

p.add_controller(None,None, test_controller )

As for problem 2, this is very strange, and I haven't seen it before and can't give any advice other than a couple of longshots: try different nVidia driver versions and doublecheck your screensaver settings.

Cheers!
Andrew

richard srebro wrote:
I am trying to get a length 511 pseudorandom m sequence to control the
phase of a checkerboard. The two checkerboards are preconstructed. CC is
one checkerboard. CP is the counterphase checkerboard. I also want a
signal that shows the checkerboard phase. Here is the control script
that I am using

LPT1 = 0x378

def control_dynamic(t):

if t<= dynamic_time:

tt=(int(t*100)%511)

if ps[tt]== 0:
dynamic_texture_object.put_sub_image( CC )
data = 0x00
raw_lpt_module.out(LPT1,data)
else:
dynamic_texture_object.put_sub_image( CP )
data = 0xFF raw_lpt_module.out(LPT1,data)


p.add_controller(None,None,FunctionController(during_go_func=control_dynamic))

p.go()



There are two problems.

(1) tt=(int(t*100)%511) does not give an ordinal sequence. For example
it gives 0,1,2,3,4,5,7,etc  skipping up every 6 to 7 positions.I
understand why but I have not been able to find a way to get a counter
going within the control loop. If I try a statement like cnt=cnt+1, it
increments once and that is all.

(2) every once in a while the screen stops updating the display, usually
with one or the other checkerboard displayed statically
or on occasion with a blank screen. However, LPT1 goes on happily
changing. I can get the screen to resume displaying the checkerboards
if I move the mouse around in the "Konsole" window. If I keep the
"Konsole" window visible and keep the cursor in it, the display does
not stop updating.


I am using an Nvidia board and the displays are free of any tears and refreshing at 85 Hz.

I am operating with Fedora Core 2.

Thanks for any help you can give me

Dick Srebro

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html



--
Andrew D. Straw  Post-doctoral scholar
,-.              Dickinson Lab
\_/              California Institute of Technology
8||}             Mailcode 138-78
/ \              Pasadena CA 91125, USA
`-^
                 email:  astraw@xxxxxxxxxxx
                 office: +1 626 395 4396

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: