Jump to content

Can't get Logic to recognize the controller I made using a Teensy (Arduino) - help appreciated!


ReelToLogic

Recommended Posts

I just built a MIDI CC controller with five 100mm sliders and a foot-pedal using this thread as a guide (https://www.gearslutz.com/board/music-computers/1240121-diy-midi-cc-controller-w-100mm-sliders-under-100-2018-edition.html#post15325303). Using MIDI-OX (on my Windows laptop) I can see that all sliders are outputting CC values between 1 and 127 perfectly, and there are no "extraneous" signals when I'm not moving a slider. All great so far.

 

When I plugged the controller into my Mac and powered up Logic, the Teensy controller was not recognized and therefore didn't work. I looked at Logic\Preferences\Control Surfaces and my AKAI LPD8 shows up but not the Teensy. When I looked at Logic\Preferences\MIDI, I did see "Teensy MIDI" listed with a check in the ON column (and it was BOLDED) so the Teensy was recognized at some level by Logic. I then went to Logic\Control Surfaces\Setup\New but I didn't see the Teensy in the list of options to install and don't know how I could add it.

 

Has anyone used a custom Teensy controller with Logic? If so, I'd greatly appreciate any advice! After the time I put into this project it would be disappointing if I couldn't use it with Logic.

Link to comment
Share on other sites

It's not a control surface, it's a generic MIDI controller.

 

Control surfaces are intelligent devices that have bi-directional communication with Logic, that support a particular control protocol. I don't think you have built an MCU! Do not set your device up as a control surface, as it is just a generic MIDI device that sends MIDI to Logic. If you have done so, undo any control surface stuff you have done, because this will prevent MIDI reaching Logic.

 

Once you've done that, your MIDI CC's generated will be recordable just like any other MIDI data.

Link to comment
Share on other sites

Thank you very much for the prompt reply. I haven't "set up" the device at all. I just plugged it into my Mac and then started Logic. I hoped that the signals from the Teensy would be recognized but they are not. Is there something I need to do in order for Logic to see this as a generic MIDI controller?
Link to comment
Share on other sites

You can use Snoize's MIDI Monitor to observe the MIDI output from your controller to verify it's sending MIDI to the system.

 

When it is sending, watch Logic's MIDI reception display in the transport window - is it showing that MIDI CC's are being recognised when you move the faders?

 

Make sure nothing in your control surface setup window is set to the MIDI ports your controller is sending on, as well.

 

If your device is successfully sending MIDI, Logic will be receiving it, there's nothing special you have to do. Check with MIDI Monitor first to make sure it's sending data, and go from there.

Link to comment
Share on other sites

Thanks for the helpful suggestions. It definitely provided some insights, but I'm not quite there yet. I installed Snoize's MIDI Monitor and here's what I found;

When I first boot up my Mac, MIDI Monitor can see all of the CC messages sent by my Teensy Controller (as well as those from my MIDI Keyboard, Mod wheel, etc). But after I start Logic, MIDI Monitor still sees all the messages sent from my MIDI Keyboard, Mod wheel, etc), but it no longer sees any signals from my Teensy controller.

 

So something is happening when I start Logic that is preventing my Teensy controller from functioning.

 

You previously suggested I ensure that nothing in my control surface setup is set to the MIDI ports my Teesy is sending on, but I'm not sure how to do that. I looked at the "Audio MIDI Setup" utility and although my Teensy MIDI controller shows up, I can't edit anything (like ports). Any suggestions for next steps will be much appreciated.

Link to comment
Share on other sites

MIDI Monitor can see all of the CC messages sent by my Teensy Controller (as well as those from my MIDI Keyboard, Mod wheel, etc). But after I start Logic, MIDI Monitor still sees all the messages sent from my MIDI Keyboard, Mod wheel, etc), but it no longer sees any signals from my Teensy controller.

 

Are you "spying" on the MIDI port where the data from your controller is coming in on? Or are you monitoring some other MIDI port?

 

There's no real way that Logic can prevent your controller transmitting data, unless possibly some driver or other that's loading with Logic is killing the MacOS MIDI server (but you'd get a "MIDI timeout" warning in Logic if that was happening though).

 

So something is happening when I start Logic that is preventing my Teensy controller from functioning.

 

Hmm, Logic literally has no influence on your controller sending MIDI bytes to your Mac. it's just another MIDI application that can listen to and send MIDI. it can't "stop" another device, driver or app from sending or receiving MIDI to/from MacOS.

 

If you load some other application in place of Logic, do you see still the same MIDI problem? Say, Hosting AU, or Ableton Live, or something?

 

You previously suggested I ensure that nothing in my control surface setup is set to the MIDI ports my Teesy is sending on, but I'm not sure how to do that. I looked at the "Audio MIDI Setup" utility and although my Teensy MIDI controller shows up, I can't edit anything (like ports). Any suggestions for next steps will be much appreciated.

 

I meant go to the control surface setup window, and if you have any control surfaces defined there, check they haven't been allocated to MIDI ports that your controller is using, otherwise that data will be intercepted and stolen by Logic and you won't be able to use it how you want. If you don't have any control surfaces defined there, then that's fine. You can also try to select the "Bypass All Control Surfaces" preference option just to rule this stuff out.

Link to comment
Share on other sites

Thanks again for the helpful responses. Based on the comments and suggestions here's what I've done:

 

1) I had been using MIDI Monitor to look at the Teensy Port directly, but I tried the "spying" option as well. Both times I could see MIDI data from my Teensy before starting Logic, but it stopped as soon as Logic started up. I don't think there's any Port conflicts as my MIDI Keyboard appears to be using Port1 and Port2 and my Teensy is listed as using a Port called Teensy MIDI.

 

