Help "drawAnalyserBackground", "drawAnalyserPath" "drawAnalyserGrid",
-
@d-healey Actualy I don't know how to use Trace(obj).
-
Proper LAF Doc is very urgent. Somebody please write it. Please. specially the New Ones.
-
@DabDab said in Help "drawAnalyserBackground", "drawAnalyserPath" "drawAnalyserGrid",:
@d-healey Actualy I don't know how to use Trace(obj).
Just place the code I put inside the LAF function and it will show you all of the available data you can use within the function. This works with all LAF functions, once you know one you know all.
For example
laf.registerFunction("drawTablePath", function(g, obj) { Console.print(trace(obj)); });
Also here is a video about the
trace
command if you would like to know more. -
@d-healey Superb :)
-
@d-healey Nothing is showing
locLaf.registerFunction("drawAnalyserBackground", function(g, obj) { Console.print(trace(obj)); g.setColour(Colours.red); g.drawEllipse(obj.area,2.0); });
-
@DabDab Have you assigned your locLaf function to your analyser?
-
@d-healey Yup... All laf functions are not being shown. I was looking for MatrixPeakmeter via
trace(obj)
. Trace function doesn't show anything. -
I was looking for MatrixPeakmeter via trace(obj). Trace function doesn't show anything.
What do you mean?
-
const var PeakMtr = Content.getComponent("PeakMtr"); const var Laf = Content.createLocalLookAndFeel(); Laf.registerFunction("drawMatrixPeakMeter", function(g, obj) { Console.print(trace(obj)); g.setColour(Colours.pink); g.drawRect(obj.area, 2.0); g.setColour(Colours.greenyellow); g.fillPath(obj.peaks, obj.area); }); PeakMtr.setLocalLookAndFeel(Laf);
I can't not figure out how to customize Peaks and max peaks.
-
@DabDab obj.peaks is not a path
-
@d-healey So How can I make custom LAF Matrix peak meter with gradient.
-
@DabDab Without doing it for you there's not much more to say. This is the function I'm using, perhaps it will give you some guidance.
laf.registerFunction("drawMatrixPeakMeter", function(g, obj) { var a = obj.area; var value = 0; var numActive = 0; for (x in obj.peaks) { if (x > 0) { numActive++; value += x; } } value = value / numActive; g.setColour(obj.itemColour); g.fillRoundedRectangle(a, 8); g.setColour(Colours.withAlpha(obj.itemColour2, 0.2 + value)); if (a[2] > a[3]) { a[2] *= value; } else { a[1] = a[1] + a[3] - a[3] * value; a[3] *= value; } g.fillRoundedRectangle(a, 8); });
-
@d-healey Oho... really complicated scripts. It was beyond my knowledge database..
Thank you so much.
-
@DabDab It's not complicated, it just looks it at first. This handles vertical and horizontal meters in my project.
-
@d-healey Yes.. I am going through the code.
-
@DabDab said in Help "drawAnalyserBackground", "drawAnalyserPath" "drawAnalyserGrid",:
@d-healey Yes.. I am going through the code.
My code is also to draw a single bar with the average of all channels. That's what this part does.
for (x in obj.peaks) { if (x > 0) { numActive++; value += x; } }
You don't need that if you want to display each channel individually or if you have a mono signal.
-
@d-healey Ok.. got it. (y)
-
D DabDab marked this topic as a question on
-
D DabDab has marked this topic as solved on
-
@DabDab I have done so - a highly detailed LAF documentation and tutorial. look in the repository…wherever they put it. It's where all the contributions go…I just don't remember off the top of my head.
-
@clevername27 Can you please put the url here ?
-
@d-healey Just to add the David's comments, depending on what you need, it can be simply to add LAF parameters by modifying HISE's C++ code. For example, I posted a while back about adding the component name to LAFs for specific widgets.