Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The big audio library update #565

Merged
merged 39 commits into from
Nov 8, 2024

Conversation

a740g
Copy link
Contributor

@a740g a740g commented Nov 6, 2024

Lot of things:

  • Fixes PLAY does not ignore ";" character #554
  • Adds Pink noise, Brownian noise, LFSR noise, pulse, and custom (_WAVE) waveform support to SOUND & PLAY
  • Adds support for ADSR envelope for SOUND & PLAY
  • Adds muti-channel (4 voice) support for SOUND & PLAY
  • Adds SOUND WAIT and SOUND RESUME support for multi-channel for SOUND & PLAY
  • Adds Amiga Basic like _WAVE command
  • Closes Amiga BASIC like WAVE and SOUND improvements #187
  • Adds support for _SNDRAWBATCH that can push a batch of audio sample frames at once compared to just one frame that _SNDRAW supports
  • Fixes and cleans up multiple data type issues for audio library functions in subs_functions.bas
  • Moves BEEP out of the audio library. BEEP now uses cross-platform tinyfd_beep() and as such does not pull in the entire audio library
  • Restores CHR$(7) beep support (due to the above change)
  • Backports tinyfd_beep() improvements & fixes from the latest tinyfiledialogs library
  • Refactors away some unpleasant stuff like usage of various custom clamp functions instead of std::clamp, ad-hoc function declarations and general formatting issues

New commands and enhancements:

  • SOUND frequency!, duration![, volume!][, panning!][, waveform&][, waveformParameters!][, voice&]
  • SOUND WAIT
  • SOUND RESUME
  • PLAY voiceCommands1$[, voiceCommands2$][, voiceCommands3$][, voiceCommands4$]
  • remainingTime# = PLAY([voice&])
  • _WAVE voice&, waveDefinition%%([index&])[, frameCount&]
  • _SNDRAWBATCH array!([index&])[, channels&][, handle&][, frameCount&]

PLAY MML language improvements (special thanks to @grymmjack for guidance):

  • Wn / @n: waveform select (1 = SQUARE, 2 = SAWTOOTH, 3 = TRIANGLE, 4 = SINE, 5 = NOISE_WHITE, 6 = NOISE_PINK, 7 = NOISE_BROWNIAN, 8 = NOISE_LFSR, 9 = PULSE, 10 = CUSTOM_WAVE)
  • /n: attack (percentage of total note time 0 - 100)
  • \n: decay (percentage of total note time 0 - 100)
  • ^n: sustain (percentage of MML volume 0 - 100)
  • _n: release (percentage of total note time 0 - 100)
  • Yn: extra params for current waveform (percentage 0 - 100 - usually for pulse wave)
  • Sn: pan position (0 to 100) where 0 is leftmost and 100 is rightmost
  • R / P: rest / pause
  • V+ & V-: Volume increment / decrement (single-step & clamped)
  • S+ & S-: Pan right / left (single-step & clamped)

a740g and others added 30 commits October 16, 2024 02:51
@a740g a740g added bug Something isn't working enhancement New feature or request libqb-refactor Separating out libqb.cpp labels Nov 6, 2024
@a740g a740g self-assigned this Nov 6, 2024
@a740g a740g merged commit b479c60 into QB64-Phoenix-Edition:main Nov 8, 2024
4 checks passed
@a740g a740g deleted the the-big-audio-library-update branch November 8, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request libqb-refactor Separating out libqb.cpp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PLAY does not ignore ";" character Amiga BASIC like WAVE and SOUND improvements
2 participants