2) I tried two other stand-alone music applications instead of Logic. Both Orchestral Tools' SINE player and EastWest's Engine recognized my Teensy MIDI controller and the Teensy kept on working when the stand-alone players were running. It was fun to play a VI and be able to use my new controller! But again, as soon as I launched Logic, I stopped seeing any data from the Teensy.

 

3) I looked at my "control surface setup" window in Logic. I don't have any control surfaces installed, but I tried checking "Bypass All Control Surfaces" anyway. Unfortunately that didn't make any difference.

 

4) My Teensy is set up as a MIDI device as cmrick suggested. And it shows up as a MIDI Input in SINE and the EW Engine, just not in Logic.

 

I should note MIDI Monitor stops showing any data coming from my Teensy controller as soon as Logic starts, and it doesn't come back after I close Logic. The only way I can get it going again is to reboot my Mac. So whatever is going on, does not correct itself when Logic is no longer running. I've done the experiment more than half a dozen times now and every time my Teensy sends CC data to my Mac until Logic starts and then immediately stops doing so. Any other suggestions? This is very strange...

Link to comment
Share on other sites

I should note MIDI Monitor stops showing any data coming from my Teensy controller as soon as Logic starts, and it doesn't come back after I close Logic. The only way I can get it going again is to reboot my Mac. So whatever is going on, does not correct itself when Logic is no longer running. I've done the experiment more than half a dozen times now and every time my Teensy sends CC data to my Mac until Logic starts and then immediately stops doing so. Any other suggestions? This is very strange...

 

Strange indeed... What's your OS version and Logic version?

 

Can you try this is a new temporary user account, to rule out any problems with your user account?

Have you tried connecting on different USB ports, different cables, not through a hub etc?

Do you have any other MIDI devices? Do they carry on working with Logic running?

Link to comment
Share on other sites

Can't help, but it looks very similar to the problems with bluetooth midi people reported here, the midi works fine with other apps, but dies as soon Logic is opened...

 

Do you have a thread link for this?

I'm sure I've seen more of these, I'll keep looking... :)

EDIT Looks like a KORG problem, though...

Logic terminates bluetooth connection to Korg's microKEY Air

Midi bluetooth not working right

Link to comment
Share on other sites

Thanks for the additional suggestions and questions. I think you're onto something asking about my OS. But first...

 

* I first tried plugging my Teensy directly into the Mac (I had been using a hub),using a different USB cable and got the same behavior.

* I do have other MIDI devices (Keystation 88 Keyboard, LPD8 Controller) and they all keep working fine when Logic is running.

* When I'm in Logic, and look at Preferences \ MIDI \ Inputs, I see "Teensy MIDI" listed and it is bolded and checked, so Logic sees my Teensy.

* I don't know if this is important, but when I connect my Teensy the OS gives me a message saying "Changed Number of MIDI Inputs/Outputs. 5 Inputs, 3 Outputs" and when I unplug it, I get the same message but with "4 Inputs, 2 Outputs". So my Teensy adds both 1 Input and 1 Output, but it only needs to act as in Input to my Mac.

 

But...I am still on Sierra (10.12.6) and running Logic version 10.4.3, both of which are getting a bit old. The reason is that (with the exception of this new issue with my Teensy controller), my system has been absolutely rock solid; no Logic crashes, no annoying bugs, everything just works perfectly. I'm due to replace my Mac, and would do so right now, but I want to wait until the new MINI's with Apple Silicon can handle more RAM, so I've been keeping my current system going and not wanting to mess up a good thing.

 

One reason that I suspect my slightly outdated operating system and/or Logic version could be the reason for this strange behavior is that a while back a friend gave me his 2014 Mac MINI to use when I was traveling and that system also has Sierra (10.12.6) and Logic (10.4.4). I just tried my Teensy controller on that system and it exhibited the exact same behavior. I plugged in my Teensy, loaded MIDI Monitor and could see that the small portable MIDI keyboard worked fine before and after Logic was loaded, but my Teensy controller worked fine before Logic started but stopped as soon as I loaded Logic. I'm not sure why this would happen, but it certainly points toward the OS or Logic version as the culprit.

 

