LAF for MatrixPeakMeter
-
In this example, there is a LAF for MatrixPeakMeter FT but only for mono sum.
How can we write LAF for right and left channel separately?HiseSnippet 1845.3oc2Y87aaTDEd2jrkZ2VTAUT4RkFEwgz1TiWm1jBUk3z33VKRZshSaAUUAS18Y6oY8LK6NN+nUQhiH0qbo23F23N23Jm4.WQpGPbi+CJuY1c8tqiaHDJEB4f8Neu2alu4Mu48dqSy.gCDFJBLLKt1N9fg4IsZsCW1cwtTF2nQMCy2zZEZnDBHQP2XGeZXH3ZXZN9MU.lElvP+2uO+MndTtCjBYXbOAyAVl0iISQaV8iYdd0otvZrdYz9xUa3H3KJ7D8Q9LtUYCepyFzNvsoJ0Fyx3VzvtFlWvZV21zYcm6JksgYtp6bUrm6Jevkma1xka6dU64Vet0mg5RmctxFlGaIWlTDzRRkPng4D2P3tSqths3QKv8Xgr08.0.aiV3JGAWW34p1hpmMVrKyysYhiJzvvzpYpaa7H21YrVg4xFfm59NsV.I0hrNPywxSuwyQO6rzqbF5MBJYlgRSDQo2xpkS.yWlJQwmSX0fimlso34TVpDoqwXe63VKJPM3xR8na.0CvACrXJzEOMA+37WqXwh3gUnjrIMfzDnarhLfbcRhsc.4hhd9BNNXpIikO4PlsLscFSbB.zKrrvg5srPrwBb25.3MkxFTwRAPGlJNrdetijI3SMoa.cqUnx.1154GPgSNMoch7NSSDq+nyW7IEKfKQnvCJ4GvP5HCTaEkLbtKPJVPwEJxDDpDEYw0JRHDM5lTu9.Jo70hzh2u2B3ruYBVwBcJEp1ppXV0TVhIgdQCUSdmRswP8UE84X7zpfijx63ASQmlbUkX05n9qsHfL01DFWSAeb2Dd9DYH8KvZqD+QjxmGGn.JLfHW7hWSMNhnW75jsUC2sPrwjjYY2jGR1QQe+9o6nnMczG5Ej9fJODWS5Cl4g3xpVUMxEhsEWG8jV.7BA8COQuFnV1ODW.8WWTaN4RQecgDKi0alrylBZ2TNj0uF8UXosXxtK342kNjmtxzjxkpfKldpTmpQyvKy2WA0XWUbUbboZo1S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Ht7FQM+nYwwidNesHMj5neYnclZMjpCDrZtW2AClqCf65XDSFKpV7me97I3YM3KOy28qyurXql3BVO.9hAyyW8SUuEaOnF0pNTd90.7UpymXFi7dU0z6q6VFhSJ8lwIkVEv15WONsYDDIBK+gzpBQO0qzF6C9lm8rea9Zzd9HySN.lYlmO+8A7UtwDZop8iyWKXmgv9s4y9FGZ.7L.dLjIWDh98Gc8x6e4IL.6nSZtyZgM2Tgny0Q92OY2qiCxWGqQOpSf3ybh9kGUoNOtFA22b8+ClBVqnFSrMz+ZjYcr8v9t9LGm7S0dLrxg0vYNrFd4CqgW4vZ3rGVCm6vZ3U+yMT0V7B8khdQ2Sv2an4R5emSSynWYPekw3Of.oO3r
-
@JulesV
obj.peaks
contains the current value for each channel. You can use those to draw individual level meters. -
@d-healey Thank you for the info. Yes I predicted that.
But
for (x in obj.peaks[0])
givesno iterable
type error. -
@JulesV What is
obj.peaks[0]
? -
@d-healey When I make
trace(obj)
, I get:"id": "PeakMtr", "area": [ 0.0, 0.0, 50.0, 300.0 ], "numChannels": 2, "peaks": [ 0.0, 0.0 ], "maxPeaks": [ 0.0, 0.0 ], "isVertical": true, "segmentSize": 0.0, "paddingSize": 1.0, "processorId": "SimpleGain1", "bgColour": 4278190080, "itemColour": 495684491, "itemColour2": 4294904844, "textColour": 4294967295, "parentName": ""
So the
obj.peaks[0]
is the left channel,obj.peaks[1]
is the right channel, isn't it?Since I need to draw individually, I need this?
-
@JulesV said in LAF for MatrixPeakMeter:
So the obj.peaks[0] is the left channel, obj.peaks[1] is the right channel, isn't it?
Correct, so
obj.peaks[0]
is a number, so your loop is like writingfor (x in 10)
-
@d-healey Hmm, I knew there was a syntax mistake :) I am new into this.
Can you please be more clearer or a simple snippet? -
@JulesV
obj.peaks
is an array.obj.peaks[0]
will give you the first value in the array. Afor in
loop will loop over all the values of an array.Your original snippet that you posted does this.
Everything you need is in that snippet.
-
@d-healey Yes I know, that's because I used
for (x in obj.peaks[0])
for the left channel, like previously mentioned.And I got
no iterable
type error.I really don't get it.
-
@JulesV
obj.peaks[0]
contains just one value. Let's imagine it contains0.05
. A loop requires an array,0.05
is a number, not an array.If you want to do something with the left channel's value you write
obj.peaks[0]
, and for the right channelobj.peaks[1]
.If you want to do something with both channels then you would use
obj.peaks
and a loop, as in the snippet.For example to print both the left and right values to the console you can do this:
Console.print(obj.peaks[0]); // Left value Console.print(obj.peaks[1]); // Right value
Or you could do this
for (x in obj.peaks) { Console.print(x); }
Or this
for (i = 0; i < obj.peaks.length; i++) { Console.print(obj.peaks[i]); }
etc.
-
@d-healey Yes I already know this. And that's still not the solution or help hahaha :D Thanks anyway.
-
@JulesV said in LAF for MatrixPeakMeter:
that's still not the solution
Do you know how to draw a rectangle in a paint routine?
-
@d-healey Yes I know.
-
@JulesV Draw two of them in your look and feel function. Then draw two more on top of them and multiply the height by the
obj.peak
value.You might need to add an offset to the Y or something funky like that, otherwise the peak meter will look upside down, but we can deal with that later.