HISE Logo Forum
    • Categories
    • Register
    • Login

    Custom AHDSR LAF

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 77 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 have seen multiple posts on the platform about this topic, but I just can't seem to get rid of it.

      How do I remove the vertical lines that appear when playing audio? I understand that I'm missing something in the LAF to get rid of this, but I don't know enough to remove it myself.

      Can anyone help me?

      Here is my current script for the LAF:

      const var Envelope = Synth.getModulator("AHDSR Envelope1");
      
      
      laf.registerFunction("drawAhdsrPath", function(g, obj)
      { 
      
      var a = obj.area;
      
      g.setColour(0xFFFF5400);
      
      g.setGradientFill([Colours.withAlpha(0xFFFF5400, 0.10), 100, 200, 0xFF8d478d, 300, 25]);
      g.fillPath(obj.path, obj.pathArea);
      
      g.setColour(0xFFFF5400);
      g.drawPath(obj.path, 1.5, 1.5);
      
      });
      
      T ulrikU 2 Replies Last reply Reply Quote 0
      • T
        tiesvdam @tiesvdam
        last edited by

        @tiesvdam Scherm­afbeelding 2025-02-25 om 16.04.45.png

        1 Reply Last reply Reply Quote 0
        • ulrikU
          ulrik @tiesvdam
          last edited by

          @tiesvdam I don't think you can get rid of it, I solved it by painting the path in a panel, and removing the "extra line" parts by manipulating the path string
          The moving ball is from the envelope floating tile but the rest is a painted panel

          it involves converting the path to string - remove certain strings - convert it back

          I hope there is a better way to do it, but I don't know if there is any.
          Anybody knows how to do it in a less cumbersome way?

          this is part of the string manipulation, p is the path

          		var a = p.toString().split(" ");
          		var ax = parseInt(a[6]);
          		var ay = parseInt(a[7]);
          		var acx = parseInt(a[4]);
          		var acy = parseInt(a[5]);
          		var dx = ax + (parseInt(a[14])-ax)*0.95;
          		var dy = parseInt(a[15]);
          		var sx = parseInt(a[17]);
          		var sy = parseInt(a[13]);
          		var rx = parseInt(a[22]);
          		var ry = this.getHeight()-3;
          
          		var str = a.join("\n");
          		var path = Content.createPath();
          		path.fromString(str);
          		g.setColour(Colours.chartreuse);
          		g.drawPath(path, path.getBounds(1), 1.0);
          

          paintedahdsr.gif

          Hise Develop branch
          MacOs 15.3.1, Xcode 16.2
          http://musikboden.se

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

          14

          Online

          1.7k

          Users

          11.8k

          Topics

          102.6k

          Posts