HISE Logo Forum
    • Categories
    • Register
    • Login

    Separation of design and function

    Scheduled Pinned Locked Moved General Questions
    22 Posts 3 Posters 825 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
      last edited by

      There is some good advice here - https://forum.hise.audio/topic/79/scripting-best-practices

      Basically if you are updating the UI from one of the realtime callbacks (on note on, on note off, on timer) then you should defer the script - it's a good practice to always defer your main interface script.

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

      MikeBM 1 Reply Last reply Reply Quote 0
      • MikeBM
        MikeB @d.healey
        last edited by MikeB

        @d-healey

        According to this, everything should fit - I only have one NoteOn call, and it is in the ScriptProcessor before the arpeggiator.

        function onNoteOn()
        {
        if (Message.getNoteNumber() == 60)
        	    Message.setVelocity(5);
        	else 
        	    Message.ignoreEvent(true)	    
        }
        

        No timer, no control.
        and now additionally Synth.deferCallbacks(true); in the init script

        "One hour of trial and error can save 10 minutes of reading the manual."
        "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
        HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

          @MikeB I don't think setVelocity will work in a deferred script, but I might be wrong.

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

          MikeBM 1 Reply Last reply Reply Quote 1
          • MikeBM
            MikeB @d.healey
            last edited by

            @d-healey

            That's funny, that doesn't belong in there at all - good thing we talked about it. :beaming_face_with_smiling_eyes:

            It was still there for testing.
            I was wondering when the arpeggiator was off that the note was played so quietly - no wonder with velocity 5.

            You can already have fun with the thing here 👍

            "One hour of trial and error can save 10 minutes of reading the manual."
            "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
            HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User @d.healey
              last edited by A Former User

              @d-healey said in Separation of design and function:

              Hey David. In your snippet I see a line in the midi processor timer that goes:

              Interface.setAttribute(Interface.Panel1, 1); 
              

              How exactly does this work?? It changes the color of the panel on compile. In my case, I want to pass it a reg variable called count. I do this with

              Interface.setAttribute(Interface.Panel1, count); 
              

              But how do I get it to repaint the panel on the interface right after passing the count variable in that (midi processor) synth timer?

              Edit: I can, of course run a panel timer (for the repaint) in the interface… but that always misses the first beat of my custom arp graph. I’d like repaint it immediately after setting its value to count in the synth timer.

              thx!

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @A Former User
                last edited by

                @UrsBollhalder The panel's control callback is triggered by the setAttribute call. If you call component.repaint() in the callback it will update the panel.

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

                ? 2 Replies Last reply Reply Quote 0
                • ?
                  A Former User @d.healey
                  last edited by

                  @d-healey I’ll try that! Thanks a ton!! Thx for the continued sharing of wisdom and knowledge!

                  1 Reply Last reply Reply Quote 1
                  • ?
                    A Former User @d.healey
                    last edited by

                    @d-healey It works in sync as long as the notes stay below 8th notes. But as soon as the arp is faster, somehow that communication between the synth timer of the midi processor and the panel (which paints my arp), gets scrambled up and it only draws an occasional beat here and there… if I set up a panel timer to repaint, but works. But I’d rather avoid that.
                    Also, for the love of god, I can’t seem the get it to work that when I press a note, it starts drawing the first line. It always leaves the first note a blank and paints from the 2nd on. Although I reset my variable to -1 onNoteOff…

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @A Former User
                      last edited by

                      @UrsBollhalder said in Separation of design and function:

                      somehow that communication between the synth timer of the midi processor and the panel

                      Probably because one is realtime and one isn't.

                      if I set up a panel timer to repaint, but works. But I’d rather avoid that.

                      Panel timer sounds like the right solution for this, is there a reason you don't want to use it?

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

                      ? 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @d.healey
                        last edited by

                        @d-healey Too many timers… trying to keep everything performant. With panels full of paint routines and shaders… 😬

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @A Former User
                          last edited by

                          @UrsBollhalder Why so many timers? Do they all have different intervals?

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

                          ? 1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User @d.healey
                            last edited by

                            @d-healey No. it’s not that many. One for the granular, 2 for lfo’s, one for the shader and one for the panel of the paint routine so far… Just trying to avoid too much expansion in general and doing more with less whenever possible… But deferring the UI script is a priority…

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @A Former User
                              last edited by

                              @UrsBollhalder All timers (except Synth.timer) are running in the non-realtime thread anyway, so don't worry about it too much.

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

                              ? 1 Reply Last reply Reply Quote 0
                              • ?
                                A Former User @d.healey
                                last edited by A Former User

                                @d-healey We Swiss tend to be frugal… 😂😁
                                Edit: at least with time… 😂

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

                                27

                                Online

                                1.8k

                                Users

                                12.0k

                                Topics

                                104.2k

                                Posts