[visionegg] Re: pseudorandom

Hi,
Well this is better

data = 0x00
raw_lpt_module.out(LPT1,data)

def get_frame(f):
                
        if f < 511*50:
                
                tt=f%511
                if tt == 0:#put out a pulse when m sequence starts
                        data = 0xFF 
                        raw_lpt_module.out(LPT1,data)
                it tt == 1:
                        data = 0x00
                        raw_lpt_module.out(LPT1,data)
                        
                if ps[tt]== 0:
                        dynamic_texture_object.put_sub_image( CC )
                        
                else:
                        dynamic_texture_object.put_sub_image( CP )
                        
                        
                                                
test_controller=FunctionController(during_go_func=get_frame,temporal_variables=Controller.FRAMES_SINCE_GO)
                      
p.add_controller(None,None,test_controller)
        
p.go()
        

but I can not get more that 8501 frames. For example with the above
code which I expected to produce 511*50 = 25550 frames I got

2005-03-09 15:20:01,285 (3440) 
INFO: 8501 frames were drawn.
Mean frame was 11.77 msec (85
.00 fps), longest frame was 13.50 msec.

Thanks
Dick




On Tue, 2005-03-08 at 17:07, Andrew Straw wrote:
> 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
> > 
> 
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: