Getting error message "Execution timed-out"



  • Hello,
    I am just getting error message "Execution timed-out" while adding panel on script.
    Is there any limit with the number of panels which can be added?



  • Actually it isn't supposed to run into the time out when building the interface. How many elements have you created - and are you doing anything else that may cause heavy CPU usage there?

    I could raise the timeout but this will also increase the loading times of the plugin for the end user so maybe there it's wiser trying to reduce the complexity (I never got this problem with NSK).



  • I have to make pickable slider knob by using flimstripimage.
    But HISE knob doesn't support mouse call-back. So I have to make it by customizing Panel.
    Actually, current project BlueBeast what I am doing has many elements because of dynamic fx racks.
    Would you have a look current codes and give me some hints?



  • I can load the interface without problems (it takes about 3 seconds to compile on my machine, which is a bit high, but still in a reasonable range considering the amount of controls you're using).

    You can change the timeout duration with Tools -> Change Compile Timeout duration. The default is set to5.0s but you might want to set this to a higher level until it doesn't throw this error.

    Nice coding style BTW 🙂



  • Thank you very much!



  • Sure, no problem. How are you getting along with designing the interface in HISE? If you hit any serious workflow issues, let me know (you are one of the first people that use HISE besides me and David).



  • I just profiled the script compiling of BlueBeast and it seems to spend about 30% of its time in reloading the images for the script panels.

    I'll try to come up with some kind of caching that speeds up this process.



  • Oh, great! It will help me a lot really.



  • It also spends 20% of the time in the for loop of the onControl callback. Changing all those else ifs to a switch statement might speed things up on your side (the switch statement is evaluated natively while the engine has to evaluate each else if as Javascript statement.



  • Oops, Forget my last advice, switch doesn't work because you don't use constant references for the case statements



  • Alright, I just pushed a commit that fixes this:

    https://github.com/christophhart/HISE/commit/58b4730e585bda47c314b71010faea9cc56c5ca1

    It reloaded all image files from disk instead of using the cached version (IIRC I chose this behavior because it makes the design workflow easier - you now have to restart HISE if you change the image files).

    The BlueBeast interface compiles now twice as fast 🙂



  • Ok, I got. Thank you.
    One quick question.
    Would you let me know about event parameter in setMouseCallBack function?
    like event.mouseDown, event.mouseUp, event.mouseMove, event.mouseX, event.mouseY...
    Am I right?



  • You can use the autocomplete popup to get every parameter. Just type event. and press Escape (you even don't need to be in the callback as I hardcoded event just for this purpose (I also did this with g for the graphics object in the paint callback).

    0_1494004264887_events.png



  • Hello, @Christoph-Hart!
    I am just wondering that HISE can allocate and manage UI stuffs on heap memory.
    For example, we may need to create some kinds of panel by user events like selecting combo box item or clicking button.
    Such panel may not be fixed and pre-defined while making designs.
    And it may have variable controls which will be resolved on runtime.
    I know we can use javascript functions to allocate such UI stuffs, but then how can we get events from controls created on runtime?
    In other words, is it possible to allocate child components or panels and set event process call-back function for those objects?
    If it's possible, I want to get some samples of doing that.
    Thanks.



  • This is indeed a bit tricky. The scripting engine expects all components to be created in the onInit callback (and that's how almost all other scripted interface system works) Removing this restriction might come with some side effects and will create a performance impact (remember the control callbacks might get called in the audio thread if the control is automated by a MIDI CC so it's not just graphics).

    Are you sure you can't solve this problem with a fixed pool of "preallocated" UI widgets that are created when the script is compiled? I could add the possibility to change the parent relationship between components dynamically as well as changing the mouse callback function and the paint routine function (the latter is already working), so you could simply create a bunch of empty and invisible panels and morph them into the thing you need on certain user events.

    This should work for the FX rack system (unless you want to have an effect more than once, but this complicates things also on the DSP side).



  • This is an example of using a pool of preallocated Panels:

    namespace PanelPool
    {
    	const var POOL_SIZE = 256;
    	
    	inline function _createEmptyPanel(index)
    	{
    		local p = Content.addPanel("Panel" + index, 0, 0);
    		p.set("visible", false);
    		return p;
    	}
    
    	const var _emptyPanels = [];
    	const var _panelUsed = [];	
    	_emptyPanels[POOL_SIZE] = 1;
    
    	for(i = 0; i < POOL_SIZE; i++)
    	{
    		_emptyPanels[i] = _createEmptyPanel(i);
    		_panelUsed[i] = false;
    	}
    
    	inline function newPanel(x, y)
    	{
    		local i;
    		local p;
    		
    		for(i = 0; i < POOL_SIZE; i++)
    		{
    			if(!_panelUsed[i])
    			{
    				_panelUsed[i] = true;
    				p = _emptyPanels[i];
    				p.set("visible", true);
    				p.set("x", x);
    				p.set("y", y);
    		
    				return p;
    			}
    		}
    	}
    	
    	inline function deletePanel(p)
    	{
    		local i = _emptyPanels.indexOf(p, 0, 0);
    		
    		_panelUsed[i] = false;
    		
    		p.set("visible", false);
    	}
    }
    
    notePanels = [];
    notePanels[127] = 1;
    
    function onNoteOn()
    {
    	notePanels[Message.getNoteNumber()] = PanelPool.newPanel(Message.getVelocity(), 0);
    }
    function onNoteOff()
    {
    	PanelPool.deletePanel(notePanels[Message.getNoteNumber()]);	
    }
    function onController()
    {	
    }
    function onTimer()
    {	
    }
    function onControl(number, value)
    {	
    }
    

    When you press a note, it "creates" a panel (and sets it's x-position to the velocity value) and if you release the note it "deletes" it.



  • Well, that's interesting.

    Anyhow, I had to make FX rack system which can get the effect more than once. You can see those racks in BlueBeast. Each empty slot should be able to be replaced by any rack selected on runtime. And there may be same racks. So I had to make interface something heavy.
    I guess it is the limit of script based sdk. It would be hard to manage multi thread processing logic with UI and audio thread dynamically.

    One more thing I want to ask.
    Is it possible to make panel which can show stretched image according its size?
    When we make iOS app or plugin or we make resizable stand-alone application, control images should be resized or stretched. And so we will definitely need such features, I think.

    Really appreciate for your kind answer and support.

    Thanks.



  • I just pushed a commit that allows changing parent components dynamically:

    In this example there is a button and a Panel. If you press a note, the button will be attached to the panel and if you release it, it will be back to default.

    HiseSnippet 777.3ocsU82SSCDF951ZhTcDw3Gfl8WiDbrBnPzXD1jYlxFKVBwDiAuc8F6Bs20b8J3fvWI+r42.8tds1trAgZhMYY6ddeed2y812eLhyP3nHFGX73SlEhAFOwzcFULs6THgB5+dfwplCfQBL2VC0YVHLJB6ALLp9AEfwJ0.IO+5ccf9PJBmCA.mxHH7Qj.hHG866+IhueOnG9DRPAu2Y+9HFsKymEK0SUy1fPH5B343gPkaULAWRvWEALZat8Vs3W3L95CZ0p00imMXq66yQ.TLmiohSkzAFlF+V9XXdnGQv3tBn.KiY0NLuYtSYWQ0+0mRhHi8wpCN.WolzvftSI9dixRaQ.fQsQ4Iwp5j3yMGP7H+EOOY9zDC14LJlNMpLujpMmjbtKI0i46oBvcHOiBxqlVdqY5h3jPQtEk1dVJ5cnNsQPkeZXZIeMEIruDxsGAoXe62Z2kQExLbKnmWBTyFIe0XCam81cC61q+FqM2z9qez83gZNeyJiRDVIjPLWPvQ83r.kS47uotksciqHdhoMdssyNaW251znsYgvU2ptUAc0IVHXz4ElFqYC82xP2VKrIwTjfH8lQGxD3ioMW25FqUztojWyFgPU8SWVPHiJ+gjap9jzucg.LYxCJBKPVoUNy2Gy07m2ppYYoFRo0jFGLFy2Pd+8iwY9IqKlupx5gUUgz4sBNxn8oDwwg3zNjrr0BHSljAoHkeoJ5XxkoHPpa4PKVJCReWpJpScW5pHojd0zhWcJGPjkrOxL8PR9n3PIvhsDxFSlWrOTLe2pZBWpAYtdt9g9JsDQDyJNArDsvsWZKryxt2OP4tl4Hh.Mc45sxRzqLQ9+VuoCDqad3jIXjHWr0L68k+0oekPJelEKHzyG.EbxOjy9GFG3JWufvRkPkMvQp8AUT0V5ysUmUYFWL0qc1xhTiNpyFoFcxLBBfHN6LjthTMx8QIHRMQSVbshbCp7rsSVknR2Ax8.mgPpDwKjJe4L1pzL1tzL1ozLdYoY7pRyX2RyXu6ggZo6AwBVfts..9C9fgWB
    

    Setting the mouse callbacks and changing the paint routine also works dynamically (just pass another function into Panel.setMouseCallback(). Let me know if this works out for you or if you need something else.



  • OK I see. But even if you have the same racks multiple times, you should be able to use this approach. In this case, you would not need a dynamic amount of rack panels, but rather a pool of sliders and other UI elements that can be skinned and assigned to the panels dynamically. However this is the easy part, hooking it up to the callbacks and assigning them to control parameters in a performant way is a bit more complicated, but I'll think of something - maybe I add the possibility of connecting a callback function directly to the component so you can do something like:

    
    const var slider = Content.addSlider("slider", x, y);
    slider.setControlCallback(inline function(value))
    {
        Console.print(value);
    }
    

    This also removes the necessarity of writing one big switch statement, however the function passed in must be an inline function, so it works without allocation.

    Resizing is already supported. You can pass a rectangle to the g.drawImage function and it will rescale the image. If you are using a retina display, it will use the full resolution (so the best practice for retina images is to load the full image and scale it by 50%).



  • I got. Thanks for your good information.

    And it would be better to make enable following things.

    const var delayRack = createRack(FX_DELAY); // create fx rack with its id
    delayRack.setControlCallback(inline function(id/*child control of rack*/, value)
    {
        switch(id)
        {
            ...
        }
    });

 

3
Online

353
Users

1.1k
Topics

7.6k
Posts