# How to apply ParameterCondition to SingleSound via script in FMOD Studio?

**URL:** <https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273>\
**Category:** FMOD Engine\
**Created:** [August 26, 2025, 5:11pm UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273 "2025-08-26T17:11:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lala\_Garcia](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lala\_Garcia](https://qa.fmod.com/u/Lala_Garcia)\
**Post date:** [August 26, 2025, 5:11pm UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273/1 "2025-08-26T17:11:29Z")

</div>

I’m trying to automate the application of parameter conditions (ParameterCondition) to SingleSound modules using scripts in FMOD Studio.

What I’ve achieved so far:

Traversed all events, groupTracks, and SingleSounds.

Identified the audioFile.assetPath of each SingleSound and used that to detect the language (PT/ENG/ESP).

Found that SingleSound exposes methods like addParameterCondition(parameter, min, max) in the API (via dump()), but when I try to call them directly in a script I get TypeError: not a function.

What I’ve tried:

mod.addParameterCondition(param, 0, 0) → error TypeError: not a function.

Accessed studio.\_internal.extensions.addParameterCondition and attempted to call it with studio.runExtension:

studio.runExtension(  
studio.\_internal.extensions.addParameterCondition,  
[studio.project, mod, param, 0, 0]  
);

but I’m still not sure if this is supported at runtime.

My question:  
Is there a supported way to apply ParameterCondition to a SingleSound via the scripting API?  
Or is this feature not exposed in the public API and only available through the UI?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [August 27, 2025, 6:34am UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273/2 "2025-08-27T06:34:43Z")

</div>

Hi,  
Thanks for sharing the code. I am not sure what `mod` is but the issue may be that the `groupTracks.modules` is an array so you have to specify which one you are trying to add the `ParameterCondition` to:

```auto
var event = studio.window.browserCurrent() // Make sure an event is currently selected with a single instrument in the first audio track
event.groupTracks[0].modules[0].addParameterCondition(triggerParam, 0.5, 1)

```

![AddCondition](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/f/fd311d6a551d1471e0baf6d0af2adb799a231ef3.gif)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Lala\_Garcia](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lala\_Garcia](https://qa.fmod.com/u/Lala_Garcia)\
**Post date:** [August 28, 2025, 12:16pm UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273/3 "2025-08-28T12:16:57Z")

</div>

> [@Connor\_FMOD](#):
>
> ```auto
> var event = studio.window.browserCurrent() // Make sure an event is currently selected with a single instrument in the first audio track
> event.groupTracks[0].modules[0].addParameterCondition(triggerParam, 0.5, 1)
> 
> ```

Hi!

Thanks for the answer! I should have explained better beforehand.  
In my project, I have a p\_language parameter with three conditions (0, 1, and 2) in discrete type.

Since I have many assets, I would like to implement these conditions with a script in the custom script function rather than in the FMOD terminal.

Is that possible?  
I managed to see the structure of my project with a debug script, but I cannot apply it.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [August 29, 2025, 3:38am UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273/4 "2025-08-29T03:38:09Z")

</div>

Thanks for the info,

I made a script that will apply a parameter trigger to all single instruments:  
[ApplyParamtrigger.txt](https://qa.fmod.com/uploads/short-url/cH4DPrwOQOqaO4gP0ZPz2US1M8x.txt) (3.9 KB)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Lala\_Garcia](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@Lala\_Garcia](https://qa.fmod.com/u/Lala_Garcia)\
**Post date:** [September 1, 2025, 12:11pm UTC](https://qa.fmod.com/t/how-to-apply-parametercondition-to-singlesound-via-script-in-fmod-studio/23273/5 "2025-09-01T12:11:02Z")

</div>

Hi Connor,

Thanks a lot for your answer and for the script! I’ve just adjusted it to fit my project, and it works fine.

Thanks again!
