Midi2Macro

Sharing Midi2Macro 2 Profiles

Sharing Midi2Macro 2 Profiles

Midi2Macro stores all profiles and macros in simple JSON (text) files. You can export them, copy them to your other computer or send them to a friend, then import them there and that should be it. However, this doesn't always work the way you expect and the reasons are worth understanding before you start.

One thing to know up front. Midi2Macro doesn't have a smart import yet, one that lets you remap imported macros to your own device as you import them. An imported profile only lines up by itself when the other computer gives the controller the exact same name as the one it was made on. When it doesn't, you can fix that by hand in the file, and this guide shows you how. A proper remapping import is a feature I'm hoping to add in the future.

To keep things concrete, I'll use my own DaVinci Resolve setup from the Midi2Macro launch video as the example all the way through. It's a Launchpad X custom mode plus a Resolve profile with 30 keyboard shortcuts, and you're welcome to download both and follow along:

  • launchpad-x-custom-mode-resolve.syx, the Launchpad X layout

  • midi2macro-resolve-profile.json, the Midi2Macro profile

For more on which Resolve shortcuts are worth putting on pads, see the DaVinci Resolve MIDI controller guide.

What has to line up

Midi2Macro remembers each macro by two things: the name the computer gives the MIDI device and the note or CC the pad sends. When you press a pad, it looks for a macro saved under that exact device name and note. So for a shared profile to work on another computer, three things have to match:

  1. The other computer has to call the controller exactly what the original computer called it.

  2. Each pad has to send the same note it sent when the macros were made.

  3. The shortcuts have to suit the system. A shortcut made on Windows uses Ctrl where the same command on a Mac uses Cmd, and the other way round.

The rest of this guide takes them one at a time.

Export a profile

  1. Open Midi2Macro and go to File, Manage Macros...

The Manage Macros dialog in Midi2Macro with the Export and Import buttons at the bottom left
The Manage Macros dialog. Import and Export are at the bottom left.
  1. Click Export and save the .json file.

The export holds all of your profiles, not just the one on screen, so whoever imports it gets all of them.

Keyboard shortcuts travel well. Macros that point at something on your own computer don't. A sound effect needs the same audio file in the same folder, an OBS macro needs scenes and sources with the same names, and a Launch App macro needs the app installed in the same place. That's why my Resolve profile is shortcuts only.

Share the controller layout too

Plenty of controllers can change which note each pad sends. Launchpads have layouts and custom modes, many keyboards have octave buttons and some pad controllers have banks. If the person importing uses a different layout, the pads send different notes and the macros either do nothing or fire the wrong shortcut.

So if your controller has a layout editor, share the layout along with the profile. For a Launchpad X that's a custom mode from Novation Components. Here's how to load mine:

  1. Open Novation Components, either in the browser or the desktop app, with your Launchpad X plugged in. Check it shows Connected in the top right.

  2. Go to Custom Modes, click New Custom Mode, then Upload Custom Mode and pick the .syx file.

Novation Components showing the Upload Custom Mode button for the Launchpad X
Upload Custom Mode loads the .syx file into Components.
  1. The layout opens in the editor. Click Send to Launchpad X at the top and pick a custom mode slot.

The Resolve custom mode open in Novation Components with the Send to Launchpad X button at the top
The Resolve custom mode in Components. Send to Launchpad X writes it to the device.
  1. On the Launchpad, switch to that custom mode before you use the profile.

Other controllers have their own editors, so the steps will differ, but the idea is the same.

Import the profile

  1. Open File, Manage Macros... and click Import.

  2. Pick the .json file.

  3. Set the mode to Merge and click Confirm Import.

Merge adds the imported profiles next to the ones you already have. Replace All throws away all of your current profiles and macros and keeps only what's in the file. Unless you're starting from scratch, Merge is the one you want.

Switch to the imported profile and press a pad. If the right thing happens, you're done. If nothing happens, read on.

Why the pads might do nothing

My Launchpad X on Windows reports itself as Focusrite-Novation / MIDIIN2 (LPX MIDI), so in my Resolve profile a pad that sends C2 is stored like this:

"Focusrite-Novation-MIDIIN2 (LPX MIDI)-C2": {
  "steps": [
    {
      "type": "Trigger Shortcut",
      "keys": ["CONTROL", "Y"],
      "midiNote": {
        "id": "Focusrite-Novation-MIDIIN2 (LPX MIDI)-C2",
        "deviceId": "Focusrite-Novation-MIDIIN2 (LPX MIDI)",
        "deviceName": "Focusrite-Novation MIDIIN2 (LPX MIDI)",
        "name": "C2"
      }
    }
  ]
}

