Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Possibly Related Threads…
Thread Author Replies Views Last Post
  need help playing sound using certain parameters madscijr 0 401 04-01-2025, 03:52 PM
Last Post: madscijr
Question sound file playback (and record) - manipulating speed + pitch in realtime? madscijr 12 2,010 02-26-2025, 06:33 PM
Last Post: Petr
  List of file sound extensions eoredson 17 2,767 12-27-2024, 04:30 PM
Last Post: hsiangch_ong
  _SndPlayFile not starting sound file eoredson 11 2,481 07-20-2023, 04:33 PM
Last Post: TerryRitchie
  incorporate sound files in code mdijkens 6 1,188 01-02-2023, 11:24 AM
Last Post: a740g

Forum Jump:


Users browsing this thread: 1 Guest(s)