Hello,
sorry to query this in the Arduino forum, but I have queried this on the intel forum and as of yet haven't found a solution.
I have built a step sequencer using an Arduino sketch on the Galileo gen 2 board, it uses a 2d array that is filled with information for midi note, velocity, cc values etc.
The code is all working and Im super excited to hear it triggering sounds, but thats where I am stuck.
Ive tralled the web and all I can find (from information provided by an Intel employee) is information on using ALSA on the linux side of the board.
As I have zero experience in using linux its all a little over my head and from what I've read Im uncertain if I would be able to get ALSA to communicate with my MacBook.
I have an old school 5 pin din breakout board that you would connect to RX and TX on an Arduino board, but none of the libraries for the midi on the Arduino work on the Galileo.
Is this a simple thing to achieve, is it just a case of sending midi hex information out using Serial.println(midi hex info here); or is it not that easy?
I've made a system I'm so proud of and watching it playing away (16x8 led matrix, oled screen) displaying my sequences, but with no sounds getting triggered is heart breaking.
If anyone could shed some light on this you would make my year.
thanks in advance
Lee
Is this a simple thing to achieve, is it just a case of sending midi hex information out using Serial.println(midi hex info here)
Yes it should be that simple. But you need to use serial write not serial print to send those bytes in bit format. It is not hex it is not ASCII, it is just the binary bit patterns you need to send.
My only worry is if the Intel machine can cope with the MIDI baud rate.
Hello Mike,
Well I've got to say it, you my friend are a star.
At first I read binary and my heart sank but having just had a look online at how midi binary is written, I think my tiny mind can handle that. I get a sound card tomorrow that has old school midi on it so can't test if baud rate can be handled but it looks like I might be able to implement the code by tonight.
Just seen the (value, BIN) method too in another post.
do you have any idea how i could attach two binary values together so 1001 "note on" and (5 , BIN) becomes 10010100.
I know thats a super noob question but Im totally new to coding outside of my usual "arduino to max msp" comfort zone.
Thanks in advance
Lee
When I say binary that is the form of the transmission not necessarily the format you have to deal with the constants. When you assign a variable a value you can use any number base supported by C. What C does is to convert it into binary before it stores it. It is that value you want to send, not what that value represents in any number base. You get the latter with a serial print, and the former with a serial write.
Many people prefer to use hex to specify the constants for commands and decimal for the parameters. So the hex value of 0x90 is the note on command, to merge that with the channel number 0 to 15 you simply OR the two together.
command = 0x90;
channel = 4;
toSend = command | channel;
Note that channels run from 0 to 15 in programming and these correspond to midi channels 1 to 16, a bit confusing.
To send this you can use this function
void sendMIDI(byte command, byte note,byte velocity){
Serial.write(command | channel);
Serial.write(note);
Serial.write(velocity);
}
Where channel is a global variable.
Hi Mike,
Thanks so much. I have not been able to get the Midi working through my Midi breakout board, but your code help has meant I can get it running through a serial to midi software converter.
It has a rather large latency but I can deal with that for a while. I have found a post on the Intel forum where someone had made a hardware baud rate converter and I have found some info online on how to build them, so thats my next step.
But if it wasn't for you I would still be getting no sounds triggered at all, but now I do. 
Thankyou so much
Lee
Just a recap. The software converter doesn't have an latency. The latency was the graphical button bang I was using in max msp.
But I'm still going to make this unit a fully working midi device as a learning study.
It's a shame intel have discontinued this board, but the arduino tre looks like it will be a beast.
Lee
It's a shame intel have discontinued this board,
Well it was not a very good board. I had the origional one and the design concepts were poor. It was rather like putting a V-8 engine in a golf buggy.
I would be interested in the link for a hardware baud rate converter, if you need one of those then an Arduino would be a good start.
Hi Mike,
Here is a link to a baud rate converter build. Ive not really sank my teeth into it yet though as it's not something I plan to do immediately. I was thinking maybe I could slave an Arduino micro to the Galileo maybe that way I could get midi USB. But I'm unsure if using the tx and rx ports would disable the USB port on the micro (I haven't ever slave/mastered two boards before). I've kinda ran out of cash for the project at the minute so will back on it next month when my pay slip lands 
Lee
Thanks, it is just as I thought, a stand alone Arduino chip.
Their is no reason why you can't use an Arduino for that circuit, maybe a cheap Nano look alike.
Having said that I can't see what advantage it would be to have a Galileo on the back end. You might just do it all with an Arduino and be done.
The sketch I have wrote is pretty huge and needs to do a lot of processing from a timer interrupt. I've tried running it on a mega and it just freezes up. I originally bought a due for the project but the board was faulty and as I'm using a lot of adafruit 5v i2c stuff with it, I didn't want to have to mess around with logic converters and powering things externally. Was scared I'd burn the board (or my house down). I want to have the processing power and storage space to keep adding functions to the step sequencer. For smaller projects micro is my go to board as I can use the arco library, but this project has been a lot of trial and error. I've learned so much from it though (sometimes when things go wrong it turns out to be more valuable).
Just can't wait to get my hands on an arduino tre, then I can turn all my max msp patches into a single hardware unit.
Lee