Replacing a patch cord from one input with another
While experimenting with jitter video processing I find my self quickly wanting to swap out which video stream is going to a given input of a shader.
What I have to do is:
1. Attach a patch cable from a second video stream to the shader input
2. Delete the patch cable from the first video stream
This is actually super annoying. In patching software I've worked with in the past, inputs would typically only be able to have one cable connected, and if I drag a second cable to the input, the first cable gets automatically deleted. It's way more convenient for experimentation to be able to swap things out this way. Is there any way to make Max do this?
maybe 2 gates to the two inputs might help?
Well, that would still require more than one mouse click to swap out the input. I'm hoping for a one-click (or one drag and drop operation) way to do it.
toggle controlling a switch object... one click
Right, but if you think about it, that doesn't truly solve the problem, because if I later want to switch to a third thing, it's still more than one click...
Not to mention that I'd have to set up two additional objects just to toggle between two things. I would want some other object that supports an arbitrary number of inputs and has the toggling built into its own UI...
Those are all things that are relatively simple to achieve by programming the functionality you want. Max is, after all, a programming language and, as such, gives you the power of a language to express your own ideas.
You can develop a system to play an arbitrary set of media files, video or audio, by learning how to use the folder object to contain the files and read them into a player as needed.
You could also learn about the poly~ object which would allow you to preload your database of media from the folder into a set of as many players as you need, allowing you to play more than one at a time.
"Well, that would still require more than one mouse click to swap out the input."
so you have tried it already? ;)
How about a switch with inlets for as many files as you want to access controlled by a umenu with filenames?
Or, fill a named coll with the contents of your media folder and view it with jit.cellblock. That would allow you to view the whole set and select any one with one click.
You could grab the top of the patch cord and drag it from one video stream to the other. This would neither create nor delete patch cords, but switch the connection, unless I'm missing something obvious here.
I do agree with the approach of programming a UI for yourself if you want to switch inputs in finished patchers.
@SLO Oh my gosh you're right about dragging the top of the cord! Why didn't I think of that...
Now if only I could make jit.gl.slab have separate inputs for each texture when I'm using two or more textures. Though I guess I could do that with a subpatch.
@Kenneth Newby thing is I don't want to just switch video files, I also want to switch between video streams coming out of shaders down the line.
Despite that basically anything is programmable in Max there are still certain limitations that make me want to build my own custom program...
For instance, I wish when I hover over a wire I could get an instant preview of the value on it or the video stream traveling through. Doing something like that would require a pretty low-level plugin, I'm sure.
jit.gl.slab does have an @inputs attribute that sets the number of inputs.
There are event, signal, and matrix probes in the Debug menu.
The matrix probe doesn't seem to be working...I enabled debugging but when I hover over a video patch cord I don't see anything in the probe.
Since the event probe shows a jit_gl_texture event on the cord coming out of a jit.gl.slab, I'm guessing that doesn't work with the matrix probe? I'm trying to do all my video processing in OpenGL instead of on the CPU.
Oh well...I guess if nothing else i can just drag the top of the patch cord going to my jit.gl.layer object around.