Author Topic: _LIMIT & PAINT issue?  (Read 2590 times)

0 Members and 1 Guest are viewing this topic.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
_LIMIT & PAINT issue?
« 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

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: _LIMIT & PAINT issue?
« Reply #1 on: January 16, 2021, 11:37:18 pm »
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.
« Last Edit: January 16, 2021, 11:43:58 pm by NOVARSEG »

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: _LIMIT & PAINT issue?
« Reply #2 on: January 17, 2021, 09:46:03 am »
Thanks , @NOVARSEG. Yeah, that's probably the best guess.

Anyway, the program is working and I hope to post it soon.

- Dav