Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom Native Audio Plugin GUI and exporting parameters to script

Discussion in 'Audio & Video' started by mtytel, Mar 21, 2017.

  1. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    84
    The default UI for an audio plugin is a list of parameter sliders. If you right click on the name of a parameter you can expose that parameter to be changed by script.

    I have a lot of parameters in my plugin so am making a custom UI for it. With the custom UI however, there is no way for a user to expose a parameter by right clicking on the slider since I've removed them.

    Is there a way to draw my own UI element like EditorGUILayout.Slider, that supports right click to expose the parameter?
     
  2. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hi Matthew, been looking at your threads on making Helm work in Unity. very supportive of that! i'm probably more of a unity generalist than an expert, but i believe it should be possible to design your own custom UI slider. the Input Manager handles all inputs including all mouse buttons, and i'm fairly certain it runs in the Editor as well as in game. here's a link to a basic rundown of how to set up a custom UI window: http://blog.theknightsofunity.com/custom-unity-editor-window/

    and here's Unity's manual section on the subject:
    https://docs.unity3d.com/Manual/editor-EditorWindows.html

    and lastly here's a (Free!) Asset Store Asset that might be very much up your alley:
    https://forum.unity3d.com/threads/kissui-a-simple-ui-builder.330951/

    best of luck! let me know if you need some beta testers! i've been pretty arms deep into investigating synthesis with Unity, mainly through PD at the moment, but getting pretty frustrated with my toolset's limitations (libpd4unity) and it runs horribly on Android. so i've been looking for other options using Unity that can run on Android (GearVR or Cardboard specifically) and build in APKs.

    best,
    scott
     
  3. mtytel

    mtytel

    Joined:
    Feb 28, 2014
    Posts:
    84
    hey, thanks for the response. I'm not sure you got my problem exactly though. If you right click on a built in slider, you get a menu where you can "Expose" the audio parameter to a C# script. I can't find the code hook to do that (if it exists) so I can't add that functionality to any custom slider I make.

    I think I found a better way to do what I want though. I'm allowing people to bypass the whole "Expose to script" interface and go directly to the plugin. Way better workflow.

    I definitely need more beta testers! If you PM me your email I'll send you a build soon.
     
  4. rorywalsh

    rorywalsh

    Joined:
    Apr 10, 2015
    Posts:
    114
    Anyone figure this out yet? I think @mtyel's idea of bypassing the plugin altogether is an attractive one, but I'd like to keep the use of my plugin consistent with how Unity's own effects work.
     
  5. manassehclifford

    manassehclifford

    Joined:
    Sep 20, 2021
    Posts:
    8
    Hello Guys I have a follow up question to this. how can i make sure that the native ui sliders also move when i change the custom sliders? the audio params inside the processor get called and changed however there is no change in the native slider UI