Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An even better Pete.BAS!
#1
Pete posted his glorious Pete.BAS example over here: https://qb64phoenix.com/forum/showthread...1#pid11971

So... I had to one up it!  Here's the new and improved "Steve(tm) Improved Pete.BAS"

Code: (Select All)
Screen Pete
_Title "Steve(tm) Improved Pete.BAS"

Randomize Timer
If Play(0) = 0 Then
    Play "MBMNT210O3L4EEEP4EEEP4EGCDL1EL4FFFFFEEL8EEL4EDDEL2DL4G"
    Play "P4O3L4EEEP4EEEP4EGCDL1EL4FFFFFEEL8EEL4GGFDL4CL1"


    Play "MBMNT200O3L4CFL8FGFEL4DDDGL8GAGF"
    Play "L4ECCAL8AB-AGL4FDL8CCL4DGEL2F"
    Play "L4CFFFL2EL4EFEDL2CL4CAGF"
    Play "O4L4CO3L4CL8CCL4DGEL2F"
    Play "L4CFL8FGFEL4DDDGL8GAGFL4ECCAL8AB-AG"
    Play "L4FDL8CCL4DGEL2F "
End If
Do

    PlotChar "Xmas Pete"
    _Limit 15
    _Display
Loop Until _KeyHit
System


Sub PlotChar (text$)
    Static tempScreen
    If tempScreen = 0 Then tempScreen = _NewImage(8000, 100, 32)
    d = _Dest: s = _Source
    _Dest tempScreen
    Cls , 0
    Color , 0
    Print text$;
    _Source tempScreen
    _Dest d
    For i = 0 To Len(text$) - 1
        a$ = Mid$(text$, i + 1, 1)
        For y = 0 To 16
            For x = 0 To 8
                Color Int(Rnd * 16) + 16, Int(Rnd * 8)
                Locate y + 5, i * 8 + x + 4
                If Point(x + i * 8, y) Then Print a$;
            Next
        Next
    Next
    _Source s
End Sub
Reply
#2
Sorry it took awhile to respond, but it crashed my system. I had to completely reboot.

It got through the first song just fine, but got stuck early in the second. The computer just kept repeating a single note. My neighbors thought it was a tsunami alarm, and starting climbing up the hill. Oh well, F them....

Possibly a memory leak, as the the mouse pointer came to almost a complete stand still.

Other than that...

Pete
Reply
#3
The sound goofed up?  Are you using the old sound system or the new version?  There shouldn't be anything in those simple PLAY statements to freeze up or interact with the mouse.
Reply
#4
3.4.1
Reply
#5
(12-22-2022, 07:44 PM)Pete Wrote: 3.4.1

[Image: image.png]

The last option on that dialog for the Compiler Settings.  Is yours checked, or not?  Tongue
Reply
#6
Yep, just like the screen shot.

Pete
Reply
#7
When I press the key to quit. The program freezes until the play buffer clears out. Can't even click the X.
Reply
#8
Give the version up top a shot once again.  What we had before was an endlessly expanding list of notes to play, and memory usage went up, up, and UP...  Around 28GB of memory usage on my system, Windows decided it needed to start putting stuff into a swapfile, and that's when I terminated things.  Who knows how much disk space I could've used up just writing PLAY notes over and over and over!!
Reply
#9
You fixed it! That's a much more festive version, for sure.

Oops, have to go. My neighbor tripped and went tumbling down the hill. Normally I wouldn't mind, but the bastard knocked into my fence, and now I have to go pound in a loose board. It's always something...

Pete
Reply
#10
Worked well for me on Manjaro MATE. It must have been after the fix.
Reply




Users browsing this thread: 1 Guest(s)