Academia.eduAcademia.edu

Customized room acoustics simulations using scripting interfaces

2011, Journal of The Acoustical Society of America

AI-generated Abstract

The paper presents a solution for customizing room acoustics simulations through the integration of scripting interfaces within Pachyderm, an open-source acoustics prediction plugin for Rhinoceros CAD. This approach enables acousticians to creatively control and manipulate simulation parameters, moving beyond the limitations of precompiled graphical user interfaces. By leveraging scripting, users can craft simulations that enhance their understanding and interpretation of acoustic data, ultimately improving design outcomes.

A. van der Harten Proceedings of Meetings on Acoustics Volume 12, 2011 http://acousticalsociety.org/ 161th Meeting Acoustical Society of America Seattle, Washington 23 - 27 May 2011 Session 1aAAb: Architectural Acoustics 1aAAb10. Customized Room Acoustics Simulations Using Scripting Interfaces Arthur Van der Harten* *Corresponding author’s address: Room Acoustics, Kirkegaard Associates, 801 W. Adams St., Chicago, IL 60607, avanderharten@kirkegaard.com Geometrical computer modeling is commonly used in consulting practice to make predictions of room acoustical quality. A large number of new parameters have been created by academicians and acousticians in recent years-so much that it has been difficult for room acoustics simulation providers to include them all. This presentation will demonstrate how customized scripted simulations in Rhinoceros (a CAD program), using Pachyderm (an open source geometrical acoustics simulation engine), can allow the use of new parameters, or parameter simulation types, without reliance on software vendors to release software versions explicitly implementing new code. Published by the Acoustical Society of America through the American Institute of Physics © 2011 Acoustical Society of America [DOI: 10.1121/1.3602460] Received 22 May 2011; published 5 Jun 2011 Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 1 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten I. Introduction This paper introduces a time saving and accessible solution to the need for unique problem solving techniques using Pachyderm[1]. Pachyderm is an open source room acoustics prediction plugin for Rhinoceros (a cad program)[2] that uses IronPython[3], a .net scripting language. Development of this solution has enabled new possibilities, such as visualization of parameters which have been impractical to create until now (i.e. Stage Support). In recent years, architects have discovered the utility of scripting and programming for generation of forms which would have been difficult or impossible to create without their use. These new tools are considered by many to be a liberation from the confines of rigid interface tools of cad programs. Rhinoceros has incorporated a number of scripting devices which have been used in highly imaginative ways to create the recent Avant-garde in design. Figure 1. 02 Dubai Moebius, Dubia UAE, Observation Tower. Design competition entry by Ralf Lindemann and Christine Heil. Image Courtesy of Ralf Lindemann [4] There are endless ways to view the data that acousticians work with on a daily basis. The ways in which we view this data largely affect the way we interpret them. The way we form and frame our simulations shapes our understanding of the science espoused in them.[5] Using an inappropriately narrow or myopic method for evaluating a parameter can obscure the truth behind the performance of a space[6]. By allowing acousticians full control of a simulation through scripting interfaces, new facilities for creative use of simulation technology are enabled, just as they have been in the design industries. The acoustician has an opportunity to escape the confines of limited user interface tools. Precompiled graphical user interfaces are convenient for day to day analysis, but are typically written by individuals who can only afford to design for the most common uses of a simulation algorithm, and could never hope to imagine the multitude of creative ways that simulations can be used. One such difficult-to-visualize problem was required for the Dublin National Concert Hall design competition. During this competition, stage acoustics predictions were required for two parameters – ST-1 and a relatively new parameter, change in Early Reflection Enhancement (¨ERE). Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 2 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Figure 2. Dublin National Concert competition – Encore Consortium main hall design entry. Rendering is provided courtesy of 3XN – Arkitekter, Copenhagen, DK. II. Example 1: Energy Ratios and Energy Ratio Differences ERE is a parameter based on a concept developed in 2007 by DHV for the evaluation of the Casa da Música building (by OMA). A stage acoustics parameter was sought which would be independent of proximity to the source, and which counted only sound from reflections on stage as the early part. The parameter was first called CCM [7]:           At that point in development, the time constraints were still under discussion. The parameter was later renamed Logarithmic Quotient (LQ7-40) in 2008 [8, 9]. In late 2008, the Dublin National Concert Hall competition authority required the predicted maximum variation in ERE to be reported for evaluation of design performance on stage. ERE was to be calculated in the following way [10]:           The required positions to be simulated on stage and the differences between those positions were reported in order to ensure that the reflection coverage over the stage was even within a stated amount of variation - 4 decibels. Available room acoustics prediction software packages allow the calculation of customized energy ratios, but none make it simple to view and evaluate the difference between various source and receiver positions. The need for such a comparison is highly specialized and typically is beyond of the scope of developers’ goals when writing software. The creation of an algorithm to evaluate this stage acoustics measure would rely Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 3 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten heavily on the knowledge and abilities of the acoustician to adapt and work outside the confines of simulation software. At the time of the competition, our solution was to export the energy time curve from the simulation software, and write a series of Matlab scripts to process the results. The alternative solution presented in this paper capitalizes on new scripting resources in Rhinoceros v.5.0, which is currently in beta testing status. For this operation, we write a script in IronPython that accesses functions in Pachyderm, and customizes the acoustics simulation algorithms in order to obtain a specialized prediction. We have chosen to test this on a model of Elmia Hall in Jonköping, Sweden. This is the room used for the second PTB Round Robin, and is well known in the field of room acoustics simulation [11]. (See Figure 3) The script we have written (see Appendix A) creates a mesh of the stage with evenly spaced vertices. A spherical receiver object for a ray tracing simulation is placed at each vertex. The user is then prompted for an indeterminate number of source positions. When all positions have been entered, the script iterates through each source position and runs a full simulation for each using all of the stage receivers. After each iteration, the ERE parameter is calculated for each receiver and stored. When all iterations have been completed, the last remaining task is that of calculating the change in ERE (¨ERE). Viewing a graph of the difference for each source position is still a great deal of data to evaluate. The only information needed for this prediction is the maximum deviation between all values. In order to simplify the data, we take the maximum ERE value, and the minimum ERE value for each receiver point, and find the difference. The maximum ¨ERE values for each point on the stage are shown below in Figure 4. This is more information that was strictly necessary for the Dublin National Concert Hall competition. Since the acquisition of this data has been made simple and accessible, presentation of values for the entire stage is useful, and facilitates understanding: Figure 3. Model of Elmia Hall, Jonköping, Sweden. Detailed information on this room is found in reference [11] Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 4 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Figure 4. Max ¨ERE values for the stage of Elmia Hall in Jonköping, Sweden. This simulation comprises a prediction that is more than a simple display of an energy ratio, but a sophisticated comparison of spatial energy ratio trends from source position to source position. III. Example 2: Stage Support – Early and Late It has been shown that it is possible to write scripts in Rhinoceros in the IronPython language which run multiple geometrical simulations and extract customized data. This feature offers the user an unprecedented level of flexibility in terms of the kinds of data that can be predicted for a given space. It can be used to further understanding of a number of prediction parameters. Stage Support is an energy ratio that seeks to characterize the performance of stage conditions for performers [12, 13]. It is calculated in the following way:                      Stage Support is unusual from other energy ratio measurements in that it requires that the source and receiver to be exactly 1 meter apart. A typical room acoustics simulation with arbitrarily placed sources and receivers is not suitable for creating a Stage Support coverage map of a stage environment. To create a parameter map of a stage displaying Stage Support values would require a large number of source/receiver pairs. Each pair would require its own individual simulation iteration. Though it takes a significant investment of time, this form of simulation is now possible. Figure 4 diagrams the required source/receiver pair configuration. The script we have written first prompts the user for the stage. A mesh of the stage is created with regularly spaced vertices. At each vertex in the mesh, a spherical receiver is placed 1 meter above the stage. A paired source is then placed one meter from the receiver. In order to rationalize the directional orientation of the source to the receiver, an attracting point is placed at Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 5 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten the location of an orchestra conductor. The receiver will sit approximately where a musician's head would be, and - utilizing simple vector math - the source location is made to correspond to the orientation of the musician's string or wind instrument. Figure 5. Stage configuration of Elmia Hall. The blue spheres correspond to the receiver locations. The linked red spheres are the source locations. Note that they all converge on an attractor “A” at the conductor location. An identical simulation is performed for each source/receiver pair individually. At the end of each simulation, an energy time curve histogram is synthesized and the stage support parameters are calculated and stored. When this is completed for every vertex in the mesh, the mesh and its vertex colors are passed to a custom mapping interface in Pachyderm. In Pachyderm, the user can choose a color scale and bounds that allow for maximum visibility of the phenomena they find interesting to display. This simulation has been run and completed. On a dual core Intel i3 computer with four gigabytes of RAM it took approximately three days to complete. The results are shown in Figure 6. Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 6 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Figure 6. Parameter maps of Stage Support. ST-1 (early) is shown above. ST-2 (late) is shown below. IV. Conclusion We have shown that it is possible to customize a simulation in a proven geometrical acoustics program without relying on the software vendor to rewrite or include different types of simulations in future releases of simulation software. It is impractical to try to write and compile interface systems for every possible configuration of simulation possibilities. If the end user is empowered to customize a simulation in an accessible manner instead, a simulation tool is made significantly more valuable. This is a concept which is becoming well understood in the design industry, and ought to be realized in applied acoustics simulation. The techniques illustrated here have the potential to increase knowledge of acoustical phenomena in rooms by allowing for more creative use of simulation algorithms. The forms of exploration are no longer limited by what is provided by software developers. Rather, unlimited use of the algorithms is enabled. Acknowledgements Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 7 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Arthur van der Harten would like to acknowledge the Ireland National Development Finance Agency for their generosity with information concerning the ¨ERE parameter and the NCH competition, and colleagues in the Encore Consortium and at Kirkegaard Associates, whose moral support makes developing simulation tools endlessly rewarding. References 1 A. v.d. Harten. Pachyderm Acoustical Simulation: An Open Source Geometrical Acoustics Laboratory. <http://www.perspectivesketch.com/pachyderm/> 2 McNeel, Inc. Modeling Tools for Designers. <http://www.rhino3d.com/> 3 S. Tibbits, A. v.d. Harten, S. Baer. Python for Rhinoceros 5.Robert McNeel & Associates, (2011) 4 R. Lindemann, C.Heil. “02 Dubai Moebius, Dubai, UAE” Mark Magazin no. 27, Aug/Sep (2010): 17 5 M. McLuhan. Understanding Media: The Extensions of Man, 1st Ed. McGraw Hill, NY; reissued by MIT Press, (1964) 6 L. Kirkegaard, “In search of a new paradigm – our ‘parameters’ tend to bias the way we listen and constrain the ways we think about concert hall acoustics,” Proceedings of Internoise 2010, Lisbon, Portugal. 7 R. Van Luxemburg, C. Hak, B. Kok, E. Van den Braak. “Transparent Concert Hall Acoustics” 19th ICA Madrid (2007) 8 E. van den Braak, L. van Luxembourg, “New (stage) parameter for conductor’s acoustics?” Acoustics ’08 Paris (2008) 9 E. van den Braak, C. Hak, L. van Luxemburg, “New (stage) parameter for conductor’s acoustics? – part 2: further investigation on LQ7-40”, Internoise 2009 Ottawa (2009) 10 B. Kok, “Considerations for developing ERE” White paper attached to letter to the author. 20 May, 2011 11 I. Bork, “A Comparision of Room Simulation Software – The 2nd Round Robin on Room Acoustical Computer Simulation”, Acustica – acta acustica 86 (2000): 943-956 12 A.C. Gade. “Investigations of musicians’ room acoustics conditions in concert halls. Part I: Method and laboratory experiments” Acta Acustica united with Acustica 65 (1989): 193-203 13 A.C. Gade. “Investigations of musicians’ room acoustics conditions in concert halls. Part II: Field experiments and synthesis of results” Acta Acustica united with Acustica 65 (1989): 249-262 Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 8 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Appendix A: ¨ERE Calculation Script for Pachyderm and Rhinoceros in IronPython import clr clr.AddReference("Pachyderm_Acoustic") import Pachyderm_Acoustic as pach import Pachyderm_Acoustic.Utilities.PachTools as pt import rhinoscriptsyntax as rs import Pachyderm_Acoustic.Environment as Env clr.AddReference("Rhino_DotNet") import RMA.OpenNURBS as ON import math import System as S import Rhino.Input as RG import Rhino.Commands.Result as Res def main(): pt.ClearCMControl(); STVerts = [] stage = pt.PromptSurfaces() #Prompt the user for the stage Boundary Representation STMesh = pt.Create_Map_Mesh(stage, 1) ##Prompt user for a number of points. SPTs = [] while (True): result = RG.RhinoGet.GetPoint("Choose a Point. Press Enter when finished...", True) if (result[0] != Res.Success): break SPTs.append(ON.On3dPoint(result[1].X, result[1].Y, result[1].Z)) #Simulation Parameters Scene = pt.Get_Poly_Scene(50, 20, 101.325, 0, False) Scene.partition(15) for i in range(STMesh.m_V.Count()): STVerts.append(ON.On3dPoint(STMesh.m_V[i].x, STMesh.m_V[i].y, STMesh.m_V[i].z+1)) No_of_Rays = 25000 Max_Duration = 1200;#in milliseconds ERE63 = [] ERE125 = [] ERE250 = [] ERE500 = [] ERE1000 = [] ERE2000 = [] ERE4000 = [] ERE8000 = [] for v in range (STVerts.Count): ERE63.append([]) ERE125.append([]) ERE250.append([]) ERE500.append([]) ERE1000.append([]) ERE2000.append([]) ERE4000.append([]) ERE8000.append([]) Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 9 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten for i in range(SPTs.Count): print("Iterations remaining to execute: " + (SPTs.Counti).ToString()) #Designate the source and receiver positions Receiver = Env.Receiver_Bank(array(STVerts,ON.On3dPoint), SPTs[i], Scene, No_of_Rays, 1000, Max_Duration, Env.Receiver_Bank.Rec_Type.FieldType.Stationary) Source = Env.GeodesicSource(SPTs[i], No_of_Rays, Max_Duration,60,60) ###Set up and run three simulation types.### D = pach.Direct_Sound(Source, Receiver, Scene) Dout = pt.Run_Simulation(D) IS = pach.ImageSourceData(Source,Receiver, D, Scene, 1) ISout = pt.Run_Simulation(IS) RT = pach.SplitRayTracer(Source, Receiver, Scene, Max_Duration*0.343, No_of_Rays, 2, False) RTout = pt.Run_Simulation(RT) Receiver_out = RTout.Get_Receiver for v in range(STVerts.Count): ### Get Histograms combining simulations hist63 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 0, v) hist125 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 1, v) hist250 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 2, v) hist500 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 3, v) hist1k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 4, v) hist2k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 5, v) hist4k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 6, v) hist8k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 7, v) histBB = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 8, v) ERE63[v].append(Calc_ERE(hist63) ERE125[v].append(Calc_ERE(hist125)) ERE250[v].append(Calc_ERE(hist250)) ERE500[v].append(Calc_ERE(hist500)) ERE1000[v].append(Calc_ERE(hist1k)) ERE2000[v].append(Calc_ERE(hist2k)) ERE4000[v].append(Calc_ERE(hist4k)) ERE8000[v].append(Calc_ERE(hist8k)) dERE63 = [] dERE125 = [] dERE250 = [] dERE500 = [] dERE1000 = [] dERE2000 = [] dERE4000 = [] Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 10 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten dERE8000 = [] for v in range(STVerts.Count): dERE63.append(Calc_Delta(ERE63[v])) dERE125.append(Calc_Delta(ERE125[v])) dERE250.append(Calc_Delta(ERE250[v])) dERE500.append(Calc_Delta(ERE500[v])) dERE1000.append(Calc_Delta(ERE1000[v])) dERE2000.append(Calc_Delta(ERE2000[v])) dERE4000.append(Calc_Delta(ERE4000[v])) dERE8000.append(Calc_Delta(ERE8000[v])) pt.AddToCMControl("63 Hz. delta ERE", array(dERE63,float), STMesh) pt.AddToCMControl("125 Hz. delta ERE", array(dERE125,float), STMesh) pt.AddToCMControl("250 Hz. delta ERE", array(dERE250,float), STMesh) pt.AddToCMControl("500 Hz. delta ERE", array(dERE500,float), STMesh) pt.AddToCMControl("1000 Hz. delta ERE", array(dERE1000,float), STMesh) pt.AddToCMControl("2000 Hz. delta ERE", array(dERE2000,float), STMesh) pt.AddToCMControl("4000 Hz. delta ERE", array(dERE4000,float), STMesh) pt.AddToCMControl("8000 Hz. delta ERE", array(dERE8000,float), STMesh) pt.Show_CM_Control() def Calc_ERE(Histogram): d = 0 for d in range(Histogram.Length): if Histogram[d]>0: break if d > Histogram.Length - 50: return -100 num = 0 denom = 0 for i in range(d+7, d+50): num+=Histogram[i] for i in range(d+50, d+1000): denom+=Histogram[i] return 10*math.log10(num/denom) def Calc_Delta(collection): max = 0 min = 100000 for i in range(collection.Count): if collection[i] < min: min = collection[i] if collection[i] > max: max = collection[i] return (max - min) def array(dlist, type): a1 = S.Array.CreateInstance(type, dlist.Count) for i in range(dlist.Count): a1[i] = dlist[i] return a1 if __name__=="__main__": main()  Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 11 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten Appendix B: ST-1 & ST-2 Calculation Script for Pachyderm and Rhinoceros in IronPython import clr clr.AddReference("Pachyderm_Acoustic") clr.AddReference("Rhino_DotNet") import RMA.OpenNURBS as ON import Pachyderm_Acoustic as pach import Pachyderm_Acoustic.Utilities.PachTools as pt import rhinoscriptsyntax as rs import Pachyderm_Acoustic.Environment as Env import Rhino import math import System as S def main(): pt.ClearCMControl(); #Declarations ST163 = [] ST1125 = [] ST1250 = [] ST1500 = [] ST11000 = [] ST12000 = [] ST14000 = [] ST18000 = [] ST263 = [] ST2125 = [] ST2250 = [] ST2500 = [] ST21000 = [] ST22000 = [] ST24000 = [] ST28000 = [] #Calculation parameters and scene declaration No_of_Rays = 15000 Max_Duration = 1200;#in milliseconds Scene = pt.Get_Poly_Scene(50, 20, 101.325, 0, False) Scene.partition(15) #Declare Stage Object stage = pt.PromptSurfaces() #Prompts user for stage boundary representation STMesh = pt.Create_Map_Mesh(stage, 1) # ###Begin calculation for i in range(STMesh.m_V.Count()): print("Iterations remaining to execute: " + (STMesh.m_V.Count()i).ToString()) ###Designate the source and receiver positions SamplePT = STMesh.m_V[i] SamplePT.z+=1 DIR = STMesh.AreaCentroid() #Start with source attractor at center of stage. Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 12 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten DIR.x += 4 #Set source attractor to concertmaster – musician/instrument relationship. DIR = pt.SubPTPT(SamplePT, DIR) DIR.z = 0 DIR.Unitize(); RPT = ON.On3dPoint(STMesh.m_V[i].x,STMesh.m_V[i].y,STMesh.m_V[i].z) SPT = ON.On3dPoint(DIR.x + STMesh.m_V[i].x, DIR.y + STMesh.m_V[i].y, DIR.z + STMesh.m_V[i].z) Receiver = Env.Receiver_Bank(RPT, SPT, Scene, No_of_Rays,1000, Max_Duration, Env.Receiver_Bank.Rec_Type.FieldType.Stationary) Source = Env.GeodesicSource(SPT, No_of_Rays, Max_Duration, 60, 60) ###Set up and run three simulation types.### D = pach.Direct_Sound(Source, Receiver, Scene) Dout = pt.Run_Simulation(D) IS = pach.ImageSourceData(Source,Receiver, D, Scene, 2) ISout = pt.Run_Simulation(IS) RT = pach.SplitRayTracer(Source, Receiver, Scene, Max_Duration*0.343, No_of_Rays, 2, False) RTout = pt.Run_Simulation(RT) Receiver_out = RTout.Get_Receiver ### Get Energy Time Curve Histograms combining simulations hist63 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 0, 0) hist125 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 1, 0) hist250 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 2, 0) hist500 = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 3, 0) hist1k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 4, 0) hist2k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 5, 0) hist4k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 6, 0) hist8k = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 7, 0) histBB = pach.Utilities.AcousticalMath.ETCurve(Dout, ISout, Receiver_out, Max_Duration/1000, 1000, 8, 0) ### Store Performance Parameter Results ST163.append(Calc_ST1(hist63)) ST1125.append(Calc_ST1(hist125)) ST1250.append(Calc_ST1(hist250)) ST1500.append(Calc_ST1(hist500)) ST11000.append(Calc_ST1(hist1k)) ST12000.append(Calc_ST1(hist2k)) ST14000.append(Calc_ST1(hist4k)) ST18000.append(Calc_ST1(hist8k)) ST263.append(Calc_ST2(hist63)) ST2125.append(Calc_ST2(hist125)) ST2250.append(Calc_ST2(hist250)) ST2500.append(Calc_ST2(hist500)) ST21000.append(Calc_ST2(hist1k)) ST22000.append(Calc_ST2(hist2k)) Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 13 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten ST24000.append(Calc_ST2(hist4k)) ST28000.append(Calc_ST2(hist8k)) ###Add the mesh and the parameter values to the CustomMapping control with a unique handle. pt.AddToCMControl("63 Hz. Stage Support - Early (ST1)", array(ST163), STMesh) pt.AddToCMControl("125 Hz. Stage Support - Early (ST1)", array(ST1125), STMesh) pt.AddToCMControl("250 Hz. Stage Support - Early (ST1)", array(ST1250), STMesh) pt.AddToCMControl("500 Hz. Stage Support - Early (ST1)", array(ST1500), STMesh) pt.AddToCMControl("1000 Hz. Stage Support - Early (ST1)", array(ST11000), STMesh) pt.AddToCMControl("2000 Hz. Stage Support - Early (ST1)", array(ST12000), STMesh) pt.AddToCMControl("4000 Hz. Stage Support - Early (ST1)", array(ST14000), STMesh) pt.AddToCMControl("8000 Hz. Stage Support - Early (ST1)", array(ST18000), STMesh) pt.AddToCMControl("63 Hz. Stage Support - Late (ST2)", array(ST263), STMesh) pt.AddToCMControl("125 Hz. Stage Support - Late (ST2)", array(ST2125), STMesh) pt.AddToCMControl("250 Hz. Stage Support - Late (ST2)", array(ST2250), STMesh) pt.AddToCMControl("500 Hz. Stage Support - Late (ST2)", array(ST2500), STMesh) pt.AddToCMControl("1000 Hz. Stage Support - Late (ST2)", array(ST21000), STMesh) pt.AddToCMControl("2000 Hz. Stage Support - Late (ST2)", array(ST22000), STMesh) pt.AddToCMControl("4000 Hz. Stage Support - Late (ST2)", array(ST24000), STMesh) pt.AddToCMControl("8000 Hz. Stage Support - Late (ST2)", array(ST28000), STMesh) ###Show the CustomMappint control, so the user can deploy the results. pt.Show_CM_Control() ###Stage Support - Early Calculation algorithm def Calc_ST1(Histogram): d = 0 for d in range(Histogram.Length): if Histogram[d]>0: break if d > Histogram.Length - 50: return -100 num = 0 denom = 0 for i in range(d+20, d+100): num+=Histogram[i] for i in range(d, d+10): denom+=Histogram[i] return 10*math.log10(num/denom) ###Stage Support - Late Calculation algorithm Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 14 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13 A. van der Harten def Calc_ST2(Histogram): d = 0 for d in range(Histogram.Length): if Histogram[d]>0: break if d > Histogram.Length - 50: return -100 num = 0 denom = 0 for i in range(d+100, d+1000): num+=Histogram[i] for i in range(d, d+10): denom+=Histogram[i] return 10*math.log10(num/denom) ###A simple command to convert an IronPython List to a .Net array def array(dlist): a1 = S.Array.CreateInstance(float, dlist.Count) for i in range(dlist.Count): a1[i] = dlist[i] return a1 if __name__=="__main__": main() Proceedings of Meetings on Acoustics, Vol. 12, 015001 (2011) Page 15 Redistribution subject to ASA license or copyright; see http://acousticalsociety.org/content/terms. Download to IP: 82.35.187.31 On: Sat, 08 Mar 2014 19:24:13