BBC BASIC
« *STEREO and *VOICE commands »

Welcome Guest. Please Login or Register.
Sep 24th, 2017, 01:33am


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: *STEREO and *VOICE commands  (Read 323 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 587
xx *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:

Code:
      *STEREO chan,pan
      *VOICE chan,waveform 

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.



Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 587
xx 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.



Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 587
xx Re: *STEREO and *VOICE commands
« Reply #2 on: Mar 15th, 2017, 3:11pm »

on Mar 12th, 2017, 10:07am, Richard Russell wrote:
Here's another demonstration, this time of Bach's Toccata & Fugue in D Minor

If you would like to play this on your own device here is a link to the code:

www.rtr.myzen.co.uk/tocfugue.txt

I've made it available as a plain-text file to simplify copying to an Android device (visit the URL with your browser; 'select all' and copy to the clipboard; paste into an empty file in BBC BASIC).

It will run as-is in all editions of BBCSDL. To play in BB4W REM-out the OSCLI "voice " and OSCLI "stereo " lines (obviously there will be no stereo or stop-change effects in this case).

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls