HISE Logo Forum
    • Categories
    • Register
    • Login

    Failing at HISE 101

    Scheduled Pinned Locked Moved Solved Scripting
    18 Posts 2 Posters 583 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 @clevername27
      last edited by

      @clevername27 said in Failing at HISE 101:

      I globally allocated an array in my Interface Script Processor

      You should be doing this in a non-deferred script because you have no guarantee that this one's midi callbacks will trigger when the UI is closed or that they will trigger before the other scripts that are not deferred and are reading the values.

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

      clevername27C 1 Reply Last reply Reply Quote 0
      • clevername27C
        clevername27 @d.healey
        last edited by

        @d-healey There may be no advantage, but why am I getting an error message that I can't use them at all?

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

          @d-healey I don't understand - are you saying I can't use global variables in MIDI callbacks?

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

            @clevername27 said in Failing at HISE 101:

            @d-healey There may be no advantage, but why am I getting an error message that I can't use them at all?

            Ah looks like you can't use them there after all - I never tried. Use local and all will be well.

            @clevername27 said in Failing at HISE 101:

            are you saying I can't use global variables in MIDI callbacks?

            Nope. I'm saying you can't depend on a value set in a deferred script's MIDI callback to be available in a non-deferred scripts MIDI callback when you want it to be.

            You should use two non-deferred scripts. Separate the concerns, the UI script should only be used for UI stuff, anything not directly related to the UI should be in one or more separate MIDI processors and the UI script should connect to them as needed.

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

            clevername27C 1 Reply Last reply Reply Quote 0
            • clevername27C
              clevername27 @d.healey
              last edited by

              @d-healey Thank you - I may still be missing something. I did try with two non-deferred scripts.

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

                @clevername27 said in Failing at HISE 101:

                @d-healey Thank you - I may still be missing something. I did try with two non-deferred scripts.

                We're talking about two separate things. Using two non-deferred scripts is good practice, but won't solve the issue you're having. There is something else wrong with your code but no way of knowing without seeing the whole project. So try the simple version I suggested and see if that works (it does for me) and then figure out from that what is different in your implementation in your main project.

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

                clevername27C 1 Reply Last reply Reply Quote 1
                • clevername27C
                  clevername27 @d.healey
                  last edited by

                  @d-healey Thank you - I did try a simple test - I simply cannot access the global array from one script processor in another. I'll try downloading another build. Thank you again for your continued assistance.

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

                    @clevername27 said in Failing at HISE 101:

                    I'll try downloading another build.

                    Let me know how it goes in the latest develop branch, you should be able to load my snippet there.

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

                    clevername27C 2 Replies Last reply Reply Quote 1
                    • clevername27C
                      clevername27 @d.healey
                      last edited by

                      @d-healey Thanks, man.

                      1 Reply Last reply Reply Quote 0
                      • clevername27C
                        clevername27 @d.healey
                        last edited by

                        @d-healey Thank you again, Dave. I built with a newer dev branch, and it works. My immense gratitude.

                        1 Reply Last reply Reply Quote 1
                        • clevername27C clevername27 has marked this topic as solved on
                        • clevername27C clevername27 has marked this topic as unsolved on
                        • clevername27C clevername27 has marked this topic as solved on
                        • First post
                          Last post

                        40

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        102.1k

                        Posts