Writing MIDI Notes

Hi Everyone,

I'm looking to write a program to generate some basic midi notes based on buttons.

I have the project all laid out in my mind, the only thing I am unfamiliar with is writing/transmitting MIDI notes. At first I thought I would need a shield, but a bit of googling revealed that you can simply use the serial ports.

As I understand it, the 4 most significant bits refer to the command you wish to send, and the 4 least significant identify the channel number.

I have previous experience joining two bytes to make an int and vice versa, but I'm not sure how to go about building a full byte from scratch if you will.

Can anyone recommend the documentation that will help me achieve this correctly? I imagine I'll be using bit shifting, similar to what I did joining bytes together, but I'm unsure how I should go about configuring individual bits in a byte.

*just a though now: would it actually be easier if I calculated the decimals that represent the bit states I want and then add the numbers to the byte?

Thanks in advance :slight_smile:

There are various midi libraries that take the grunt work out of it. Also, while you can "just use the serial port" you do need the additional opto-isolating components.

KeithRB:
There are various midi libraries that take the grunt work out of it. Also, while you can "just use the serial port" you do need the additional opto-isolating components.

Cheers, I hadn't seen anything regarding optoisolators, will look into it.

Then maybe a shield would be a good idea.