Sample outline of rate groups in BASIC

Post Reply
voidstar
Posts: 488
Joined: Thu Apr 15, 2021 8:05 am

Sample outline of rate groups in BASIC

Post by voidstar »

This is another example using BASLOAD. Tokenized version is in the runnable PRG file.

This example shows an approach for setting up a kind of "rate monotonic" event scheduler in BASIC. And specifically it is setup to play some music notes in the background while doing other things (from within BASIC, no POKE's needed).

The overall framework could be used to do many other more interesting things.

Try It Now!
Attachments
TTIME.ZIP
(6.46 KiB) Downloaded 248 times
ttime.png
ttime.png (4.81 KiB) Viewed 3539 times
TTIME.PRG
(2.65 KiB) Downloaded 235 times
TTIME.BAS
(3.32 KiB) Downloaded 250 times
voidstar
Posts: 488
Joined: Thu Apr 15, 2021 8:05 am

Re: Sample outline of rate groups in BASIC

Post by voidstar »

Here is an updated version of this sample. It was only called TTIME earlier because I had planned to do something else and it just then morphed into this rate-group concept.

This updated version (now called RATEV2.BAS) will require the newer (upcoming) BASLOAD-0.2.3
You can still run the PRG now if you'd like, since it is the "compiled output" (or tokenized) result of BASLOAD.

Functionally there isn't much difference. The main differences are:

- addresses a "time roll over" bug, which could cause a bit of a stutter for a moment after running for a while.
- minor re-arrangement and expanded comments/clarifications on some things
- exercise the "RESTORE <label>" to play a couple different DATA-as-music options
Attachments
RATEV2.PRG
(3.1 KiB) Downloaded 241 times
RATEV2.BAS
(3.84 KiB) Downloaded 222 times
Post Reply