Module to connect/disconnect rack cables over midi

Ok, i get it. First of all i want to note that i played around and i find your Gate, midi-cc workaround to be a real solution, although, very complex. I calculate that i need 1 midi-cc per midi controller and 1 gate and 1 μMap per output. I guess i can make this work for 10-15 modules… (i guess i can edit the presets to make the mapping more “automated”)…

The thing is that when i was developing the arduino -lets say communication protocol- to make them understand from where the cable is coming i spend a lot of time to overcome some limitations and expand it. Now it can successfully recognize ~120 different outputs.

Ok, about the module: can you midi map straight to a input/output?

if yes, the best solution for my implementation is to bind a midi control to a specif input or output. AND all these binding to be shared across the midi devices of a specific channel. Then: when midi device A send: "channel 16, cc 100, value 127,

channel 16, cc 101, value 127,

channel 16, cc 101, value 0,

channel 16, cc 100, value 0" (like intermix)

it will connect the output which is mapped to cc 100, with the input which is mapped to cc 101.

When midi device B send: "channel 16, cc 100, value 127,

channel 16, cc 103, value 127,

channel 16, cc 103, value 0,

channel 16, cc 100, value 0"

it will connect the output which is mapped to cc 100 (the same output as before), with the input which is mapped to cc 103.Preformatted text

How did you do it? My first idea would be to encode every port of every Arduino with a number and then constantly outputting this number in some sort of binary code a few bits long. If a connection is made the receiving Arduino needs to listen for a short period of time and then decode the number of the sending port and Arduino…

(take a look in my second answer if you didnt)

Yes, the idea with the outputting number like ID is a good start…let’s say you use Serial communication…and you send an ID char … Although, this was my initial idea, i spend like 100 hours more to implement it in a different way after much reading…head scratching and thinking. Serial doesnt work nice after the first output…unless you invest a lot of money…and buy lets say 2-3 arduino mega and connect them to the leonardo or micro…

If you want to know the trick…i can tell after the magic module :stuck_out_tongue:

No, I wouldn’t use an existing protocol or serial connection, I would implement this thing myself on the digital outputs as it needs a builtin constant synchronization, using something similiar to the encoding of MIDI might work. The standard serial ports and their protocol are not meant to change connection during “runtime” as far as I remember…

I’m not sure if your suggestion is a good protocol. Maybe something like this:
channel 16, cc 37, value 4 (means module “37”, port 4)
channel 16, cc 107, value 8 (means module “107”, port 8)
channel 16, cc 0, value 127 (means “make connection”, 0 would be “remove connection”)

So, you’ll need three consecutive messages to make a connection. You could address up to 127 hardware modules per MIDI channel, each having up to 128 ports. I must add I haven’t thought this trough, just a quick idea. It would also need some sort of MIDI merger before the connection to the computer.

I guess using MIDI SysEx would be a more straightforward solution though…

2 Likes

But the thing you are describing (the binary code) is like Serial communication… What do you mean change connection? You suppose to have the same “id” on specific pins that is your output…

I understand what you mean, but the “protocol” i suggested is the one that you saw in the video and is working with intermix nicely…i have built the whole communication like this so for me is maybe better to keep this way. On the other hand, there is no need for me to use “module” AND “port” because every port is unique…every port has one ID…so i can send this ID as a midi cc…and i can have 127 ports… …now that im thinking about it, the good about your suggestion, is that there will be no way for the connection to get confused with disconnection (as it is with intermix…where you send the same messages to enable and disable)… Anyway…whatever you choose its not big deal for me to change…maybe the three midi messages communication is better and faster…the disadvantage is you cannot use it with usual midi devices (as intermix could)

is there any way to implement midi merger straight to vcv rack?

never worked with midi sysex

edit: i am curious… is it finally possible to program a cable (as your code snippet here?) because if it is…it would be extremely easy if you can make a module using the 3 midi messages you mentioned to put a virtual cable. the only thing that would left is the input-outputs mapping with a specific midi cc…

Wow this is fascinating!

Maybe it would be a lot easier to do it with buttons instead of real physical cables.

You could hold one button and press a second one and the MIDI messages get sent only when two buttons are pressed at the same time and then make a connection between the two corresponding ports. And you could even make multiple connections to one output this way, and to destroy a connection you press both connected buttons again. And you could still make connections with the mouse without breaking anything.

With cables it might quickly get quite complicated on both ends.

It’s exactly the same with the buttons… If you use intermix you will see that you can map 2 buttons and create/delete connection as you said. I do the same with the cables. I have overcome the limitations from the hardware side…the problem is now with the vcv rack because you have to map everything to intermix and other modules… that’s why we discuss about a possible module solving this

