Generic panning tools for MAX/MSPSkip other details (including permanent urls, DOI, citation information)
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 3.0 License. Please contact firstname.lastname@example.org to use this work in a way not covered by the license. :
For more information, read Michigan Publishing's access and usage policy.
Page 00000001 Generic panning tools for MAX/MSP Ville Pulkki email@example.com Laboratory of Acoustics and Audio Signal Processing Helsinki University of Technology Center for New Music and Audio Technologies (CNMAT) University of California, Berkeley Abstract Vector base amplitude panning (VBAP) is a generic method for virtual source positioning. It generalizes the pair-wise panning paradigm to triplet-wise panning paradigm, which can be used in three-dimensional loudspeaker setups. The VBAP implementation in MAX/MSP software presented in this paper is a powerful tool to produce spatialized computer music pieces that can be presented with different loudspeaker setups. Virtual sources are positioned by defining the virtual source directions as (azimuth, elevation) coordinates. The spread of the virtual sources can also be controlled. INTRODUCTION In computer music it is a common problem that the loudspeakers are in different positions in different concert halls and computer music studios. The ideal is a system that would be able to create identical soundscapes using different loudspeaker configurations. Vector base amplitude panning (VBAP) (Pulkki 1997) is a new approach. It is an amplitude panning method which can be used to position virtual sound sources using an arbitrary loudspeaker configuration. The applications of VBAP vary from computer music to virtual acoustics. The presented implementation is already being used by some computer musicians. VBAP is also used as virtual source positioning method in virtual acoustics projects (Savioja, Huopaniemi, Lokki & Vaininen 1999, Fouad, Ballas & Brock 2000). An implementation of it is being included to CSound 4.06 software. In this paper the theory of VBAP is reviewed, and its implementation in MAX/MSP software is presented. Some possible uses of it are discussed and demonstrations available are presented. 1. VBAP 1.1. Theory In conventional amplitude panning a sound signal is applied to two loudspeakers in front of the listener (Blumlein 1931). The listener perceives a virtual source between the loudspeakers. When a sufficient loudspeakers are placed on horizontal plane around the listener, virtual sources in all azimuth directions can be produced using the pair-wise paradigm (Chowning 1971). One sound signal is then applied to two loudspeakers at one time. With loudspeaker systems that also include elevated loudspeakers, the pair-wise paradigm is not appropriate. Triplet-wise panning can be formulated for such loudspeaker configurations. The loudspeakers in a triplet form a triangle from listener's view. The listener will perceive a virtual source inside the triangle depending on ratios of the loudspeaker amplitudes. \4 channel k virtual, source, / /\, channel n channel m ', Figure 1: Three-dimensional panning. In three-dimensional VBAP a loudspeaker triplet is formulated with vectors as in Fig. 1. The Cartesian unit-length vectors In, 1 and lk point from listening position to the loudspeakers. The direction of the virtual source is presented with unit-length vector p. Vector p is expressed as a linear weighted sum of the loudspeaker vectors P = 9mlm + gnln + gklk. (1) Here gi, gn, and gk are the gain factors of respective loudspeakers. The gain factors can be solved as g TL -1 g~ -P rnk, (2) where g = [gm 9n gk] and Lmnk = [1 In Ik]. The calculated factors are used in amplitude panning as gain factors of the signals applied to respective loudspeakers after suitable normalization, e.g. |lgl| = 1. If more than three loudspeakers are available, a set of non-overlapping triangles are formed of the loudspeaker system before run time. One of the defined
Page 00000002 triplets is used in panning at one time, see Fig. 2. There can be, of course, several virtual sources applied to one triplet. The triangularization can be performed automatically using method presented in (Pulkki & Lokki 1998). ----------- 7". o ~fl, - / ~\ '\ Figure 2: Using VBAP with arbitrary loudspeaker setups. VBAP has some important features. If a virtual source is panned to the same direction with any of the loudspeakers, the signal emanates only from that particular loudspeaker. Also, if it is panned to a line connecting two loudspeakers, the sound is applied only to that pair, following the tangent panning law (Bernfeld 1973). These properties imply that VBAP produces virtual sound sources that are as sharp as it is possible with any loudspeaker configuration and amplitude panning. However, the perceived direction may differ from the panning direction, when the virtual source is applied to more than one loudspeaker. The difference between panning direction and perceived virtual source direction has an upper limit. In cases when the virtual source direction is perceived differently from the value that VBAP predicts, it is not localized outside of the triangle to which it was panned. Thus the maximal localization error is proportional to the dimensionality of the loudspeaker triangle. This is also valid outside the best listening position. When the amount of loudspeakers is increased, the directional error of virtual sources decreases, because the dimensionalities of triangles decrease. With a sufficient amount (> 8) of loudspeakers, it is possible to generate fairly constant spatial impression to a large listening area. VBAP can also be formulated for two-dimensional setups. Panning is performed then with conventional pair-wise panning. All used vectors are twodimensional, and the vector bases are formed of two vectors. 1.2. Virtual source spread control In pair-wise and triplet-wise amplitude panning it can be found disturbing that spread and timbre of a virtual source varies when it is moved. This happens because the spread of a virtual source is dependent on the amount of loudspeakers producing it. When a virtual source is in same direction with a loudspeaker, the virtual source is localized very consistently to that direction. When it is panned between loudspeakers, it will appear spread. This is sometimes described as "loudspeaker directions are audible". This artefact is not present with Ambisonics system, when it is used as a panning tool (Malham & Myatt 1995). In Ambisonics the directional spread is not dependent on virtual source positioning direction, because the amount of loudspeakers producing a sound signal is not dependent on it. However, in Ambisonics system the sound is applied to almost every loudspeakers at one time. The produced virtual sources are spatially spread, and the perceived virtual source direction is dependent on listening position. The spreading of virtual sources can be controlled in pair-wise or triplet-wise panning. The method is called multiple-direction amplitude panning (MDAP) (Pulkki 1999). In it the gain factors are calculated with multiple panning directions close to each other. The gain factors corresponding to each loudspeaker are summed up to form one gain factor for each loudspeaker. The resulting gains are normalized. The listener perceives still a single virtual source. The perceived spread of the virtual source can be controlled with amount and distribution of panning directions used in MDAP. If a sufficient set of panning directions applied, the coloration and spread is not dependent on panning direction. The amount of loudspeaker producing a virtual source is then constant and the virtual source will be spread and colored in same degree in all directions. This approach makes it possible to control the spreadness of the virtual source as an independent parameter. Also, the spreadness of virtual sources in matrixing systems like Ambisonics can be simulated. 2. PANNING WITH VBAP IN MAX/MSP MAX/MSP is a graphical programming environment. MAX is designed for processing of events, and MSP is an extension of it designed for real-time audio applications. In this work an earlier implementation of VBAP was ported to MAX/MSP with primary use in CNMAT's sound spatialization theatre (Kaup, Freed, Khoury & Wessel 1999). ~ O 'a a Con ct u C1 Co -.VBAP gain direction control factors spread control sound generation......i au'diO'........ - - - - - - - - - - - - - - - - - - - - - I_ _ L______ L______ - -.......................... - - 3 0 Figure 3: A schematic figure of VBAP implementation. The VBAP implementation consists of three objects: define_ loudspeakers, vbap, and matrizx. A schematic figure of the implementation is shown in Fig. 3. A vbap object is attached to each generated sound signal. The user may design controls for direction and spreading for it. The loudspeaker setup is defined using define_ loudspeakers. The matri~x object performs distribution of sound signals to loudspeakers. When the patch is applied for different loudspeaker setups, only the settings of define_loudspeakers and matrixz
Page 00000003 object has to be updated. Object define loudspeakers performs all needed calculations to form a data set that describes the loudspeaker setup, see Fig. 4. It is initialized by specifying the directions of the loudspeakers. It chooses loudspeaker pairs or triplets and calculates an inverse matrix L-1k for all of selected triplets. It outputs the matrices and the loudspeaker numbers of each triplet to all vbap objects. It performs these calculations when it receives a bang message. It can read the loudspeaker configuration as a list and read the loudspeaker triplets as a list. The latter list is used if the user wants to select the triangles by hand. Normally this is not needed. n tion. In 2-D setups the number of panning directions is 7 and in 3-D setups the number is 17, the layouts of directions are presented in Figs. 6 and 7. In these figures the variable 7 presents the largest angle between actual panning direction and the partial panning directions. II Figure 6: Panning directions used in 2-D spreading. The spreading parameter is equal to 7 value used in MDAP. In addition, when the value of the spreading parameter exceeds 70, the gain factors of all loudspeakers are faded in. When the parameter has value 100, the gain factors of all loudspeakers have nearly the same values. Figure 4: The loudspeaker configuration is specified in define loudspeakers object. The first parameter is the dimensionality of the loudspeaker setup, which can be 2 or 3. If the dimensionality is 2, the following entries are the azimuth angles of the loudspeakers. If the dimensionality is 3, following number pairs are (azimuth, elevation) coordinates of the loudspeakers. The loudspeaker directions are presented in order of the loudspeaker channel numbers. The vbap object calculates gain factors depending on specified panning direction and on received loudspeaker setup information, see Fig. 5. It takes as input the loudspeaker setup data from object define_loudspeakers, panning angle as azimuth and elevation parameters, and a parameter that controls spread of the virtual source. When the vbap object receives a bang, it performs calculations of VBAP and MDAP and outputs the gain factors for all loudspeaker channels. Panning direction azi ele Vc I I - I spreading of the virtual source Figure 7: Panning directions used in 3-D spreading. The matrix- object performs the panning process of audio signals. It receives audio signals from MSP object(s) and gain factors from vbap object(s), see Fig. 8. It outputs each audio signal to each loudspeaker channel gained with corresponding gain factor. In Fig. 8 the object Is_ delays is used to delay the loudspeaker signals to compensate different loudspeaker distances. Object dac performs the digital-to-analog conversion. The parameters are the number of inputs, the number of outputs, type of cross fading and the length of cross fade as amount of samples. The cross fade type can be smooth (linear cross fading) or fast (no cross fading). The only MSP object in VBAP implementation is matrixn, it also is the only object that demands significant computational facilities. However, the implementation is computationally efficient. Over 30 virtual sources can be synthesized and panned using one 300 MHz G3 Macintosh at 44100 Hz sample rate. The vbap implementation in MAX/MSP is available at http://www.acoustics.hut.fi/vville/. Related demonstrations also are available at the web server. 3. USING VBAP Before the run time directions of the loudspeakers are measured and entered to object define_loudspeakers. The loudspeakers should be in equal distance from the best listening position. If they are not, the loudspeaker signals should be delayed to compensate the propagation time differences. The level generated by each loudspeaker to the best listening position should be equal. / | l I l el I | l i actual spreading azi ele actual panning direction Figure 5: Object vbap calculates the gain factors of the loudspeakers and sends them to matrixz object. If the specified virtual source direction is outside of the panning directions possible with the current loudspeaker setup, vbap object finds the nearmost triangle and it applies the sound to it. The panning angle to which the sound was actually panned is an outcome of the object. The value of the spread parameter can vary between 0 and 100. When the value is 0, conventional amplitude panning is used. When the value is greater, MDAP is applied. Gain factors are calculated to a number of directions around the desired panning direc
Page 00000004 V F 4 / matrix 10 10 smooth 1000 il,ll-i ______iililiililli~ililil^^ dai 123456767910 Figure 8: The matrix- object takes to one inlet the audio signal from MSP objects and gain factors from vbap object. The audio signal is panned to loudspeakers using the gain factors. The loudspeaker signals can be adjusted with power amplifiers or in MAX/MSP. The vbap object is basically controlled by entering the panning angles and spreading value to its inlets. Graphical user interfaces can be also designed. A simple example is shown in demonstration *2. In it the upper hemisphere is projected to a 2-D circle. The virtual source directions can be controlled by clicking and dragging inside the circle. A simple virtual acoustic environment is presented in demonstration *4. The distance and direction of a virtual source can be controlled. The distance effect is implemented by controlling the amplitude and delay of sound signal. The amplitude is calculated with 1/r law to simulate the distance attenuation. The sound signal is delayed to simulate the air propagation delay. The direction is simulated with VBAP. In the demonstration a mechanism moves the virtual source on a surface of a 3-D toroid around the listener. The Doppler shift, changing loudness and changing direction of the virtual source are clearly audible. Also a simple 2-D graphical interface is provided to control the location of the virtual source in horizontal plane. The patch can be modified to produce arbitrary 3-D movements of several virtual sources if wanted. This virtual acoustic environment corresponds to anechoic conditions. If rooms with reflections and reverberation are to be simulated, more complicated models have to be constructed. A random panning method is applied in demonstration *5. This demonstration is a computer music piece by author, that is an interpretation of a binary counter to music. The counter runs with constant speed through all binary numbers sequentially. A signal generator is attached to each bit, which produces a tone when the bit is set. Each tone is panned to a random direction individually. The rate of tones corresponding to least significant bits is very fast, which produces an immersive surround effect. 4. ACKNOWLEDGMENT The work of Mr. Pulkki has been supported by the Graduate School in Electronics, Telecommunications and Automation (GETA) of the Academy of Finland and by Tekniikan Edistamissditi6. The author wishes to thank Gibson, DIMI, Meyer and Edmund Campion who helped build CNMAT's sound spatialization theater and covered CNMATs internal costs relating to author's visit. The author would also like to thank Mr Tristan Jehan and Mr Richard Dudas of their help in MAX/MSP programming and all CNMAT people for hosting a fruitful visit. References Bernfeld, B. (1973), 'Attempts for better understanding of the directional stereophonic listening mechanism', 44th Convention of the Audio Engineering Society, Rotterdam, The Netherlands. Blumlein, A. D. (1931), U.K. Patent 394,325. Reprinted in Stereophonic Techniques, Audio Eng. Soc., NY, 1986. Chowning, J. (1971), 'The simulation of moving sound sources', J. Audio Eng. Soc. 19(1), 2-6. Fouad, H., Ballas, J. A. & Brock, D. (2000), An extensible toolkit for creating virtual sonic environments, in 'Proceedings of International conference on auditory displays 2000', ICAD, Atlanta, Georgia, USA. Kaup, A., Freed, A., Khoury, S. & Wessel, D. (1999), Volumetric modeling of acoustic fields in CNMAT's sound spatialization theatre, in 'proceedings of the International Computer Music Conference', ICMA, Beijing, China. Malham, D. G. & Myatt, A. (1995), '3-d sound spatialization using ambisonic techniques', Comp. Music J. 19(4), 58-70. Pulkki, V. (1997), 'Virtual source positioning using vector base amplitude panning', J. Audio Eng. Soc. 45(6), 456-466. Pulkki, V. (1999), Uniform spreading of amplitude panned virtual sources, in 'Proceedings of the 1999 IEEE Workshop on Applications of Signal Processing to Audio and Acoustics', Mohonk Mountain House, New Paltz. Pulkki, V. & Lokki, T. (1998), Creating auditory displays to multiple loudspeakers using VBAP: A case study with DIVA project, in 'International Conference on Auditory Display', ICAD, Glasgow, England. Savioja, L., Huopaniemi, J., Lokki, T. & Vinainen, R. (1999), 'Creating interactive virtual acoustic environments', J. Audio Eng. Soc. 47(9), 675-705.