Music programs for Commander X16 using it's PSG in Vera.
The example Frere Gustav is modified from Sinclair ZX Spectrum BASIC Programming by Steven Vickers: https://worldofspectrum.org/ZXBasicManual/zxmanchap19.html. It's played with minor coords.
Command line to run using x16emu:
x16emu -bas FRERE-GUSTAV.BAS -run
x16emu for Windows, Linux, and macOS can be downloaded from https://www.commanderx16.com/
I most often run x16emu in Raspberry Pi OS Linux on Raspberry Pi 4 B 8GB, but then you need to get it from https://snapcraft.io/x16emu, or compile it
from source.
This simulates the DECPS escape sequence using BASIC v2 DATA statements.
Command line to run using x16emu:
x16emu -bas DECPS.BAS -run
The subroutine in FRERE-GUSTAV.BAS and DECPS.BAS is compatible with Basicode-3 and 3C, but has extra entry line numbers for polyphonic music: https://github.com/robhagemans/basicode/blob/master/BASICODE.rst#gosub-400