Sorry I didn’t fully explain my idea. What I thought was it would be a lot easier to use buttons on the hardware side because you don’t need ports that send and receive messages to figure out which port is connected to which, and you could connect all modules to one single arduino with multiplexers.

You could also use the cable jacks like buttons that get activated by a jack.

With real cables you then would have to always work in pairs when connecting, so the arduino recognizes port x is being pushed, waits for a second message to arrive from port y and then sends the MIDI creating the cable between the two. If one port is being unplugged the arduino sends the message to destroy that cable. But at this point you would have to unplug the cable from the other port as well before making a new connection to the same port or implement some complicated logic functions.

With buttons you could use the same message to destroy a cable as to create a cable and the whole implementation would be a lot easier.

Of course this would require either everything to be connected to one arduino or some other communication between the arduinos. But I would always prefer a solution with one Arduino/MIDI device.

Now all this is under the premise that a software module is created to receive special MIDI messages to create and destroy cables. I’m only talking about this theoretical solution for both ends, not any workarounds with existing modules.

im not sure i get your idea… but with my implementation you dont have to disconnect both sides (it was stuck for a moment in the video, but normally if you disconnect one side…the “cable” is removed)

To proceed i was very concerned about the expandability of the whole project. Even the cables are mono cables, (the same as eurorack), not need for a “supervisor” or middle equipment, every module is stand alone. You can have just 3…you can have 23… If all of them use the same protocol (the one i mentioned in previous posts), they can work all together just fine…no further equipment…

One arduino and multiplexers, can be a way to go…but i believe you will have to do a lot of hardware adjustments in order to add or remove some modules…(not to mention the wiring)

edit: @stoermelder today, i was thinking your “3 midi messages connection/disconnection protocol” and it looks the best case scenario. Because even if i am ok with the 120 different outputs, the inputs can be much more (and my hardware arduino protocol can support it).

If you develop something to this direction, do you believe it will it be supported to enable the same output from whichever midi device sends the same midi message? (lets say “channel 16, cc 37, value 4” in your example)…

I saw there are some related updates in the Rack v2…but im not sure i understand correctly.

It was always possible, this snippet is from my STRIP module. It is just not part of the stable API and might break at any time in any update of Rack. There are also some technical difficulties but these should be solvable.
So, yes, the “only” thing left would be how to map MIDI CCs to modules. Also, addressing ports of a module might be a bit of a problem, but this will change in Rack v2 as ports will get tooltips similar to the tooltips of parameters in Rack v1.

My “protocol” was a quick suggestion without thinking it through completely, so it might have problems for sure :slight_smile:
I’m not sure though if I get your reference on the 120 different outputs. My suggestion was to use CC numbers to identify modules and CC values to address input/output ports. This way you could have about 127 modules per MIDI channel and about 127 ports for each module. Are you saying you are going to build a module with more than 127 ports?
Another idea might be to drop MIDI at all and use something different, something more suitable for this scenario. MQTT could be candidate…

Edit: Have you considered dropping MIDI and the wiring to your computer? I’m thinking about using a cheap ESP8266 with wifi for each module and MQTT as transport protocol. Cable-plugging won’t be time-critical in my opionion so it could make things quite easier.

Hey guys @stoermelder, @ligant, interesting topic. My crazy idea (I am not programmer, so I don’t know if it will be possible but I will try to describe my idea): What about possibility to MIDI MAP input/output of module? Scenario: instead of mouse clicking of input/output, there will be module to map input/output of module. For example with CC 1 you map sine output of VCO and with CC 2 you map input of VCA. So you control plugging cables of output of VCO with CC 1 and with CC 2 you control input of VCA. You click pushbutton/plug cable of MIDI CC 1 it will plug cable in VCV Rack to VCO sine output and next you click pushbutton/plug cable of MIDI CC 2 and it will connect sine output cable of VCO to VCA.

In this case and from my experience plug cable can be done in hardware like pushbutton/switch.

I hope my idea is clear. I know that in this case you will need a lot of control. For example fundamental VCO = 5 knobs + 4 outputs and 4 inputs = 13 MIDI control parameters. But MAPING function could allow not to use all of them, you could choose.

I red your ideas and this is mine. Maybe crazy, maybe not possible at all but I tried. What do you think?

Hi Jakub, thanks for joining this discussion :slight_smile:
I think I understand your suggestion. As I far as I can follow it @ligant tries to build hardware dummies of exisiting modules which can be patched with cables on the hardware, but I’m not sure if he is going to replicate every port of the modules. Your proposal could work on standard MIDI controllers with buttons.
But, as you stated, currently it is not possible to “map” ports of a module.

