Hello I am having an issue with my Hui protocol emulation program. I have the first piece of code sending note 90 pp 7f every 800ms, in response to the message of 90 00 00 being sent from pro tools. This seems to be working properly. The problem comes in after this, I believe as a result of this. I have three buttons on a breadboard and when I press button1 it will send a midi message to start playback in pro tools. the second button is a stop button, when pressed it sends midi message to stop playback, and the third button mutes track1. Each one of these buttons semi works. When I press button1 pro tools will start playing but in order to get one of the other buttons to work I have to press the reset button on the arduino, then I can press one of the other buttons. After that I have to reset the board again. I think the problem is in the ping request because it happens every 800ms using delay(800) it doesn't allow me to use other functions. Does anybody have any idea why this could be happening and how I can resolve this. I need the ping response to happen so pro tools knows there is a Hui connected hardware device, but I also need to send other commands in addition, otherwise this whole project would be meaningless.
Anybody?? This issue has been driving me nuts for days now and I'm not sure how to fix it. I've heard of things like interrupts, and threads, but I also have seen posts about threading not being available on arduino.
I can't believe it's been two days and nobody seems to be able or wants to offer provide any possible solutions to figure this out.
Without posting any of your code, expecting help in this forum generally won't happen. Obviously there's something seriously wrong if you have to reboot the Arduino to send a new MIDI code.
Apart from that, if you want to emulate a MCU, you only need to SEND MIDI from an Arduino to the Host. In this case, Pro Tools.
The only reason Pro Tools needs to send anything back would be for a real MCU to update it's LCD display or the faders/switches/lights. There should be a way to select a control surface in Pro Tools, select the MIDI input and skip the MIDI output back to the Arduino altogether (or just unplug it). The HUI protocol is pretty chatty otherwise (and lots of SYSEX IRC).
Thus controlling the host's transport or other functions is nothing more than sending a MIDI note value to the host and telling the host it's coming from a MCU. I've done it with Ableton's Live and Digital Performer.
Unless you're planning on a full HUI or Baby HUI emulation on an Arduino in which case I'd wish you the best of luck with it... :)
I was finally able to get the arduino to stop locking up. It seems when the handshake is happening it doesn't leave much room for any other commands to take place. I currently have pro tools sending the ping signal to arduino but arduino not responding and the three switches are working fine. When I have the arduino respond to the ping from pro tools, is when the thing starts becoming unresponsive. Currently I have three buttons. One is play, One is stop, and one is mute for track number 1. I start hairless midi, then start pro tools. Go to peripherals, the controllers. I then set up Hui on the correct ports hairless is last evening on, then hit OK. Upon doing so if I have the full code for Hui handshake I get no message telling me there is no Hui device and my three buttons will not function normally. They will either not work or they will work with serious delay, but if I don't enable the code for Hui handshake I get Hui not connected message, but my three buttons will work as expected. I will post my code when I am at an area when I can get on my laptop
I've never used Hairless MIDI in any of my many Arduino MIDI setups since I am dealing with MIDI for both hardware and software in many cases. I build a small MIDI interface for the Arduino and use a standard MIDI interface on the computer. When I am working in MIDI, I stay strictly MIDI.
ProTools pinging would be annoying, not to mention a waste of serial bandwidth, so you'll have to have your sketch respond correctly every 500-800ms with the proper note and velocity. That's the part of your sketch that you'd need to work on first. Once you get ProTools to shut up, then work on the rest of the code to send the notes for control of ProTools.
Sorry I didn't respond sooner. How have you made out with this? Could you post the code you have so far?
I've created a way for arduino to be a HUI device without the need for Hairless... I used to use it myself but it's not nessesary anymore (Google "Hiduino")