Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
code to generate wav files specifying waveform, pitch, ADSR, etc.?
#6
I suspect anything _SND uses that stuff that you have to show license and source code so I did my experiment with Sound:
Code: (Select All)
'current file title: mouse circle sounds.bas
'original title squeaky mouse.bas SmallBASIC 2015-04-27 B+
'old on-line title: circles
'now more sound effects, color contrast, c=cls screen option
Const xmax = 800, ymax = 600
Screen _NewImage(xmax, ymax, 32)
_ScreenMove 200, 0
DefLng A-Z
Randomize Timer
While 1
    Locate 1, 1
    Print "press c to clear screen clutter"
    If InKey$ = "c" Then Cls

    While _MouseInput: Wend
    x = _MouseX
    y = _MouseY
    f = 37 + 3250 * y / ymax
    d = x / xmax * 18
    Sound f, d
    Circle (x, y), d, _RGB32(255 * y / ymax + 10, 255 * y / ymax + 10, 128)
    _Display
    _Limit 5
Wend

The help file says frequency can go up to 32000 but I got really screwy stuff happening so I maxed it out at 1/10 that range.

Oops! I posted this in wrong section, I meant it to go where you were experimenting with sounds using mouse, sorry!
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: code to generate wav files specifying waveform, pitch, ADSR, etc.? - by bplus - 07-24-2022, 04:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  VS Code and Qb64 pe Unseen Machine 6 733 09-03-2025, 09:42 PM
Last Post: grymmjack
  has anyone had ChatGPT write QB64 code yet? madscijr 13 2,966 08-23-2025, 09:15 AM
Last Post: doppler
  liquid code experiment madscijr 3 493 06-20-2025, 07:26 PM
Last Post: madscijr
  [split] Lines of Code bplus 20 3,059 01-25-2025, 05:11 PM
Last Post: Pete
  QB64 GPT Just Rewrote My Code SpriggsySpriggs 17 2,864 05-30-2024, 06:50 PM
Last Post: madscijr

Forum Jump:


Users browsing this thread: 1 Guest(s)