HISE Logo Forum
    • Categories
    • Register
    • Login

    Automation doesn't redraw panels

    Scheduled Pinned Locked Moved Bug Reports
    13 Posts 3 Posters 1.2k 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.
    • d.healeyD
      d.healey
      last edited by

      I just tested in Bitwig and it's exactly the same so I don't think it's a host issue.

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

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

        @dustbro Kindly tested this for me on Windows and the result was the same for him.

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

        1 Reply Last reply Reply Quote 0
        • Dan KorneffD
          Dan Korneff
          last edited by

          Here's what I'm seeing

          0_1536067340517_ezgif-1-f165fcc369.gif

          Dan Korneff - Producer / Mixer / Audio Nerd

          1 Reply Last reply Reply Quote 1
          • Christoph HartC
            Christoph Hart
            last edited by

            In your example you don't call Panel.repaint() in the control callback, so it's no wonder why it doesn't repaint :)

            Actually the recommended way of handling this is to just calculate the value in the mouse callback, call changed() and do all necessary UI updates in the it the control callback that's about to follow.

            This way you make sure that it works in all scenarios:

            
            // Define callback behaviour
            Panel.setMouseCallback(function(event)
            {
                if (event.clicked)
                {
                    //Save the value from the mouse click
                    this.data.mouseDownValue = this.getValue();
                }
                else
                {
                    if (event.drag)
                    {
                        // Calculate the sensitivity value
                        var distance  = (event.dragX - event.dragY) / 100;
            
                        var newValue = Math.range(this.data.mouseDownValue + distance, this.get("min"), this.get("max"));
            
                        if (newValue != this.getValue())
                        {
                            
                            this.get("stepSize") == 1 ? this.setValue(Math.round(newValue)) : this.setValue(newValue);
                            this.repaintImmediately(); // <= BAD, do not call this here, but let the controlCallback do it's work..
                            this.changed();
                        }
                    }
                }
            });
            
            function onControl(number, value)
            {
                // Call repaint here. Fun fact: in the new HISE version, repaintImmediately and repaint() do exactly the same thing :)
                Panel.repaint();
            
                // Theoretically you also need to call this here. BUT: if you're automating this control, it will fire in the audio callback
                // (or whatever other high priority thread the host is using for automation).
                // This is bad practice and will make the new AudioThreadGuard go crazy. The solution to this problem would be to 
                // make this asynchronous somehow (the quickest and nastiest hack would be calling this in the paint routine of the panel
                // that's about to be executed asynchronously).
                Label.set("text", value);
            }
            
            
            
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @christoph-hart But for most of my sliders I don't have a control callback because they perform their action through the parameter ID system which doesn't trigger the control callback.

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

              1 Reply Last reply Reply Quote 0
              • Christoph HartC
                Christoph Hart
                last edited by

                Ah, I see. In this case you probably need something like a method

                Panel.set("repaintOnValueChange", true);
                

                that handles this automatically. Shouldn't be too hard and is a sensible request. You're still on your own when it comes to update the label though - this would be the line where you have to leave the comfort zone of the parameter ID system.

                1 Reply Last reply Reply Quote 1
                • Christoph HartC
                  Christoph Hart
                  last edited by

                  Actually I took a look in the source code and it should already automatically repaint itself if it's connected to a parameter ID. Your minimal example is not connected.

                  I think the reasoning behind this solution is that you either:

                  1. Have not connected the slider to anything. Then it's just a dummy control and doesn't need to be updated from external automation - like your minimal example :)
                  2. Have a script defined callback. Then it's your responsibility to call repaint() in the script.
                  3. Have the panel connected to a parameter. In this case the engine will call repaint() for you.

                  Do you experience this problem with real-world scenarios?

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

                    @christoph-hart I'm putting together a more realistic test now and will report back soon

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

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

                      I just edited the example to control the release of an envelope for the sine wave generator and the result is the same.

                      HiseSnippet 1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KE1qnsnbFOk5IFX6LsjO2415cEb0oNTDm8Ptf7HlsS4WWdwxGUdRN85MKVxRlQbeeRzr3J6WFcJpYyFFzkDsr9ldpbPaiw6KckyWeIWc46BBxYsXTwiBIIqy6bUeFctLRp+C8vJk.PPTgpC1RocvjokFTO0DFpdIFJrmMUvu7aMLNIkU2iSTV2UYFJ+3VaBUfj8QSfC.wPRjfJ8DlaRFACnn6ptn0lj3WJ3gJYS5WAs7OSDeP1A9y3FGlOPyO1XeYNSFg2zsw.UNSFkFupw3s8LL+DqSpsmQZdOn9UN93i+U4NjmiKo9gjO8XE0319CAcZiifYmfV7fIUJbbR5opVvpiO0CDHF5s0hkLkmT5zHYKO4.GPmV7PewVrQDev+AilkrMR1KZsKwmfiIFPghhd+fhCH1pwX90ENyf4AEmjL2u9lm2.NcXOJtYowhdPPVViNW0aMcTPV0erjjoGwBFzi6IaiN9zexQdSX.27FaLK4nTxdsGVbj3KvHg0l4Hgy7h04DtWypMU3NX13szLvq7l56X7lLf8RVa0qGT5MGryas8ytrSSe4fx6qgxUs5.sBUu2QAjORsF8T4rd2ivHQRm5o7tme+79tmvy86ddjq.N88f1lwg73w13Nj.5dPRebQhONFllm7pckA4hzaxwQyj0auy1fMNSc5fECiTYKa.SswDikcL2k5ANieoof7y30Ny+uviw96+l2e8BEyc9bsmw6EWLEicnAg9jrp25pCSVSuHH2gy3gC3LpawDfcIhHZ+9x9I4Pel1yFBAzOKmx0aj1hnPc2G.Ig3HvMQd26JNsv0GaogKRdwD8ei56y8+y565W1zGdJVDElev5gCC5.0UcI.RXvDBvAYYVRVaTutlbstvJySs.lr53Dl0kqMSXVOk4+HmQ.1Mh+BW8juxb4ETT.6lolaaQqcjqQYi7J8MAP4vW35Jc1q.dmYqwWcg03quvZbiKrFqcg03lWXM9lKrF25TzP16YigBdf9pGPn8VpmZXZtECCYtprbi+Dp9lvc.
                      

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

                      1 Reply Last reply Reply Quote 0
                      • Christoph HartC
                        Christoph Hart
                        last edited by

                        Ah, OK, then I'll take a look why it doesn't behave...

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

                        31

                        Online

                        1.8k

                        Users

                        12.1k

                        Topics

                        105.0k

                        Posts