*STEREO and *VOICE commands
« Thread started on: Jan 18th, 2016, 11:44pm »
Most of the features of the SDL 2.0 port of BBC BASIC are either identical to, or have some restrictions compared with, their equivalents in BBC BASIC for Windows. However there is one major exception - SOUND and ENVELOPE. I have taken advantage of SDL's multimedia capabilities to support, out of the box, the High Quality (44.1 kHz, 16-bit, stereo) sound only available from BB4W by using the HQSOUND library.
Today I've gone even further by implementing two new commands to control the sound system: *STEREO and *VOICE; these have approximately the same functionality as the STEREO statement and the *CHANNELVOICE command in ARM BASIC (on RISC OS). Their syntax is as follows:
where chan is an integer value from 0 to 3, pan is an integer value from -127 (fully left) to +127 (fully right), and waveform is an integer value from 1 to 8. These commands are available in BBC BASIC for SDL 2.0 v0.10a; the Linux (x86) version can be downloaded from here.
It gave me considerable satisfaction to provide the same eight waveforms that I chose for my Z80 Music program in 1981! That used only 8-bit samples so I performed a Fourier analysis to discover the harmonic content and synthesised new 16-bit waveforms to match the originals, but with much better quality.
Here the *VOICE command is used to reproduce, approximately, the original Z80 Music waveform switching in Ron Stickley's 1983 transcription of Come To The Fair.
Re: *STEREO and *VOICE commands
« Reply #1 on: Mar 12th, 2017, 10:07am »
Here's another demonstration, this time of Bach's Toccata & Fugue in D Minor, transcribed (in 1983 and 1981 respectively) by Ron Stickley and Gerald Pye. Best appreciated with headphones, the various 'organ stops' are spread across the stereo stage.