HISE Logo Forum
    • Categories
    • Register
    • Login

    LAF for MatrixPeakMeter

    Scheduled Pinned Locked Moved General Questions
    19 Posts 4 Posters 420 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JulesVJ
      JulesV
      last edited by

      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+Q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7LzY+xsd.a8LeQ9L5u+gulG6epW2dhCFueUkL3uaSNuZpTWHgiQElWBqf5gsvOnjPaZeOYBZkbrbEAW32UvY4hFVEvzJc5.4BxF4FZAoj5rQJxYptJ3AzvL2YeupKy3.M.8SvgzWX+W9WJYjmWuqUDcIpjJj+ezb53G0ZN8u7MzQdjOVFtbhHt7FQM+nYwwidNesHMj5neYnclZMjpCDrZtW2AClqCf65XDSFKpV7me97I3YM3KOy28qyurXql3BVO.9hAyyW8SUuEaOnF0pNTd90.7UpymXFi7dU0z6q6VFhSJ8lwIkVEv15WONsYDDIBK+gzpBQO0qzF6C9lm8rea9Zzd9HySN.lYlmO+8A7UtwDZop8iyWKXmgv9s4y9FGZ.7L.dLjIWDh98Gc8x6e4IL.6nSZtyZgM2Tgny0Q92OY2qiCxWGqQOpSf3ybh9kGUoNOtFA22b8+ClBVqnFSrMz+ZjYcr8v9t9LGm7S0dLrxg0vYNrFd4CqgW4vZ3rGVCm6vZ3U+yMT0V7B8khdQ2Sv2an4R5emSSynWYPekw3Of.oO3r
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @JulesV
        last edited by d.healey

        @JulesV obj.peaks contains the current value for each channel. You can use those to draw individual level meters.

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

        JulesVJ 1 Reply Last reply Reply Quote 0
        • JulesVJ
          JulesV @d.healey
          last edited by

          @d-healey Thank you for the info. Yes I predicted that.

          But for (x in obj.peaks[0]) gives no iterable type error.

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @JulesV
            last edited by

            @JulesV What is obj.peaks[0]?

            Libre Wave - Freedom respecting instruments and effects
            My Patreon - HISE tutorials
            YouTube Channel - Public HISE tutorials

            JulesVJ 1 Reply Last reply Reply Quote 0
            • JulesVJ
              JulesV @d.healey
              last edited by

              @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?

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @JulesV
                last edited by d.healey

                @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 writing for (x in 10)

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                JulesVJ 1 Reply Last reply Reply Quote 1
                • JulesVJ
                  JulesV @d.healey
                  last edited by

                  @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?

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @JulesV
                    last edited by

                    @JulesV obj.peaks is an array. obj.peaks[0] will give you the first value in the array. A for in loop will loop over all the values of an array.

                    Your original snippet that you posted does this.

                    d69d99ee-5958-4818-83f5-7f2d1a236516-image.png

                    Everything you need is in that snippet.

                    Libre Wave - Freedom respecting instruments and effects
                    My Patreon - HISE tutorials
                    YouTube Channel - Public HISE tutorials

                    JulesVJ 1 Reply Last reply Reply Quote 0
                    • JulesVJ
                      JulesV @d.healey
                      last edited by

                      @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.

                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @JulesV
                        last edited by d.healey

                        @JulesV obj.peaks[0] contains just one value. Let's imagine it contains 0.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 channel obj.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.

                        Libre Wave - Freedom respecting instruments and effects
                        My Patreon - HISE tutorials
                        YouTube Channel - Public HISE tutorials

                        JulesVJ 1 Reply Last reply Reply Quote 0
                        • JulesVJ
                          JulesV @d.healey
                          last edited by

                          @d-healey Yes I already know this. And that's still not the solution or help hahaha :D Thanks anyway.

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @JulesV
                            last edited by

                            @JulesV said in LAF for MatrixPeakMeter:

                            that's still not the solution

                            Do you know how to draw a rectangle in a paint routine?

                            Libre Wave - Freedom respecting instruments and effects
                            My Patreon - HISE tutorials
                            YouTube Channel - Public HISE tutorials

                            JulesVJ 1 Reply Last reply Reply Quote 0
                            • JulesVJ
                              JulesV @d.healey
                              last edited by

                              @d-healey Yes I know.

                              d.healeyD orangeO 2 Replies Last reply Reply Quote 0
                              • d.healeyD
                                d.healey @JulesV
                                last edited by d.healey

                                @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.

                                Libre Wave - Freedom respecting instruments and effects
                                My Patreon - HISE tutorials
                                YouTube Channel - Public HISE tutorials

                                1 Reply Last reply Reply Quote 0
                                • orangeO
                                  orange @JulesV
                                  last edited by

                                  @JulesV As David suggested you need to draw with obj.peak value. But you need to use obj.peak value like this:

                                  HiseSnippet 1809.3oc0Y8zSabDEeWfMEb9iRpRU5kJM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O3Ge1ydwhkn9sQl28.XlYd9ha.3qfwjX8U6WWrTv9G.6EKl7wAZ.7L.dLjH+Ch9yu+5kO9RRX.16Oo1tlE12RAhN+F4seBtyhCxyh0vm5DHdnSzOFnJ04nZDbey0+maLl0ppwDaC8OPXRGqO1q0CcbROUGxvBmVCm4zZ30OsFdiSqgydZMbtSqgy+pMT0J7M6HE9Q2SvmDTcY8O8noYzqAzWYL9W.5u1kZ
                                  

                                  develop Branch / XCode 13.1
                                  macOS Monterey / M1 Max

                                  DabDabD 1 Reply Last reply Reply Quote 1
                                  • DabDabD
                                    DabDab @orange
                                    last edited by

                                    @orange If we use this snippet and disable effects ( Reverb and Delay) we will see abrupt peak meter run down kind of on/off. Looks very ugly.

                                    Bollywood Music Producer and Trance Producer.

                                    orangeO 1 Reply Last reply Reply Quote 0
                                    • orangeO
                                      orange @DabDab
                                      last edited by orange

                                      @DabDab MatrixPeakMeter apparently does not get obj.peak values by taking the Up & Down DecayTime values in LAF. Because of that it seems like that.

                                      @d-healey Is there a way to get Up & Down DecayTime values in the FloatingTile json data in LAF?

                                      Or create peak meter with these values in LAF for MatrixPeakMeter FT?

                                      develop Branch / XCode 13.1
                                      macOS Monterey / M1 Max

                                      d.healeyD DabDabD 2 Replies Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @orange
                                        last edited by

                                        @orange said in LAF for MatrixPeakMeter:

                                        Is there a way to get Up & Down DecayTime values in the FloatingTile json data in LAF?

                                        Not that I'm aware of. You'd probably need to make a custom meter using a panel + timer.

                                        Libre Wave - Freedom respecting instruments and effects
                                        My Patreon - HISE tutorials
                                        YouTube Channel - Public HISE tutorials

                                        1 Reply Last reply Reply Quote 0
                                        • DabDabD
                                          DabDab @orange
                                          last edited by DabDab

                                          @orange said in LAF for MatrixPeakMeter:

                                          MatrixPeakMeter apparently does not get obj.peak values by taking the Up & Down DecayTime values in LAF.

                                          Exactly. 👍

                                          Your post https://forum.hise.audio/topic/6615/laf-collection-for-everyone?_=1744108411508
                                          and Knob Peak Meter by Steve-mohican is impressive.
                                          I didn't find matrix peak meter very useful in anyway.

                                          Bollywood Music Producer and Trance Producer.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post

                                          43

                                          Online

                                          1.7k

                                          Users

                                          11.7k

                                          Topics

                                          102.3k

                                          Posts