Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Who wants to PLAY?
#1
As of 0.9.0 QBJS finally has the PLAY command available.  Does anyone have any favorite programs that feature PLAY that would make good additions to the samples library?  It would also be great to just have more test cases as I'm sure it is not 100% correct yet.  I've mined the wiki for some good examples like the fun Music Grid below but would love to see more.

Reply
#2
Fun! It is
b = b + ...
Reply
#3
Love this example. Rad you were able to reproduce in qbjs @dbox Smile
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#4
(01-17-2025, 01:25 AM)grymmjack Wrote: Love this example. Rad you were able to reproduce in qbjs @dbox Smile
Thanks @grymmjack!  

I'd love to see if anyone has additional good PLAY examples for QBasic/QB64 to add to the samples site:

https://boxgaming.github.io/qbjs-samples/#category=Play
Reply
#5
I am wondering if there is a way to record and share our Play (referring to the demo of Play) with others to show what musical geniuses we are?
b = b + ...
Reply
#6
@dbox the new year example from the wiki does not play correctly.

https://qbjs.org/?code=RElNIHgkCngkID0ge...lBMQVnkB1g=
Reply
#7
(01-17-2025, 09:24 PM)bplus Wrote: I am wondering if there is a way to record and share our Play (referring to the demo of Play) with others to show what musical geniuses we are?
That's a fun idea.  Here is a simple mod that will let you load and save music loops.  Browser security rules prevent QBJS from saving in the embedded iframe so you'll have to use this link to save your work:
Launch Music Grid

You can load and play samples, though, in the embedded version here.  I've attached a sample save to this post. (It's not really a text file but the forum only allows certain file types for attachements.)



(01-18-2025, 12:09 AM)a740g Wrote: @dbox the new year example from the wiki does not play correctly.

https://qbjs.org/?code=RElNIHgkCngkID0ge...lBMQVnkB1g=
Thanks @a740g, yes, the timing does seem a bit off compared to QB64.  I'll look into that.


Attached Files
.txt   mgrid.txt (Size: 578 bytes / Downloads: 6)
Reply
#8
Hrm, that’s weird.  It smushed together two separate posts.  I guess because I posted them one right after the other?
Reply
#9
Hello @dbox

I am testing the new Play demo with new Save and Load (very nice!) and notice a slight problem getting those mouse clicks caught!

maybe this requires, once again, another application of a _limit or a pause to get clear of a click.
Code: (Select All)
SUB domousestuff
    DIM x, y
    DO WHILE _MOUSEINPUT
        IF _MOUSEBUTTON(1) THEN
            x = FIX(_MOUSEX \ FIX(maxx \ 16))
            y = FIX(_MOUSEY \ FIX(maxy \ 16))
            grid(x, y) = 1 - grid(x, y)
        END IF
    LOOP
END SUB

see if this works better for you:
Code: (Select All)
Sub domousestuff
    Dim x, y
    While _MouseInput: Wend  ' there we've polled the mouse we don't need to remain inside the loop unless we need mouse wheel
    If _MouseButton(1) Then
        _delay .25 ' wait for user to release button
        x = Fix(_MouseX \ Fix(maxx \ 16))
        y = Fix(_MouseY \ Fix(maxy \ 16))
        grid(x, y) = 1 - grid(x, y)
    End If
End Sub

I am not proud of _delay .25 a quick hacky way to pause for a bit to clear the mouse button but it is short and sweet because it gets the job done better IMO than the first mouse catcher routine.
b = b + ...
Reply
#10
Well Music Grid needs its own folder under my QBJS folder since we are adding files.

OK let's test sharing:
mgrid1.txt
Code: (Select All)
                                                                                                                                                                                                                                                                                     

will that work?
   

nope! The text file saved is loadable but the txt file won't make it through editors from copy/paste.

You all will have to wait to here today's master piece. Big Grin

Actually you repeat something enough and almost anything starts to sound good, I think.
b = b + ...
Reply




Users browsing this thread: 7 Guest(s)