@Christoph-Hart said in Compiling Scriptnode to dll removes all paramters....:
Something else is trashing the parameter IDs they are created but the id is empty
Claude gave me this wisdom...
I'm checking whether the 16-parameter figure is a hard limit or just a buffer size.
No, there isn't one. Neither a preprocessor define nor a project setting controls the parameter count for a hardcoded script FX.
The only constant: OpaqueNode::NumMaxParameters = 16 (hi_dsp_library/node_api/nodes/OpaqueNode.h:102). It's a hardcoded static constexpr, not a preprocessor define. For hardcoded FX it only sets the size of the built-in buffer for the stored parameter values (HardcodedModuleBase.h:563). Past 16, that buffer moves to the heap, so 16 is not a hard limit.
Similar names that are something else: NUM_HARDCODED_FX_MODS, NUM_HARDCODED_POLY_FX_MODS and NUM_HARDCODED_SYNTH_MODS are preprocessor defines, but they set the number of modulation slots, not parameters.
While checking this I found a bug I haven't changed. Two places pass the parameter count as a byte count, which is 4 times too small because each value is a 4-byte float:
HardcodedModuleBase.cpp:563 (lastParameters.setSize(numParameters, false))
HardcodedModuleBase.cpp:967 (lastParameters.setSize(numParameters))
Line 666 does it correctly with numParameters * sizeof(float). With 16 or fewer parameters the built-in 64-byte buffer hides the mistake. With more than 16, the values would be written past the end of the buffer. Both bad calls only run in the HISE IDE (inside #if USE_BACKEND), when an effect is loaded but not compiled, so exported plugins aren't affected.