HISE Logo Forum
    • Categories
    • Register
    • Login

    Is it possible to get the Display Buffer into a Floating Tile?

    Scheduled Pinned Locked Moved Solved General Questions
    19 Posts 7 Posters 813 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.
    • griffinboyG
      griffinboy
      last edited by griffinboy

      Apologies for making more than one post today : )

      Does anyone know if it's possible to get a Display Buffer from scriptnode, into a floating tile?
      I am trying to get this peak meter to display on the UI.

      7710d83e-effb-4408-8086-40021f87e7fe-image.png

      e843f594-bd38-47c3-9b55-c49c01a42cd2-image.png

      I do have access to the buffer if I need to work out a way graph this manually... But I would rather not 😓
      Although I admit that approach would give me fantastic control.

      0391d980-a45a-4d7b-bde5-41ba09796711-image.png

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • griffinboyG griffinboy marked this topic as a question on
      • Christoph HartC
        Christoph Hart @griffinboy
        last edited by

        @griffinboy no currently there is no floating tile for this task but this method

        Link Preview Image
        HISE | Scripting | DisplayBuffer

        A reference to a ringbuffer inside scriptnode

        favicon

        (docs.hise.dev)

        will do the heavy lifting and create a path that you can render in a ScriptPanel using either the scripting API or if your in experimental mode, with the new CSS renderer…

        griffinboyG Dan KorneffD 3 Replies Last reply Reply Quote 1
        • griffinboyG griffinboy has marked this topic as solved on
        • griffinboyG
          griffinboy @Christoph Hart
          last edited by griffinboy

          @Christoph-Hart
          Thanks I am looking into it!
          I am having an issue understanding the documentation though, what am I doing wrong?
          I haven't managed to draw a path using the buffer yet. I've set up this paint routine to draw the path inside a tile but I am not getting anything .
          The buffer is definitely working because I am also setting a slider to the peak value, which is working.

          46aee259-645b-4b4f-8b0e-4220ff35c089-image.png

          EDIT:
          I solved it

          77daf473-7f0e-4c0d-8ff9-c8ca4148e034-image.png

          1 Reply Last reply Reply Quote 0
          • griffinboyG griffinboy has marked this topic as unsolved on
          • griffinboyG griffinboy has marked this topic as solved on
          • Dan KorneffD
            Dan Korneff @Christoph Hart
            last edited by

            @Christoph-Hart How is the inverted plotter supposed to work? I was assuming that a plotter would set the value at the bottom of the panel to 0 and draw upwards, and an inverted plotter would set the value at the top of the panel to 0 and draw downwards.

            I'm not seeing any difference when I change the START and use drawPath.

            g.createPath(area, [0,1,0,-1], 0.0);
            Screenshot 2024-10-15 095328.png

            g.createPath(area, [0,1,0,-1], 1.0);
            Screenshot 2024-10-15 095400.png

            I AM seeing a difference if fillPath:
            g.createPath(area, [0,1,0,-1], 0.0);
            Screenshot 2024-10-15 095303.png

            g.createPath(area, [0,1,0,-1], 1.0);
            Screenshot 2024-10-15 095247.png

            The question: Is this the way it's supposed to work? If so, how can I invert the value of a display buffer so I can start drawing at the top of the panel?

            // Oscilloscope:
            d.createPath([0, 0, w, h],   // target rectangle 
                         [-1, 1, 0, -1], // samplerange 0 - numSamples,
                                         // valuerange: from -1 to 1
                         0.0);           // start at the center (bipolar)
            
            // Plotter
            d.createPath([0, 0, w, h],   // target rectangle 
                         [0, 1, 0, -1],  // samplerange 0 - numSamples,
                                         // valuerange: from 0 to 1
                         0.0);           // start at the bottom (unibipolar)
            
            // Inverted Plotter
            d.createPath([0, 0, w, h],   // target rectangle 
                         [0, 1, 0, -1],  // samplerange 0 - numSamples,
                                         // valuerange: from 0 to 1
                         1.0);           // start at the top (negative)
            

            Dan Korneff - Producer / Mixer / Audio Nerd

            ustkU 1 Reply Last reply Reply Quote 0
            • ustkU
              ustk @Dan Korneff
              last edited by

              @Dan-Korneff Seems to work if you just flip the height to be a negative value:

              var p = gr.createPath([a[0], a[1], a[2], -a[3]], [0,1,0,-1], 0.0);
              

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

              Dan KorneffD 1 Reply Last reply Reply Quote 0
              • Dan KorneffD
                Dan Korneff @ustk
                last edited by

                @ustk You're hired!

                Dan Korneff - Producer / Mixer / Audio Nerd

                1 Reply Last reply Reply Quote 2
                • Dan KorneffD
                  Dan Korneff @Christoph Hart
                  last edited by

                  @Christoph-Hart I need to increase the buffer size to about twice what's available to the Plotter. Can I just change this:

                  return SimpleRingBuffer::withinRange<4096, 32768 * 4>(v) && wasPowerOfTwo;
                  

                  to:

                  return SimpleRingBuffer::withinRange<4096, 32768 * 8>(v) && wasPowerOfTwo;
                  

                  Or will this blow up??

                  Dan Korneff - Producer / Mixer / Audio Nerd

                  Dan KorneffD 1 Reply Last reply Reply Quote 0
                  • Dan KorneffD
                    Dan Korneff @Dan Korneff
                    last edited by

                    So far, no explosions

                    Dan Korneff - Producer / Mixer / Audio Nerd

                    ustkU JulesVJ 2 Replies Last reply Reply Quote 2
                    • ustkU
                      ustk @Dan Korneff
                      last edited by

                      @Dan-Korneff I imagine the only issue would be that a longer buffer would require more time to create a path, but if it can be noticeable I don't know :man_shrugging:

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

                      1 Reply Last reply Reply Quote 1
                      • JulesVJ
                        JulesV @Dan Korneff
                        last edited by

                        @Dan-Korneff @ustk It seems interesting. Can you guys share a basic fast snippet for this please?

                        JulesVJ 1 Reply Last reply Reply Quote 0
                        • JulesVJ
                          JulesV @JulesV
                          last edited by

                          Bump please

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

                            @JulesV Here is a custom node example. After adding a display buffer to the custom node and compiling it, you need to open this node in HardcodedMasterFX and apply the following method. To get the look I wanted here, I had to keep the buffer length quite high, it's set to 65536 :)

                            The drawing process takes place in a timer object.

                            Pnlll2.gif

                            const var dp = Synth.getDisplayBufferSource("HardcodedMasterFX");
                            const var gr = dp.getDisplayBuffer(0);
                            
                            gr.setRingBufferProperties({
                            "BufferLength": 65536,
                            "NumChannels": 1
                            });
                            
                            const var Panel1 = Content.getComponent ("Panel1");
                            const var a = Panel1.getLocalBounds(0);
                            const var Cmpt = Engine.createTimerObject();
                            
                            Cmpt.setTimerCallback(function()
                            {	
                            	Panel1.setPaintRoutine(function(g)
                            	{
                            		g.setColour (this.get("bgColour"));
                            		g.fillRect(a);
                            		g.setColour(this.get("itemColour"));
                            		var p = gr.createPath(a, [0,1,0,-1], 1.0);
                            		g.fillPath(p, a);
                            	});
                            });
                            
                            Cmpt.startTimer(40);
                            
                            
                            LindonL 1 Reply Last reply Reply Quote 2
                            • LindonL
                              Lindon @orange
                              last edited by

                              @orange is there some reason you are declaring the paint routine in the timer and not outside it, then issuing a repaint in the timer?

                              HISE Development for hire.
                              www.channelrobot.com

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

                                @Lindon Not a specific reason, I just used the time object to refresh the paint.
                                If you have a better usage recommendation instead, I'm open to it.

                                LindonL 1 Reply Last reply Reply Quote 0
                                • LindonL
                                  Lindon @orange
                                  last edited by Lindon

                                  @orange well clearly I havent tried it, but give this a go and see if it works?

                                  const var dp = Synth.getDisplayBufferSource("HardcodedMasterFX");
                                  const var gr = dp.getDisplayBuffer(0);
                                  
                                  gr.setRingBufferProperties({
                                  "BufferLength": 65536,
                                  "NumChannels": 1
                                  });
                                  
                                  reg p;
                                  const var Panel1 = Content.getComponent ("Panel1");
                                  Panel1.setPaintRoutine(function(g)
                                  {
                                  	g.setColour (this.get("bgColour"));
                                  	g.fillRect(a);
                                  	g.setColour(this.get("itemColour"));
                                  	p = gr.createPath(a, [0,1,0,-1], 1.0);
                                  	g.fillPath(p, a);
                                  });
                                  
                                  
                                  
                                  const var a = Panel1.getLocalBounds(0);
                                  const var Cmpt = Engine.createTimerObject();
                                  Cmpt.setTimerCallback(function()
                                  {	
                                  	Panel1.repaint()
                                  });
                                  
                                  Cmpt.startTimer(40);
                                  

                                  HISE Development for hire.
                                  www.channelrobot.com

                                  orangeO 2 Replies Last reply Reply Quote 3
                                  • orangeO
                                    orange @Lindon
                                    last edited by

                                    @Lindon That’s better, thanks :)

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

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • LindonL
                                        Lindon @orange
                                        last edited by

                                        @orange glad that it worked...

                                        HISE Development for hire.
                                        www.channelrobot.com

                                        JulesVJ 1 Reply Last reply Reply Quote 0
                                        • JulesVJ
                                          JulesV @Lindon
                                          last edited by

                                          @Lindon @orange Thank you for your help!

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

                                          31

                                          Online

                                          1.8k

                                          Users

                                          12.0k

                                          Topics

                                          104.2k

                                          Posts