TECHNICAL QUERIES

COPY QUERY

Dear RISC User,
I have had a lot of problems using *COPY. In fact I have not yet succeeded in making it work at all, though I have been able to copy files using the Desktop. Can you help?
J.H.Waton

From the comments that you make in your letter, I see that you have RISC OS. The information on *COPY is given on pages 208-210 of the Archimedes User Guide supplied with the RISC OS upgrade, but it is very short on examples. So I will supply some.

To copy the file myfile in directory $.PROGRAMS to $.BACKUP, just use:
*COPY $.PROGRAMS.myfile $.BACKUP.myfile
One possible trap for the unwary is that you must supply both a source and destination filename. The advantage of this is that you can change the name of a file as you copy it.

If you are copying from one disc to another, you must give disc names or drive numbers, and these must be preceded by a colon. For example, to copy the file file1 in the root directory of drive 4 to $.FILES on drive 0, with a destination file name of filebackup, you would use:
*COPY :4.$.file1 :0.$.FILES.filebackup

If you are using the disc name to identify the disc, the syntax is very similar. In the previous example, suppose that the name of the hard disc (drive 4) was HardDisc, and the name of the disc in drive 0 was BackUp, you could use:
*COPY :HardDisc.$.file1 :BackUp.$.FILES. filebackup
As with all filing system commands, case is unimportant.

In the brief space available here, I have not been able to mention copying files between filing systems or the so-called Copy Options. The latter are detailed in the User Guide referred to above together with one example.
Lee Calcraft

TELEPHONE TONES

Dear RISC User,
Do you have any plans to publish a sound voice module that can generate the tones used by a tone-dial telephone? This could be used in conjunction with a telephone directory program that I am writing, in order to dial the number automatically.
R. Carter

If any member wishes to send us a sound voice module which they have written, then we will consider it for publication, as we did in Volume 1 Issue 4. However, Mr. Carter doesn't actually need a separate module for his application.

The Dual Tone Multi-Frequency (DTMF) system of telephone dialling works by transmitting two audio tones for each digit. The two tones are chosen from two groups of four, thereby giving a total of sixteen possible variations. All that is needed to dial directly from the Archimedes is to set up two sound channels using the default 'WaveSynth-Beep' voice, and then use these to generate the two tones required. The commands needed to set up the two sound channels are:
VOICES 2
VOICE 1,"WaveSynth-Beep"
VOICE 2,"WaveSynth-Beep"

The table below gives the two tones used for each.
DigitTone 1Tone2
02406326145
12228825564
22228826145
32228826726
42297925564
52297926145
62297926726
72348225564
82348226145
92348226726

The tones can then be dialled using the following simple code:
SOUND 1,-15,tone1,100:SOUND 2,-15,tone2,100
t=TIME:REPEAT UNTIL TIME>t+20
SOUND 1,0,0,0:SOUND 2,0,0,0

This should be executed for each digit using the appropriate values for tone1 and tone2. A delay loop and a second set of SOUND statements are used to cut the tones off abruptly. Obviously, the tones must be played down the telephone line, and this can normally be done by placing the mouthpiece near to the speaker. Direct connection to the phone line is neither permitted nor easy.
David Spencer