Develop branch cannot support more than 19 scripts
-
@d-healey said in Develop branch cannot support more than 19 scripts:
I see some UI updates from the MIDI callback but they haven't been deferred. I don't think this is the cause of the crash either because those callbacks aren't triggered when loading the project, but it might be something to look into.
I managed to bypass everything in a debug build and I'm able to open it in the release build. Now I'm enabling things bit by bit to see if I can narrow down the crash.
yep sure -- can you point at them to save me looking for them?
-
@lindon said in Develop branch cannot support more than 19 scripts:
can you point at them to save me looking for them?
Yep will do.
-
@d-healey meanwhile I'm going in the complete opposite direction and rebuilding from the ground up .....
So far I've re-set up all the backend sound sources and fx and rebuilt the UI, I've found:
-- only that HISE develop doesn't seem to like Slot FX very much (or copying them around anyway..)
-
@lindon said in Develop branch cannot support more than 19 scripts:
@d-healey meanwhile I'm going in the complete opposite direction and rebuilding from the ground up .....
So far I've re-set up all the backend sound sources and fx and rebuilt the UI, I've found:
-- only that HISE develop doesn't seem to like Slot FX very much (or copying them around anyway..)
....and I started adding in the scripts ... leaving the interface script until last....
they all work fine right up until I add the rangefilter scripts, and it crashes....
Here's the contents of the range filter scripts:
const var LowRange = Content.addKnob("LowRange", 0, 0); LowRange.setRange(0, 126, 1); const var HighRange = Content.addKnob("HighRange", 150, 0); HighRange.setRange(1, 127, 1); const var FadeButton = Content.addButton("FadeButton", 300, 12); const var SubMults = [0.7,0.65,0.6,0.5,0.4,0.3,0.25,0.2,0.1,0.05,0.025,0.0125,0.0125]; SubMults.reserve(15); function onNoteOn() { //Console.print(Message.getNoteNumber()); if (FadeButton.getValue() == 0) { // not fading out strictly cutting off if(Message.getNoteNumber() < LowRange.getValue() || Message.getNoteNumber() > (HighRange.getValue())) { Message.ignoreEvent(true); } }else{ //cut things outside the fade ranges... if(Message.getNoteNumber() < LowRange.getValue()-12 || Message.getNoteNumber() > (HighRange.getValue()+12)) { // outside everything - just cut. Message.ignoreEvent(true); } if (Message.getNoteNumber() > HighRange.getValue() && Message.getNoteNumber() <= (HighRange.getValue()+12)) { // in the high range fade range Message.setVelocity(Message.getVelocity()* SubMults[Message.getNoteNumber() - HighRange.getValue()]); } if (Message.getNoteNumber() < LowRange.getValue() && Message.getNoteNumber() >= (LowRange.getValue()-12)) { // in the low range fade range Message.setVelocity(Message.getVelocity()* SubMults[LowRange.getValue() - Message.getNoteNumber() ]); } } } function onNoteOff() { if (FadeButton.getValue() == 0) { // no fade just cut if(Message.getNoteNumber() < LowRange.getValue() || Message.getNoteNumber() > (HighRange.getValue()+12)) Message.ignoreEvent(true); }else{ // is it outside all fading ranges? if(Message.getNoteNumber() < LowRange.getValue()-12 || Message.getNoteNumber() > (HighRange.getValue()+12)) Message.ignoreEvent(true); } } function onController() { } function onTimer() { } function onControl(number, value) { }
-- nothing is jumping out at me....
-
@lindon I don't see anything unusual there. I'm off to cook dinner but I'll dig a bit deeper when I'm back.
-
@d-healey --and now just like every other version its crashing no matter what I do to it.....grrrrrrrrrrrrrrrrrrrrrrrrr
-
@Lindon I don’t know if it’ll have an impact but instead of calling things multiple times I would store the note number in a reg, and same thing for the range values
-
@ustk what?
-
@d-healey said in Develop branch cannot support more than 19 scripts:
@lindon I don't see anything unusual there. I'm off to cook dinner but I'll dig a bit deeper when I'm back.
Yeah I have to call it quits for today too?
-
@lindon said in Develop branch cannot support more than 19 scripts:
@ustk what? er we are talking about using multiple scripts (one per voice) so its more modular...
-
@ustk said in Develop branch cannot support more than 19 scripts:
I would store the note number in a reg
You can use a
local
in the MIDI callbacks, I don't know if this is better than a reg... -
@d-healey For what I understand a reg is faster, hence more suitable for real-time stuff...
-
@d-healey Also I thought locals were only declarable in an inline, never tried in a midi CB though...
-
@ustk said in Develop branch cannot support more than 19 scripts:
For what I understand a reg is faster, hence more suitable for real-time stuff...
Interface script should be deferred in this case and shouldn't be doing real time stuffIgnore me, I was thinking this is the main interface script :pAlso I thought locals were only declarable in an inline, never tried in a midi CB though...
With the exception of the built in callbacks that seems to be true.
-
After disabling everything and re-enabling it one by one, saving in between and reloading HISE. The project now opens every time without crashing!
@Lindon I'll send you a snippet that is opening for me and you can see if it magically works for you as well.
Regarding the real time UI stuff, it's parts like this.
for (ondx=0; ondx<7;ondx++) { if (FMAmtVelos[ondx].getValue() == 1) { //Console.print((Message.getVelocity()/ 1.27)/100); // * (127/100)); FMAmounts[ondx].setValue((Message.getVelocity()/ 1.27)/100); FMAmounts[ondx].changed(); } }
I try to avoid loops in real time altogether if possible, but this one is just updating a UI component and triggering its callback. This should be in a deferred script. The action that you need to happen in real time (presumably whatever happens when the component's callback is triggered) should go in a separate non-deferred script. This approach will probably require a significant restructuring of your project at this stage though so if it's working for you then don't go down the rabbit hole.
The only other thing I noticed in general about the project is it takes a bit of time to open and the CPU usage idles quite high (around 10%) for me. I think this is due to the effects and other modules rather than your scripts so probably not much you can do about it.
-
@d-healey - great thanks mate - I will give it a try - what was the problem can you identify it?
-
@lindon said in Develop branch cannot support more than 19 scripts:
what was the problem can you identify it?
I wasn't able to pin it down to anything in particular.
-
@d-healey Maybe comparing the 2 project folders (original and fixed) with a tool could show up the difference and point to a Hise bug (like in an xml file or something)?