{"id":822,"date":"2011-12-05T20:33:18","date_gmt":"2011-12-06T01:33:18","guid":{"rendered":"http:\/\/abrammorphew.com\/notes\/?p=822"},"modified":"2012-03-06T00:33:14","modified_gmt":"2012-03-06T05:33:14","slug":"arduino-the-8-bit-mellotronium-prototype","status":"publish","type":"post","link":"http:\/\/abrammorphew.com\/notes\/2011\/12\/05\/arduino-the-8-bit-mellotronium-prototype\/","title":{"rendered":"Arduino: the 8-bit Mellotronium prototype"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"http:\/\/player.vimeo.com\/video\/33192130?title=0&amp;byline=0&amp;portrait=0\" width=\"500\" height=\"375\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen><\/iframe><\/p>\n<p>i&#8217;ve been pretty Arduino obsessed over the past month. i got in my head this idea about building a midi-controlled digital sampler that uses SD cards for storage after thumbing through the Arduino Cookbook and have finally started to make some headway on the project. <\/p>\n<p>there were some major obstacle to overcome, unfortunately. the first came about when i had some trouble loading the larger libraries (e.g. MIDI.h, SD.h). i spent days trying to figure out what the problem was and even went so far as to update the bootloader to use <a href=\"http:\/\/code.google.com\/p\/optiboot\/\" target=\"blank\">optiboot<\/a>. it turned out to be the version of GCC that i was using to compile my sketches. the toolchain setup on Gentoo is no easy task, so i went ahead and just compiled it manually. for those of you tempting to use develop AVR software in a Linux environment, i&#8217;d recommend the <a href=\"http:\/\/www.nongnu.org\/avr-libc\/user-manual\/install_tools.html\" target=\"_blank\">avr-libc install guide<\/a> as your path to unbridled success. i myself could never get cross-dev to work with out failing and it needs certain USE flags which it just always overrode when i specified them. <\/p>\n<p>from then on, things were pretty standard. i was able to load SD.h and begin reading files from the card. i used simple voltage dividers to convert the ATMega328&#8217;s 5v logic to the SD&#8217;s 3.3v like the standard schematic shows and then hacked up the <a href=\"http:\/\/www.arduino.cc\/playground\/Code\/PCMAudio\" target=\"_blank\">PCMAudio Library<\/a> to work as i&#8217;ve wanted. i borrow some of the techniques from <a href=\"http:\/\/blog.wingedvictorydesign.com\/2009\/05\/29\/generate-real-time-audio-on-the-arduino-using-pulse-code-modulation\/all\/1\/\" target=\"_blank\">Max&#8217;s article on generating real-time audio using PCM<\/a>. much different than my overall goal, but extremely educational. if you&#8217;re baffled by the ATMega328&#8217;s use of PWM as i was, <a href=\"http:\/\/www.arcfn.com\/2009\/07\/secrets-of-arduino-pwm.html\" target=\"_blank\">Ken Sherif&#8217;s article on PWM<\/a> will clear all that up.<\/p>\n<p>the code&#8217;s not worth posting at the moment. it&#8217;s a commented out mess of gray. i&#8217;ll most likely post it (for my own sake) when i&#8217;ve got more of the kinks worked out.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>i&#8217;ve been pretty Arduino obsessed over the past month. i got in my head this idea about building a midi-controlled digital sampler that uses SD cards for storage after thumbing<span class=\"more-button\"><a href=\"http:\/\/abrammorphew.com\/notes\/2011\/12\/05\/arduino-the-8-bit-mellotronium-prototype\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Arduino: the 8-bit Mellotronium prototype<\/span><\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[102,103,25,108,111,112,110,109,104,106,105,107],"class_list":["post-822","post","type-post","status-publish","format-standard","hentry","category-notes","tag-arduino","tag-atmega328","tag-audio","tag-digital","tag-ken-sheriff","tag-max-pierson","tag-mellotron","tag-mellotronium","tag-optiboot","tag-pcm","tag-pwm","tag-sampler"],"_links":{"self":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/comments?post=822"}],"version-history":[{"count":3,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/822\/revisions"}],"predecessor-version":[{"id":861,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/posts\/822\/revisions\/861"}],"wp:attachment":[{"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/media?parent=822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/categories?post=822"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/abrammorphew.com\/notes\/wp-json\/wp\/v2\/tags?post=822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}