Crash when creating global mod sources using the Builder
-
Content.makeFrontInterface(600, 600); reg builder = Synth.createBuilder(); inline function createGlobalModulationSources() { local modmatrix_idx = builder.create(builder.SoundGenerators.GlobalModulatorContainer, "Global Mod Container", 0, builder.ChainIndexes.Direct); local globalModulatorsChainIndex = 1; builder.create(builder.Modulators.Velocity, "Velocity", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.KeyNumber, "Key Number", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.FlexAHDSR, "Env 1", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.FlexAHDSR, "Env 2", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.FlexAHDSR, "Env 3", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MacroModulator, "Macro 1", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MacroModulator, "Macro 2", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MacroModulator, "Macro 3", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MacroModulator, "Macro 4", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.Random, "Random", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.PitchWheel, "Pitch Wheel", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MidiController, "Mod Wheel", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MidiController, "Midi CC 1", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MidiController, "Midi CC 2", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.MidiController, "Midi CC 3", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.HardcodedEnvelopeModulator, "Custom LFO 1", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.HardcodedEnvelopeModulator, "Custom LFO 2", modmatrix_idx, globalModulatorsChainIndex); builder.create(builder.Modulators.HardcodedEnvelopeModulator, "Custom LFO 3", modmatrix_idx, globalModulatorsChainIndex); }; builder.clear(); createGlobalModulationSources(); builder.flush();
If I do the above, then HISE will crash every single time.
If I remove the last two custom LFO's (or just comment them out) then it does not crash.
My extra definitions are:
HISE_NUM_SCRIPTNODE_FX_MODS=24 HISE_NUM_POLYPHONIC_SCRIPTNODE_FX_MODS=24 NUM_HARDCODED_FX_MODS=24 NUM_HARDCODED_POLY_FX_MODS=24
If I run a debug build I get the following pop-up in VS2022:
And I basically get locked in this cycle:
Given it is saying that an array subscript is out of range, I can only assume that either I'm reading out of the range of an array, or that the definitions aren't being honoured in some way. A hardcoded limit on the number of modulators perhaps??
If I comment out everything except the 3 'Custom LFO' creation steps, then it still crashes... this implies that the crash is something to do with creating multiple HardcodedEnvelopeModulator objects.
-
@Orvillain said in Crash when creating global mod sources using the Builder:
HISE_NUM_SCRIPTNODE_FX_MODS=24
16 is the current maximum, if you want to use more, you need to change this constant:
HISE/hi_dsp_library/node_api/helpers/modulation.h at 1d6a4d0e43ac6fbcf2bf7c0e53683657697f4370 · christophhart/HISE
The open source framework for sample based instruments - HISE/hi_dsp_library/node_api/helpers/modulation.h at 1d6a4d0e43ac6fbcf2bf7c0e53683657697f4370 · christophhart/HISE
GitHub (github.com)
It will also require you to recompile HISE / all DLL networks as this will change the generated C++ code for networks.
But then again, do you really need 24 modulation slots or is it still not working with gaps in the parameter definition? I'd rather fix that so that you can get away with 16 ones because the other way feels like throwing "money" (aka CPU cycles / memory) on a problem to make it go away.
-
oh wait a minute, actually it should support more than 16 modulation sources, let me check that.
-
@Christoph-Hart Yep, this is fixed now. Thanks Christoph!
-
O Orvillain marked this topic as a question
-
O Orvillain has marked this topic as solved