HISE Logo Forum
    • Categories
    • Register
    • Login

    Can I manually trigger a Callback function?

    Scheduled Pinned Locked Moved Scripting
    44 Posts 5 Posters 1.1k 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 @Lindon
      last edited by

      @Lindon said in Can I manually trigger a Callback function?:

      slightly frightened now...

      It's more likely me misremembering some issue I ran into years ago.

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

      MorphoiceM 1 Reply Last reply Reply Quote 1
      • MorphoiceM
        Morphoice @Lindon
        last edited by

        @Lindon said in Can I manually trigger a Callback function?:

        you probably want to do something on "empty"

        they'll all be occupado in the end, I just wanted to focus on the functionality before I create all the sample maps and proceed to sample all my hardware drum machines

        https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

          @Morphoice said in Can I manually trigger a Callback function?:

          @Lindon @d-healey gotcha! seems to work like a charm, and it suddenly is successfully wirtten and recalled to/from a preset. that might - if I'm not overlooking anything - solve all my problems at once.

          only thing I'd love to have is actually hearing the selected sample on selection but if I use the sample loading callback it would trigger upon preset restore aswell

          I dont really understand what you are saying in this last bit - you select a button and it loads that map - isnt that what you want?

          HISE Development for hire.
          www.channelrobot.com

          MorphoiceM 2 Replies Last reply Reply Quote 0
          • MorphoiceM
            Morphoice @Lindon
            last edited by

            @Lindon said in Can I manually trigger a Callback function?:

            you select a button and it loads that map - isnt that what you want?

            yes. I was just thinking an audible preview of the sample after it's loaded might add some comfort for the user if they switch through the available samples

            https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

              @Lindon I tried firing a note after the sample is loaded successfully but the problem was this would not work when the button is clicked but fire on recalling a preset, and there we wouldn't need it,

              https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                @Morphoice so use the preset manager to set a "loading a preset" flag , and uncheck once the preset is loaded...

                In your buttons check to see if this flag is set - if not then it really is a user pressing the button(not a preset loading) - so you can play a demo note...

                https://docs.hise.dev/scripting/scripting-api/userpresethandler/index.html

                you want setPreCallback (to set the flag ON)
                and setPostcallback (to turn the flag OFF)

                HISE Development for hire.
                www.channelrobot.com

                MorphoiceM 2 Replies Last reply Reply Quote 0
                • MorphoiceM
                  Morphoice @d.healey
                  last edited by

                  @d-healey I'm glad I'm not the only benefiting away from from the mess I caused. Unless you want all buttons off radio groups seem to be fine to use.

                  https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                  1 Reply Last reply Reply Quote 0
                  • MorphoiceM
                    Morphoice @Lindon
                    last edited by

                    @Lindon aye! the playing never worked on the button press though. only ever on the preset load. I'll have to revisit the way I fired the note

                    https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

                    1 Reply Last reply Reply Quote 0
                    • MorphoiceM
                      Morphoice @Lindon
                      last edited by

                      @Lindon this was the way I did it before

                         		Bass.asSampler().loadSampleMap(bassMaps[bassProms.indexOf(control)]);
                         		Bass.setLoadingCallback(Synth.playNote(36,127));
                      

                      and that only seems to fire on preset loading, not on the actual button use

                      https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                        @Morphoice You can…

                        1. Call it by function name (pass in the component as the first argument).

                        2. If you want the callback after a component value change, call onChanged(). Except if it's during onInit. That won't work.

                        3. Register the callback for use with a broadcaster. Then, trigger the broadcaster manually.

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

                        28

                        Online

                        1.8k

                        Users

                        12.0k

                        Topics

                        104.7k

                        Posts