HISE performance slowing down when using SVG project?
-
@d-healey I Don't get the idea, Sir?!
How Paths will show up?const var Panel1 = Content.getComponent("Panel1"); Panel1.setPaintRoutine(function(g) { g.fillAll(0Xff272727); g.setColour(0Xffffffff); g.fillPath(rhapsodyLogoWithBg,[0,0,100,100]); });
This doesn't show anything
-
@Natan Try with double quotation marks instead of brackets or parentheses.
global glarePath = Content.createPath(); global glarePathData = "647.t0Vc+HDQb+vxCIlLwCDQjHhyCUoJ+PDZQG8Pn7dODwfITOjXDgQODgHuUOTZmsCQt0C1CI7d5PDwil8PhkXE4PDf5u8P2QANDwNWaOjU+fCQcJ+1CIFC+eCQgHw1Ccv82PjH1q8P8Z6MDYZEZOjXoXyMD4JUXOTk0ZCQzNo0CEPM1PDuRS8PhoXkyPDGpt7PSXOLDsWfBODmV4BQZiUtCIFSTwBQ3SkrCweTpPjEQs5Pr9DJDQSSjNjXye7IDkzbhNjN.cBQekInCEHtlPTc+54PhY7rlPj7t54P0TmID4O4cNzM3YBQ46cmCIFf3YBQn4cmCc09mPDbZ94PvjCJDoT3eNjXfLgJDQC.hNDDsuBQd7AoCAvwsPDB9X5PhY0q0PT+L85PqdYODI+V3ND..VDQlqVvCIlAFRDQtOMwCoPrCQTb1i7P08iPDw8CKOzXsMxsTPT.K.zPhIyNYPjbT90PpGaGDQLv9MD90HBQZTxiCIFIEMBQ8esjCEEUjPD3JZ4P8MVIDIbOZNjXWZXIDQEtZNDfjYBQV5amCQFYlPzy914PhkhVlPTDS24PnsjIDAincNj59XBQfOYmCIFdmWBQz9RmCY.jkPDhKy4PThSIDw0YbNjXgE0HDETNZNzKpEBQmr.lCwufePDCcW4PhImfYPD3763PlG3DDQKGHNzVA1.QHxSfCI1lwu.QzTteCscXJPDVQs2PZHMBDsWu2MjXlHKBDUDc2MzuAd.QQbLcCAMfGPTt3R2PhA.fGPDQrR2PIyUBDQ9BoMTxOl.Qne.ZCI1C8z.QGlTUCIH0LPTFOY0P8RYDDYMVGMjXcYjDDkdfEMT9zMAQ.ErPCMxsTPT.K.zPiUF";
-
@RastaChess Don't use globals
-
@d-healey how can I put all the path data in a different script from the interface without globals?
-
-
@RastaChess You have only one interface script. Other scripts are for the modules for instance, where you don't need any LAF customisation
https://docs.hise.audio/scripting/scripting-in-hise/additions-in-hise.html#namespaces
You can have included external scripts, but they are part of the same interface script, so they do not require any global variables. If in these included script you have namespaces (which I hope you have) you want to access variables, you do it this way:
namespace CoolSpace { const var YOPLA = 47; reg youhou = 22; } // somewhere else in another namespace in interface script reg a = CoolSpace.youhou * CoolSpace.YOPLA;
-
@Natan don't call it Path, but Paths or anything else. I reckon I had a conflict with the Hise APIs when using same name. Had this with FileSystem too....
Also there's a difference betweendrawSVG
("base64SVGstring") anddrawPath
([from, loaded, array, of, data]), so choose your style wisely because one cannot paint the other... -
@RastaChess As utsk said you only have one interface so there is no need for paths in other scripts. But in general if you want to have the same code in two places you should use includes.
-
@ustk Thank you this great info.
I had no knowledge of namespaces or includes
I was just getting the clutter out from the interface script. I can see how using globals could be a drag now. Thanks for the example. I'll start implementing these changes. -
@RastaChess You might find this useful - https://docs.hise.audio/scripting/scripting-in-hise/hise-script-coding-standards.html
-
@ustk ok, I merged everything in the interface script using includes. Now HISE is working much faster and my project feels much lighter.
I just wanted to clarify, should I never ever use globals? or is it ok in some cases. For example:
I've been working on a glide script module. I need it to be on the fast lane. It has a glide rate knob and legato button that need to connect to the interface, which I have on deferred callbacks. Is it ok to use a couple of globals for something like this? or should I be looking at doing it some other way? -
@RastaChess Globals are made if you really need to share data or object between scripts, deferred or not.
In the case you just want to control your glide controls from interface, just create the same controls on the UI and connect them to the glide ones, either by script or from the property editor of the UI controls. This way you don't need globals (which wouldn't help you out in this case anyway...) -
@RastaChess
-