HISE Logo Forum
    • Categories
    • Register
    • Login

    Confusing results from message delay?

    Scheduled Pinned Locked Moved Scripting
    16 Posts 2 Posters 420 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.
    • d.healeyD
      d.healey @VirtualVirgin
      last edited by d.healey

      @VirtualVirgin Commands always execute in order from top to bottom, unless something alters the flow. The console print is not being delayed, only the message is so it's executed directly after the previous command.

      Same with your benchmark. You're saying start benchmark, delay the event, stop benchmark. Delay the event doesn't pause execution or affect the flow of the current callback.

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

      VirtualVirginV 1 Reply Last reply Reply Quote 0
      • VirtualVirginV
        VirtualVirgin @d.healey
        last edited by

        @d-healey said in Confusing results from message delay?:

        @VirtualVirgin Commands always execute in order from top to bottom, unless something alters the flow. The console print is not being delayed, only the message is so it's executed directly after the previous command.

        Same with your benchmark. You're saying start benchmark, delay the event, stop benchmark. Delay the event doesn't pause execution or affect the flow of the current callback.

        Why?
        The note on is delayed, so the subsequent lines should not receive that note on that triggers it until 2 seconds later, right?
        If not, why not?

        You can listen to my orchestral mockups here:
        https://www.virtualvirgin.net/

        d.healeyD 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin
          last edited by

          How do I delay or pause the code then?

          When I do this it just ignores the delay (it plays and prints immediately):

          Screenshot 2024-11-10 at 11.26.36 PM.png

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

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

            @VirtualVirgin said in Confusing results from message delay?:

            The note on is delayed

            I think you're misunderstanding it. The event is delayed, the callback is unaffected.

            You can't pause execution, if you want something to happen after two seconds then you need to use a timer or there is a function which I think is called callAfterDelay

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

            VirtualVirginV 1 Reply Last reply Reply Quote 0
            • VirtualVirginV
              VirtualVirgin @d.healey
              last edited by

              @d-healey said in Confusing results from message delay?:

              @VirtualVirgin said in Confusing results from message delay?:

              The note on is delayed

              I think you're misunderstanding it. The event is delayed, the callback is unaffected.

              You can't pause execution, if you want something to happen after two seconds then you need to use a timer or there is a function which I think is called callAfterDelay

              I did see the callAfterDelay when searching for solutions, but it won't be suitable:
              A) it says here that it is not reliable for real-time
              B) it is expecting a value of 1ms or higher, but I need to pause/delay in a range starting with 1 sample length

              Screenshot 2024-11-11 at 3.16.41 PM.png

              How would I implement a timer on code statements?
              I need to create a pause window, similar to writing a macro where you leave some time to let the previous step(s) process before proceeding to the next step.

              You can listen to my orchestral mockups here:
              https://www.virtualvirgin.net/

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

                @VirtualVirgin For realtime stuff you need to use the Synth timer.

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

                VirtualVirginV 2 Replies Last reply Reply Quote 0
                • VirtualVirginV
                  VirtualVirgin @d.healey
                  last edited by

                  @d-healey said in Confusing results from message delay?:

                  @VirtualVirgin For realtime stuff you need to use the Synth timer.

                  Ok :)
                  Thanks. Watching now.

                  You can listen to my orchestral mockups here:
                  https://www.virtualvirgin.net/

                  1 Reply Last reply Reply Quote 0
                  • VirtualVirginV
                    VirtualVirgin @d.healey
                    last edited by

                    @d-healey
                    This says
                    "the timer frequency is limited to 40ms":

                    Screenshot 2024-11-11 at 5.36.47 PM.png

                    Is that the lower limit for the timer interval?

                    You can listen to my orchestral mockups here:
                    https://www.virtualvirgin.net/

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

                      @VirtualVirgin Unless my maths is wrong it will actually go down to 4ms.

                      Synth.startTimer(0.004); This is working for me.

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

                      VirtualVirginV 1 Reply Last reply Reply Quote 0
                      • VirtualVirginV
                        VirtualVirgin @d.healey
                        last edited by

                        @d-healey said in Confusing results from message delay?:

                        @VirtualVirgin Unless my maths is wrong it will actually go down to 4ms.

                        Synth.startTimer(0.004); This is working for me.

                        Ah, thanks.
                        This method will not work for me then, as I need to implement delays/pauses starting with a lower limit of 1 sample.
                        I will have to find something else to do that.

                        You can listen to my orchestral mockups here:
                        https://www.virtualvirgin.net/

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

                          @VirtualVirgin What is your end goal?

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

                          VirtualVirginV 1 Reply Last reply Reply Quote 0
                          • VirtualVirginV
                            VirtualVirgin @d.healey
                            last edited by VirtualVirgin

                            @d-healey said in Confusing results from message delay?:

                            @VirtualVirgin What is your end goal?

                            This is for a voice exploder. The delay is the processing window for chord input from an arbitrary amount of voices up to 16. They need to all get written to an array before proceeding to the next step of sorting and allocating the voices to independent channels.
                            The reason for starting with a 1 sample delay window is to allow for quick turnaround for chord inputs where the notes arrive at the same sample (such as the output of harmonizer plugins that output to only one channel).
                            4ms is way too much budget for such a task.
                            I may be close to a solution.

                            You can listen to my orchestral mockups here:
                            https://www.virtualvirgin.net/

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

                              @VirtualVirgin I have a chord detector script which adds notes to an array as they come in and then processes them. Sounds like a similar thing.

                              Here's a simple snippet that adds note numbers to an array in on note on and removes them in on note off. Works with notes played at the same time and sequentially.

                              HiseSnippet 731.3ocsUstSaCCE1tzfV6tngzd.xOKSHTaoEnBMMfdYqaqP0JCMooIjiiSiEI1QNNrUMs248FrcbRfFfJtTokeTky8udNemSFqjTVbrTgvUOYVDCgel0jYBseWeBWfF1Cgeg0HRrloryTc3rHRbLyEgwq7NiBbkxnzm+71CIADAkMWEBcpjSYehGx0y0Nd+OxCBFPbYmvCK3cq8GRkhtx.YBfmUrpihHzyISYGQLtUxB8dRrOB+ZKGhScB0ya6lN65UuUy1McbZ41Bz3rSmNc7Z2fzdqcnTDd09tbsTMQSzrXHoGJcmMwW9CQVANkGycBXFgFnIPkyTi55yCbGeYyIFgvkGOuUsRVq5UVi3t7qzOuk8xTC1yinXSCW5tfTiGAjvEfT4LHsl0DphGomawfmmZMT.SPOBLaJBkLeQk9.1pqD7Pn2LjbNafBDtJhZaWu9F1vOquW0pJ1TagDvs8ar+122yKQP0bovVJNBzdrn15U+U0JARJIvV.9LB.AL.2bJSab3njPGlplISURSylQIw9C8.aGDnXD2Ym3yTrZBvieW09lo2y6QmeEKTdwhRn4OrRFDXb2jyaX1vLWrk7.qIRq0F1WPBRXW4HLIt93c0G13kl0+K3nTLTv0GGwxkGHCbMiMy62lLfxGfvaeYXOhlX3G45.+hXJM2.GbO1EvFYFaohUOV74ZYDrSdKpDPhktIAD80Y1lc9bCP+3ZzICkQDy0yJdS3QP2qemz8GJDWyZLWS8WLFKs.LBcp+GXL+Hwys564wn54.rr0futrWDtmx+YYhlKlNhnU7ehvVv9vD3XJkAUWHXAPxsvkLrkL45FYSGXBS3lJ7W3I2XCiLN2XiKMhBITk7LZ1Vf4LzSR0.XRjdltB78BP1tAJcynXeNDtJdl4pbwTcq.atrAt0xFXqkMv1KafaurAtyxF3t2eflOZcPhVFls1fPiF2O8TBF2WP.FXJaE8OLLOJoG
                              

                              Peek 2024-11-11 23-23.gif

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

                              VirtualVirginV 1 Reply Last reply Reply Quote 0
                              • VirtualVirginV
                                VirtualVirgin @d.healey
                                last edited by

                                @d-healey said in Confusing results from message delay?:

                                @VirtualVirgin I have a chord detector script which adds notes to an array as they come in and then processes them. Sounds like a similar thing.

                                Here's a simple snippet that adds note numbers to an array in on note on and removes them in on note off. Works with notes played at the same time and sequentially.

                                HiseSnippet 731.3ocsUstSaCCE1tzfV6tngzd.xOKSHTaoEnBMMfdYqaqP0JCMooIjiiSiEI1QNNrUMs248FrcbRfFfJtTokeTky8udNemSFqjTVbrTgvUOYVDCgel0jYBseWeBWfF1Cgeg0HRrloryTc3rHRbLyEgwq7NiBbkxnzm+71CIADAkMWEBcpjSYehGx0y0Nd+OxCBFPbYmvCK3cq8GRkhtx.YBfmUrpihHzyISYGQLtUxB8dRrOB+ZKGhScB0ya6lN65UuUy1McbZ41Bz3rSmNc7Z2fzdqcnTDd09tbsTMQSzrXHoGJcmMwW9CQVANkGycBXFgFnIPkyTi55yCbGeYyIFgvkGOuUsRVq5UVi3t7qzOuk8xTC1yinXSCW5tfTiGAjvEfT4LHsl0DphGomawfmmZMT.SPOBLaJBkLeQk9.1pqD7Pn2LjbNafBDtJhZaWu9F1vOquW0pJ1TagDvs8ar+122yKQP0bovVJNBzdrn15U+U0JARJIvV.9LB.AL.2bJSab3njPGlplISURSylQIw9C8.aGDnXD2Ym3yTrZBvieW09lo2y6QmeEKTdwhRn4OrRFDXb2jyaX1vLWrk7.qIRq0F1WPBRXW4HLIt93c0G13kl0+K3nTLTv0GGwxkGHCbMiMy62lLfxGfvaeYXOhlX3G45.+hXJM2.GbO1EvFYFaohUOV74ZYDrSdKpDPhktIAD80Y1lc9bCP+3ZzICkQDy0yJdS3QP2qemz8GJDWyZLWS8WLFKs.LBcp+GXL+Hwys564wn54.rr0futrWDtmx+YYhlKlNhnU7ehvVv9vD3XJkAUWHXAPxsvkLrkL45FYSGXBS3lJ7W3I2XCiLN2XiKMhBITk7LZ1Vf4LzSR0.XRjdltB78BP1tAJcynXeNDtJdl4pbwTcq.atrAt0xFXqkMv1KafaurAtyxF3t2eflOZcPhVFls1fPiF2O8TBF2WP.FXJaE8OLLOJoG
                                

                                Peek 2024-11-11 23-23.gif

                                Thanks :)
                                I'll check this out tomorrow.
                                I did end up solving for the delay problem by moving the rest of the code into a child container with another script processor.
                                Screenshot 2024-11-11 at 10.52.57 PM.png

                                Screenshot 2024-11-12 at 12.25.24 AM.png

                                The notes from the note recorder get delayed by 1 sample, and that gives room for the array to record all of the voices before sorting the order in the next module.
                                The basic problem that the delay solves is that the array cannot be sorted and reversed until all of the notes are in.

                                It is working so far:
                                Screenshot 2024-11-12 at 12.33.00 AM.png

                                I have a stray note off that I will try to clean up, but at the moment is not effecting the function.

                                You can listen to my orchestral mockups here:
                                https://www.virtualvirgin.net/

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

                                12

                                Online

                                1.8k

                                Users

                                12.0k

                                Topics

                                104.3k

                                Posts