@cuinjune thanks for your thoughts. i will think about the send and receive method and saving the connections as arguments. here is a different approach with canvasindex from iemguts. depending on the method the object id could be useful.
perhaps i need to create a new abstraction for every connection (a line with an invisible rectangle around, so that its possible to select it with help of ofIsPointInsidePath). That could also mean that its easy to disconnect the pure data cord together with deleting the abstraction (the disconnect values could be saved as arguments). with this method the connections are automatically saved together with the modules. it would be nice if you inside the ofelia window, like in pure data edit mode, first click on a cord, then it gets colored or bold, and then you can delete the cord and disconnect the pure data cord with del, but thats another problem.
connect.pd
-
Ofelia Jump On Click Slider
-
@Jona I'm sorry for the delay. I think creating a new abstraction for every connection makes sense.
I'm not sure what would be the best way to detect the cord selection yet. an invisible rectangle around the line could work.
I will try to create a simplest demo this week. I'm not sure yet how hard/easy it would be though. -
@cuinjune hi, @ingox worked with me on the one abstraction per cord solution. its still buggy but so you can get an idea if our concept makes sense or not. Mainly the communication between cord and modules seems difficult, especially if i save and reopen the patch, because $0 is renewed.
its without (mouse)cord selection and deletion and without dynamically patching the pure data connections yet, but that should be possible if the communication works well (which seems tricky, if possible at all, with dynamic patching).
the idea of iemguts canvasindex was that only the newest cord gets deleted if i release a cord outside of an input, but i think that should be possible with vanilla too.
edit: we are working on another one abstraction per cord solution.
drag_v0.3i.zip -
@Jona Hi, I couldn't finish creating the demo yet. But I think I'm getting there.
Here's what I've done so far, modular.zip. You need to reinstall ofelia v1.0.8 since I made changes to [ofEditRect] today. (I added "assignPos" and "assignDimen" method)When you open the "main.pd" patch, you will be able to create a box using Control + '1'. And delete the box using the "backspace" key.
Also, you can select/unselect multiple boxes while holding down the "shift" key. Or you can select boxes with the area selection.
And you can zoom in/zoom out the screen using Control + "-"/"+".
I only tested the patch on macOS so far. Let me know if you find any problem.
EDIT : It seems the keycode doesn't output correct value when pressed with Control key on Windows. (or it could be the problem of my macbook keyboard) I will find a way to fix this. Until then, you can try on macOS or modify the patch.I tried to make it work just like Pd. I will try to implement the patch cord feature this week.
I would also need to implement the copy/cut/duplicate/paste/undo/redo feature later. (after patch cord is ready)
And I think typing the name to create module can be implemented later.
Also, I think it needs to have some kind of window expander later. (similar to the OF addon you showed me last time)And I'm thinking to make 2 modes (editmode, playmode) just like Pd. On editmode, you can create/delete/move/connect modules but you cannot adjust the GUI. On playmode, you can only adjust the GUIs inside the module. (e.g. knob) It will be just like how Pd works.
Let me know if you like the above mentioned plan and design idea.
-
@cuinjune that is really great! thank you very much. and i am just starting my mac because of the keycode it seems that the keycode for the numbers on mac and windows isnt the same (control and shift seems correct). i will play with it and write more.
-
@Jona I just figured out what is causing the problem. I think I would need to create [ofKeyCodeListener] in order to be able to listen to the keycode values regardless of the modifier(Control). I remembered I asked a question about this before. https://forum.openframeworks.cc/t/way-to-detect-original-keycode-while-control-key-is-pressed/28684
I will update ofelia within 24hours and then re-upload the patch. -
@cuinjune no hurries i really like the pd style and all of the ideas. so its kind a simulation of a simulation of real electronic instruments copy/cut/duplicate/paste/undo/redo also sounds great, if its not too much work. i think 2 modes would make sense, too. also the scaling is great, but it doesnt work with windows, so maybe there is something wrong with the keycode too? on my macbook i can only use "control + -" and make it smaller. but i have a very old (2009) macbook, perhaps they had a different keyboard layout? i also found that when i double click and then drag a new object, its position jumps to 0 0. everything else seems to work great.
i worked on the lissajous sequencer (which could be a module), its very minimalistic now. in the example you just need to click into the lissajous window to change the shape and then press play. it has 2 "voices" and is connect to 2 seperate synths. drag_v0.3k.zip -
@Jona Hi, the new lissajous sequencer module looks nice and seems to work well.
I added [ofKeyCodeListener] which outputs constant keycode values independent from modifier keys.
Please reinstall ofelia v1.0.8 so you can use this object.
Here's a new version modular.zip. Please try to delete boxes using the backspace key(or del key?) on Windows. If it doesn't work, please let me know the output value of [ofKeyCodeListener] when you press the backspace key. Also, Please let me know the output values of left/right Control keys.
Could you also try "Command + '-'/'+'" on your macbook to zoom? if it doesn't work properly please let me know the output value of [ofKeyCodeListener] when you press '-' and '+'.
And I fixed the position jumping issue when double click and drag a new box. Thanks for finding this.
Now I will try to work on the cord connections. Let me know if you find other issues or have suggestions. -
@cuinjune hi, thanks. deleting works with backspace on windows. also creating objects with control+1 does work now.
Zoom doesnt work for me on macos and windows.
here are my windows keycodes:
shift = 340, control = 341, backspace = 259, del = 261, +(numpad) = 334, -(numpad) = 333, + = 93, - = 47, left = 263, right = 262, up = 265, down = 264.
on my macbook i dont have a numpad, and like on windows , + = 93, - = 47.
edit: if i replace keycode 45 61 with 47 93 zoom does work. -
@Jona Thanks for confirming. I also added 47 and 93 for zooming. modular.zip
Maybe I should change the shortcut for zooming later since -/+ seem to differ by platforms and hardwares. -
Or its fine like you did it now, that you assign two or more keycodes to + and -? if the keycodes do not conflict with another key function it shouldnt be a problem.
I found that the render order only changes if you drag a rectangle directly, if you first select the rectangles with drawSelectBox and then drag them the render order remains the same. In Pure Data the render order is the order of creation, but i think it could be nice if the dragged objects are always in the foreground.
Another question not related to the example: If I use [openpanel] it opens a window behind the ofelia window but in front of the pure data window. Is it possible to change that, so that its also in front of the ofelia screen (not important)? -
Hi, since ofelia isn't working on my operating system yet, i build this modular system with data structures:
It uses [text] instead of arguments to store data. As the modules can be created from that [text], saving and loading of sessions is possible.
Cords can be selected by click (a bit clunky), deleted by backspace and deselected by escape key.
Iemguts external is used for mouse events and object deletion.
Obviously this is just a demo and many things are still unsupported or wouldn't work with data structures anyway. Have fun!
Edit: This version has a demo mode that shows the subpatch where the modules are created. I got tcl errors from dynamic patching until i did vis 1, editmode 1 before disconnecting for example, so i had to do vis 0 afterwards and the modules subpatch is closed. In demo mode it stays open: modular_ds.zip (now working)
-
@ingox thanks. that is great
-
@Jona Yes the keycodes don't conflict with other keys. I will leave it like this then.
Thanks for your finding and suggestion. I applied the change. modular.zip Please check if it's working as expected.
And regarding the last question, I don't think it's currently possible to make the pop up window to appear front when using [openpanel] while ofelia window has focus. And I should note that [openpanel] and [savepanel] won't work if you use them on standalone app created with ofxOfelia. I think these objects are built using Tcl/Tk. And I don't know if there's a good cross-platform solution in openFrameworks(c++) for creating such objects.
What you can do now instead is creating a custom fake openpanel that appears inside ofelia window. It should be possible by using some utility objects. You can take a look at "file" and "directory" subpatches from "ofelia/help-intro.pd".EDIT : fixed small minor bugs. modular.zip
-
@cuinjune thanks, everything works as expected i think its nice like that. and thanks for the hint with the fake openpanel, i will have a look.
-
@ingox Great work! It works nicely on my macbook. Thanks for sharing this and I look forward to seeing the further updates.
-
@cuinjune i think i found a way to select samples relative to the path of the patch (the example uses [list-idx] from list-abs which is a vanilla abstraction). do you think this method also works with the standalone application? openpath.zip and i also found a nice open frameworks example: https://github.com/openframeworks/openFrameworks/tree/master/examples/input_output/fileOpenSaveDialogExample but i dont know about the cross platform possibilities. and i assume it would be a lot of work to implement it if its possible at all?
-
@Jona Hi Thanks for finding the example. I looked at the code and it seems openFrameworks already has functions that can do [openpanel] and [savepanel].
http://openframeworks.cc/documentation/utils/ofSystemUtils/#show_ofSystemLoadDialog
I haven't tried it yet but I think it will work on all desktop platforms without problem.
I will create the two objects. I can also include ofSystemAlertDialog() and ofSystemTextBoxDialog() as well. I will let you know as soon as I add these objects to ofelia.( I will add them within 24 hours) -
@cuinjune hi, that sounds great its not that its needed very soon, but its good to know that its possible, this way it could be easier / more flexible to load/save presets/samples/movies(?) etc. from the ofelia window... still, the openpath.pd method is fine for now and could be useful to load static soundbanks, that are located relative to the path of the patch, for example.
-
@Jona Hi I just added the 4 objects to ofelia v1.0.8.
Reinstall ofelia and open "ofelia/help-intro.pd" and then find the [pd system] subpatch in UTILS section.
I also added [ofGetCanvasIndex] since I think it will be useful for implementing the module connection.