HISE Logo Forum
    • Categories
    • Register
    • Login

    Creating dynamic fx's with Drag and Drop functionality in javascript?

    Scheduled Pinned Locked Moved General Questions
    48 Posts 12 Posters 5.6k 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.
    • orangeO
      orange
      last edited by

      Since HISE is using javascript, could the "Drag & Drop" functionality be used in gui? We can use this feature to create dynamic effects. I've found an example code but how can we integrate this into HISE with script fx?

      The example is this: https://codepen.io/awesomewilson/pen/paxoKd?page=1

      develop Branch / XCode 13.1
      macOS Monterey / M1 Max

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

        @orange HISE isn't really using JavaScript, it just looks like it

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

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

          Yup, I thought about renaming the scripting language to HISEScript so that nobody gets false expectations and tries to run Node.js in HISE :)

          Anyways, there are a few API calls that allow dynamic FX chains (HEXERACT is using 8 FX slots that can be dynamically loaded). The key ingredient is using the Effect Slot module which can dynamically load / unload effects.

          HiseSnippet 960.3oc2V80aiSDDe2j3SWLDzcHD7pUEOjHcTk.2cfDBQulzfhf1KptTc7T0l0SZV006ZYutznS22G93w2.XV+mXmK9pZj.d.+jm++alclY24wZNjjniIztWrNBHzO1wesxrZ7JlPQlMgP+DmSYIFH1Km0wqiXIIP.gRa+SVFztcHYe+4OdLSxTbnhEgboVvgeQDJLUbmezOKjxor.3BQXMse9Qy3Z0XsTmh3osyPRDieC6Z3LlUsVND5iNIPXzw9FlARPcNVGr1ek92U45eoHQrPBVhQDezQ4rIiWIjAyKy0DBg1YdUl2NOy+LmSEAhM7qp.OISfWkE0qAzVaCoNaAoQeHHMUKCrN3C.OZM30IGdO0wmGKhLURrX6iblovCmkLrrWGV45RZ8GTmwZTCk4vP1MvzXjXiE8e4vgOy6ECGN36641yEK9IFuaYwdIRsw6G7x5DN7Zv3izSeS+CNY4Rfa7rjGjaiPIEJvaYphaDZkm87Kbg9X8cirwMVK6y0gQZEhfmg9VlBC5491dtcsw3vDvj6yJsrwalABu.tyzefMJuKKRkoAJdbot8OXSzNXf0YEwbLSJWf8N82ENVGVCsmoMvqU8G39V2ttuaGIKW1jnBWIg3ljZapiuGy5qRCW.wkUiB8vy4sajdzCqQhmWVponVMSILuNBJnqZ0F0PqFontZa5J.HppIqk6IEsbk0PhHv1wsojRxxfZi6GQ90YSXFVoyP+hwJBhMBaJQm.2hqCx6m65LARtwnixzs3.ES6GXnuiPcnmgwbs8mKweBYY7Zg+Jv9GLdegiuHLRBmC2BwKbmrVwBEbLo2c5Bmw0AoRlY6Ae6FtBA3Y3VSX1oHUhvrt9Fv8XavvF2Fz3QzCDtO0YtvvW0Lda0.dwio+swawt0dN4i4Ufsiyz27e7hzBr7Xm70YYvnDXY6z1FOsuu6ZFsG20TGCeZNFbc1zLZQwmWGEWsQz120ZfSTLLhA0O.sruXULjrBqCuufWYL3Rv58mVtmCRfkTar82NxN+EmgvFBQkvFCTk3ysMc0iVkn2GIeYsP1.dxdv.zDXJjzHRJjsaVWHXm.UGEmh2NlF0f61Uv+XcFjy0oFg55SYlXgc40Yog93ie3.NmnTfLobgVA8PKsEB9fJHi3uvuBgirzzBgiJE9+lXDx3w5q34WQYGqdbFGr1pxddXW7cpHs2lakr07P7gaWw410Me0HBoYK9581huYus346sEuXus3k6sEe6daw2cOVXek7qRM5v7KePFyOI60.T5lIYZaxeCTs1Ul
          
          orangeO resonantR 2 Replies Last reply Reply Quote 1
          • orangeO
            orange @Christoph Hart
            last edited by

            @christoph-hart That's great!
            How about this? I think Hexeract has similar function like this;

            alt text

            Could that Drag & Drop be implemented?

            develop Branch / XCode 13.1
            macOS Monterey / M1 Max

            1 Reply Last reply Reply Quote 0
            • resonantR
              resonant @Christoph Hart
              last edited by

              @christoph-hart Can we do that?

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

                Yes, but it's complicated. You definitely require wizard skills in ScriptPanel coding if you want to do this kind of thing:

                • enable draggability of Script Panels
                • check in the dragging callback whether the position changes and update an internal array or the slot FX order.

                Also these kind of things are hitting the limit of what's doable with a scripting engine. I've done that once but if I have to do it again, I'll probably write it in C++ since it's easier to debug.

                resonantR 1 Reply Last reply Reply Quote 1
                • resonantR
                  resonant @Christoph Hart
                  last edited by

                  @christoph-hart
                  If we want to make just one feature: "enabling draggability of Script Panels."
                  Can you give a starting point for that? A resource or hint?

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

                    That's the easiest part:

                    Panel.set("allowDragging", true);
                    Panel.set("allowCallbacks", "Clicks, Hover & Dragging");
                    
                    1 Reply Last reply Reply Quote 1
                    • Dan KorneffD
                      Dan Korneff @resonant
                      last edited by

                      @remarkablex Did you make any progress? I'm about to head down this rabbit hole. Might need someone for emotional support 😬 😬

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      resonantR 1 Reply Last reply Reply Quote 1
                      • resonantR
                        resonant @Dan Korneff
                        last edited by resonant

                        @dustbro

                        No unfortunately :/ But I am sure @Christoph-Hart could find a cool way for this, like he always does...

                        Might need someone for emotional support 😬 😬

                        Yeah all need emotional support, dude :)

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

                          AFAIK, @ustk got pretty far with a draggable FX chain system a few months back.

                          lalalandsynthL 1 Reply Last reply Reply Quote 2
                          • lalalandsynthL
                            lalalandsynth @Christoph Hart
                            last edited by

                            @ustk Trying to work this out now , any tips on how you did this ?

                            https://lalalandaudio.com/

                            https://lalalandsynth.com/

                            https://www.facebook.com/lalalandsynth

                            https://www.facebook.com/lalalandsynth

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

                              @lalalandsynth The very first step is to learn how to update an object with mouse drag.
                              Create a panel that contains an object with several rows. Swap the rows with mouse drag
                              Each object should keep track of the position
                              Paint the object in the panel using the position

                              But first, start with very very simple things, like creating an index that follows the mouse inside the panel
                              Let say you divide the panel into 4 parts, the mouse should update the index from 0 to 3

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

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

                                @ustk Excellent , thanks mate , will work on this .
                                So starting with something like this ?
                                Draggable panels.
                                Draggable.gif

                                https://lalalandaudio.com/

                                https://lalalandsynth.com/

                                https://www.facebook.com/lalalandsynth

                                https://www.facebook.com/lalalandsynth

                                ustkU 2 Replies Last reply Reply Quote 0
                                • ustkU
                                  ustk @lalalandsynth
                                  last edited by

                                  @lalalandsynth The main issue I encountered is to actually swap the FXs... Changing IDs in FX slots if I remember well...

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

                                  lalalandsynthL 1 Reply Last reply Reply Quote 1
                                  • lalalandsynthL
                                    lalalandsynth @ustk
                                    last edited by

                                    @ustk You mean when they rotate around ? Its simple to change them when static so a problem arises when you swap them around I guess ?

                                    https://lalalandaudio.com/

                                    https://lalalandsynth.com/

                                    https://www.facebook.com/lalalandsynth

                                    https://www.facebook.com/lalalandsynth

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

                                      @lalalandsynth Dragging panels is not my approach (although it might work)
                                      I do everything in one unique panel. The object represents the rectangles, positions, FXs, and anything that needs to be painted...

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

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

                                        @ustk I see, I guess I was thinking about that approach as I wanted to use a png , but I could use a vector facsimile of the png while dragging I guess ?

                                        https://lalalandaudio.com/

                                        https://lalalandsynth.com/

                                        https://www.facebook.com/lalalandsynth

                                        https://www.facebook.com/lalalandsynth

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

                                          @lalalandsynth Yes as I said I don't remember well, but something wasn't clear about the IDs. like they are changing/ adding a suffix when you swap, so the name has changed and the module can't not be found later... Something like this...

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

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

                                            @lalalandsynth Nothing prevents you to draw images instead of vectors. The only thing is to have the object that updates with mouse drag
                                            Step by step is the only way.
                                            Draw rectangles of different colors and move them according to the object data

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

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

                                            16

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.6k

                                            Posts