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




Users browsing this thread: 1 Guest(s)