If your computer calls the device something else, nothing matches and the pads do nothing. The import itself still succeeds, which is what makes this confusing the first time.

The same controller can show up under different names:

  • A Mac most likely reports a different name to the one Windows uses.

  • Windows sometimes adds a number in front, like 2- Launchpad X, when several MIDI devices are plugged in.

  • A different driver or a firmware update can change the name.

  • A different controller will obviously have its own name, and its pads will send different notes too.

The fix is to swap the original device name in the file for the name your computer uses, then import it again.

Find your device's name

The easiest place to find the exact name is Midi2Macro's own macros file.

  1. In Midi2Macro, assign any shortcut to any pad on your controller. This makes sure your device appears in the file. You can delete it afterwards.

  2. Open the macros file in a text editor:

SystemLocation
WindowsC:\Users\{username}\AppData\Roaming\Midi2Macro\Midi2Macro\macros.json
Mac~/Library/Application Support/Midi2Macro/Midi2Macro/macros.json
  1. Search for deviceId and copy the value next to it. Also copy the deviceName value, which is the same name with a space instead of the first hyphen.

Only read this file. Midi2Macro keeps its macros in memory while it runs and writes them back to this file, so any edits you make here while the app is open get overwritten.

On a Mac you can open the folder from Finder with Go, Go to Folder and pasting the path. The Library folder is hidden by default, which is why it's easy to miss.

Replace the names

The original device name appears in the shared file in two slightly different forms, and you replace each one with the matching value from your own macros.json. In my Resolve profile they look almost the same. The only difference is the character between Novation and MIDIIN2, a hyphen in the first and a space in the second.

Find in the shared fileCharacter after NovationWhere it's usedReplace with your
Focusrite-Novation-MIDIIN2 (LPX MIDI)hyphenMacro keys, id and deviceIddeviceId
Focusrite-Novation MIDIIN2 (LPX MIDI)spacedeviceNamedeviceName

The hyphen version is the one that matters for matching. The space version is only the label Midi2Macro shows in its lists, but it's worth fixing so the import doesn't show someone else's device name everywhere.

Search for each one exactly as written. Because of that one character, replacing the first doesn't touch the second, so you need both. For a profile from someone else, look up the deviceId and deviceName values in their file the same way.

Any plain text editor will do. Notepad on Windows and TextEdit on a Mac are already installed.

  1. Open the shared .json file in the editor. In TextEdit, choose Format, Make Plain Text first.

  2. Open Find and Replace. That's Ctrl+H in Notepad and Cmd+Option+F in TextEdit.

  3. Paste the hyphen version into Find, paste your deviceId into Replace and click Replace All.

  4. Do the same for the space version and your deviceName.

  5. Save the file.

Sharing between Windows and Mac

Shortcuts are stored with the key names they were recorded with, so a profile made on one system can need a small fix on the other. My Resolve profile was built on Windows, so undo is stored as CONTROL + Z, which does nothing useful in Resolve on a Mac.

While the file is open, use Find and Replace once more:

Profile made onUsed onFindReplace with
WindowsMac"CONTROL""COMMAND"
MacWindows"COMMAND""CONTROL"

Keep the quotes in the search. They make sure only the key names change and nothing else in the file. Alt works either way because Midi2Macro treats it as Option on a Mac.

Import and test

Import the edited file with Merge as above, switch to the profile and press a pad. If the shortcut fires, you're done.

If nothing happens, check the pad shows up in Midi2Macro's note history. If it does, the device name still doesn't match, so compare the deviceId in the edited file with the one in your macros.json character by character. Spaces and brackets are the usual culprits. If the pad fires the wrong shortcut, your controller is sending different notes to the original. Check it's in the same layout or custom mode. On a different controller that's expected, so reassign those pads in the app.

Importing the same file twice is safe. With Merge it updates the existing profile instead of adding a second one.

Smart import planned for future relase

Editing JSON by hand to import a profile isn't how it should work. I'm hoping to add an import option that lets you pick which of your connected devices an imported profile should use, so the name swapping above happens for you. It's on the list for 2.1, though I can't promise when it might become a reality. Until then, hopefully this guide will help get you there.