So I think I have three options:

1) Not use my Teensy controller until I upgrade to a new Mac MINI with Apple Silicon and more RAM (hopefully in the next year?)

2) Upgrade my Mac's operating system and Logic (perhaps to Mojave - but I'm quite hesitant to do this!)

3) Try loading my Teensy with software that makes it look like an MCU (https://github.com/tttapa/Control-Surface#readme) and see if that makes any difference.

 

Thanks again for the very helpful suggestions. Please let me know if you disagree with my conclusions above, or if you have other options I could consider to resolve this issue with my current OS & Logic.

Link to comment
Share on other sites

Hmm, I don't think it's likely to be an issue magically solved with a different OS version (it's not impossible, but seems unlikely.)

 

In using Logic since the 90s I've literally never had, or heard of, an instance where loading Logic stops another device sending MIDI to the Mac. Unless the driver of your controller is doing something bad, perhaps? Does it act as USB class compliant? Do you have any other Mac systems you can try it on?

 

I'm about out of suggestions at this point, other than checking your Console log to see if any errors are generated when the controller dies...

Link to comment
Share on other sites

You were correct that the OS or version of Logic made no difference (I tried on a system running Mojave). Thanks once more for all your suggestions.

 

But I'm happy to report that I found a solution and I'm posting it here in case others have this issue in the future. MIDI controllers which only transmit data should be designed to read and ignore all incoming messages. If software (like Logic) is sending messages to Teensy, it can cause problems with USB buffers filling up with never-read messages. Logic ignores controllers that generate a flood of messages, and even though this controller is not providing any signals when the sliders are not moving, it appears that it needs to ignore any incoming MIDI messages to make Logic happy. This must not happen with some other DAWs because the example I copied did not include the code below and others seem to have used it successfully.

 

I added the code below right after "void loop(){" and my Teensy controller now works with Logic.

 

// MIDI Controllers should discard incoming MIDI messages.

while (usbMIDI.read()) {

// read & ignore incoming messages

}

 

I found the solution here:https://www.pjrc.com/teensy/td_midi.html

Link to comment
Share on other sites

Thanks for updating this with your findings.

 

If software (like Logic) is sending messages to Teensy, it can cause problems with USB buffers filling up with never-read messages.

 

So your controller defined a MIDI input port that it announces to MacOS, but crashes if it receives MIDI input?

 

In this case, probably it should only announce itself as a MIDI source, and not a MIDI destination, and not open a MIDI input port in this case (or I guess ignore the MIDI input gracefully, as your new code solution does).

 

Logic ignores controllers that generate a flood of messages, and even though this controller is not providing any signals when the sliders are not moving, it appears that it needs to ignore any incoming MIDI messages to make Logic happy.

 

How did you arrive at this conclusion? I've never seen Logic ignoring any controllers based on a "flood" of MIDI messages (after all, a flood of messages is exactly what Logic is designed to record/react too!).

 

It's possible you had some kind of MIDI loop going on in Logic (ie, your incoming MIDI messages were being routed out of Logic back to your controller that caused it to only "crash" when running Logic) perhaps but it seems weird. When spying on the MIDI ports with Snoize, when you generated MIDI data with your faders, did you observe that those events generated by the faders were also coming back out of Logic to your controller? (and thus causing it to crash).

 

If I was going to make a *guess* as to what was happening, I'd say that when Logic runs (or when the MIDI port config changes), Logic sends out some exploratory MIDI to available MIDI ports to determine if there are control surfaces present and therefore to install them, so your controller was getting a few MIDI bytes that it wasn't expecting, confusing it and causing it to lock up. You'd assumed that it shouldn't be receiving MIDI as you weren't sending it anything - but *Logic* was sending a few bytes to it. Now you are correctly handling them, your controller is no longer locking up.

 

My conclusion is this is not at all a Logic problem as you concluded, and nothing to do with Logic ignoring "floods of messages", but it was simply the software in your controller wasn't handling a necessary case.

 

Anyway, glad you got it working, and this thread might prove to be a useful resource to others encountering something similar.

Link to comment
Share on other sites

Thanks for following this thread and for your continued responses. Your explanation makes a lot of sense. I want to apologize if my proposed explanation for why this additional code solved the problem was off the mark. During my searches over the past couple of days I had read the comment about Logic disconnecting if it got a lot of "garbage MIDI" *, but I think I took it out of context and your explanation makes more sense in my case. I realize that this issue was with a custom controller that I built and programmed so in no way did I intend to disparage Logic!

 

* https://forum.pjrc.com/threads/57678-Teensy-3-2-Midi-controller-not-showing-in-Logic-Pro which references this other thread:

https://forum.pjrc.com/threads/45325-Teensy-LC-Logic-Pro-X-help

Edited by ReelToLogic
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...