HISE Logo Forum
    • Categories
    • Register
    • Login

    Threads with Changed()

    Scheduled Pinned Locked Moved Unsolved General Questions
    7 Posts 2 Posters 119 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.
    • clevername27C
      clevername27
      last edited by clevername27

      Does anyone know if Changed is synchronous, or asynchronous? Cheers.

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

        @clevername27 changed() is guaranteed to run on the scripting thread. So if you call if from within the scripting thread, it will be synchronous, otherwise it will be asynchronous.

        You can confirm this by using Perfetto and this snippet

        HiseSnippet 1061.3ocsV80aaTDDeOmbErApnn9AXUdgKRVowk1BRHTBwItxJjTKbRD7T0lamK2pb2tm1cuj3Vwa74guB7UA3IdjuAvr6cN24lnjVKgevxy++MyryLdhVECFiRSB5dzrBfD7ogSmIsoCSYBIY7tjfGFd.yXAMsh0NyJXFCvIAAq7RGiftqR7e9ms1gkwjwPCKB4DkHF9AQtv1vcx16KxxFw3vQh7VZ+rsGGqjCUYpRDOqDtIofEeN6L3PlSsNgjfGrGWXU5oVlELnN6n3yllptTVo+IBi3zLvQLfLEcTEaxvTQFex7b0PHAqNoIyWoJyeb3ABt3Z9MUfO2Kf1XQ6ZPPm6BRC9.fTPKHsZEjdT3zXsnv1HwgmOIbrDaHILrT2FJU5R5zYkvgJTCocib14vHMRbsEQuXyM6SwuV+a606IOgNRoiApMEnGLd2wzXVV1oXU2PsJZJqn.jTkzKmUxEJ7WZfwoJsmmwGRg7rZ987Od1fCIfd3bWEY0kfKbX20XoWvzz8kpSGP+N5bbdFXGpxKTRjHZMuz0bVzSHyDRflTJisBkCKdgN6zprn34F0GcaFFkdusWWLqbNSjAzKE1T5DLyAqU0mx3bJ6ZZ5EB3RP22kIRpwxzV2O8NnPqRDXnOqOMUXwvBToxB8Q0TEMRoLImJjlBH1aK0huncH16jHCvzwozDrZs1niOb+edvZdKpHd5ZthrAPXlBZfJreogxhskXgaluS.7060cCq102laCVV9ErxbmUtMLNt9Rz7tPzhUNzKspoGho1qjQ9p2Bgy2E55Mz4ySb03nCXXKVi4gJOZ8F4woL4Y.OxAvdz206IIUt+cjUCmLPeqhcKHz2kgQxx7Sc8vl1uSQbBZwwxG79MVFWUUaonRNVJruBmCpnGox3twM2uu4PLots3FmqQHpp0OL+v5g4oYBNnIBzIeTnuzQ7fudQ3ebwe82aQNd7tLKataPOhQo.zVgKYB1Et.WqVsina3tf4b7UoW25WB3d76MnW0r4ku8rqInv1F6LWo4AdEI4BNOClnLBWou099eGOKTLU7FOxe6i+sW9mu4W2Ju8IABImcU6KDlxjDwU9c43.TtwhXabNthmD7EgGa.Jt4fUlYolyQ+fCRmC7iTd8I2b8HtXVwKyX1E2V6NKUKvA31qHcqAkXhLqMn9.Vgu4ctB+8EhOJbhvFmd6XrysfQ7cv+GXr9v2mEtWRBt.qAfqFN5mV1qb2S3+QUo6dAtCQ6dHDdXY9T7deLfQWJgLz4gAcbSRUza5ncUfofj6I9W7SsvAN5fZgClKDezEqUuNtZ9ycZ8i8bPLI8+Sht3eoAooKN3U8dEuz+533Ec0ML7oKqge0xZ3yVVCe9xZ3KVVC+5k0vu49Mz8Gw99RqJuZrgPNXxd9EkAA6IY3KP+qUx+AH1jXfH
        
        clevername27C 2 Replies Last reply Reply Quote 1
        • clevername27C
          clevername27 @Christoph Hart
          last edited by

          @Christoph-Hart Thank you, and what I was hoping. If I could pls ask a follow-up — how would it not be called from the scripting thread?

          1 Reply Last reply Reply Quote 0
          • clevername27C
            clevername27 @Christoph Hart
            last edited by

            @Christoph-Hart Thank you for the example. I must be doing this wrong…

            2cbb6f40-33f0-4c29-a9fd-926876570774-image.png

            Christoph HartC 1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart @clevername27
              last edited by

              @clevername27 Click once on the power button to start and then again to stop the profiling.

              how would it not be called from the scripting thread?

              Synth.deferCallbacks(false) will make the onNoteOn callback run in the audio thread. The other scenario is custom LAF which will be executed synchronously in the UI thread but if you call changed() from within a LAF function then you deserve all the pain it brings to you :)

              clevername27C 2 Replies Last reply Reply Quote 3
              • clevername27C
                clevername27 @Christoph Hart
                last edited by clevername27

                @Christoph-Hart Understood and thank you. However, when I call changed(), execution appears to be asynchronous, and if I call the control callback, explicitly, execution is synchronous. I may have misstated my question. I can upload a screen movie showing a simple example. I will add that I'm doing this during the loading callback with a custom preset manager. (It's not during onInit.)

                EDIT: I have a movie but the screen movie "exceeds the pixel limit" for an upload. The screen capture is 50% of the built-in display on my Mac laptop.

                Somebody please fix the forum. I will help.

                1 Reply Last reply Reply Quote 0
                • clevername27C
                  clevername27 @Christoph Hart
                  last edited by clevername27

                  @Christoph-Hart

                  @Christoph-Hart said in Threads with Changed():

                  Click once on the power button to start and then again to stop the profiling.

                  I'm aware lol, it just doesn't seem to work on my end. (But that's a different affair.) Thank you again for taking the time to write that snippet.

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

                  9

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  103.1k

                  Posts