Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
waveform line demo by SupremoZanne
#1
This one is kind of neat, looks like it lets you draw a sound waveform and plays it. 

Code: (Select All)
' QB64 - A tech demo where one can move the mouse to alter the _SNDRAW waveform (self.QBprograms)
' https://www.reddit.com/r/QBprograms/comments/t9477v/a_tech_demo_where_one_can_move_the_mouse_to_alter/

' submitted 4 months ago by SupremoZanne
' https://www.reddit.com/user/SupremoZanne

_Title "waveform line demo" ' made for QB64
Dim xx(1100)
Screen _NewImage(1100, 300, 13)
Do
    If InKey$ <> "" Then
        For vv = 1 To 100
            PSet (Rnd * 1100, Rnd * 300) 'press any key to splatter pixels
        Next
    End If
    While _MouseInput 'move mouse to form soundwave
        x = _MouseX
        y = _MouseY
    Wend
    x2 = x
    y2 = y
    For xz = x1 To x2
        xx(x) = y
        Line (xz, 0)-(xz, 300), 0
    Next
    Line (x1, y1)-(x2, y2)
    For z = 1 To 1100
        For y3 = 1 To 300
            If Point(z, y3) = 15 Then
                zzt = y3
                GoTo 1
            End If
        Next
        1
        _SndRaw y3 / 350
    Next
    While _SndRawLen
    Wend
    y1 = y2
    x1 = x2
Loop
Reply
#2
LOL that is weird stuff, almost like a theremin. Smile I removed the "350" from _SndRaw y3 / 350 and it sounds even weirder. LOL Be careful with these commands though, I don't want to hear about someone breaking their speakers. Smile
Reply
#3
nice example of _SNDRAW
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WinAPI Mouse Demo Pete 0 184 12-20-2025, 06:40 PM
Last Post: Pete
  Hyperlink Demo in SCREEN 0 Pete 2 368 11-02-2025, 07:13 PM
Last Post: madscijr
  Qix line monster Abazek 2 835 01-22-2025, 03:25 AM
Last Post: Jack002
  "5-line" engine James D Jarvis 35 7,778 02-16-2024, 11:06 AM
Last Post: Jack
  Email Demo (from 6/6/2014) SMcNeill 0 599 11-13-2023, 06:39 AM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)