The present invention relates to sound synthesis. More particularly, but not exclusively, the present invention relates to new methods and software tools that simulate interacting with geometric shapes to synthesize sound. The present invention has wide-ranging applications, such as the design of musical instruments, loudspeaker casings, architectural spaces and the like.
With fast computers and modern techniques, one can synthesize various sounds in real time. When objects, such as musical instruments, are used to generate sound, it would be desirable to know how changing the shape of the object, or the materials that make up the object, will change the object's sound. When such changes are made to the object, interactive sounds synthesis in real time is problematic. The primary reason is because the computational techniques used in modal synthesis for sound generation are time-consuming.
The modal synthesis method lends itself naturally to sound synthesis, because it allows one to accurately model object sounds without the need to explicitly program the properties of several oscillators. Instead, oscillator properties are determined by the system equations, which depend on the object's geometry and mathematical properties.
Using a modal decomposition, one can convert a large system of coupled linear differential equations into simple, independent differential equations in one variable, which is much more efficient than solving the original coupled system. The modal response of an object is determined by performing a system eigendecomposition to arrive at eigenvectors forming a basis for the object's motion and eigenvalues determining the resonant frequencies of the object. The eigenvalues and eigenvectors provide the information needed to recreate the object's surface as it deforms.
This eigenvalue problem is relatively expensive to perform. And, to design new object shapes with standard modal analysis, one would need to recompute the modes for each new design—a prohibitively expensive step for an interactive software computational and musical tool. Put another way, a significant limitation of using the modal method for designing sound generating objects, such as instruments, is the cost of computing the eigen-information. This affects the modifications that can be made to the object's geometry and material after the eigensolution has been determined. To design an object from physical simulation, it would be desirable to be able to compute modes in real time, so that the geometry, and therefore spectrum, of the object can be changed interactively.
For example, plate reverberation has traditionally been used as a synthetic means to simulate large room acoustics. It was one of the first types of artificial reverberation used in recording. Despite the unnatural sound produced as compared to large room reverberation, plates were used extensively due to their relative low cost and size. More recently, researchers have looked for a means of digitally simulating plate reverberation to recreate this unique analogue recording style.
Analogue plate reverberation works by mounting a steel plate with tension supplied by springs at the corners where the plate is attached to a stable frame. A signal from a transducer is applied to the plate, causing it to vibrate. This vibration is then sensed elsewhere on the plate with contact microphones. A nearby absorbing pad can also be used to control the near-field radiation.
By using a physical model, one can modify the geometry of the plate and input/output parameters. To simulate plate vibration, the model can be discretized in space and time using finite differences. One significant drawback of this method, however, is the large performance requirements, preventing the model from running in real time on an average digital workstation. A need therefore exists for methods of computing reverberation in real-time that still allows for modifications of the plate and input/output parameters.
It is a primary object, feature, or advantage of the present invention to improve over the state-of-the-art.
It is a further object, feature, or advantage of the present invention to provide improved computational tools to aid in the design of a musical instrument and other sound generating objects.
It is a still further object, feature, or advantage of the present invention to provide computer-implemented methods of simulating in real-time the resonant frequencies of an object of arbitrary geometry as changes are made to the geometry of the object.
Yet another object, feature, or advantage of the present invention is the provision of a software article/system for interactive use by a user in simulating reverberation in real time for a structure represented by a finite element model.
A still further feature, object, or advantage of the present invention is the provision of a software system/article that allows users to interact with an object either in a plate reverberation or instrument design mode to understand how changing the shape and/or materials of the object will change the resulting sound.
One or more of these and/or other objects, features, or advantages of the present invention will become apparent from the specification and claims that follow.
According to one aspect of the present invention, the computer-implemented method of simulating in real time the resonant frequencies of an object as changes are made to the geometry of the object is provided. Using modal synthesis methods, a modal decomposition of a finite element model of the object is computed. Changes are made to the geometry of the object and the corresponding finite element model, and estimated resonant frequencies for the object as modified are computed. A simulated sound for the object as modified is rendered by applying an impulse to the object. The Rayleigh-Ritz method is preferably used to compute the estimated resonant frequencies for the object as modified. A three-dimensional representation of the object can also be rendered on a computer display, and various locations on the object can be mapped to controllers on a digital interface to allow the user to select a location on the object to apply the impulse.
According to another aspect of the invention, a computer-implemented method of designing an instrument in real time is provided. The method includes providing a finite element model for the instrument and computing a modal decomposition for the finite element model. A three-dimensional graphical representation of the instrument is displayed on a computer display. Once changes are made to the geometry of the instrument and the corresponding finite element model, a three-dimensional graphical representation of the instrument as modified is rendered on the computer display and estimated resonant frequencies for the instrument as modified are computed. A simulated sound for the instrument as modified is then rendered by applying an impulse to the instrument. The estimated resonant frequencies are again preferably performed using the Rayleigh-Ritz method.
Another aspect of the present invention is a software article for interactive use in simulating reverberation in real time for a structure represented by a finite element model. Upon receiving an input from the user to modify the geometry of the structure, modifications to the finite element model are made and estimated resonant frequencies for the structure as modified are computed. In an interactive fashion, the software enables the user to render a simulated sound by applying an impulse at one of various locations on the structure as modified. The impulse can include complex waveforms.
According to another aspect of the invention, a software article for interactive use in generating sounds in real time for a virtual instrument is provided. Estimated resonant frequencies are computed in real time as the user modifies the geometric parameters of the object and/or other sound-shaping input parameters. Musical notes can be mapped to controllers on a digital interface to enable a user to play the virtual instrument using a peripheral device, such as a MIDI/OSC keyboard.
The present invention provides new methods and computational tools that provide for real-time reverberation simulation and interactive sound synthesis for objects as the objects undergo shape change. Given a finite element analysis of a geometric object, the vibration of the object can be computed efficiently using modal synthesis. As explained previously, to use modal synthesis, one must first compute a partial eigenvalue decomposition of the system matrices. This eigenvalue problem is relatively time-consuming, but only needs to be computed once for a given object. To evaluate changes to the resonant frequencies of the object after undergoing a shape change, one would normally need to recomputed the modes for each new design or shape, which is a time-consuming step for an interactive software tool.
The following description of exemplary embodiments describes methods for estimating the resonant frequencies for shape-changing geometric objects. Once the modal decomposition is performed and the model is broken up into uncoupled resonators, one can interact with the model quite efficiently and in real time to generate realistic sounds. A detailed description of preferred software systems is provided that enables users to interact with the model as an instrument. As an instrument, the user can feel as though she is “playing” the object by applying forces to a physical interface. Alternatively, a user can select an audio input to be played at various locations on the object in order to simulate plate reveration.
Those skilled in the art having the benefit of this disclosure will appreciate that the present invention extends far beyond simple instrument design and plate reverberation, and has direct application into such fields as sonic aesthetic design of architectural performance spaces, mechanical engineering design, and musical sculptures. By way of example only, the present invention can be used not only in designing new instruments, but in designing loudspeaker casings, architectural spaces, and can be used to actively dampen and selectively cancel resonant frequencies of an object or instrument to thereby change the sound characteristics of the object or instrument.
Once an object has undergone a shape change and changes have been made to the corresponding geometric finite element model of the object, the present invention provides a method that obviates recomputing modes for the object while still providing an accurate representation of the timbre of the object. The method exploits properties of parameter-dependent linear systems by tracking an invariant subspace as modifications are made. Using the method, one can forego the need for recomputing the spectrum. Results show high accuracy from moderate shape changes. The method can also be implemented using a conventional computer processor in a modest linear time for standard finite element discretizations.
Model Reduction
The eigenvalue problem that we want to solve is:
Ax=λBx (1)
where A and B are the positive definite symmetric stiffness and mass matrices respectively (i.e. K and M), and x is the vector of nodal displacements of the mode with natural frequency λ=ω2. One means of formulating approximate equations for freely vibrating discrete systems is via the Rayleigh's quotient:
where {circumflex over (x)} is an approximation to x. The relative accuracy of methods based upon this formulation results from the fact that eigenvalues λ are stationary with respect to perturbations in the elements of A, B, and the eigenvectors x. Thus, if a transformation for the n physical node displacements, {circumflex over (x)}, into fewer (m<n) generalized coordinates is available, say
then the corresponding Rayleigh quotient becomes
Making λR stationary to arbitrary variations in the m elements of y yields the reduced eigenproblem
VTAVy=λRVTBVy (5)
We can view this reduction as imposing n−m constraints on the original system thus giving the following result using the Cauchy Interlace Theorem.
λ(i)≦λR(i)≦λ(j+n−m)j≦m. (6)
Thus all the λR are contained between λ(i) and λ(n) and the approximations become exact for m=n.
The essence of the reduction scheme lies in the definition of the transformation matrix V. It is preferable to use a matrix that is made from exact modal vectors. By using the exact model vectors, one can use trial functions that are similar to the actual eigenvectors under small perturbations.
In the Rayleigh-Ritz method, the shape of deformation of the continuous system v(x) is approximated using a trial family of admissible functions that satisfy the geometric boundary condition of the problem
where ci are unknown constant coefficients and φi are the known (or selected) trial family of admissible functions.
The accuracy of the method depends on the value of the number n and the choice of trial functions φi(x) used in the approximation. By using a larger n, the approximation can be made more accurate, and by using trial functions which are close to the true eigenfunctions, the approximation can be improved. That is, using a larger subset of functions can provide a better interpolation to the true solution. Similarly, using interpolation functions which closely fit the true solution yields a better estimate. By using eigenvectors found from previous modifications to the same shape, one can utilize the best estimate to the current modification by using information from a previous modification.
If we use this approximation technique to estimate the vectors forming the solution to the eigenvalue problem in Equation (5), we have
or y=Uq where U=[U1U2, . . . , Un]. Substituting into Equation (5) we have
UTKUq=λrUTMUq. (9)
In this form, one can see why using a subspace formed of eigenvectors of similar systems will generate an accurate approximation for the solution to the original system. We use this form to approximate the solution as the geometry changes.
Approximation From a Subspace
Let s denote a geometric parameter. For a given finite element model, we have generalized eigenvalue problem
(K(s)−λ(s)*M(s))u(s)=0, (10)
where K(s) is the stiffness matrix of the system and M(s) is the mass matrix at the given state of the geometry, and λ(s) and u(s) are an eigenvalue and its corresponding eigenvector for the system.
If w(s) is accurate to O(h) as an estimate for u(s), then
μ(s)=(w(s)*K(s)w(s))/(w(s)*M(s)w(s)) (11)
is accurate to O(h2) as an estimate for λ(s).
Suppose that we have computed eigenpairs (λ(so), u(so)) and λ(s1),u(s1)), and now want to compute the pair (λ(s2),u(s2)). Then we can use the initial approximation μ(s) drawn from a Rayleigh-Ritz approximation on the pencil
(U*Ks2)U,U*M(s2)U) (12)
where U=[u(so),u(s1)] (or if several of the lowest eigenvalues are desired, then simply replace u(so) with u1(so),u2(so), . . . and u(s1) with u1(s1),u2(s1), etc.). For most systems, only the first few natural frequencies and associated natural modes greatly influence the dynamic response, and the contribution of higher natural frequencies and the corresponding mode shapes in negligible.
If the step size is O(h), then the error in approximating ui(s2) by extrapolating through ui(so) and ui(s1) should be O(h2)—the approximation is good through the linear term—and the eigenvalue approximation should be O(h4). More generally, if one uses invariant subspaces computed at k points, one should get O(hk) accuracy in the eigenvector, and a corresponding O(h2k) accuracy in the computed eigenvalue.
Therefore, by building a basis from n eigenvectors sampled at k locations in parameter space, we can predict the same n eigenvectors and the corresponding eigenvalues at nearby points. In essence, by looking at a couple of steps, we can capture the behavior of the eigenvectors as the geometry changes and by solving a smaller eigenproblem, we can reduce the time to compute the decomposition in order to determine a subset of eigenvalues and eigenvectors.
Variable Mapping
Given that changes made to the geometry are parametric in nature, it is possible to map the geometries from step to step, and interpolate the variables of interest to the current configuration.
In this example, we will use a triangular plate element to discretize the domain. First we examine mapping the scalar fields from one mesh to another. We then describe how to map the vector fields from one mesh to another.
The map between these geometries can be defined with the following the parametric relation:
where s1 and s2 represent the height parameter values at the two sample points.
To map the undeformed geometry (
{right arrow over (X)}=φ{right arrow over (x)} (14)
to each node in the undeformed geometry.
This mapping brings the domain covered by the first shape to be the same as the domain covered by the second shape. It can be used for example, to overlay the original geometry onto the deformed geometry for mapping after the re-meshing process.
Next we examine mapping the vector rotation field for a triangular plate element.
Vector Field
Returning to the scalar map φ, differentiating this expression we arrive at the Tangent Map:
We use this map to transfer the vector fields from one mesh to another. That is, for each node, we apply the tangent map:
{right arrow over (X)}=D(φ){right arrow over (x)} (16)
Putting these changes together we arrive at the map for scalar and vector fields:
For large changes, the parametric deformation applied to mesh might distort the finite elements. In these cases, one would need to re-mesh the domain. Therefore an additional map must be applied to map the variables in the old geometry, to variables in the new geometry, essentially transferring variables from one mesh to another. This operation is similar to the variable mapping, but the number of nodes in the new mesh is not necessarily the same as the number of nodes in the old mesh.
Remeshing
To transfer variables in the old geometry to the variables in the new geometry, we interpolate the value using the finite element interpolation functions. For each node in the new geometry, we find a surrounding element from the old geometry. This can be performed using an inside/outside search. Once we select an element, we find the local coordinates ξ and η using the element shape functions.
For example, for a linear triangular element, we know that for any point
We then solve the system
ξ(x2−x1)+η(x3−x1)+(x1−xi)=0 (22)
ξ(y2−y1)+η(y3−y1)+(y1−yi)=0 (23)
for ξ andη.
For mapping from old mesh to new mesh, we then have
where Mj(Xi) is the shape function of the old element evaluated at the point in the new mesh.
We can rewrite Equation 24 as
x′=hx (25)
Recall that we are using this mapping to transfer the eigenvector information from one geometry to the next under deformation. Therefore, for each eigenvector of interest, we use the mapping matrix, H, to interpolate to the new system size.
v′=Hv (26)
where H=h×I expands the mapping to the number of degrees of freedom at each node.
We can apply this technique to the eigenvectors of the old system to transfer them to the new system. We then use the vectors as before, concatenating them to form a Ritz Basis.
The preferred method used to approximate the resonant frequencies following shape change has been shown to be accurate while reducing the computational time to enable real-time analysis. Various geometries can be formed using a parametric method have been tested for examination of the method. For each geometric object, first we examine using the eigenvectors from the previous iterations directly, i.e. no geometric remapping. We then examine using geometric remapping to “warp” the eigenvectors from the old geometry to the new geometry. Finally, we examine using geometric remeshing to transfer eigeninformation from one mesh to another.
We examined changing the height of a 1 mm tall×1 m wide plate by 10 cm, 1 cm, and 1 mm and examined the error in the prediction of the new resonant frequencies of the system. The geometric object 10 shown in
per node.
No Geometric Mapping
When simply concatenating the previous eigenvectors, the approximation to the actual eigenvalues are shown in
Next, we examine using two sample points.
We also investigated using a larger subspace. Instead of using the first 25 eigenvectors, we use the first 50.
Geometric Mapping
If we remap the eigenvectors from the old geometry to the new geometry using Equation (15), we see the approximations in
Remeshing
For the cases where the geometry needs re-meshing, we can map the eigenvectors from the old geometry to the new using Equation 12.
Next we examine the preferred method of estimating the resonant frequencies on a more complicated plate 12 shown in
No Geometric Mapping
When simply concatenating the previous eigenvectors, the approximation to the actual eigenvalues are shown in
Using two sample points improved the predictive capabilities to 1.24×10−7% for the smallest and 1.56% for the largest step size, as shown in
Geometric Mapping
If we remap the eigenvectors from the old geometry to the new, the approximation improves the largest step size error to 0.88%, as shown in
Remeshing
When remeshing the geometry at each sample point, the prediction capabilities follow the curves shown in
To illustrate the approximation capability for 3D objects, we extrude the previous plate to form a marimba bar 14, which is shown in
No Geometric Mapping
We examine the error when changing the height of the object by 10 cm, 1 cm, and 1 mm using two sample points.
Geometric Mapping
Using geometric mapping and two sample points, the maximum error decreases to 0.38% (see
Remeshing
When remeshing the geometry, the maximum error in
This example uses a parametric geometry, as shown in
We examine a shell whose curvature is defined by four control points as shown in
The control points define a curve which is then revolved around the z-axis to form an axisymmetric geometry. By changing the location of these control points, we change the geometry parametrically. We examine changing a 1 m tall by 1 m radius object shown in
No Geometric Mapping
Using only one sample point in parameter space, s, we examine the accuracy in prediction of the Ritz values. The results in
Next, we examine using two sample points.
Note that the axisymmetric bell has many more repeated eigenvalues than the previous models.
The speedup gained by using this method over traditional reanalysis is the difference between modest linear and super-linear computing time once the initial k samples have been computed.
The results from Examples 1-4 above illustrate that the preferred tracking method can be used to predict the changes in the frequency spectrum of an object as parametric changes are made. The results show that without remapping, it is possible to avoid recomputing the eigendecompositions in order to resolve the resonant frequencies of interest for moderate changes only. With geometric remapping, one can make significant changes to the geometry and still accurately retain the frequency spectrum. Even in the worst case when the mesh is significantly different, one can still accurately and rapidly predict the new spectrum.
By exploiting the properties of the system matrices, we can verify the O(h2k) bound on the errors produced using different step sizes. For an interactive design tool, this would mean that the software could alert the user when errors above a given threshold have been made and signal the need for a full reanalysis. This can be used in the tuning stages of design.
For systems with many repeated eigenvalues, such as axisymmetric systems, it may be beneficial to use analysis techniques that will factor out the multiple eigenvalue problem.
The present invention provides a software instrument that, using the rapid resonant frequency evaluation methodology previously discussed, allows the user of the software to hear the resulting frequency spectrum in real-time as changes are made to an object's shape and various other sound-shaping input parameters.
The software instrument presents a novel use of 3D models for audio synthesis, as it generates sound in real time, thus allowing a user to feel as though they are “playing” the object by applying forces to a physical interface. The sound synthesis routines are preferably incorporated into a digital synthesizing plug-in that takes as input 3D geometric data. By implementing the system as a software synthesizer, one can interact with the object using software hosts that support the plug-in. Using this design allows for integration with music interfaces, such as a piano keyboard. For interactive sound generation, this software can be written as a plug-in to a host audio rendering engine.
The design of this plug-in can be broken down into the synthesis algorithms used, design of the user-interface, and the overall architecture of the performance environment. The synthesis algorithms used have been previously described. Following is a description of the user-interface and the system architecture.
The software is preferably written in C++ and OpenGL APIs for the user-interface. The audio engine for the plug-in preferably utilizes the Core Audio and Altivec APIs. The calls to the synthesizer are made by the host software, which also processes the MIDI/OSC events. In this way, the synthesizer acts as a black box, receiving MIDI/OSC data and producing an audio stream.
The software instrument provides visual feedback showing the changes to the parameters and the geometry used in the synthesis computations.
The parameters that the user can control, corresponding to the sliders at the top portion 30 of the user interface 28 in
Using the frequency scale to lower or raise the natural frequencies affects the perceived object size and material. Alternatively, one can adjust the material to achieve the desired natural frequencies. One can also examine the results of the modal decomposition by iterating through the mode shapes. A slider selects the mode vibrating at a natural frequency (whose value is displayed at the bottom of the slider) and displays the corresponding shape deformations in the viewing window.
Using the mouse, the user selects a specific locations to strike the object. The radius of the striking object determines the area over which the force is applied. These locations are mapped to keys on a MIDI/OSC keyboard. Once the location and key are mapped, the velocity of the key press determines the intensity of the impulse applied to the model. The strike direction is determined by the angle between the viewing direction and the normal of the surface at the strike location. The plug-in can also be modified to allow for lateral striking directions as well.
Again, the user interacts with the object by selecting locations on the object's surface with a mouse click. These locations are mapped to keys on a MIDI/OSC keyboard. Once the location and key are mapped, the velocity of the key press determines the intensity of the impulse applied to the model.
Using the instrument software, the user can generate sounds from objects as geometric modifications are made and then hear the changes in frequency spectrum as a function of shape.
As described previously, the sound synthesis engine can be programmed as a virtual instrument plug-in which receives MIDI/OSC controller data as a signal to start the audio rendering process. To support musical gestures that are more complex than a single strike (or impulse) to the object, the software instrument system can be modified to support controllers that send more complicated force profiles. The following describes methods of generating arbitrary force profiles from controller data and modification to the software instrument system that can be used as an audio effect.
The software system described previously maintained a process that listened for an incoming MIDI/OSC signal which notified the audio processing engine of the value of a given MIDI/OSC controller. Controllers can be keys on a keyboard, position of sliders, angles of a modulation wheel, etc. For this system, the key controllers are mapped to locations on the surface of an object so that when their value is changed, the force applied to the surface changes. Because the MIDI/OSC device used is velocity sensitive, one can simulate striking the object with varying force by pressing the keys with varying velocity. Other controllers can be mapped directly to the synthesis parameters allowing for flexible and smooth modification of the synthesized sound.
The engine listening for MIDI/OSC signals also tracked the current state of the controller, such as attack (where initial contact with the surface is made), sustain (where the exciter remains in contact with the resonator), and release (where the exciter leaves the resonator's surface). These different states can be used to further add detail to the rendering engine, such as adding transients on attack to simulate bouncing or friction. For interactions that have longer contact times, the state can be sustained to indicate that micro-contact is occurring.
There are, however, controllers which use more natural gestures to generate control data. For example, haptic feedback devices can be used to link the sound synthesis engine with user-perceived applied forces. Other controllers such as the drum pads, wind controllers and special-purpose voltage to MIDI/OSC conversion devices can be used to generate these complex force profiles.
As shown in
Using the modal synthesis method, we can compute a plate reverberation model in real-time and still allow for modifications of the plate and input/output parameters. To achieve this performance, we use the same finite element model and apply forces using the discrete convolution integral method. This reverberation is an effect plug-in that takes an audio stream as the input and produces the sound of the object vibration as the output.
The rendering algorithm works by first performing the modal decomposition and then filtering the incoming audio through the resonator bank produced. The time to compute the modal decomposition depends on the number of modes required and the number of elements in the finite element model. The software system achieves real-time performance by first computing the decomposition. The system only computes the decomposition at the start of the audio rendering. The previously described methodology for rapidly computing this decomposition is used when the object undergoes a shape change or other changes are made to the model. We then evaluate for each audio sample.
The user interface 48 for the plug-in loads an object geometry and displays the surface for specifying the input and pickup locations (see
The following examples were computed using one processor of a dual 2.5 GHz PowerPC G5. In each example, the points 54 represent the input position and the points 56 represent the pickup locations.
For the first example shown in
The software system can also be used with novel shapes to explore the effect on the resulting audio.
For both of these examples, simulating object vibration using 20 modes consumed around 1.4% of the overall CPU capacity; 100 modes consumed roughly 3%; 1000 modes consumed 22%; 3000 modes used 84% for two channels of stereo processing. These results show that for up to 1000 modes, the method performs well.
The present invention has been disclosed, including its various aspects relating to sound synthesis. The present invention contemplates numerous options, variations, and alternatives, and should not be limited to the details of the embodiments set forth herein.