C++ External Node & XML Issues
-
Github issue: https://github.com/christophhart/HISE/issues/866
I've been getting a lot of these errors lately (maybe since the last 3-4 weeks?)
XML file is not valid. Loading abortedUsual context is having a hardcoded FX module with a custom C++ node (or Scriptnode Networking containing a C++ node). If I remove the reference in a text editor (.xml), the project will load and I can add my node back in. But resaving and opening again will reproduce this issue. Mind you it isn't a matter of updating HISE or recompiling the FX, this happens on any build from this year.

-
@HISEnberg Probably an issue with your parameter names. Note that using eg. "Type" is illegal because it clashes with the XML element for the module type (HISE!).
-
@Christoph-Hart Hmm that seems reasonable. Do any of these raise any flags? I'll try changing the parameter name but I can't imagine this causing issues (it's from one of the C++ modules causing me troubles).
void createParameters(ParameterDataList& data) { { parameter::data p("PreGain (dB)", { -24.0, 24.0, 0.1 }); registerCallback<0>(p); p.setDefaultValue(0.0); data.add(std::move(p)); } { parameter::data p("Hold (ms)", { 0.0, 100.0, 1.0 }); registerCallback<1>(p); p.setDefaultValue(5.0); p.setSkewForCentre(30.0f); data.add(std::move(p)); } { parameter::data p("Release (ms)", { 1.0, 2500.0, 1.0 }); registerCallback<2>(p); p.setDefaultValue(80.0); p.setSkewForCentre(800.0f); data.add(std::move(p)); } { parameter::data p("Ceiling (dB)", { -60.0, 0.0, 0.1 }); registerCallback<3>(p); p.setDefaultValue(0.0); data.add(std::move(p)); } } -
@HISEnberg I see a parenthesis in a parameter Id, I get instant rash on my forehead.
-
@Christoph-Hart Wouldn't cause a corruption in XML. So far as I know, it is perfectly legal to do so. I've used parenthesis in parameter id's for ages and not had any errors in xml files like what @HISEnberg is reporting.
-
@Orvillain Strange, I am inclined to agree with you since I've done this with other nodes, but removing them in this particular context seems to have solved the problem. Still I can't find the root issue here so I'll keep digging...
-
@HISEnberg said in C++ External Node & XML Issues:
@Orvillain Strange, I am inclined to agree with you since I've done this with other nodes, but removing them in this particular context seems to have solved the problem. Still I can't find the root issue here so I'll keep digging...
That is very odd. There's nothing in the XML specification that says you shouldn't use parenthesis in an attribute name, so far as I know. The only character to definitely be wary of in my experience is an ampersand.
-
@Orvillain I think the problem is that HISE converts Parameter IDs into actual attributes. This is only the case with hardcoded modules, script processors or DSP networks properly escape that in the value string.
<Processor Type="Hardcoded Master FX" ID="HardcodedMasterFX1" Bypassed="0" Network="No network" YourParameterGoesHere="0.5" TryValidating(That)="nope"> <EditorStates BodyShown="1" Visible="1" Solo="0"/> <ChildProcessors/> <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> </Processor>I do a bit of sanitizing at some place though (eg. remove white space for the XML attribute, so all my ramblings might be moot because I sprinkled a character sanitation in there too.
-
@Christoph-Hart said in C++ External Node & XML Issues:
@Orvillain I think the problem is that HISE converts Parameter IDs into actual attributes. This is only the case with hardcoded modules, script processors or DSP networks properly escape that in the value string.
<Processor Type="Hardcoded Master FX" ID="HardcodedMasterFX1" Bypassed="0" Network="No network" YourParameterGoesHere="0.5" TryValidating(That)="nope"> <EditorStates BodyShown="1" Visible="1" Solo="0"/> <ChildProcessors/> <RoutingMatrix NumSourceChannels="2" Channel0="0" Send0="-1" Channel1="1" Send1="-1"/> </Processor>I do a bit of sanitizing at some place though (eg. remove white space for the XML attribute, so all my ramblings might be moot because I sprinkled a character sanitation in there too.
ahhhhhhhhhhhhh, gotcha. Yes, then that does make sense that parenthesis would possibly break things... and now I'm going to do a sweep through my code to see how many landmines I've invented.
