Sound commands on the Archimedes machine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Name: 0310022 Version: 0.02 History: 0.01: Undated : started. 0.02: 14-Feb-89: updated for release on SID The sound system on the Archimedes series is not fully compatible with that on other members of the BBC family of computers. The Archimedes machine has 8 channels, each of which can be individually programmed to different instruments with their own stereo positions, while the BBC Micro has 4 channels (3 sound channels and 1 noise) in mono. Further, the Archimedes machine does not queue sounds, but truncates anything playing on the specified channel when the next note is executed: i.e. on the BBC, SOUND 1,-15,10,10:SOUND 1,-15,100,10 would sound a low tone for one second followed by a high tone for one second, while the Archimedes would play a very short section of the first tone and then immediately play the second. The sound system is controlled by five statements: SOUND, BEATS, TEMPO, STEREO, and VOICES. 1. The SOUND statement The sound statement has four or five parameters: SOUND ,,,[,]] is the channel on which the sound is to be played, which can be between 1 and 8 depending on the VOICES statement. controls the volume at which the note is to be played. This is the same as on the BBC Micro, i.e. -15 is the loudest and zero is silence. There is also a logarithmic scale which is invoked by giving a value between 256 (&100) and 383 (&17F). A change of 16 represents a doubling or halving of the volume. Note that values between 1 and 255 have no effect since the Archimedes machine does not provide envelopes. can be controlled by using values between 0 and 255 as on the BBC Micro. Alternatively, a finer control is available by giving a value between 256 (&0100) and 32767 (&7FFF). Each number consists of 15 bits, with the top 3 controlling the octave number while the bottom 12 control the fractional part of the octave. Thus each octave is split into 4096 different pitch levels. Middle C has the value 16384. determines the maximum time for which a note will sound. A value of 0 to 254 specifies the duration in twentieths of a second. A value of 55 causes the note to sound continuously, stopping only when escape is pressed or another note is played on that channel. The optional parameter is used for synchronising the playing of several notes. This causes the playing of the note to be delayed until the beat count equals or exceeds the value of . The SOUND command can also be used to switch the sound system on or off with the commands SOUND ON and SOUND OFF. 2. The BEATS statement The beats statement is used to set the maximum value of the beat counter before it resets to zero. The format of this statement is BEATS . Note that this does not reset the beat counter to zero. 3. The TEMPO statement The tempo statement controls the speed at which the beat counter counts. By typing TEMPO , the beat counter will count at /&1000 beats per centi-second. Thus a value of &1000 corresponds to one beat per centi-second while &0500 corresponds to one beat every two centi-seconds. 4. The STEREO statement The stereo statement sets the position in the stereo image of each channel from extreme left to centre to extreme right. The command is STEREO , where is a number from -127 to +127, with -127 being the extreme left, +127 the extreme right, and 0 the centre. 5. The VOICES statement It is helpful to understand the difference between a VOICE and a CHANNEL. Unfortunately, Basic V confuses the issue! A voice is a definition of how a note should sound. A list of the installed voices can be seen with *VOICES. A channel is used to play a note and has an associated voice. The VOICES statement determines how many channels are active at any one time. This is important, since sound generation consumes a lot of computer power and the number of active channels should therefore be minimised. Another consideration is that as the number of active channels is increased, the volume of each is reduced. Thus, if you have 4 active channels, they will each be half the volume of 2 active channels. To determine the number of active channels, use VOICES where is the number of channels required. Note that the number of channels must be a power of 2 and therefore the computer will round the number to 1, 2, 4, or 8.