Creating dynamic fx's with Drag and Drop functionality in javascript?
-
@orange HISE isn't really using JavaScript, it just looks like it
-
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
-
@christoph-hart That's great!
How about this? I think Hexeract has similar function like this;Could that Drag & Drop be implemented?
-
@christoph-hart Can we do that?
-
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.
-
@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? -
That's the easiest part:
Panel.set("allowDragging", true); Panel.set("allowCallbacks", "Clicks, Hover & Dragging");
-
@remarkablex Did you make any progress? I'm about to head down this rabbit hole. Might need someone for emotional support
-
@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 :)
-
AFAIK, @ustk got pretty far with a draggable FX chain system a few months back.
-
@ustk Trying to work this out now , any tips on how you did this ?
-
@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 positionBut 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 -
@ustk Excellent , thanks mate , will work on this .
So starting with something like this ?
Draggable panels.
-
@lalalandsynth The main issue I encountered is to actually swap the FXs... Changing IDs in FX slots if I remember well...
-
@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 ?
-
@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... -
@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 ?
-
@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...
-
@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 -
Ok, as for the ids , I was thinking of having say 4 fx available per slot , then just switch which one is loaded , obviously i would need to think of having the sliders and buttons
copied between them.
Something in this direction , unless I am missing another obvious way to do this ?*HiseSnippet 2860.3oc6as0bhajEVLdzLiIKISRsOrOpkWVbFGFIvfMYprwb0Fa.yvMi8VakHjZPBzM2pE2Rkp1G1eC6+u888g8evtcqKFAFayvXOWRfJoFzoO8oOc2eemVbNtqB0E.ll5Pp.a2XhAfJveft9DMjTVIdYMph4nB7kzk4MQ.HiinLSL3MMAhTABr0QDAA19oT1e9u+XFdEdMAvLQTTszkE.kjUkQyj9yGdprhRAdQPCYUeZu2gEEz0xpqnag8msnYoL3EFv2CTgmn1SnoB7r7hxHcXcDOBXRE3oYzEmTWRejli9sjMk6n.HOvQUGaHGwEzUDIdLQJUVIYEwpdyaSJrUpNaUXKmUg+HcYYQ4qkOa03k1MvLqG9WOB7j6x8376drqt68Det2Scbuultt.T1.MqEhu8MtRuEuyoQpmr0Koe82xzPR1jA+e7LY3MAI2iAL1PGh.hLlDu+6CELTvs4hxXBT.BHFjDfQUWzRArKCtgXQYHS0u6ulEBvZesMzDzE8LAVs3QYpR.O1c2DAk05wzEpqZ+rfhrQGcdnHVwPAY111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