{"id":2738,"date":"2021-07-01T07:50:09","date_gmt":"2021-07-01T14:50:09","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2738"},"modified":"2021-07-01T07:50:09","modified_gmt":"2021-07-01T14:50:09","slug":"project-16-sound-music-acoustics-mk18","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2738","title":{"rendered":"Project #16: Sound &#8211; Music Acoustics &#8211; Mk18"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2738-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Sound #WhiteNoise #Mozzi #WavePacket #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05a.png\" alt=\"Music Acoustics\" width=\"720\" height=\"531\" class=\"alignnone size-full wp-image-2740\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05a-300x221.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05b.png\" alt=\"Music Acoustics\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2741\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05c.png\" alt=\"Music Acoustics\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2742\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05d.png\" alt=\"Music Acoustics\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2743\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/07\/DL2106Mk05d-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Music Acoustics<\/strong><\/p>\n<p>Music acoustics is a multidisciplinary field that combines knowledge from physics, psychophysics, physiology, and signal processing among other disciplines. As a branch of acoustics, it is concerned with researching and describing the physics of music, how sounds are employed to make music. Examples of areas of study are the function human voice (the physics of speech), computer analysis, and in the clinical. <\/p>\n<p>DL2106Mk05<\/p>\n<p>1 x Arduino Pro Mini 328 &#8211; 5V\/16MHz<br \/>\n2 x Mountable Slide Switch<br \/>\n1 x 10K Ohm<br \/>\n2 x LED Green<br \/>\n2 x 270 Ohm<br \/>\n3 x Rotary Potentiometer &#8211; 10k Ohm<br \/>\n3 x Knob<br \/>\n1 x Audio Jack 3.5mm<br \/>\n1 x SparkFun Audio Jack Breakout<br \/>\n2 x Battery Holder &#8211; 2 x AAA<br \/>\n4 x Alkaline Battery &#8211; AAA<br \/>\n1 x JST Jumper 2 Wire Assembly<br \/>\n19 x Wire Solid Core &#8211; 22 AWG<br \/>\n8 x Screw, 1\/4 inches, 4-40<br \/>\n8 x Nut, Nylon Locknut, 4-40<br \/>\n3 x Standoff, Metal 4-40, 3\/8 inches<br \/>\n1 x Adafruit Perma-Proto Quarter-sized Breadboard PCB<br \/>\n1 x Bakelite Perfboard<br \/>\n1 x Hamburger Mini Speaker<br \/>\n1 x ABS Plastic Multi-Purpose Enclosures<br \/>\n1 x SparkFun Cerberus USB Cable<br \/>\n1 x SparkFun FTDI Basic Breakout &#8211; 5V<\/p>\n<p><strong>Arduino Pro Mini 328 &#8211; 5V\/16MHz<\/strong><\/p>\n<p>PO1 &#8211; Analog A0<br \/>\nPO2 &#8211; Analog A1<br \/>\nPO3 &#8211; Analog A2<br \/>\nSPK &#8211; Digital 9<br \/>\nLD1 &#8211; Digital 6<br \/>\nLD2 &#8211; Digital 7<br \/>\nSW1 &#8211; Digital 4<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2106Mk05p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ ***** Don Luc Electronics \u00a9 *****\r\n\/\/ Software Version Information\r\n\/\/ Project #16: Sound - Music Acoustics - Mk18\r\n\/\/ 06-05\r\n\/\/ DL2106Mk05.ino 16-18\r\n\/\/ 1 x Arduino Pro Mini 328 - 5V\/16MHz\r\n\/\/ 2 x Mountable Slide Switch\r\n\/\/ 1 x 10K Ohm\r\n\/\/ 2 x LED Green\r\n\/\/ 2 x 270 Ohm\r\n\/\/ 3 x Rotary Potentiometer - 10k Ohm\r\n\/\/ 3 x Knob\r\n\/\/ 1 x Audio Jack 3.5mm\r\n\/\/ 1 x SparkFun Audio Jack Breakout\r\n\/\/ 2 x Battery Holder - 2 x AAA\r\n\/\/ 4 x Alkaline Battery - AAA\r\n\/\/ 1 x JST Jumper 2 Wire Assembly\r\n\/\/ 19 x Wire Solid Core - 22 AWG\r\n\/\/ 8 x Screw, 1\/4 inches, 4-40\r\n\/\/ 8 x Nut, Nylon Locknut, 4-40\r\n\/\/ 3 x Standoff, Metal 4-40, 3\/8 inches\r\n\/\/ 1 x Adafruit Perma-Proto Quarter-sized Breadboard PCB\r\n\/\/ 1 x Bakelite Perfboard\r\n\/\/ 1 x Hamburger Mini Speaker\r\n\/\/ 1 x ABS Plastic Multi-Purpose Enclosures\r\n\/\/ 1 x SparkFun Cerberus USB Cable\r\n\/\/ 1 x SparkFun FTDI Basic Breakout - 5V\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Mozzi\r\n#include &lt;MozziGuts.h&gt;\r\n\/\/ Mozzi Random\r\n#include &lt;mozzi_rand.h&gt;\r\n\/\/ Oscillator template\r\n#include &lt;Oscil.h&gt;\r\n\/\/ Mozzi Analog\r\n#include &lt;mozzi_analog.h&gt;\r\n\/\/ WavePacket Sample \r\n#include &lt;WavePacket.h&gt;\r\n\/\/ Rolling Average\r\n#include &lt;RollingAverage.h&gt;\r\n\/\/ Sine table for oscillator whitenoise\r\n#include &lt;tables\/whitenoise8192_int8.h&gt;\r\n\r\n\/\/ Set the input for the knob\r\n#define FUNDAMENTAL_PIN A0\r\n#define BANDWIDTH_PIN A1\r\n#define CENTREFREQ_PIN A2\r\n\r\n\/\/ for smoothing the control signals\r\n\/\/ Rolling Average\r\nRollingAverage &lt;int, 32&gt; kAverageF;\r\nRollingAverage &lt;int, 32&gt; kAverageBw;\r\nRollingAverage &lt;int, 32&gt; kAverageCf;\r\n\/\/ SINGLE selects 1 non-overlapping stream\r\nWavePacket &lt;SINGLE&gt; wavey; \r\n\r\n\/\/ Oscil &lt;table_size, update_rate&gt; oscilName (wavetable)\r\nOscil &lt;WHITENOISE8192_NUM_CELLS, AUDIO_RATE&gt; aSin(WHITENOISE8192_DATA);\r\n\r\n\/\/ Mini Speaker\r\nint SPK = 9;\r\n\r\n\/\/ Mountable Slide Switch\r\nint iSS1 = 4;\r\n\/\/ State\r\nint iSS1State = 0;\r\n\r\n\/\/ LED Green\r\nint iLEDG1 = 6;\r\nint iLEDG2 = 7;\r\n\r\n\/\/ Set the input for the volume\r\n\/\/ Volume level from updateControl() to updateAudio()\r\nbyte vol;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;16-18&quot;;\r\n\r\nvoid loop() {\r\n\r\n  \/\/ Slide Switch\r\n  \/\/ Read the state of the iSS1 value\r\n  iSS1State = digitalRead(iSS1);\r\n  \r\n  \/\/ Audio Hook\r\n  audioHook();\r\n\r\n}\r\n<\/pre>\n<p><strong>getMozzi.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Mozzi\r\n\/\/ Update Control\r\nvoid updateControl(){\r\n\r\n  \/\/ If it is the Slide Switch State is HIGH\r\n  if (iSS1State == HIGH) {\r\n\r\n    \/\/ White Noise\r\n    vol = 255;\r\n\r\n  } else {\r\n\r\n    \/\/ Wavey Set\r\n    wavey.set(kAverageF.next(mozziAnalogRead(FUNDAMENTAL_PIN))+1,\r\n    kAverageBw.next(mozziAnalogRead(BANDWIDTH_PIN)),\r\n    kAverageCf.next(2*mozziAnalogRead(CENTREFREQ_PIN)));\r\n  \r\n  }\r\n\r\n}\r\n\/\/ Update Audio\r\nint updateAudio()\r\n{\r\n\r\n  \/\/ If it is the Slide Switch State is HIGH\r\n  if (iSS1State == HIGH) {\r\n\r\n    \/\/ LED Green\r\n    digitalWrite(iLEDG1, HIGH);\r\n    digitalWrite(iLEDG2, LOW);\r\n    \r\n    \/\/ White Noise\r\n    char whitenoise = rand((byte)255) - 128;\r\n    return (((whitenoise * aSin.next())) * vol)&gt;&gt;8;  \r\n\r\n  } else {\r\n\r\n    \/\/ LED Green\r\n    digitalWrite(iLEDG1, LOW);\r\n    digitalWrite(iLEDG2, HIGH);\r\n    \r\n    \/\/ AUDIO_MODE STANDARD\r\n    \/\/ Wavey Next\r\n    return wavey.next()&gt;&gt;8;\r\n   \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Slide Switch\r\n  pinMode(iSS1, INPUT);\r\n\r\n  \/\/ LED Green\r\n  pinMode(iLEDG1, OUTPUT);\r\n  pinMode(iLEDG2, OUTPUT);\r\n\r\n  \/\/ Mozzi Start\r\n  startMozzi();\r\n  \r\n  \/\/ Set the frequency\r\n  aSin.setFreq(0.05f);\r\n  \r\n}\r\n<\/pre>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc&#8230;)<\/li>\n<li>Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc&#8230;)<\/li>\n<li>Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc&#8230;)<\/li>\n<li>Social Media Programming &#038; Integration (Facebook, Twitter, YouTube, Pinterest, etc&#8230;)<\/li>\n<li>Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc&#8230;)<\/li>\n<li>Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc&#8230;)<\/li>\n<li>eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc&#8230;)<\/li>\n<\/ul>\n<p><strong>Instructor<\/strong><\/p>\n<ul>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<li>DOS, Windows, OSX, Linux, iOS, Android, Multi-OS<\/li>\n<li>Linux-Apache-PHP-MySQL<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2021 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/CV\/LucPaquinCVEngMk2021c.pdf<br \/>\nhttps:\/\/www.jlpconsultants.com\/CV\/LucPaquinCVEspMk2021c.pdf<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> http:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLE\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLHackster\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<br \/>\n<strong>Web:<\/strong> https:\/\/zoom.us\/<br \/>\n<strong>Patreon:<\/strong> https:\/\/www.patreon.com\/DonLucElectronics<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #Sound #WhiteNoise #Mozzi #WavePacket #Arduino #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Music Acoustics Music acoustics is a multidisciplinary field that combines knowledge from physics, psychophysics, physiology, and signal processing among other disciplines. As a branch of acoustics, it is concerned with researching and describing the physics of &#8230; <a title=\"Project #16: Sound &#8211; Music Acoustics &#8211; Mk18\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2738\" aria-label=\"Read more about Project #16: Sound &#8211; Music Acoustics &#8211; Mk18\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119,50,38,59,5,138,58,10,43],"tags":[6,102,4,19,85,24,162,9,27,120,109,33,34],"class_list":["post-2738","post","type-post","status-publish","format-standard","hentry","category-sound","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-patreon","category-arduino-programming","category-projects","category-sparkfun","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-music-acoustics","tag-programming","tag-projects-2","tag-sound","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2738","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2738"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2738\/revisions"}],"predecessor-version":[{"id":4800,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2738\/revisions\/4800"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2738"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2738"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2738"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}