Thanks for your reply Ben @stoermelder. In my case you could do it with pushbuttons but same with cables, like in @ligant case (it’s just question of hardware structure). Just curious, it will be very hard to implement this function? Every developer has to change “structure” of his module? It is even possible? Thanks for your time.

@stoermelder

I wasnt clear… i have built some midi controllers. These controllers can recognize 120 different IDs lets say, with the way i built it. So, every “receiver” (actually every module is a receiver AND a transmitter, but with my protocol, only the receiver sends the message), when receives an output to one of its inputs it will say "i received the output e.g. “Bleak OUT” in my Laterus INPUT, so i will transmit this connection as a midi message of any kind. The “limitation” to my used protocol to make receivers understand different outputs that coming to their inputs are 120. So, in my whole Rack of midi controllers i cannot have more than 120 outputs all together (for every module available in the rack). I can have as much inputs as i want. If you put lets say 10 more outputs in sum, in the rack, i will not be able to identify from where they are coming. I hope its more clear now…if its not, im happy to explain it in person with a video chat or something (skype, messenger whatever)

yes but for a starting point it looks excellent.

as i said, i have worked the whole project (and believe me…squeezed my brain a lot about it) to make the closest to a real eurorack system. As you saw in the video, i dont have any mentioned delays, any other equipment…just pure USB.

Now, the problem can only be solved Rack side… From my “hardware” side i can send the info in any format you like, that this module’s output is connected with this module input…but how i will implement this change in Rack? Do u want midi? i can in midi…do you want MQTT…easy… but how i can make this cable in rack…that’s my problem.

I have worked much more with esp than arduino and midi, but as i mentioned…my problem is Rack side, which i have never worked with. I really dont understand how MQTT will solve the problem…

do i miss something?

If you guide me, I’ll be happy to make the cabling thing myself…im just afraid ill have to invest a big amount of time on Rack SDK…

@mudjakub First of all ive seen your work, and im happy to find that other people see the huge advantage of a “real” midi controller can give to VCV rack. (fun fact…search my previous topic here…i started with the same phrase: “my crazy idea”…im happy now, my own crazy idea, has started taking a little flesh and bones)

Its exactly the same as my idea, i just dont know how to do this in rack… My initial idea was the button thing as you said…press one button…press the other…boom there is a connection.(actually i could do that immediately with intermix and a controller with buttons…like launchpad) But, i didnt like it because you loose the feeling of real eurorack. I spend the biggest time, thinking how to do this with cables…and now it works…

Ok, lets say you send from your controller the “perfect” message. How the Rack will understand this connection? This is the problem i discuss from the beginning…

Correct. I can do that, until 120 outputs in total. So, i say i’ve already in hand the first prototype that can be duplicated as many times as i want to have a Rack of 120 outputs in total, and endless(not exactly…but not so limited) amount of inputs. I can replicate every port i want if Rack had this option. (i can replicate every knob for example, without any problem now…i can have a midi controller with 30 knobs…no problem)

No…not at all, if i had a module that could create cabling with midi messages… i would had the whole thing ready the next day.

@stoermelder is it easy to have a huge module with lets say 120 output port and 200-300 input port (something in Midi-CC format) where i connect all my inputs and outputs of my rack and then, with midi messages make a connection with any of them? (there is no need for error checking or midi messages conflict, as my protocol cannot allow this by default)

Again, thanks for your comments guys!

It was question for Ben @stoermelder

And for you @ligant, I think we think the same way. I totally understand your problem. We have to resolve some way of cable connection via MIDI.

1 Like

Ok, you are right, there are some things in Rack that need to be sorted no matter which protocol used. I did some quick tests about modules and ports, a first step for mapping.

Imgur

I don’t understand what are you doing in this GIF, BUT if you are on way to find solution, you are crazy, man :slight_smile: Thank you for your work :pray::pray::pray:

@ligant I mean, I plug hardware cable, it will send constant 127 value (like knobs totally open) of CC1, for “mapped” output of VCO (for example) in VCV Rack it means = plug virtual cable, once I unplug, value is 0, it means unplug virtual cable. Next I plug again hardware cable, value is 127, it means plug virtual cable of VCO output in vcv rack, I take another end of hardware cable, I plug into other module (for example VCA), plugging hardware cable will activate CC message 2 (value is 127), information for VCV Rack, connect output of VCO with input of VCA. Every MIDI controller output/input will have different CC number you could map, like I explained before.

In your (my) hardware controller, modules will share only voltages via cables.