# Adding Sound To Interactions Sound event integration is usually done in the *cockpit* behavior file. The generation of these events is heavily dependent on the **components hierarchy** to organise instruments by panel (see here for more information on this: [Model Behaviors Component Overview](../model-behaviors-component-overview/)). The component hierarchy is usually created in conjunction with the sound designer such that each physical instrument is associated with a *location* within the cockpit space and has a sound *type* attributed to it. The table below is an example of what you should be working from:   Control Description Location Type ID Value Master Warning Front Panel Switch 1 CRS / RANGE Front Panel Knob (Inner / Outer) 2 Sync Radio Front Panel Button 3 Half Bank Front Panel Button 3 ELT Side Panel Cover 4 ELT Side Panel Switch 1 Pitch Trim Pedestal Switch 1 Trim Interrupt Pedestal Button 3 Minimums Overhead Knob 2 Autopilot Controls Button 3 Pitch / Aileron Trim Controls Switch 1 ETC...   The component hierarchy is going to be heavily based on the **location** of the different controls, such that they are logically grouped according to their place in the actual cockpit. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} This is simply the ***recommended*** process for creating components and sound events, as used by the Microsoft Flight Simulator 2024 developers, but you may adapt things to suit your own unique workflow. {{< /callout >}}   The values in this table will be used in the model behaviour templates to generate various **sound event IDs** with the following format: <LOCATION>\_<TYPE>\_<ID>\_<SUFFIX>   The generated sound event ID should match that which has been defined in the [Sound XML](../../../../sounds/sound-xml/) file for the SimObject, within the `` element. For example: ``` xml ``` Within the model behaviour XML you control the *location*, the *ID*, and the *suffix*, while the *type* is normally generated automatically by the template being used. For example if you use [`ASOBO_CT_Button_Template`](../../templateexplorer/asobo-ex1/common/shared/utils/interaction/interaction-templates/#ASOBO_CT_Button_Template) then the *type* will be `BUTTON_TYPE_`. {{< callout context="note" title="NOTE" icon="outline/bulb" >}} You do not **have** to use this auto-generated type and it is provided simply as a convenience. Instead you can specify your own type identifier using the `SOUND_EVENT_INTERACTION_TYPE` parameter in the behaviour. {{< /callout >}}     ### Component Blocks With the location list you can then go ahead and block out the components in the XML, something like this: ``` xml ``` For each component you will need to define the following parameter: `SOUND_EVENT_GROUP`. This parameter value will be used to create the **prefix** of the generated sound events of every interaction created within this component, for example: ``` xml OVERHEAD ```     ### Creating Sound Events Within The Hierarchy With the locations blocked out in the file, you can then go ahead and add in the different instrument interactions using the templates and interactions outlined on the [Creating Cockpit Interactions](creating-cockpit-interactions/) page. Within each component you will need to add in specific tags to identify the sound that will be used using the sound ID (and optionally the suffix, explained further down this page). As such the component will look something like this: ``` xml OVERHEAD 1 1 @LIGHTING_Light_Landing_L @ELECTRICAL_Circuit_Light_Landing_L FIXED_L LIGHTING_SWITCH_LANDING_LIGHT_FIXED_L (R:1:@TT_Package.STATE.LEFT) ``` The snippet above will generate a sound event ID of `OVERHEAD_SWITCH_TYPE_1`.   For things like stacked knobs or switches with various states, it may be necessary to have multiple sound effects played for each of them. In these cases the sound designer could simply create new sound event IDs for each one, but often it's easier to keep associated ID's together and instead use a *suffix* to identify the sound event. The following example is for a stacked knob and uses *inner* and *outer* suffixes: ``` xml PANEL MAIN_PANEL_KNOB_LIGHT_OUTBD_BRT_CONTRAST OUTBD_BRT_CONTRAST INNER 3 5 MAIN_PANEL_KNOB_LIGHT_OUTBD_DU OUTBD_DU_BRIGHT OUTER 3 5 ``` This will generate two sound event IDs: `PANEL_KNOB_TYPE_3_INNER` and `PANEL_KNOB_TYPE_3_OUTER`.