addModuleStateToUserPreset - recall state without preset system?
-
I'm using addModuleStateToUserPreset to save the data from a draggable filter floating tile.
The data from the preset looks like:<?xml version="1.0" encoding="UTF-8"?> <Preset Version="1.0.0"> <Content Processor="Interface"/> <Modules> <Processor Type="CurveEq" ID="Parametriq EQ1" Bypassed="0" NumFilters="14" Band0="10.1694917678833" Band1="792.3529052734375" Band2="0.6567482948303223" Band3="1.0" Band4="4.0" Band5="-24.0" Band6="1926.261596679688" Band7="2.585139274597168" Band8="1.0" Band9="4.0" Band10="-17.49152374267578" Band11="1926.261596679688" Band12="9.0" Band13="1.0" Band14="4.0" Band15="5.084745407104492" Band16="1163.872192382812" Band17="3.081507682800293" Band18="1.0" Band19="4.0" Band20="-6.101696014404297" Band21="36.56168365478516" Band22="0.300000011920929" Band23="1.0" Band24="1.0" Band25="-14.64406967163086" Band26="73.82585144042969" Band27="0.3187055885791779" Band28="1.0" Band29="4.0" Band30="5.491525650024414" Band31="539.42626953125" Band32="2.585139513015747" Band33="1.0" Band34="4.0" Band35="-24.0" Band36="13171.890625" Band37="9.0" Band38="1.0" Band39="4.0" Band40="-13.22033786773682" Band41="7253.22216796875" Band42="2.585139513015747" Band43="1.0" Band44="4.0" Band45="-7.728813171386719" Band46="5070.61572265625" Band47="2.775229930877686" Band48="1.0" Band49="4.0" Band50="4.4745774269104" Band51="3146.06005859375" Band52="4.233390331268311" Band53="1.0" Band54="4.0" Band55="5.084745407104492" Band56="6523.2744140625" Band57="9.0" Band58="1.0" Band59="4.0" Band60="-5.694915771484375" Band61="7157.689453125" Band62="9.0" Band63="1.0" Band64="0.0" Band65="-14.03389835357666" Band66="11536.2978515625" Band67="3.472524166107178" Band68="1.0" Band69="4.0" FFTEnabled="1"> <ChildProcessors/> <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> </Processor> </Modules> <MidiAutomation/> <MPEData Enabled="0"/> </Preset>
Is there a way to easily load this data into an eq module without using the preset system? I'm trying to avoid writing code for all of thes bands, as well as free up the preset system to do other things.
-
@Dan-Korneff use
effect.exportState()
&effect.restoreState()
:
https://docs.hise.audio/scripting/scripting-api/effect/index.html#exportstate -
@Matt_SF Excellent!
Is there a way to exclude items from the state?For instance, I'd like to restore the filter curves, but not the bypassed/enabled variable.
-
@Dan-Korneff I don't think so. The tests i've made a while ago only saved/restored the whole module...