{"id":136,"date":"2014-04-14T19:33:52","date_gmt":"2014-04-14T19:33:52","guid":{"rendered":"https:\/\/arduino-developer.com\/arduino\/?p=136"},"modified":"2014-09-26T18:01:00","modified_gmt":"2014-09-26T18:01:00","slug":"using-midi","status":"publish","type":"post","link":"https:\/\/arduino-developer.com\/arduino\/programming\/midi\/using-midi","title":{"rendered":"Using Midi"},"content":{"rendered":"<p>\n<a href=\"http:\/\/www.electronic-products-design.com\/geek-area\/communications\/midi\/midi-comms\">MIDI Comms<\/a>\n<\/p>\n<h4>\nMIDI Library<br \/>\n<\/h4>\n<p>\nInstall the library from <a href=\"http:\/\/playground.arduino.cc\/Main\/MIDILibrary\">here<\/a>.\n<\/p>\n<p>\nThis library documentation seems somewhat overwhelming and difficult to carry out simple tasks such as specifying a different UART TX port when we looked. &nbsp;If you only need to send simple Note On and Note Off commands then you can just use the UART instead if preferred.\n<\/p>\n<h4>\nMIDI Using Basic&nbsp;UART Functions<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n #define  MIDI_OUT_CHANNEL    0x0        \/\/0x0 to 0xF\r\n \r\n  \/\/----- SETUP MIDI PORT -----\r\n  Serial.begin(31250, SERIAL_8N1);\r\n \r\n \r\n \r\n  \/\/MIDI Note On\r\n  Serial1.write(0x90 + MIDI_OUT_CHANNEL);\r\n  Serial1.write(43);                     \/\/Note Number (0 - 127)\r\n  Serial1.write(64);                     \/\/Velocity  (64 is default for no velocity info available)\r\n  \r\n  delay(50);\r\n  \r\n  \/\/MIDI Note Off\r\n  Serial1.write(0x80 + MIDI_OUT_CHANNEL);\r\n  Serial1.write(43);                     \/\/Note Number (0 - 127)              \r\n  Serial1.write(0);                      \/\/Velocity  (64 is default for no velocity info available)\r\n  \r\n  delay(500);\r\n  \r\n  \/\/MIDI All Notes Off (Can be handy during development and as a general power up command to send)\r\n  Serial1.write(0xB0 + MIDI_OUT_CHANNEL);\r\n  Serial1.write(0x7B);\r\n  Serial1.write(0x00);\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MIDI Comms MIDI Library Install the library from here. This library documentation seems somewhat overwhelming and difficult to carry out simple tasks such as specifying a different UART TX port when we looked. &nbsp;If you only need to send simple Note On and Note Off commands then you can just use the UART instead if [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-midi"],"_links":{"self":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":12,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":168,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/posts\/136\/revisions\/168"}],"wp:attachment":[{"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino-developer.com\/arduino\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}