QB64 Phoenix Edition
An even better Pete.BAS! - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Christmas Code (https://staging.qb64phoenix.com/forumdisplay.php?fid=48)
+---- Thread: An even better Pete.BAS! (/showthread.php?tid=1323)

Pages: 1 2


An even better Pete.BAS! - SMcNeill - 12-22-2022

Pete posted his glorious Pete.BAS example over here: https://staging.qb64phoenix.com/showthread.php?tid=1321&pid=11971#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



RE: An even better Pete.BAS! - Pete - 12-22-2022

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


RE: An even better Pete.BAS! - SMcNeill - 12-22-2022

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.


RE: An even better Pete.BAS! - Pete - 12-22-2022

3.4.1


RE: An even better Pete.BAS! - SMcNeill - 12-22-2022

(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


RE: An even better Pete.BAS! - Pete - 12-22-2022

Yep, just like the screen shot.

Pete


RE: An even better Pete.BAS! - James D Jarvis - 12-22-2022

When I press the key to quit. The program freezes until the play buffer clears out. Can't even click the X.


RE: An even better Pete.BAS! - SMcNeill - 12-22-2022

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!!


RE: An even better Pete.BAS! - Pete - 12-22-2022

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


RE: An even better Pete.BAS! - mnrvovrfc - 12-22-2022

Worked well for me on Manjaro MATE. It must have been after the fix.