QB64.org Forum
		Active Forums => QB64 Discussion => Topic started by: Dav on January 16, 2021, 11:14:21 pm
		
			
			- 
				I'm working on a keyboard recording/playback program - will post it soon.  Had an issue with _LIMIT when used with the PAINT command.   Basically I'm using _LIMIT to control the speed of the recording and playback, and allowing the user to control the _LIMIT rate to speed up/slow down song playback speed.  
Roughly something like this...
speed = 100 
DO
   _LIMIT speed * 10
  .... allow use to adjust speed value from 40 to 200  
  ...PAINT a key played...etc..
LOOP
Well, it worked sometimes, then not at all -it will get to a point that _LIMIT won't change anymore and stayed on one speed no matter what the speed variable is.
After much bug testing and eliminating lines, I narrowed it down that the PAINT call was the culprit -- when I replaced it with a LINE that does the same thing, the _LIMIT change always worked as it should.  Put PAINT back in, it fails. Any idea what could be causing the PAINT/LIMIT to clash? Perhaps my graphics system is the problem?
Anyway, _LIMIT is working fine using LINE command, so I'm beyond the hurdle now, just wondering about it still...
.
- Dav 
			 
			
			- 
				My guess is PAINT is slowing the main loop to the point where LIMIT can't compensate. 
Remember that LIMIT auto adjusts.  It'll compensate to a certain point but if the loop in which it resides is too slow it will not be able to auto adjust.
			 
			
			- 
				Thanks , @NOVARSEG. Yeah, that's probably the best guess. 
Anyway, the program is working and I hope to post it soon.
- Dav