SOUND and waveforms
#2
You'll have to compute the waveform yourself if using "_SNDRAW" in QB64.  "SOUND" is pretty much hard-coded to be compatible with GW-BASIC at the oldest.  The Tandy BASIC set the voice for the third parameter because some Tandy computers were capable of three-channel sound.  That dialect also had "NOISE" which was pretty cool but couldn't do anything else with the noise sound and couldn't change the frequency of the pulse wave.  The QB45 version of "SOUND" carried only two parameters.

I was going to post an example program which makes use of "text-file waveforms". A text file could have 256 lines, each line having a single-precision float value from -1 to 1. These values are fed into "_SNDRAW" per sample to produce sound according to sampling rate. In this way sinewaves and pulsey-type sounds could be produced. The pitch could be changed simply by setting a rate other than one, for the counter that chooses which sample to play for the current frame.

I'm sorry if I'm going heavy with technical details, but "SOUND" is hard-coded, cannot make progress with that for your project if you want more variety with sound.
Reply


Messages In This Thread
SOUND and waveforms - by CharlieJV - 08-06-2022, 07:41 PM
RE: SOUND and waveforms - by mnrvovrfc - 08-08-2022, 12:42 AM
RE: SOUND and waveforms - by madscijr - 08-13-2022, 06:41 PM
RE: SOUND and waveforms - by CharlieJV - 08-13-2022, 06:52 PM
RE: SOUND and waveforms - by madscijr - 08-16-2022, 06:15 PM
RE: SOUND and waveforms - by mnrvovrfc - 08-14-2022, 09:47 AM
RE: SOUND and waveforms - by madscijr - 08-14-2022, 11:37 AM
RE: SOUND and waveforms - by madscijr - 08-16-2022, 06:26 PM



Users browsing this thread: 4 Guest(s)