Getting EQ values out of presets
-
So I have a 4-voice instrument with a set of presets and the instrument voices each contain a CurveEQ
I want to : for each voice randomly select a preset and take its values and apply it to the voice
Easy enough(tedious XML parsing but leaving that aside..) for each interface param/widget..except the EQ:
So saving the eqs into presets with:
Engine.addModuleStateToUserPreset("VoiceEQ1");
leaves me with a preset containing this XML:
<Processor Type="CurveEq" ID="VoiceEQ1" Bypassed="0" NumFilters="5" Band0="4.173913955688477" Band1="63.68705368041992" Band2="1.0" Band3="1.0" Band4="2.0" Band5="-4.173912525177002" Band6="196.5518341064453" Band7="1.0" Band8="1.0" Band9="4.0" Band10="0.0" Band11="1457.363037109375" Band12="1.0" Band13="1.0" Band14="4.0" Band15="8.34782600402832" Band16="4689.4375" Band17="1.0" Band18="1.0" Band19="3.0" Band20="-16.69565200805664" Band21="263.2481689453125" Band22="1.0" Band23="1.0" Band24="4.0" FFTEnabled="1">
Now...how to get this into the EQ in question, as its not base64 encoded...
Also as an aside - this looks a bit silly - 24 Bands ? when I'm only using 5??
-
@Lindon it is zero based so in fact 25 not 24.
This means there are 25/5 param per "real" bandSo my guess is that:
Band 0 is Gain
Band 1 is Freq
Band 2 is Q or Enabled
Band 3 is Q or Enabled
Band 4 is TypeThey effectively could have been named more appropriately
So without saying this is what you should do since there might be a better solution for your use case, you have the possibility to parse those bands numbers (modulo 5) and retrieve the values