HISE Logo Forum
    • Categories
    • Register
    • Login

    SliderPack doesn't trigger onControl Callback

    Scheduled Pinned Locked Moved Scripting
    8 Posts 3 Posters 588 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.
    • toxonicT
      toxonic
      last edited by toxonic

      at the moment i want to create a kind of multi-fx plugin, where the most parameters are controlled by a sliderpack. The sliderpack values can be morphed between two presets with a slider.
      Peek 2019-11-28 11-03.gif
      For some reason, the sliderpack doesn't trigger the main onControl callback - but also a custom onContro callback for the sliderpack doesn't reflect value changes of the sliderpack, when they are triggerd by the single slider.
      so i had to copy the following bunch of parameter controls to the main onControl Callback, as well as the custom onControl callback for the slider:

      Degrade1.setAttribute(Degrade1.Quant, SliderPack1.getSliderValueAt(0));
          Degrade1.setAttribute(Degrade1.Rate, ((SliderPack1.getSliderValueAt(1) * 0.2) + 0.5)  );
          PhaseFX1.setAttribute(PhaseFX1.Frequency1, pitchToFreq(rangeCon( SliderPack1.getSliderValueAt(2), 0, 1, 12,136) ));
          PhaseFX1.setAttribute(PhaseFX1.Frequency2, pitchToFreq(rangeCon( SliderPack1.getSliderValueAt(3), 0, 1, 12,136) ));
          PhaseFX1.setAttribute(PhaseFX1.Feedback, SliderPack1.getSliderValueAt(4));
          SimpleReverb1.setAttribute(SimpleReverb1.WetLevel, SliderPack1.getSliderValueAt(5));
          SimpleReverb1.setAttribute(SimpleReverb1.RoomSize, SliderPack1.getSliderValueAt(6));
          ShapeFX1.setAttribute(ShapeFX1.HighPass, pitchToFreq(rangeCon( SliderPack1.getSliderValueAt(7), 0, 1, 12,136) ));
          ShapeFX1.setAttribute(ShapeFX1.LowPass, pitchToFreq(rangeCon( SliderPack1.getSliderValueAt(8), 0, 1, 12,136) ));
          ShapeFX1.setAttribute(ShapeFX1.Drive, SliderPack1.getSliderValueAt(9));
          ShapeFX1.setAttribute(ShapeFX1.Reduce, SliderPack1.getSliderValueAt(10)*14);�
      

      this is somehow annoying, and i ask myself, if there is'n an better way to get this to work without scripting that twice.
      any ideas?
      here's a snippet:

      HiseSnippet 3649.3oc6Z0DajbTEtm06rI1gE1rrQhKAUZIBMSh2wc0+2xqYFu1q20I1qcFu4ObrbZOSMd508z8jt6w+rIFENjynHDGBmxIj3BRHNfxsHDW.wAtvIPh.HhTRtDI3Db.dUUcOc2yzisWSxFfrSh7r8qduW889od0qqoV02qAIHvyWnv329ftDgBeohqcfaX64ZaY6Jr37BEtXwNd9caG3X2f3uIthnlv0NnqUP.ooPgBicCJeEF+rBrOeR0qY4X41fjPRP348.QWxticXB0Uq8L1NNKX0jba6No3Vo1hM7bmyywqGfowJJJz0pwNVaStkEksyTTnv4tdS6PO+0BsBIABEN607ZdvZs81yky+yaGXukCg9.VXMPQbxK34zjhXJUg4Za6zb0XaOPPnPwUS7Diw8DWp3x1Ms6SOwibA1.nDIR6OJbliBd3zvS7jCuBof2Y4v6QKtVCe6tgIiPw1iTbQ2PheKKHDjFVbdENyi+XEmyC3vMrRGqcHK3COzWhRJhhShjjDKO84m.BCAgncs7QyS11GBTXzLHVtQksIgWuUKRivRWNdrKmUjUaaEPV3EyUD1XHXvAjYs1VcGkLrwxSFG6lD+UgTDpXwVFH3bdc554BO.xlvy.R+LtdaMZ4XiNfDKMRtWZ.NqORNqOnM.YKPB9nwOe7AkxtSWGRcxtD+sx2kwX.EwAS5zxeqdc3Nl.pvItHpJRFqT1IEFXUeR.IjJjBSiSMEE1vbDh.7h7sbASw1MzCY4h7BaS74zN+Ds541Hz1yk+LHDpzJNMedKmdjIQv+ZYaW92V6OI5Vj8XOS+1Z+xmehW67SffO7+xvBYOlr.RJUpulPWIRUkQOIpDWZfFWckKilhMobhQLVF8TQiOMW69jvd9t8m.f5gTKkaqVNM54.KsQK3Sd0dD2FGfZ460AspcXi1oLxtzmusGkKToco5IwHnvuEc.vIpHB.cYKH100auRRSFwL.OMSJbwRkyBKpfwPB.DDL50E0kEUPV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suydY3xD1iOt1z9f4gfSRrAV09WpFebwYXy+fAn8IUegTMr7Nu8a+gUg5Dj6RRkB.Te2p+OqW9qFuO9r8ZZ6sjG8UcXN4KwofnjPq5Xc.wGeD2T3e6I8lB28DeSgW6.2FYWp8IUYMBcaenhbl0ZBBTXdcWKvG2LM+P1PH82NO8MUdM5RUBDo7CA0mVIr7o.RFZvRpnKqb8hS01qCYpPu88bsaLEy+LEWaASsm0tS0zuWmfo1zAvRvTs54tyla4Sr1YSQoMazKby4uwlVA1aBup9Vc6TADPnC0ExCeQMI+d8Nm.UdF7hGygYbMiGevjsydxR1tG5n5+9txz2+ZserSFbOl8uGOFi7RUW2Epq.qsh1+ddRKqdNgwTytvZYOWutsooXYyMgBBauMwOM1y0flMLLoiE1ujPchCAZXHgzSTCZckX4O3xq6AewmR8x70JxgKhVM.8+GuR1Xeg7Uxtury08i4niUCeuMit6Azb4GlQAraW19.iWbY5yn9+bYEKJVQDpk2zdyFMnt6qfEDxWFoSgLxmBYTNExndJjQ6THi9oPFiiTF5lQzVo6vWJBDV85rCwsPg98DTXLg+MKECciB�
      
      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @toxonic
        last edited by

        @toxonic The snippet doesn't work because of include("{GLOBAL_SCRIPT_FOLDER}functions.js");
        And why do you put your external script in {GLOBAL_SCRIPT_FOLDER}? This folder doesn't belong to your project but to Hise itself if I'm not mistaken... Or maybe you re-use this script in other projects?
        Also, we have no component at all in the snippet ;)

        Can't help pressing F5 in the forum...

        toxonicT 1 Reply Last reply Reply Quote 0
        • toxonicT
          toxonic @ustk
          last edited by

          @ustk said in SliderPack doesn't trigger onControl Callback:

          @toxonic The snippet doesn't work because of include("{GLOBAL_SCRIPT_FOLDER}functions.js");
          And why do you put your external script in {GLOBAL_SCRIPT_FOLDER}? This folder doesn't belong to your project but to Hise itself if I'm not mistaken... Or maybe you re-use this script in other projects?
          Also, we have no component at all in the snippet ;)

          oh, i'm so sorry. didn't know, that the script won't be included. yeah, i want to make a collection of small functions, which i want to reuse in different projects.
          i edited my last post, so the snippet should work now. you only need to load a loop into the audio loop player, which i used for testing purposes - or add another synth / sampler if you want to.
          what do you mean, there are no components in the snippet? shouldn't the normally be included? please try again and tell me, if it works! ;-)

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

            If you're using a custom callback then the main on control callback won't trigger. It's usually better to use a custom callback anyway.

            Place this Console.print(SliderPack1.getSliderValueAt(value));at the top of your custom callback and you will see the sliderpack is returning the correct value, the problem must be somewhere else in your callback.

            Don't use var, use local instead. Only use var in real functions like paint routines and mouse callbacks.

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

            toxonicT 1 Reply Last reply Reply Quote 0
            • toxonicT
              toxonic @d.healey
              last edited by

              @d-healey
              thanks, that's it! ;-) in this case, the sliderpack movements have also to be triggered, when other interface elements change their values, so the custom callback won't work. i moved the complete logic from the custom callback into the control callback, which now works as it should.

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

                Only use custom callbacks, life will be easier for you :) Remember you can use the same custom callback for multiple controls.

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

                1 Reply Last reply Reply Quote 1
                • toxonicT
                  toxonic
                  last edited by toxonic

                  i'm willing to heed that, but i have no clue how to trigger the sliderpacks' custom callback by changing another interface element like a knob. can you give me a hint there? btw, i still didn't find out, how to use the .changed() methods, is this related to that issue?

                  PS: Sorry, forget my last question, got it! ;-)

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

                    @toxonic sliderpack.changed()

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

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

                    33

                    Online

                    1.8k

                    Users

                    12.1k

                    Topics

                    105.0k

                    Posts