Skip to content

v4.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 14 Dec 10:15
· 17 commits to main since this release
8cfb91e

Long time announced, now finally done and the main reason for us to give this release a major version bump, is the deprecation of $NOPREFIX. But no worries, we've added a converter which will automatically transform your old $NOPREFIX using programs back to the regular underscore using syntax as soon as you open such a program. Aside from some subtle side cases, the converter should perfectly do its job without requiring further manual adjustments afterwards.

Moreover the new version got a big audio library update with lots of new features, and a comprehensive new logging system which will help debugging and streamlining your programs. These two had been probably worth a major version bump by itself. Also to highlight is the addition of several new precompiler flags and a huge set of preset constants for use in your programs.

QB64-PE v4.0.0 - Thanks to everyone who contributed to this brand new version.

Breaking changes

  • #544, #548 - Complete deprecation of $NOPREFIX. - @RhoSigma-QB64
  • #553 - Added automatic $NOPREFIX to underscore usage converter, triggered when a file using $NOPREFIX is opened in the IDE. If the user agrees to convert, a backup of the file and any includes are made. - @flukiluke

Enhancements

  • #535 - Relax ALIAS function name validation, closing issue #493. - @a740g
  • #536, #571, #572 - The "Export As ..." feature now checks for an active selection first. If there is one, only the selected code is exported, otherwise the entire source will be exported as usual. Plus some adjustments for new commands. - @RhoSigma-QB64
  • #550 - added new _MOUSEHIDDEN function. - @RhoSigma-QB64
  • #558 - Implements the _QB64PE_ precompiler flag, closing issue #551. - @RhoSigma-QB64
  • #561 - Various enhancements to the IDE and the Compiler. - @RhoSigma-QB64
    • Now showing the syntax for all user defined SUBs and FUNCTIONs for better reference in the status messages.
    • Added lots of preset constants available in every program by default.
    • Added _MIN, _MAX, _ENCODEURL$ and _DECODEURL$ functions.
  • #562 - The HTTP support for _OPENCLIENT is stabilized now, $UNSTABLE:HTTP is no longer required. Also added the _DEBUG_ precompiler flag, closing issue #29. - @RhoSigma-QB64
  • #565 - The big audio library update. - @a740g

Lot of things:

  • PLAY now ignores the ";" character as QB4.5 did, fixing issue #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 multi-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, closing issue #187
  • Adds support for _SNDRAWBATCH that can push a batch of audio sample frames at once compared to just one frame that _SNDRAW supports
  • Moves BEEP out of the audio library, i.e. a simple BEEP no longer pull in the entire audio library
  • Restores CHR$(7) beep support (due to the above change)

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)

This adds new logging capabilities to QB64, both internally from libqb and also exposed to the QB64 code. Beyond being a bit nicer than a Print since it captures the function name and line number, a big feature is that logging an error captures a stacktrace of the program at that point. Logging can also easily be turned on without recompilation via environment variables, and can be filtered via various scopes and a couple different logging levels. Overall this should hopefully be a big aid for debugging, as we can ask users to provide us with the logging output of programs when they error.

Below is an example of some logging from a QB64 program (note how the IDE opens a separate console window to display it):
image

The new commands are _LOGTRACE, _LOGINFO, _LOGWARN, _LOGERROR and _LOGMINLEVEL. The first four write out log messages at the indicated log level. The last returns a number indicating the lowest level of logging is enabled, allowing you to skip generating more expensive logging if it won't be displayed.

Logging is enabled via a variety of different environment variables (when run from the IDE these are configured automatically):

  1. QB64PE_LOG_LEVEL - sets the lowest log level to display, options are Trace, Information, Warning, Error
  2. QB64PE_LOG_SCOPES - A comma-separated list of different sets of logging to turn on, allowing basic filtering of what is displayed. Options are:
    a. libqb - Some generic logging from libqb, such as error codes when they happen, program startup/shutdown, etc.
    b. libqb-image - Logging from the image subsystem (when images are loaded,freed, errors that happen, etc.)
    c. libqb-audio - Logging from the audio subsystem
    d. qb64 - Logging from the QB64 Program ( _Log* statements)
  3. QB64PE_LOG_HANDLERS - A comma-separated list of the logging handlers to enable. If no handlers are enabled, then no logging is generated. Current options are:
    a. console - Logging output is written to the console.
    b. file - Writes logs to the file set via the QB64PE_LOG_FILE_PATH environment variable

Currently the IDE just defaults to using Information and enabling all the scopes, in a future update I'd like to have an IDE dialog that lets you pick the log level and scopes.

Bug fixes

  • #534 - Allows users to revert to the built-in soundbank by passing an empty string to _MIDISOUNDBANK. Before it was not possible to switch back to the default soundbank once an external one had been used with _MIDISOUNDBANK. - @a740g
  • #537 - Fixed some wrong Wiki links in exported code. - @RhoSigma-QB64
  • #546 - Update clipboard library to latest, fixing issue #541. - @a740g
  • #557 - Fixed a bug where KILL, FILES, and _FILES$ unintentionally shared a static DIR pointer when performing file searches. As a result, calling any of these functions would reset the search state of _FILES$, leading to unexpected behavior. This issue was reported here. - @a740g
  • #560 - Fixed unary negation when using CONST, closing issue #542. - @mkilgore
  • #568 - Reloading a MIDI file with a different soundfont now works as expected, also _MEMSOUND now works correctly with fully decoded MEMORY sounds. - @a740g
  • #570 - Removes the voice range check in _PLAY (function). If the voice is out of range, it now simply defaults to zero, aligning the behavior with QB4.5 standards. - @a740g
  • #574 - Resolved an issue in _ROL and _ROR, where the second argument could incorrectly be a STRING. - @a740g

Internal changes

  • #539, #585 - Switch to LLVM MinGW C++ compiler on all Windows architectures. - @a740g
  • #538, #540, #543, #547 - Enable globbing by default and silence lots of C++ compiler warnings. - @a740g
  • #548, #550 - Complete removal of rotten Android remains, i.e. $VIRTUALKEYBORD and friends. - @RhoSigma-QB64
  • #569 - Various libqb refactoring, silence more C++ compiler warnings. - @a740g
  • #588 - Tidy up the markdown files in the repository - @a740g