{"id":2696,"date":"2021-04-09T07:12:32","date_gmt":"2021-04-09T14:12:32","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2696"},"modified":"2021-04-09T07:12:32","modified_gmt":"2021-04-09T14:12:32","slug":"project-16-sound-white-noise-or-wave-packet-mk17","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2696","title":{"rendered":"Project #16: Sound &#8211; White Noise or Wave Packet &#8211; Mk17"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2696-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#donluc #sound #whitenoise #mozzi #WavePacket #arduino #sparkfun #project #programming #electronics #microcontrollers #consultant #zoom #patreon #videoblog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02a.png\" alt=\"Wave Packet\" width=\"720\" height=\"465\" class=\"alignnone size-full wp-image-2698\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02a-300x194.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\/04\/DL2104Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02b.png\" alt=\"Wave Packet\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2699\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02b-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\/04\/DL2104Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02c.png\" alt=\"Wave Packet\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2700\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/04\/DL2104Mk02c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>White Noise<\/strong><\/p>\n<p>White Noise can be used by all audiences in a variety of ways throughout our daily lives. Whether you&#8217;re trying to work, study, relax, or even sleep. Offices can be either too quiet or too noisy. White noise makes it impossible to concentrate. Sound affects many areas of the brain and has an undeniable effect on the body. A good way to test if a particular sound is relaxing to you is to check your pulse, if it slows down, then you have found the sound that is calming you. Keep listening to it and you will relax, reaching a state of increased calmness and reducing your levels of anxiety, stress, or anger. <\/p>\n<p><strong>Wave Packet<\/strong><\/p>\n<p>In physics, a wave packet is a short burst of localized wave action that travels as a unit. A wave packet can be analyzed into, or can be synthesized from, an infinite set of component sinusoidal waves of different wavenumbers, with phases and amplitudes such that they interfere constructively only over a small region of space, and destructively elsewhere.Each component wave function, and hence the wave packet, are solutions of a wave equation. Depending on the wave equation, the wave packet&#8217;s profile may remain constant or it may change while propagating. <\/p>\n<p><strong>DL2104Mk02<\/strong><\/p>\n<p>1 x Arduino Pro Mini 328 &#8211; 5V\/16MHz<br \/>\n1 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 \/>\n1 x Hamburger Mini Speaker<br \/>\n12 x Wire Solid Core &#8211; 22 AWG<br \/>\n7 x Jumper Wires 3 inches M\/M<br \/>\n2 x Jumper Wires 6 inches M\/M<br \/>\n1 x Full-Size Breadboard<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>DL2104Mk02p.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 - White Noise - Mk17\r\n\/\/ 04-02\r\n\/\/ DL2104Mk02p.ino 16-17\r\n\/\/ 1 x Arduino Pro Mini 328 - 5V\/16MHz\r\n\/\/ 1 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\/\/ 1 x Hamburger Mini Speaker\r\n\/\/ 12 x Wire Solid Core - 22 AWG\r\n\/\/ 7 x Jumper Wires 3 inches M\/M\r\n\/\/ 2 x Jumper Wires 6 inches M\/M\r\n\/\/ 1 x Full-Size Breadboard\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;WavePacketSample.h&gt;\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-17&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<\/strong><br \/>\nhttps:\/\/www.donluc.com\/DLE\/LucPaquinCVEngMk2021a.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; #donluc #sound #whitenoise #mozzi #WavePacket #arduino #sparkfun #project #programming #electronics #microcontrollers #consultant #zoom #patreon #videoblog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; White Noise White Noise can be used by all audiences in a variety of ways throughout our daily lives. Whether you&#8217;re trying to work, study, relax, or even sleep. Offices can be either too quiet &#8230; <a title=\"Project #16: Sound &#8211; White Noise or Wave Packet &#8211; Mk17\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2696\" aria-label=\"Read more about Project #16: Sound &#8211; White Noise or Wave Packet &#8211; Mk17\">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,128,9,27,120,109,33,34,108,151,150],"class_list":["post-2696","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-mozzi","tag-programming","tag-projects-2","tag-sound","tag-sparkfun","tag-technology","tag-video-blog","tag-vlog","tag-wave-packet","tag-white-noise"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2696","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=2696"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2696\/revisions"}],"predecessor-version":[{"id":3992,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2696\/revisions\/3992"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}