Patchcord-like UI object?

Brian H.'s icon

Hi,
I'm a newbie and looking to make a simple simulated analog patchbay for my students to practice signal path stuff in a lab as a supplement to the real thing. Should be a pretty simple thing for Max, but I'm wondering what to use for a patchcord object they can use to connect points, thereby putting the whole thing in motion. My idea is this would be a runtime app, so it would have to be something they can manipulate in that. Anyone point me in the right direction to start out?

Thanks,
Brian

jazzisfaction's icon

Hi,

I made a little patch....Maybe it's not what u were looking for..sorry then.

You can just connect the outlets of the 'bangs' with the inlets of other 'bangs' or if you connect a 'bang' which is already connected with the '1' which is going to to 'jt.qt.movie' object you start a little film (of course you first have to 'read' a mov-file into the patch which you could find in Max5 -> patches ->media).

The possibilities are endless.......
But the patch I made is really for children and I'm not sure if it is what you were looking for.

Cheers
Peer

Max Patch
Copy patch and select New From Clipboard in Max.

Brian H.'s icon

Thanks, looks like fun! However, I am looking for something which I guess is similar, but can run standalone and users can still interact with. I wasn't able to find any obvious patchcord-like UI object, but if there was a way to make your patch usable as a standalone app, that might be way in. Ideas anyone?

Thanks,
Brian

Gregory Taylor's icon

You should take a look at the matrixctrl object,
which is about as close as a standard way to
depict patchbays as I can imagine - it's certainly
what I use, and a loving homage to the old pinboard
on the Synthi AKS.

jazzisfaction's icon

It's easy:
I modified the patch and used some gates and toggles which run fine in 'standalone' modus.
I added a description how to make a standalone after the patch.
It's just a copy of what u can find in the 'Topics' documentation starting at page 13.
Good luck and have fun

Peer

Max Patch
Copy patch and select New From Clipboard in Max.

With your top-level patch in the foreground, choose Build Collective / Application /
Plug-in ... from the File menu.
You will be presented with a script window, in which you create a list of things Max
must do to create the collective. Max has already made the first entry in its
script—open thispatcher— instructing itself to load in your top-level patch. Any external
objects required by your patch, any subpatches used as objects in your top-level patch
(or used in a bpatcher), and any nested subpatches (sub-subpatches used in subpatches
of the top-level patch) will all be included automatically in the collective. In addition,
certain objects, such as js, fpic, and hi, copy files they use into the collective for you.
For the js object, the script text file is copied, but not files the script uses.

When you click on the Build button in the “Collective Editor” dialog, you are presented
with a standard Save As dialog allowing you to name your collective and save it to disk. In
the lower part of this dialog you are presented with a Format menu. By default this menu
is set to save a Max Collective file, but if you want to save your patch as a standalone
application, all you need to do is select Application from this menu. It’s as easy as
that—Max will automatically combine your collective with the MaxMSP Runtime appli-
cation and save the result as a single file (or folder on Windows) which appears and
functions as a standalone application, requiring neither Max nor MaxMSP Runtime. If
you have multiple versions of MaxMSP Runtime in your Max folder, Max will use the
application that has the word “Runtime” in its name, and the most recent creation date.

jazzisfaction's icon

the problem is that u don't have really patchchords which u can connect with the patcher I sent u...well, didn't figure out how to manage that, but I think working with toggles and gates is a fine alternative....

Stefan Tiedje's icon

Brian Heller schrieb:
> Anyone point me in the right direction to start out?

You could script real patch cords also in a standalone...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

jazzisfaction's icon
Brian H.'s icon

WOW, that is fascinating! I had no idea Max had scripting ability in that way, and I figured it out just by looking at your great patch and reading a few help bits. I think something like this is great groundwork. Ideally, I need make students use something as close to a virtual patchcord as I can (which is why having them interact with gates and switches is less preferable), but this example is on the way to that I think.

Thanks a lot!!!

Amazed,
Brian

Stephen Lee's icon

I'm working on something that sounds like what you're describing. My solution was to use the LCD object to create the entire interface. It's the only way I can really think of to get an intuitive click-and-drag approach to creating patch cables. In other words, what Max does naturally when in edit mode, but it works when the patch is locked and is customizable (jack size, cable thickness, colors, etc.). I guess you could do something similar with Jitter or JSUI, but I didn't have Jitter when I began the project, and my Javascript chops aren't all that great.

