QB64 Phoenix Edition
waveform line demo by SupremoZanne - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7)
+---- Thread: waveform line demo by SupremoZanne (/showthread.php?tid=666)



waveform line demo by SupremoZanne - madscijr - 07-21-2022

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



RE: waveform line demo by SupremoZanne - SierraKen - 07-21-2022

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


RE: waveform line demo by SupremoZanne - vince - 07-23-2022

nice example of _SNDRAW