getAttributeIndex
-
I've added a
getAttributeIndex()function to all classes that have agetAttributeId()function.This will return the index of the attribute with the given name.
For example, this will return the
WetLevelof a simple reverb effect.const var SimpleReverb1 = Synth.getEffect("Simple Reverb1"); Console.print(SimpleReverb1.getAttribute(SimpleReverb1.getAttributeIndex("WetLevel")));Now why would I do this instead of passing
SimpleReverb1.WetLevel? Sometimes you want to have the parameters you are using stored as strings so that you can access attributes programmatically without having to specify every attribute constant manually. This I have found is especially true with effect slots where you don't know in advance which effect a user is going to use.It was already possible to do this using
getNumAttributes()andgetAttributeId()but it required a decent amount of extra work. So I've added this new "convenience" function to make our lives a little more pleasant.Pull request - https://github.com/christophhart/HISE/pull/221