A set of FORTRAN routines which aid the production of synchronised soundtracks for computer animated films has been added to the Graphics Algorithm Library. The sound is created by using an EMS VCS3 synthesizer which is attached to and controlled by the ACD PDP15. This set of routines creates a data file on the host machine, which must be transferred to the PDP15. This data is then interpreted by the Computer Aided Sound Synthesis (CASS) system which controls the synthesizer.
Users are referred to the CASS Manual for details of the CASS system and how to use it and the synthesizer. All restrictions mentioned in the CASS manual still apply.
When using these routines on the 1906A data records are written to a GEORGE filestore file via a *LP, *TP or *CP channel. This file can easily be transferred to the PDP15 by using the BSI link. (PDP15 User Note 11 describes the use of the BSI 1ink).
This set of routines is not currently being made available on the 360/195 due to the problems involved in transferring a data file from the 360/195 to the PDP15.
The routines can be used with either SMOG or SPROGS.
FORTRAN naming conventions are used throughout; there is only one variable of type REAL.
The following argument names will always have the meaning outlined below.
(1) ISTART (See CASS Section 5)
This argument specifies the time at which an action is to start in time units.
If ISTART is zero then the action will occur in relative time.
(2) LENGTH (see CASS Section 5)
This argument gives the duration of the action in time units. If LENGTH is zero then an instantaneous change will be produced.
(3) IFREQ (See CASS Section 4)
This argument controls the frequency (pitch) of an oscillator, either directly or via a "note". It is in the range -30 to +50 and gives the number of semitones above or below middle 'C'.
(4) NVLOPE (See CASS Section 6)
This argument controls the CASS envelope used for the action, which specifies how long the attack should be to reach the specified value, how long it should hold that value, and how long the decay should be to return to the original value. There are 9 envelopes, numbered 1 to 9, currently defined in CASS; NVLOPE should be in the range 0-9, zero indicating an instantaneous change exactly as if LENGTH was zero. Envelope 9 is a gradual change; this is slightly different in that it takes the whole LENGTH of the action to reach the specified value and then stays there.
The exact shapes of the envelopes used are defined in the CASS manual.
SYNTHI
The routine SYNTHI is the initialisation routine which sets up the default tempo to l time unit per frame.
This routine must be called before any of the others in this Section (except 7.2.11).
NOTE1(ISTART,LENGTH,IFREQ,NVLOPE) NOTE2 (ISTART,LENGTH,IFREQ,NVLOPE)
A "note" in CASS means simultaneous control of an oscillator and an amplifier, either oscillator 1 and amplifier 1 or oscillator 2 and amplifier 2. The routines which control notes are NOTEl and NOTE2.
An envelope used for a "note" controls the volume in such a way that the volume starts at zero and rises to the current value and returns to zero.
RHYSTR(IRHYTH) RHYFIN(IRHYTH,LENGTH) PLAYRH(IRHYTH,ISTART,IREPT,ISHIFT)
A Rhythm, a series of actions, is defined using the routines RHYSTR and RHYFIN, which signify the beginning and end respectively of a rhythm definition.
LENGTH gives the length of the rhythm. Rhythms are played using the routine PLAYRH.
IRHYTH gives the number of the rhythm.
IREPT gives the number of times the rhythm is to be repeated.
ISHIFT gives a frequency shift applied to all "notes".
FILTER(ISTART,LENGTH,IFREQ,NVLOPE)
The routine FILTER controls the filter frequency.
The routine FILTRA is identical to FILTER except that the filter frequency control parameter, number 3, is in the range 0 to 4095; a value of zero gives a high band pass and 4095 a low band pass. This is rather less convenient.
REVERB(ISTART,LENGTH,MIX,NVLOPE)
The routine REVERB controls the reverberation mix level.
MIX controls the reverberation mix level; it is in the range 0-100; a value of 0 gives untreated sound, one of 100 gives full reverb.
The routine REVRBA is identical to REVERB except that the reverberation mix contro1 parameter, number 3, is in the range 0-4095; a value of 0 gives full reverb, 4095 gives untreated sound.
FREQI(ISTART,LENGTH,IFREQ,NVLOPE)
The 3 oscillators on the VCS3 are controlled by the routines FREQ1, FREQ2 and FREQ3.
Users should note that oscillator 3 has a different range to that of oscillators 1 and 2.
LEVEL1(ISTART,LENGTH,IVOLUM,NVLOPE) LEVEL2(ISTART,LENGTH,IVOLUM,NVLOPE)
The output levels of the 2 amplifiers on the VCS3 are controlled by the routines LEVEL1 and LEVEL2.
IVOLUM controls the output level and is in the range 0 (inaudible) to 4095 (very loud).
TEMPO(ISTART,LENGTH,TEMFAC,NVLOPE)
The routine TEMPO controls the tempo with the only REAL argument required by the routines. This is a factor by which the system will multiply the default tempo. For example, if 2 time units per frame are required, a value of 2.0 should be used.
TEMFAC is the argument controlling the tempo.
FREQ(ICHAN,ISTART,LENGTH,IFREQ,NVLOPE) LEVEL(ICHAN,ISTART,LENGTH,IVOLUM,NVLOPE) NOTE(ICHAN,ISTART,LENGTH,IFREQ,NVLOPE)
The routines FREQ, LEVEL and NOTE control oscillator frequencies, output levels and notes in the same way as do FREQ1, LEVEL1 and NOTE1 except there is an extra argument (the first) which specifies the unit number. Thus a call to FREQ(1, .... ) is equivalent to a call of FREQ1( .... ).
MUSOUT(KEYIND,ISTART,LENGTH,IVAL,NVLOPE)
The routine MUSOUT is used by all the other routines to write data to the file in the format required by CASS.
KEYIND is the CASS Key Index (See 7.3) which tells CASS what sort of record it is and what to do with it.
IVAL is the value controlling the synthesizer device (IFREQ etc).
The format required by CASS is (I3,1H,,I6,/,I7,1H,,I4,1H,,I1). The user is unlikely to need to use this routine directly.
CASOUT(JCHAN)
The routine CASOUT can be used to change the output stream number for the data file to JCHAN. The default is stream number 6. On the 1906A using the default program description for SMOG and SPROGS, held in :SUBLIB.TASK-SPD, this writes to GEORGE channel LP9. In the macro call to SMOG or SPROGS a parameter #LP9 filename should be given. If the routine CASOUT is used to change the stream number the user must supply his own program description segment which should link this stream to an appropriate GEORGE channel.
ENDMUS(IEND)
The routine ENDMUS writes an essential record to the datafile which is recognised by CASS as an end of file marker, All records after this are ignored.
IEND gives the time to stop synthesizer control. The synthesizer will remain in the state it was in at time IEND, except for the volume levels which are set to zero.
(1) KEY INDEX (See CASS Section 2)
This is a number which tells CASS what sort of record it is to expect and what to do with it. Each routine uses a Key Index according to the following Table.
SYNTHI 11 REVERB 13 NOTE1 2 REVRBA 5 NOTE2 3 FREQ1 6 RHYSTR 90 FREQ2 7 RHYFIN 90 FREQ3 8 PLAYRH 90 + IRHYTH LEVEL1 9 FILTER 12 LEVEL2 10 FILTRA 4 TEMPO 11 MUSOUT - FREQ 5 + ICHAN CASOUT - LEVEL 8 + ICHAN ENDMUS 1 NOTE 1 + ICHAN
(2) DEFAULT VALUES
CASS will assume the fo1lowing defaults:-
JFREQ in FILTRA : 2048 IVOLUM in LEVEL1 and LEVEL2 : 3000 MIX in REVERB : 0 MIX in REVRBA : 4095
1. The routines can be used with either SMOG or SPROGS.
2. The routines are accessible from the 1906A library file :GRAFLIB.GRAFLIB and this name must be included in a LIB parameter in a macro call.
The routines are not available on the 360/195.
1. Francis A.H. and Peart I.R. 'The CASS Manual', Atlas Computing Division of the Rutherford Laboratory.
2. Ford L.O. PDP15 User Note 11, Atlas Computing Division of the Rutherford Laboratory.
The following program uses the SMOG routines to draw a circle moving across the frame, in 51 frames. On one audio channel a continuous note is heard which decreases in frequency; on the other channel are 11 'pips', one every 5th frame of 1 frame's duration, increasing in frequency. If the example program is in a file EXAMPLE then the following SMOG call on the 1906A can be used to produce CASS data in the file CASSDATA.
SMOG *CR EXAMPLE,LIB:GRAFLIB.GRAFLIB,#LP9 CASSDATA,JT25
Example Program LIST C MASTER CIRCLECASS C C INITIALISE GRAPHICS C CALL FRPR16 C C SET LIMITS C CALL CINE CALL LIMITS(0.0,0.0,100.0,100.0,1.0,1.0 ) C C INITIALISE CASS C CALL SYNTHI C C DO CONTINUOUS SOUND ON CHANNEL 2,FREQUENCY DECREASING C CALL LEVEL2(0,0,3000.0) CALL FREQ2(0,0,5,0) CALL FREQ2(0,51,-5,9) C C DO SOUND AND GRAPHICS FOR 51 FRAMES C PI=1.1415926 K=6 DO 20 1=1,51 ITIME=I-1 C C TIME TO DO PIP YET? C IF(ITIME-(ITIME/5)*5.NE.0)GO TO 100 C C YES - INCREASE FREQUENCY AND DO PIP ON CHANNEL 1 C K=K+1 CALL NOTE1(ITIME,1,K,6) C C DRAW CIRCLE ON THIS FRAME C 100 XX=FLOAT(ITIME)+20.0 X=XX+20.0 Y=25.0 CALL SETXY(X,Y) DO 10 J=1,64 ANG=FLOAT(J)*PI/2.0 X=XX+20.0*COS(ANG) Y=25.0+20.0*SIN(ANG) CALL TOXY(X,Y) 10 CONTINUE CALL ADVFLM 20 CONTINUE C C TERMINATE GRAP1CS C CALL ENDSPR C C TERMINATE CASS C CALL LEVEL2(51,0,0,0) CALL ENDMUS(51) STOP END
Listing of CASS data file produced by example program
11, 0 0,1440,0 10, 0 0,3000,0 7, 0 0, 5,0 7, 0 51, -5,9 2, 0 1, -5,6 2, 5 1, -4,6 2, 10 1, -3,6 2, 15 1, -2,6 2, 20 1, -1,6 2, 25 1, 0,6 2, 30 1, 1,6 2, 35 1, 2,6 2, 40 1, 3,6 2, 45 1, 4,6 2, 50 1, 5,6 10, 51 1, 0,0 1, 51 0, 0,0