fernandraynaud Posted February 28, 2018 Share Posted February 28, 2018 If you own any of the many plastic gizmos that send out MIDI data to your DAW, you probably know that Logic has the ability to recognize many MIDI devices, some as full blown control surfaces, others as just "MIDI Controllers". If you connect one of the latter that it recognizes, it offers the option to enable automatic mapping (to Smart Controls) of its rotaries, faders, and the PLAY, STOP, RECORD buttons etc. This is enabled by a checkbox under Logic Pro X -> Preferences -> Control Surfaces -> MIDI Controllers. You can then view, edit, delete or override these automatic assignments under Logic Pro X -> Control Surfaces -> Controller Assignments. One problem is that all the controls that Logic maps no longer appear as MIDI CC data to be recorded in tracks, the conventional way, unless you reprogram your gizmo to e.g. send on a different MIDI channel. I prefer to keep my MPK88 faders as MIDI Continuous Controllers on MIDI Channel 1, to control parameters in third party plugins. I've been trying to create and save my own assignments. I'm not sure how Logic is meant to prioritize user choices vs. its own, except that in practice it unexpectedly reverts to its auto choices and trashes any carefully constructed MIDI learned assigns that I've made. I'd love to disable auto mapping on at least some of the controls, but there seems to be no way to save or create our own templates. No question I want the PLAY, STOP, RECORD etc buttons to work, or I could have simply disabled the whole auto mapping of my MPK88. But it's all or nothing. So, if you're in that situation, here is where Logic gets its template, and how to modify it, using just the TextEdit utility. Right click on the Logic Pro X.app file (whichever version), select Show Package Contents. Navigate to Contents -> Frameworks -> MACore.framework -> Versions -> A -> Resources -> MIDI Device Scripts and locate your device. In my case it's under Akai -> Akai MPK88.device, as shown in the enclosed screen shot. Right Click on your .device file and select Show Package Contents. You will see a file called config.lua Copy then Paste this config.lua to a handy location, say your desktop. And make a backup copy to another location. Right click on it and open with TextEdit. You will see a definition of your device as shown in the second enclosed screen shot. It's easy to find all your controls there: faders, buttons, rotaries, what have you. Now decide which ones you wish to wrench from Logic's automatic assigns and use as ordinary Continuous Controllers for your own MIDI-Learn mappings. Do you see how some statements in the config.lua file start with a couple of hyphens? Those are "comment markers" that make the whole line just text, to be ignored by the application. Place a couple of hyphens followed by a space right before the definition of every control that you want Logic to leave alone. In my case it was faders 1-7, as fader 8 was already reserved as a volume control for the track. The result is shown in the enclosed third screen shot. Now save the edited config.lua, paste it back into the .device that you got it from. From now on Logic will ignore the "commented out" controls as if they never existed. For me, that's 7 faders to map how I want with any and all plugins. For now, I left the rotaries for Logic to auto-map, but I may end up repossessing these rotaries too. As you look at your own config.lua file you may come up with other ideas. To restore the old way (with Logic auto-mapping everything to Smart Controls), just paste the original config.lua (that you'd saved) back into your device's .device file in the tree. This was tested with both versions 10.2.4 and 10.4.0. 1 Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted February 28, 2018 Share Posted February 28, 2018 Thanx for sharing! Quote Link to comment Share on other sites More sharing options...
fernandraynaud Posted March 1, 2018 Author Share Posted March 1, 2018 Welcome. Glad to see you still have your Atari Notator. Mine's in a box, but at the rate things are going, what with modular rats' nests and CV and tattoos being the rage, we may yet have to pull 'em out. Wanna see something funny? I'm not sure exactly why, but I get a very creepy feeling watching this. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted March 3, 2018 Share Posted March 3, 2018 Perhaps because that was 30 years ago... and like me, you have the feeling that we won't to be there, in 30 years from now, to see what lies ahead... Quote Link to comment Share on other sites More sharing options...
airforceguitar Posted March 3, 2018 Share Posted March 3, 2018 Wow fernandraynaud that really takes me back! All the things that I lusted after and the people that I wanted to be like! BTW- thanks for the great controller tip. I may just plug a few “plastic thingies” back into my Mac! Quote Link to comment Share on other sites More sharing options...
Pete Posted March 13, 2018 Share Posted March 13, 2018 WOW — Fernandraynaud! Thanks so much for this VERY HELPFUL post unravelling the never-ending many-layered and elusive mysteries of MIDI Quote Link to comment Share on other sites More sharing options...
carlcaulkett Posted June 10, 2018 Share Posted June 10, 2018 Hello Fernand. Are you the same Fernand Raynaud who used to frequent the Delphi newsgroups many moons ago? If so, I remember exchanging a couple of messages with you, and I was very impressed with your depth of knowledge in Delphi. If the above post is anything to go by, your knowledge of Logic Pro is equally, if not more, profound! Quote Link to comment Share on other sites More sharing options...
fernandraynaud Posted July 18, 2018 Author Share Posted July 18, 2018 Hiya @caricaulkett thank you for the kind words. Yup, I'm the same Delphi and C and machine code hack. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted April 5, 2020 Share Posted April 5, 2020 Anyone know if there is any information about how I can write one of these lua scripts from scratch to support a midi controller that isn't on the list? Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted April 5, 2020 Share Posted April 5, 2020 Naively, I would try comparing the various lua files and also possibly what other files are present in the .device file... Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted April 5, 2020 Share Posted April 5, 2020 There aren’t any other files. Just a lua script which for most of them are nothing more then defining some attributes, but that is the part we need clarity, what those parameters are and the valid values. Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted April 5, 2020 Share Posted April 5, 2020 For the sake of curiosity, which controller are you referring to? Perhaps, comparing what MIDI comes out of each knobs/fader/pots (of that controller) with the defined MIDI events in one (or some of the) lua file(s), you could eventually try to trick Logic into believing it is dealing with that one... Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted April 5, 2020 Share Posted April 5, 2020 Alright..I figured it out...at least for my simple midi controller (iRig Keys 2 PRO). Now I have my 8 knobs automatically connected to smart controls! Cool! This is what I did for anyone else wondering... First use Audio Midi Setup to determine the Manfucaturer and model names that identify the controller. In my case its 'IK Multimedia' and 'iRig Keys 2 PRO' Then create a folder for user Midi device here, Note I created a sub folder with the manufacturer name: ~/Music/Audio Music Apps/Midi Device Scripts/IK Multimedia/ Now right click on the LogicPro App icon show package contents and navigate to the following place: /Applications/Logic Pro X.app/Contents/Frameworks/MACore.framework/Versions/A/Resources/MIDI Device Scripts/ Look for a simple device to start with. They are all very different honestly. I chose the Arturia KeyLab 25 since it seemed relatively simple. My controller is even more simple. Copy and paste the device file from there over to the folder I created above under Audio Music Apps. Rename the device file to 'iRig Keys 2 PRO.device' and right click on it to show package contents. Inside will be revealed a config.lua file, open it with the editor of your choice. Below you will see the before and after versions of the file after I deleted a bunch of sysex stuff and knobs that don't exist on my controller. I may still have to remove pitchblende and mod wheel since I want to make sure those don't ever get blocked by the control surface system. But anyway you can get the idea by comparing these two file versions to see what I changed. More or less: Removed non-relevant sysex stuff Changed all occurrences of manufacturer and keyboard name Change the CC#'s on the knobs according to how my midi controller is setup. Note its Hexidecimal BEFORE SysexValues = { -- P1-P5 [0x4A] = 1, [0x47] = 2, [0x4C] = 3, [0x4D] = 4, [0x5D] = 9, -- P6-P10 [0x12] = 5, [0x13] = 6, [0x10] = 7, [0x11] = 8, [0x5B] = 0x0a, --Volume [0x07] = 0x30, } function controller_midi_out(midiEvent,name,valueString,color) if midiEvent[0] == 0xB0 then receivedEvents = true if SysexValues[midiEvent[1]] then --print("converting cc to sysex") --print(midiEvent[0],midiEvent[1],midiEvent[2],name,valueString,color, SysexValues[midiEvent[1]]) return {midi={0xf0,0x00,0x20,0x6B,0x7F,0x42,0x02, 0x00, 0x00, SysexValues[midiEvent[1]], midiEvent[2], 0xf7 }, outport='KeyLab 25'} else --print("not a knob cc") --print(midiEvent[0],midiEvent[1],midiEvent[2],name,valueString,color) end end return nil end -- Define the knobs, buttons, etc. of the device -- This is also used to check if this device is a match (model, manufacturer and/or device inquiry status) function controller_info() return { -- model name for this device model = 'KeyLab 25', -- manufacturer name for this device manufacturer = 'Arturia', -- All buttons, knobs, keyboard, possible pedals are defined here items = { -- The default midiType is 'Absolute', it only has to be defined, if it is different {name='Pitch Bend', label='Pitch', objectType='Wheel', midi={0xE0,MIDI_MSB,MIDI_LSB}}, {name='Modulation', label='Mod', objectType='Wheel', midi={0xB0,0x01,MIDI_LSB}}, {name='Keyboard', label='KeyLab 25', objectType='Keyboard', midiType='Keyboard', startKey=48, numberKeys=25, midi={0x90,MIDI_Wildcard,MIDI_Wildcard}}, {name='Channel Pressure', objectType='Wheel', midi={0xD0,MIDI_LSB}}, {name='Sustain Pedal', label='Sustain', objectType='Sustain Pedal', midiType='Momentary', midi={0xB0,0x40,MIDI_LSB}}, {name='Expression Pedal', label='Expr', objectType='Pedal', midi={0xB0,0x0B,MIDI_LSB}}, {name='REWIND', label='REWIND', objectType='Button', midiType='Momentary', midi={0xB0,0x35,MIDI_LSB}}, {name='FORWARD', label='FORWARD', objectType='Button', midiType='Momentary', midi={0xB0,0x34,MIDI_LSB}}, {name='STOP', label='STOP', objectType='Button', midiType='Momentary', midi={0xB0,0x33,MIDI_LSB}}, {name='PLAY', label='PLAY', objectType='Button', midiType='Momentary', midi={0xB0,0x36,MIDI_LSB}}, {name='RECORD', label='RECORD', objectType='Button', midiType='Momentary', midi={0xB0,0x32,MIDI_LSB}}, {name='CYCLE', label='CYCLE', objectType='Button', midiType='Momentary', midi={0xB0,0x37,MIDI_LSB}}, -- BUTTONS {name='Button 1', label='1', objectType='Button', midiType='Momentary', midi={0xB0,0x16,MIDI_LSB}}, {name='Button 2', label='2', objectType='Button', midiType='Momentary', midi={0xB0,0x17,MIDI_LSB}}, {name='Button 3', label='3', objectType='Button', midiType='Momentary', midi={0xB0,0x18,MIDI_LSB}}, {name='Button 4', label='4', objectType='Button', midiType='Momentary', midi={0xB0,0x19,MIDI_LSB}}, {name='Button 5', label='5', objectType='Button', midiType='Momentary', midi={0xB0,0x1A,MIDI_LSB}}, {name='Button 6', label='6', objectType='Button', midiType='Momentary', midi={0xB0,0x1B,MIDI_LSB}}, {name='Button 7', label='7', objectType='Button', midiType='Momentary', midi={0xB0,0x1C,MIDI_LSB}}, {name='Button 8', label='8', objectType='Button', midiType='Momentary', midi={0xB0,0x1D,MIDI_LSB}}, {name='Button 9', label='9', objectType='Button', midiType='Momentary', midi={0xB0,0x1E,MIDI_LSB}}, {name='Button 10', label='10', objectType='Button', midiType='Momentary', midi={0xB0,0x1F,MIDI_LSB}}, {name='Volume', label='Volume', objectType='Knob', midi={0xB0,0x07,MIDI_LSB}, outport='KeyLab 25'}, -- BANK 1 {name='Knob 1', label='Cutoff', objectType='Knob', midi={0xB0,0x4A,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 2', label='Resonance', objectType='Knob', midi={0xB0,0x47,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 3', label='LFO Rate', objectType='Knob', midi={0xB0,0x4C,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 4', label='LFO Amount', objectType='Knob', midi={0xB0,0x4D,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 5', label='Chorus Amount', objectType='Knob', midi={0xB0,0x5D,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 6', label='Param 1', objectType='Knob', midi={0xB0,0x12,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 7', label='Param 2', objectType='Knob', midi={0xB0,0x13,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 8', label='Param 3', objectType='Knob', midi={0xB0,0x10,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 9', label='Param 4', objectType='Knob', midi={0xB0,0x11,MIDI_LSB}, outport='KeyLab 25'}, {name='Knob 10', label='Delay Amount', objectType='Knob', midi={0xB0,0x5B,MIDI_LSB}, outport='KeyLab 25'}, -- FADERS {name='Fader 1', label='F1', objectType='VFader', midi={0xB0,0x49,MIDI_LSB}}, {name='Fader 2', label='F2', objectType='VFader', midi={0xB0,0x4B,MIDI_LSB}}, {name='Fader 3', label='F3', objectType='VFader', midi={0xB0,0x4F,MIDI_LSB}}, {name='Fader 4', label='F4', objectType='VFader', midi={0xB0,0x48,MIDI_LSB}}, {name='Fader 5', label='F5', objectType='VFader', midi={0xB0,0x50,MIDI_LSB}}, {name='Fader 6', label='F6', objectType='VFader', midi={0xB0,0x51,MIDI_LSB}}, {name='Fader 7', label='F7', objectType='VFader', midi={0xB0,0x52,MIDI_LSB}}, {name='Fader 8', label='F8', objectType='VFader', midi={0xB0,0x53,MIDI_LSB}}, {name='Fader 9', label='F9', objectType='VFader', midi={0xB0,0x55,MIDI_LSB}}, -- BANK 2 {name='Knob 1', label='P1', objectType='Knob', midi={0xB0,0x23,MIDI_LSB}}, {name='Knob 2', label='P2', objectType='Knob', midi={0xB0,0x24,MIDI_LSB}}, {name='Knob 3', label='P3', objectType='Knob', midi={0xB0,0x25,MIDI_LSB}}, {name='Knob 4', label='P4', objectType='Knob', midi={0xB0,0x26,MIDI_LSB}}, {name='Knob 5', label='P5', objectType='Knob', midi={0xB0,0x27,MIDI_LSB}}, {name='Knob 6', label='P6', objectType='Knob', midi={0xB0,0x28,MIDI_LSB}}, {name='Knob 7', label='P7', objectType='Knob', midi={0xB0,0x29,MIDI_LSB}}, {name='Knob 8', label='P8', objectType='Knob', midi={0xB0,0x2A,MIDI_LSB}}, {name='Knob 9', label='P9', objectType='Knob', midi={0xB0,0x2B,MIDI_LSB}}, {name='Knob 10', label='P10', objectType='Knob', midi={0xB0,0x2C,MIDI_LSB}}, -- FADERS {name='Fader 1', label='F1', objectType='VFader', midi={0xB0,0x43,MIDI_LSB}}, {name='Fader 2', label='F2', objectType='VFader', midi={0xB0,0x44,MIDI_LSB}}, {name='Fader 3', label='F3', objectType='VFader', midi={0xB0,0x45,MIDI_LSB}}, {name='Fader 4', label='F4', objectType='VFader', midi={0xB0,0x46,MIDI_LSB}}, {name='Fader 5', label='F5', objectType='VFader', midi={0xB0,0x57,MIDI_LSB}}, {name='Fader 6', label='F6', objectType='VFader', midi={0xB0,0x58,MIDI_LSB}}, {name='Fader 7', label='F7', objectType='VFader', midi={0xB0,0x59,MIDI_LSB}}, {name='Fader 8', label='F8', objectType='VFader', midi={0xB0,0x5A,MIDI_LSB}}, {name='Fader 9', label='F9', objectType='VFader', midi={0xB0,0x5C,MIDI_LSB}}, {name='Endless Knob 1', label='Category', objectType='Knob', midiType='DirectionAndSpeed', midi={0xB0,0x70,MIDI_LSB}}, {name='Endless Knob 2', label='Preset', objectType='Knob', midiType='DirectionAndSpeed', midi={0xB0,0x72,MIDI_LSB}}, {name='Sound', label='Sound', objectType='Button', midiType='Momentary', midi={0xB0,0x76,MIDI_LSB}}, {name='Multi', label='Multi', objectType='Button', midiType='Momentary', midi={0xB0,0x77,MIDI_LSB}} } } end AFTER -- Copied from Arturia 25, tweaked to kind of work for iRig Keys 2 PRO function controller_midi_out(midiEvent,name,valueString,color) return nil end -- Define the knobs, buttons, etc. of the device -- This is also used to check if this device is a match (model, manufacturer and/or device inquiry status) function controller_info() return { -- model name for this device model = 'iRig Keys 2 PRO', -- manufacturer name for this device manufacturer = 'IK Multimedia', -- All buttons, knobs, keyboard, possible pedals are defined here items = { -- The default midiType is 'Absolute', it only has to be defined, if it is different {name='Pitch Bend', label='Pitch', objectType='Wheel', midi={0xE0,MIDI_MSB,MIDI_LSB}}, {name='Modulation', label='Mod', objectType='Wheel', midi={0xB0,0x01,MIDI_LSB}}, --{name='Keyboard', label='iRig Keys 2 PRO', objectType='Keyboard', midiType='Keyboard', startKey=48, numberKeys=37, midi={0x90,MIDI_Wildcard,MIDI_Wildcard}}, {name='Sustain Pedal', label='Sustain', objectType='Sustain Pedal', midiType='Momentary', midi={0xB0,0x40,MIDI_LSB}}, --{name='Expression Pedal', label='Expr', objectType='Pedal', midi={0xB0,0x0B,MIDI_LSB}}, {name='Data Knob', label='Data', objectType='Knob', midi={0xB0,0x0B,MIDI_LSB}}, --{name='Volume', label='Volume', objectType='Knob', midi={0xB0,0x07,MIDI_LSB}, outport='iRig Keys 2 PRO'}, {name='Knob 1', label='P1', objectType='Knob', midi={0xB0,0x0C,MIDI_LSB}}, {name='Knob 2', label='P2', objectType='Knob', midi={0xB0,0x0D,MIDI_LSB}}, {name='Knob 3', label='P3', objectType='Knob', midi={0xB0,0x0E,MIDI_LSB}}, {name='Knob 4', label='P4', objectType='Knob', midi={0xB0,0x0F,MIDI_LSB}}, {name='Knob 5', label='P5', objectType='Knob', midi={0xB0,0x10,MIDI_LSB}}, {name='Knob 6', label='P6', objectType='Knob', midi={0xB0,0x11,MIDI_LSB}}, {name='Knob 7', label='P7', objectType='Knob', midi={0xB0,0x12,MIDI_LSB}}, {name='Knob 8', label='P8', objectType='Knob', midi={0xB0,0x13,MIDI_LSB}}, } } end Now Restart LogicPro. When starting up you will be prompted if you want to enable the connected midi controller, etc.. fine. IF you go into Midi Controller prefs you will now see it shows up in the list and is enabled as a "known" midi controller. Load up a track....the knobs are automatically connected to smart controls. sweet. Attached is the device file I made so far, for the iRig Keys 2 PRO, in case anyone ever looks for it. iRig Keys 2 PRO.device.zip Quote Link to comment Share on other sites More sharing options...
Atlas007 Posted April 10, 2020 Share Posted April 10, 2020 Oh! That's a great one!! Thanx for sharing!! Quote Link to comment Share on other sites More sharing options...
fernandraynaud Posted August 10, 2020 Author Share Posted August 10, 2020 Great, thanks! I wonder if Apple's new Control Surfaces help book has any new info on how to build a more complex one. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.