Page  362 ï~~Resource Utilisation for a Real-time Instrument Design Language M.A. Marks & N.L. Briggs University of Bradford, Microcomputer Music Research Unit Department of Computing, Bradford BD7 1DP, UK & ABSTRACT Throughout the history of computer music there have been a profusion of musical languages aimed at aiding musical composition. Most Languages have followed the Music V paradigm (Mathews 1969), which realistically bases the construction of musical instruments around using only a few oscillators. Accurate simulations of acoustic instruments are more complex and require a large number of oscillators. At this level of utilisation most music languages become too unwieldy to use. The University of Bradford Microcomputer Music Research Unit is currently reviewing the field of music languages, with the aim of producing a viable real-time instrument design language for an additive synthesis machine. Research has divided into three areas: (i) the instrument interface. (ii) the generation, storage and output of waveforms. (iii) resource allocation. This paper concentrates on resource allocation and how system resources map to notes of an instrument. System resources are defined as unit generators that can output sine or complex waveforms. In particular the paper considers the extremes of system use, i.e. under a heavy or low work load. Two techniques to aid resource allocation are investigated: (i) priority (ii) variable wavefonn resolution. 1. INTRODUCTION When constructing an acoustic simulation for a real-time additive synthesis Instrument Model. machine, a generalised instrument model may be formed from the definition of... {,, four basic building blocks. The four blocks together with their inter-relationship are indicated in figure 1 The controller is responsible for receiving notes and other gestural information [,,,,. from the instrument interface. Upon receiving messages from the instrument interface the controller can communicate with the soundfiles and resource state. Using information from the resource state, the controller assigns generators to waveforms from the soundfiles and outputs the waveforms to the music machine $rfN hardware. Whilst a note is sounding the controller still has control of each 'K4..waveform and can receive information from the instrument inteiface. Once a note has finished sounding the controller can notify the resource state that the re 1 G.rc,, V k,n, Mode waveformn generators are free. 2. THE PROBLEM The model shows that for a real-time acoustic instrument simulation the machine system resources are intrinsically linked to the instrument model, as the availability of system resources affects the potential quality of the instrument sound. Additive synthesis can be considered a particularly "greedy" algorithm in the way it consumes generators. In most additive synthesis machines the number of generators available is limited and compromises have to be made. For example the Bradford Musical Instrument Simulator (BMIS) (Comerford 1986) allows the grouping of harmonic partials into a single amplitude envelope, so that they may be sounded by a single generator. The number of harmonic groups used to represent each note of an instrument governs the performance/quality of the instrument. However what happens when a large number of notes are played and there arc simply not enough generators to provide the amount of partials required? Conversely what if a system does have a latrge number of generators, which are under-used until a large number of notes are played? These two extremes of resource allocation show the need for a well defined strategy to utilise system resources, to produce an optimum quality of sound from the resources available. 3. PRIORITY The Priority heuristic assigns a usefulness to each active generator. This enables a system under a heavy load to reallocate generators of low priority to more crucial tatsks. A simple priority system is implemented on the BMIS (Marks 362

Page  363 ï~~1988) where if there are no free generators the system software re-allocates generators sounding low amplitude waveforms to newly instigated notes. However, removing the quietest generator is not always the optimal solution, as the perceived change in sound can be affected to a great extent by the variation in the spatial clustering of individual frequencies. For example, if a chord is played at the lower end of a keyboard simultaneously with a single note played several octaves above, then, even if the single note is the quietest played, the contribution of its partials to the total sound may be greater than that of some of the chord partials. A more justifiable heuristic would be to take into account both frequency grouping and amplitude, by constantly assigning/updating a priority rating to each generator. However a priority heuristic has one main drawback, that is the heuristic only operates when the system is overloaded i.e. it does not seek to improve the sound quality when the system is under a low work load. On the present BMIS system each note of an instrument model is allocated a fixed number of generators. Suppose an instrument model is allocated four generators per note from a system total of sixty four, then, if for the majority of the time the system is playing single notes, only 6% of the total resources will be utilised. 4. VARIABLE WAVEFORM RESOLUTION The Variable Waveform Resolution heuristic allows the sound structure of each note from the instrument model to change, dependent on the availability of resources. Using such a heuristic, a hierarchy of note structures could be created for each note of the instrument model. The hierarchy would allow a different quality of realism to be added to a note, related to the number of generators available. For example, an acoustic piano simulation may have several hierarchical levels as follows:- Analysis shows that a piano note has partials which progressively sharpen. If a generator can only create partials which are harmonic, a sharpening of successive partials may be approximated by splitting partials into different groups and progressively sharpening each group assigned to a note. The quality of the approximation will then be dependent upon the number of groups used. At another level in the hierarchical structure spare generators could be used to simulate sympathetically resonating strings created when a piano note is struck. One drawback of pre-generating complex wavefonns for the variable waveform heuristic is that all partials within a generator must be a harmonic of the fundamental so that there are no discontinuities when the generator's waveform is cycled. This causes two problems: (i) it is difficult to move from one harmonic approximation to another, should the system require free generators, as there can be no discontinuities in a complex waveform's phase and frequency relationship (ii) there is a higher limit on the number of generators that can be used to simulate each note, without causing an unjustifiable degradation in sound quality. However, if generator memory was extended to hold multiple cycles of the fundamental then it would be possible to store inharmonic partials. The minimum number of cycles needed (i.e. units of wavestore memory) for m generators is defined as follows: Let g 1, be a sequence of m generators such that m aI Vgl,g2... gm {U} & Ugi={U & gig=, l~i,j_<m, ij where U is the set of natural numbers representing the time periods of partials. m LCMg} Then the minimum number of cycles needed for the generators is given by rin gl~g2.... gm i=l maxtgl where LCM{gi) = lowest common multiple of the elements of gi i J & max is the largest element of giNote: Accuracy will be dependent on the resolution of the integer approximation of time period. 5. CONCLUDING REMARKS The priority and variable waveform resolution heuristics seek to improve real-time resource utilisation and hence improve the quality of sound synthesis attained. Although, both reduce sound quality degradation when the availability of system resources is limited, the variable waveform resolution heuristic will also improve the sound quality when resources are under-utilised. 6. REFERENCES Comerford P.J. "The Bradford Musical Instrument Simulator" Proceedings of the 12th International Computer Music Conference '86," The Hague, Netherlands, pp 301-301, Oct. 20-25, 1986. Marks, M.A., "Resource Allocation in an Additive Synthesis System for Audio Waveform Generation," Proceedings of the 14th International Computer Music Conference '88," Cologne, pp 378-382, Sept. 20-25, 1988. Mathews, M.V., Miller, J.E., Moore, F.R., Pierce, J.R., & Risset, J.C., The Technology of Computer Music MIT Press Cambridge, Mass, 1969. 363