HISE Logo Forum
    • Categories
    • Register
    • Login

    SlotFX add rearrange Method along with swap

    Scheduled Pinned Locked Moved Feature Requests
    7 Posts 2 Posters 576 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.
    • ustkU
      ustk
      last edited by

      @Christoph-Hart Is it possible to add a re-arrange method for the SlotFX based on an array that contains all SlotFXs?

      The swap method is quite limited when you want more than swapping. I need to re-arrange FXs by drag and drop, and it's easy to swap back and forth when you move an FX in the chain. However, if you move several FXs and save the preset, it becomes hard to re-arrange all the FXs at once on preset load. (maybe with a double for loop that checks all FXs one by one against all the others, but you need to know the names of the FXs that are already loaded)

      It would be possible to use exportState/restoreState along with clear and setEffect, but I would lose the benefit of swapping dynamically (the sound will cut).

      but the re-arrange method has to come along with another method that gathers the FX names which are actually loaded in the slots, so a name comparison would be possible between the two arrays that contain preset FXs order, and actual FXs in slots. (based on the part of the character chain that is not overridden at init of course).

      Can't help pressing F5 in the forum...

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @ustk
        last edited by ustk

        @Christoph-Hart In fact, after hours trying to do something, just being able to know what FX is loaded in a slotFX would be sufficient, no need for an extra re-arrange thing...

        Aside of that, how is the scriptFX managed in slotFX? If I have more than one scriptFX loaded, how would I make the difference if I want to swap them?

        Can't help pressing F5 in the forum...

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

          If you use a unique ID for each ScriptFX, you can have multiple ones with the same type.

          Getting the ID of the currently loaded FX is a sensible suggestion, I'll try to add this when I find the time.

          1 Reply Last reply Reply Quote 1
          • ustkU
            ustk
            last edited by

            @Christoph-Hart Cool for the scriptFX ;)

            Getting the ID of the loaded FX is the only thing that prevents me to make multiple FX swapping operational 🙃
            In fact, it is working, even with preset load, but it's an async operation because it's based on the precedent movement, not the actual state. So if an error appears, it's impossible to check the current slot state so you continue swapping in a total disorder 😬

            Can't help pressing F5 in the forum...

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

              Alright, I've just pushed this. I didn't add a getID() function, but a getCurrentEffect() which might be more versatile for future use cases (you can bypass it, or change parameters directly). If you want the ID, just call the method on the returned object:

              const var EffectSlot1 = Synth.getSlotFX("Effect Slot1");
               
              /** Returns the ID of the effect in the given slot. */
              inline function getIdFromSlot(slot)
              {
                  local fx = slot.getCurrentEffect();
                  
                  if(isDefined(fx))
                      return fx.getId();
                      
                  return undefined;
              }
               
              Console.print(getIdFromSlot(EffectSlot1))
              
              ustkU 1 Reply Last reply Reply Quote 1
              • ustkU
                ustk @Christoph Hart
                last edited by ustk

                @Christoph-Hart Wow thanks, man! Gathering the current FX is cool! 😎

                But sorry, there's still something I don't understand with script FX in the context of swapping.
                How would I differentiate between two different scriptFXs? Because the ID is reset at init, and "getCurrentEffect()" will return the same thing.
                My FX chain will almost only be made of home-made DSP in ScriptFXs...

                Can't help pressing F5 in the forum...

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

                  @ustk said in SlotFX add rearrange Method along with swap:

                  Because the ID is reset at init, and "getCurrentEffect()" will return the same thing.

                  If you restore the scripts using a Base64 encoded state, it will retain the ID (even if the ID is actually stored in the state).

                  So if you have only Script FX, just don't use setEffect but ScriptFX.restoreState with predefined states.

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

                  36

                  Online

                  1.8k

                  Users

                  12.0k

                  Topics

                  104.7k

                  Posts