Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a Parameter in Unity is broken or am I doing something wrong? #44

Closed
JimPapanick opened this issue Jun 18, 2024 · 8 comments
Closed
Assignees

Comments

@JimPapanick
Copy link

Hi all, I am trying to get the current value of a parameter called "FzeroCompare" but no output was given in the Debug.Log
So I tried making a simpler parameter, and tried a simple counter called "test"
I exported the plugin with the name "fzeroCompare3"

You can see in the images that the Log doesn't show any changes in any of the two parameters while when I open max they run just fine.

What is going wrong?
image
image

@JimPapanick JimPapanick changed the title Getting a Parameter is broken or am I doing something wrong? Getting a Parameter in Unity is broken or am I doing something wrong? Jun 18, 2024
@x37v
Copy link
Contributor

x37v commented Jun 19, 2024

one thing to note is that I think unity's plugin view isn't monitoring for parameter changes coming out of your plugin, so the GUI sliders won't update.. right @jinpavg ?

@x37v
Copy link
Contributor

x37v commented Jun 19, 2024

@JimPapanick I see that you haven't set the Instance Index in the mixer to 1.

@jinpavg
Copy link
Contributor

jinpavg commented Jun 19, 2024

That's right @JimPapanick -- you'll need to make sure that you Instance Index (currently set at 0.00 key in your screenshot) matches the instance index you set in your script. But to @x37v 's point -- yes, the GUI will not update the visualization of the sliders in your plugin inspector in response to your plugin's parameter values changes. If you want to debug these values while playing in editor, you could log out the values, for example:

https://github.com/Cycling74/rnbo.unity.audioplugin/blob/main/docs/PARAMETERS.md#getting-a-parameter-value

@JimPapanick
Copy link
Author

JimPapanick commented Jun 20, 2024

I'm still not getting the counter's values (they should range from 0 -100 as shown in max/msp screenshots).

I'm not sure what instance index is , never needed it before but now that i set it to "1" the parameter's values are just "1".
I don't understand why this happens since both parameters should give their own unique values at any current time
image

@jinpavg
Copy link
Contributor

jinpavg commented Jun 20, 2024

Hi @JimPapanick , thank you for the screenshot, this helps clarify what's going on. On line 30 and 31, you are successfully getting the value of your FZeroCompare and test params -- but you've set them explicitly to the value of 1 on lines 24 and 25.

It seems like you want to know what your patch sets as the value of these two parameters. Could you try removing lines 24 and 25, where you set those parameters to the value of fzeroHigher and testOn, which you've defaulted to 1?

@jinpavg jinpavg self-assigned this Jun 20, 2024
@JimPapanick
Copy link
Author

Thanks!
Only problem now is that fzero doesn't seems to show any changes in Unity
In max/msp it does
It does take audio input and the counter does give the values that it should (I just commented them out to avoid flooding the log), so it should give output according to it's input
image
image

@x37v
Copy link
Contributor

x37v commented Jun 20, 2024

I wonder if you're having issues because you don't have a stereo effect?

Maybe try adding in~ 2, out~ 1 and out~ 2
I'd probably just route in direct to out.. a pass thru, but you can still keep your fzero on in~ 1

@JimPapanick
Copy link
Author

This worked weirdly enough!
This is the new patch. I don't know why this would work since I only want the patchers data and not it's audio output. Only step now is to put it's gain at 0 since I don't want it's output to be heard in the game
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants