HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I get GlobalCable value?

    Scheduled Pinned Locked Moved Unsolved Scripting
    2 Posts 1 Posters 29 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.
    • ChazroxC
      Chazrox
      last edited by

      as the title says....

      I created a clock ramp in scriptNode and connected the needed values to global cables. How do I retrieve the values from these cables?

      I have one tracking beat ticks and one tracking whole bar progression.

      You guessed it im making a playhead and tempo marker. lol.

      So with that said, I added a slider to my UI that I am going to later LAF to look like a cool progression bar of some sort.....

      Any tips or snips? haha.

      Thank You! 🙏

      My scriptNode setup...
      Screenshot 2025-11-26 at 8.02.49 PM.png

      Shown in module tree..
      Screenshot 2025-11-26 at 8.05.47 PM.png

      ChazroxC 1 Reply Last reply Reply Quote 0
      • ChazroxC
        Chazrox @Chazrox
        last edited by

        update...

        I figured it out...

        I found the snippet in Docs and modified it for my usage. Yee.

        
        const var rm = Engine.getGlobalRoutingManager();
        const var mc = rm.getCable("bars");
        const var pnlMasterPlayheadBars = Content.getComponent("pnlMasterPlayheadBars");
        pnlMasterPlayheadBars.data.value = 0;
        
        mc.registerCallback(function(value)
        {
        	pnlMasterPlayheadBars.data.value = value;
        	pnlMasterPlayheadBars.repaint();
        
        	//Console.print(value);
        }, AsyncNotification);
        
        pnlMasterPlayheadBars.setPaintRoutine(function(g)
        {
        	var a =  this.getLocalBounds(0);
        
        	g.fillAll(this.get("bgColour"));
        	g.setColour(Colours.withAlpha(this.get("textColour"), 1.0));
        
        	var x = a[2] / 100 * (this.data.value * 100);
        	
        	g.drawVerticalLine(x, 0, a[3]);
        });
        
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        34

        Online

        2.1k

        Users

        12.9k

        Topics

        112.1k

        Posts