Module to connect/disconnect rack cables over midi

I actually meant @ligant when I said to prepare a JSON file. Currently the module does nothing, I have to implement the mapping. I think the protocol @ligant proposed is a good start as you might use it with standard MIDI controllers and trigger the messages by hand. The protocol I described before won’t work “manually” I guess.

Ahhh OK, thanks, I will follow this thread and your work and we will see… :wink:

Maybe something like this could work…

{
	"protocol": "MidiCcTwoStepToggle",
	"mapping": [
		{
			"midiChannel": 2,
			"midiCc": 12,
			"midiCcTriggerValue": 127,
			"moduleId": 4,
			"portType": "input",
			"portId": 3
		},
		{
			"midiChannel": 0,
			"midiCc": 17,
			"midiCcTriggerValue": 127,
			"moduleId": 2,
			"portType": "output",
			"portId": 1
		}
	]
}

@mudjakub dont worry…json is pretty easy even for non programmers…just google it

@stoermelder sorry i dont get you,

  1. with the Test7-MIDI i can bind all my Arduinos and just send the midi messages to a “main” midi core module? So, if i send midi cc 100 value 127 from Arduino 1, will be the same as if i send it from Arduino 2?

  2. do you want me to create a JSON like what? this?

{
  "modules": [
    {
      "moduleId": 4,
      "ports": [
        {
          "inputs": [
            {
              "inputID": 0,
              "midiCC": 1
            },
            {
              "inputID": 1,
              "midiCC": 3
            },
            {
              "inputID": 2,
              "midiCC": 5
            }
          ]
        },
        {
          "outputs": [
            {
              "outputID": 0,
              "midiCC": 2
            },
            {
              "outputID": 1,
              "midiCC": 4
            },
            {
              "outputID": 2,
              "midiCC": 6
            }
          ]
        }
      ]
    },
    {
      "moduleId": 7,
      "ports": [
        {
          "inputs": [
            {
              "inputID": 0,
              "midiCC": 7
            },
            {
              "inputID": 1,
              "midiCC": 9
            },
            {
              "inputID": 2,
              "midiCC": 11
            }
          ]
        },
        {
          "outputs": [
            {
              "outputID": 0,
              "midiCC": 8
            },
            {
              "outputID": 1,
              "midiCC": 10
            },
            {
              "outputID": 2,
              "midiCC": 12
            }
          ]
        }
      ]
    }
  ]
}

now if i want to create a connection between moduleId 4, port 2(output) going to moduleId 7, port 1(input) i should send the following midi messages(intermix style) :

midi device * (any)

midi control: 6, midi value:127
midi control: 9, midi value:127
midi control: 9, midi value:0
midi control: 6, midi value:0

to disconnect this cable sends the same:

midi control: 6, midi value:127
midi control: 9, midi value:127
midi control: 9, midi value:0
midi control: 6, midi value:0

haha…i like that i hadnt read your comment…and we wrote almost the same json :heart_eyes:

edit: you said to keep it intermix style, so i didnt put “midiCcTriggerValue”…

edit2: SUPER important…can the midi mergers work only for a dedicated “wiring channel” lets say the 16? because all the other midi messages for knobs/buttons, sliders, dont need the merger thing…

Imgur

3 Likes

is this what i think it is?? hehe

how i can test this?

1 Like

Hi Ben, you’re such a crazy wizard :exploding_head: :star_struck: :+1:

2 Likes

So, I cleaned up everything and it works quite nicely, I’m a bit surprised myself. I separated the “helper” module and the mapping module:

  • T7-ASSISTANT is used to identify module ids and port ids
  • T7-CORE processes messages and does all cable handling
  • T7-MIDI receives MIDI messages and transports them to the module on the left side (expander for T7-CORE)

On your questions:

Yes, they will be considered the same as long as MIDI channel and CC are identical.

I modified my first draft of the JSON schema a bit. There is a context menu option on T7-CORE which copies an example mapping to the clipboard. Also, mappings can only be copied to and from the clipboard, this should suffice for now.

I like to keep it extensible. There is only one “driver” for now, called MidiCcTwoMessageToggle.

{
  "events": [
    {
      "type": "cable",
      "midiChannel": 0,
      "midiCc": 12,
      "midiCcTriggerValue": 127,
      "moduleId": 4,
      "portType": "output",
      "portId": 1
    },
    {
      "type": "cable",
      "midiChannel": 1,
      "midiCc": 13,
      "midiCcTriggerValue": 127,
      "moduleId": 2,
      "portType": "input",
      "portId": 3
    }
  ],
  "driverName": "MidiCcTwoMessageToggle"
}

