Closed jinpavg closed 1 year ago
Export the feedback-synth from the RNBO tour, which has @polyphony 8 In Unity, try to use .GetParamIndexById("poly/delay/fb")
@polyphony 8
.GetParamIndexById("poly/delay/fb")
You'll get the following error:
ArgumentException: An item with the same key has already been added. Key: cutoff System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <612a2c65aaf843d698f8d38b2ad7654a>:0) System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <612a2c65aaf843d698f8d38b2ad7654a>:0) FeedbackPolyphonyGroupHandle.GetParamIndexById (System.String id) (at /Users/alexvangils/rnbo.unity.audioplugin/build/FeedbackPolyphonyGroup/Assets/Scripts/FeedbackPolyphonyGroupHelper.cs:297) ExceptionTest..ctor () (at Assets/ExceptionTest.cs:9)
Which leads here:
private static Dictionary<string, int> parameterIdToIndex; public static int? GetParamIndexById(string id) { if (parameterIdToIndex == null) { parameterIdToIndex = new Dictionary<string, int>(); foreach (var p in Parameters) { parameterIdToIndex.Add(p.name, p.index); } } int index = 0; if (parameterIdToIndex.TryGetValue(id, out index)) { return index; } return null; }
plugin and script included below:
FeedbackPolyphonyGroup.zip
ExceptionTest.cs.zip
should be fixed if you pull main now and rebuild
Export the feedback-synth from the RNBO tour, which has
@polyphony 8
In Unity, try to use.GetParamIndexById("poly/delay/fb")
You'll get the following error:
Which leads here:
plugin and script included below:
FeedbackPolyphonyGroup.zip
ExceptionTest.cs.zip