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!
b = b + ...
Reply


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



Users browsing this thread: 1 Guest(s)