HISE Logo Forum
    • Categories
    • Register
    • Login

    Opacity Image, Control by Value Knob of effect

    Scheduled Pinned Locked Moved Scripting
    14 Posts 3 Posters 200 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.
    • T
      tiesvdam
      last edited by

      I am working on a vinyl effect. I want the opacity of the cassette tape image (Image1) to gradually become more visible when adjusting the Value knob (Knob9).

      I wrote the following script but it don't work, pls help <3:

      // opacity
      const var Image1 = Content.getComponent("Image1");
      
      inline function onKnob9Control(component, value)
      {
          Image1.set("alpha", value);
      };
      
      Content.getComponent("Knob9").setControlCallback(onKnob1Control);
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @tiesvdam
        last edited by

        @tiesvdam Working here, what's the range of your knob?

        Peek 2025-01-09 10-53.gif

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

        T MorphoiceM 2 Replies Last reply Reply Quote 0
        • T
          tiesvdam @d.healey
          last edited by

          @d-healey

          0.1 min
          10 max

          Because I don't want the effect to be too intense, could this cause my opacity not to work?

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

            @tiesvdam Looks like the alpha property is in the range 0 - 1

            Peek 2025-01-09 11-01.gif

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

            T 1 Reply Last reply Reply Quote 0
            • T
              tiesvdam @d.healey
              last edited by

              @d-healey I’ve changed the knob range from 0.0 to 1.0, but unfortunately, nothing is happening yet. Could it possibly be disrupted by a processor ID linked to it?

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

                @tiesvdam Yes that will be it, you can't have processor/parameter ID and a control callback, it's one or the other.

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

                T 1 Reply Last reply Reply Quote 0
                • T
                  tiesvdam @d.healey
                  last edited by

                  @d-healey Okay Thats clear thanks for the info! Could it be that if I script the ProcessorID, it would work? And what would such a script look like?

                  ProcessorID: Midi Controller1
                  ParameterID: DefaultValue

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

                    @tiesvdam Nope. It's one or the other, either you use a callback or you use processor/parameter ID.

                    Another option, if you want to keep the processor/parameter ID is to use a value broadcaster rather than a control callback.

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

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      tiesvdam @d.healey
                      last edited by

                      @d-healey Okay that sounds good! I am completely new to a broadcaster. I have looked online at the HISE docs, but I can't figure out how to create a broadcaster for the elements and link them.

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

                        @tiesvdam Use the broadcaster wizard in the Tools menu, I've also shown broadcasters in a couple of videos.

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

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          tiesvdam @d.healey
                          last edited by

                          @d-healey its getting a bit more clear.

                          Its connected correct when I look into the ScriptBroadcasterMap and I see changing the alpha value of the knob changing in de ScriptBroadcasterMap but the image is still is not changing his alpha.

                          Schermopname 2025-01-10 om 11.36.30.gif
                          I've made the following code:

                          //zichtbaarheid vintage effect
                          
                          // Broadcaster definition
                          const bc = Engine.createBroadcaster({
                            "id": "SenderBC",
                            "args": ["component", "alpha"],
                            "tags": ""
                          });
                          
                          // attach to event Type
                          bc.attachToComponentValue(["Knob9"], "Sender");
                          
                          // attach first listener
                          bc.addComponentValueListener(["Image1"], "Sender Listener", function(index, component, value, alpha){
                          	return value;
                          });
                          
                          
                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @tiesvdam
                            last edited by

                            @tiesvdam The component value broadcaster just needs component and value arguments, and for the listener it should be index, component, value.

                            Now I just remembered that there is a bug in HISE (which I've fixed but it hasn't been merged yet) that prevents the value listener from calling the .changed function of the component. So this is probably what's causing the issue here.

                            Instead of using a value listener you could try using a property listener to directly change the alpha value. Or you can use a standard listener callback and set the alpha manually.

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

                            1 Reply Last reply Reply Quote 0
                            • MorphoiceM
                              Morphoice @d.healey
                              last edited by

                              @d-healey how do you all do these gifs?? I cant find a free program on mac to do that

                              https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                                @Morphoice I use Peek - Linux only I think. For Windows and Mac you can use LiceCap from the developers of Reaper.

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

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

                                31

                                Online

                                1.8k

                                Users

                                12.0k

                                Topics

                                104.8k

                                Posts