Unity-Technologies / Unity-Technologies/NativeAudioPlugins

BUG: Custom GUIs won't update once a parameter has been changed

Open
#14 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
169
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Summary

With two or more plug-in instances active in an AudioMixer (e.g. in two Groups), the Custom GUI won't reflect the plug-in parameter's state after a parameter has been set via the Custom GUI's script. It only shows the last set value independent of the plug-in instance.

In code words:

after calling

plugin.SetFloatParameter("parameterName", value);

in IAudioEffectPluginGUI's OnGUI(IAudioEffectPlugin plugin) method,

plugin.GetFloatParameter("parameterName", out float value);

always returns the value which was set most recently, independent on which plugin instance is currently selected.

Steps to reproduce

  • Clone / download the latest version of this repository
  • build the project in NativeCode
  • create a new Unity project
  • import the binary (e.g. AudioPluginDemo.bundle on macOS) into the projects (assets)
  • also import EqualizerCustomGUI.cs, GUIHelpers.cs, MathHelpers.cs from GUICode/AudioPluginDemoGUI
  • create an AudioMixer
  • create a new Group
  • add the Demo Equalizer plugin in both groups (Master and the new one)
  • move the sliders of LowFreq, MidFreq, and HighFreq in one of the instances (only sliders, NOT the editor)
  • switch back and forth between both plugins and verify that the state updates accordingly
  • move one of the vertical bars (black, grey, white) of one instances, see how the corresponding frequency slider changes (expected behaviour)
  • again: switch back and forth between the plugins, see that the rendered GUI won't update any more although the Horizontal Sliders do

I don't think this is a bug of this repository, but rather one in Unity itself. Or is there something you can do in the scripts to prevent this from happening?

This behaviour renders the CustomGUI feature unusable if the GUI is used to change parameter values and not only displays them (like in all the UI examples in this repository).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Build NativeCode and import the binary with EqualizerCustomGUI.cs, GUIHelpers.cs, and MathHelpers.cs into a Unity project. Reproduce the issue with two Demo Equalizer instances, then inspect IAudioEffectPluginGUI.OnGUI and the SetFloatParameter/GetFloatParameter calls. Done means each custom GUI reflects its selected plug-in instance after parameters are changed, or the Unity limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp, unity
Domain
audio-video-rtc, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.