HISE Logo Forum
    • Categories
    • Register
    • Login

    Crusher Laf

    Scheduled Pinned Locked Moved Scripting
    7 Posts 4 Posters 174 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.
    • U
      udalilprofile
      last edited by

      Hi) hi. how can i render crusher from scriptfx? thanks.
      IMG_0076.jpeg )

      HISEnbergH 1 Reply Last reply Reply Quote 0
      • HISEnbergH
        HISEnberg @udalilprofile
        last edited by HISEnberg

        @udalilprofile You will have to draw it yourself or edit the HISE source code I beleive. Here is an example of how you might do it though :)

        const var Bitcrusher = Synth.getEffect("Bitcrusher");
        const var BitcrusherPanel = Content.getComponent("BitcrusherPanel");
        const var StepsKnob = Content.getComponent("StepsKnob");
        StepsKnob.setRange(4, 16, 1);
        StepsKnob.set("stepSize", 0.1);
        
        BitcrusherPanel.setPaintRoutine(function(g) 
        {
            var steps = StepsKnob.getValue(); // Get the number of steps from the knob
            var width = this.getWidth();
            var height = this.getHeight();
            var stepWidth = width / steps;
            var stepHeight = height / steps;
        	
            g.fillAll(Colours.black);
        	
            // Draw the staircase
            g.setColour(Colours.white);
            for (i = 0; i < steps; i++) 
            {
                var x1 = i * stepWidth;
                var x2 = (i + 1) * stepWidth;
                var y = height - i * stepHeight;
                g.drawLine(x1, x2, y, y, 2); // Horizontal line
                if (i < steps - 1) 
                {
                    g.drawLine(x2, x2, y, height - (i + 1) * stepHeight, 2); // Vertical line
                }
            }
        });
        
        // Repaint the panel based on Knob value, attach it to the FX
        inline function onStepsKnobControl(component, value)
        {
        	BitcrusherPanel.repaintImmediately();
        	Bitcrusher.setAttribute(Bitcrusher.BitDepth, value);
        };
        
        Content.getComponent("StepsKnob").setControlCallback(onStepsKnobControl);
        
        
        
        HiseSnippet 1738.3ocuX07TaaDEeEfffanSnSO0SZ3jIgRrACgNzNguCdRf3IlPxsLqkVYsikzpQZMfSmLSO1i8Z6o9uQO0q8b+K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2XREbyIUvGMoBt0GVP7egTZEAL1ER3acnJHzv3vPJz+TUUj7uqq1iP.
        
        HISEnbergH U 2 Replies Last reply Reply Quote 3
        • HISEnbergH
          HISEnberg @HISEnberg
          last edited by

          @orange is this useful for the LAF collection (or too much of an edge case)?

          MorphoiceM orangeO 2 Replies Last reply Reply Quote 3
          • MorphoiceM
            Morphoice @HISEnberg
            last edited by

            @HISEnberg this is super useful!
            I just never got how you can crush something by fractions of bits instead full bits only
            but every bitcrusher has this so I guess it's legit ;)

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

            1 Reply Last reply Reply Quote 0
            • U
              udalilprofile @HISEnberg
              last edited by

              @HISEnberg Wow, that's great. Is it possible to make straight lines?

              HISEnbergH 1 Reply Last reply Reply Quote 0
              • HISEnbergH
                HISEnberg @udalilprofile
                last edited by

                @udalilprofile could you explain a bit further? I don't fully understand.

                1 Reply Last reply Reply Quote 0
                • orangeO
                  orange @HISEnberg
                  last edited by

                  @HISEnberg Yes useful for LAF too

                  develop Branch / XCode 13.1
                  macOS Monterey / M1 Max

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

                  25

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  103.2k

                  Posts