Yes. You can pre-filter on the T7-MIDI module by selecting a channel or within the mapping.

Which OS are you on? I can provide Windows builds right now, for other OS I must set up an Azure Pipeline as I don’t compile them myself.

3 Likes

Everything looks very nice and easy as i read them… ill come up with more questions after try the modules. I have windows.

i totally agree… maybe in the future, you can add a “custom” protocol or choose the intermix style (button1 127, button2 127, button1 0, button2 0)… but its nice to have both in case someone wants to use generic midi controllers or not.

ps: its too early…but i guess its an easy implementation for the future: to add coloring metadata to the JSON and make every connection’s coloring according to omhi cohen style automatically.

I did implement the “protocol” you suggested, similar to INTERMIX, because it is quite easy to use with a button controller.

@stoermelder

man…i read your instructions on modules carefully… modified the example json… make some small changes on my arduino code…

BOOM…it looks to work flawlessly…in like 10-15’

ill return (i dont know if i have time today cuz its too late already) with more tests and maybe a video, but i would like to share my enthusiasm with you!

edit: about the delay…its fast as hell…even if you look the screen and you cable at the same time, its almost instant

edit2: after i successfully make this work…spend several minutes because i couldnt make this work again… I realized that if i copy-paste my Json to the T7-core, although i see my json pasted…it doesnt work… i have to use “Paste Json mapping from menu”. is there a reason i can write inside the module?

edit3: here you are (the alone cable supposed to be LFO square output). Listen the plug/unplug sound to see the speed.

1 Like

Wow! Congratulations to you two! Nice! :ok_hand:

1 Like

Hey guys, good job, wow! I downloaded modules and tried to understand it, but I can’t… @stoermelder Ben are you going to simplify it in future? Thank you guys :wink:

1 Like

Should be no problem.

:sunglasses:

I will check… “copy and paste” is handled by Rack itselft, so I’ll check if I can do something about that.

1 Like

I guess not. It would take a significant amount of work for a tiny group of people who will use this super-special module.
Actually it is not that hard to use it, you just have to write a JSON mapping. If you provide a patch and name some CCs of your buttons I can create one for you as an example.

Please, If you can make some basic example patch with two modules and 2 patch cables - for example fundamental VCO and fundamental VCA, CC numbers are 1,2,3,4, channel 1.???

Sure. The outputs of the VCO have CC 1…4, the input of the VCA has CC 5, everything on channel 1. To patch a cable, press button CC1 and CC5, or CC2 and CC5 etc.

Edit: file removed as won’t work with the latest release.

Ben, I am impressed, it’s working great… thank you so much, you deserve one of my controller if you will be interested in. :smiley: Now, find the way how can I learn how to program json, and last tip, I hope it will be possible, because I want also implement cables instead of pushbuttons - now when I push button value jump from 0 to 127 back to 0 it means plug cable in VCV Rack, again I push button value jumps again from 0 to 127 back to 0 and it will unplug cable. My idea - It will be possible to behave like gates, I plug hardware cable - cc value jumps from 0 to 127 it plug cable in VCV Rack and stay at 127 but when I unplug hardware cable value jumps back to 0 it means for VCV Rack unplug cable? I don t have with me so much hardware and stuff and I can t test it properly maybe your configuration is perfect for now, I need to implement hardware cables and test it, thank you so so much again, how can I edit json, I have to type into module T7 core module? Or how? I hope it’s last thing I bother you with… I can’ t believe it’s working so good, like someone said you are wizard :wink:

Thanks, Jakub, why not :slight_smile:

There is a context menu option “Copy JSON mapping” in T7-CORE which copies the mapping to your clipboard, you can paste it to any text editor you like. It is a simple text file for mapping MIDI CCs to module ports in Rack, shouldn’t be to difficult to extend the file. Feel free to ask if something is unclear!

I thought about that too and I’m planning to work on that tonight. Just to summarize it: You want to assign one pushbutton to one cable. If the button is “pushed” (value 127) a cable between two specified ports is active. If the button is inactive (value 0) the cable is removed. In particular, you only need one button for cable, not two different buttons (input and output) like the current behavior.