I attached a zip file if you want to take a look at it. However, although the interface works, it is not yet functional. In other words, while you can create patch cables, they don't "mean" anything yet. Hopefully it will be functional within the next couple of weeks. Open "AAA Patch Bay" to try it out. Readme.txt has some very, very rough documentation.

Brian H.'s icon

Yes, this looks like exactly the kind of thing, both potentially in appearance and operation. Could you/someone give me a quick suggestion for an entry-point to the patch? I'm new, but do a have a good grasp of the basics. I'd like to be able to see how it works for the sake of learning. Did you have to create everything in the subpatchers and abstractions? I looked through it some and it seems quite complex.

If I can get a grasp, I'm happy to help...maybe I can make some of the audio "guts", etc.

Thanks again for sharing your work,
Brian

Stephen Lee's icon

Yes, I created all of the abstractions, and I only used objects that are included with Max so that it would be self-contained. It might be very difficult for you to decipher the whole thing, since everybody's Max style is different, but I can give you a few hints:

1. The data is stored in colls, and all of the colls are in the main patch on the left-hand side (coll variables - coll cables). For more info, check out the readme file.

2. The seven abstractions on the left-hand side (drawcable - highlight cables, and global) contain all of the abstractions that make everything work.

3. "managevars" (inside "global") sends out all of the values in "coll variables" to the appropriate receive objects when the patch is loaded. For example, the value "white" is sent to all "receive bgcolor" objects. I use this to initialize values and edit them on the fly.

4. "EGG" is basically just a small graphics library that I am working on to make certain tasks easier with the LCD object (such as drawing a thick line with rounded ends).

Luke Hall's icon

Another substantial resurrection, but just in case anyone is still interested I've created an abstraction that loads into a [bpatcher] that allows you to create patchcords when max is not in edit mode. It uses scripting messages sent to [thispatcher]. The arguments in the [bpatcher] inspector specify the number of inlets and outlets up to a maximum of sixteen. The connections work with Max, MSP and Jitter data.

To make connections click on the desired inlet, drag to an outlet and release the mouse button. After doing this once you can make multiple connections from the same inlet by clicking on outlets without dragging. To disconnect a patchcord drag from outlet to inlet. Sending the message "clear" to the first inlet will remove all current patchcords. Connections in and from the [bpatcher] will only resemble Max/MSP/Jitter patchcords if the relevant connection is made to the inlet beforehand.

If used outside of [bpatcher] this abstraction functions much like [router] and [matrix~]. The first inlet accepts a list formatted like the output from [matrixctrl] prepended with the word "patch".

lh

Max Patch
Copy patch and select New From Clipboard in Max.

Stefan Tiedje's icon

Luke schrieb:
> I've created an abstraction that loads into a [bpatcher] that allows
> you to create patchcords when max is not in edit mode.

Nice...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

oli larkin's icon

thats cool. you have to manually restart the dsp if you are doing it with audio though. nice nonetheless.

thanks,

oli

Stefan Tiedje's icon

Oliver Larkin schrieb:
> thats cool. you have to manually restart the dsp if you are doing it
> with audio though. nice nonetheless.

could be achieved with a [0, 1] message to a dummy dac~. If you need to
be smart, check beforehand if audio is on or not:

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Brian H.'s icon

Thanks, I am certainly still following and it in my longer-term plan to make this happen-- It will just take me longer since I'm a relative newbie and there does seem to be quite a lot to it. But I appreciate whatever you skilled folks can add. I am currently trying to get some time made for doing this at work.

Thanks,
Brian

Luke Hall's icon

If you're trying to create a patchbay like one found on a mixing desk you can route your individual channels to the inputs of my abstraction above, connect the outputs to any effects or processors you want and then connect again to another instance of the abstraction and then on to your master channels/[dac~] or wherever you want. Then if you want to route one of your channels through an effect you can do all the routing you want!

lh

self help's icon

Hey @STEPHEN LEE, Don't suppose you still have that zip? I'm trying to do something similar and this seems to be the only post I can find that has any leads!