{"id":2509,"date":"2020-11-16T07:29:38","date_gmt":"2020-11-16T15:29:38","guid":{"rendered":"http:\/\/www.donluc.com\/?p=2509"},"modified":"2020-11-16T07:29:38","modified_gmt":"2020-11-16T15:29:38","slug":"project-16-sound-thumb-joystick-mk10","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2509","title":{"rendered":"Project #16: Sound &#8211; Thumb Joystick &#8211; Mk10"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2509-1\" width=\"720\" height=\"406\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04M.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04M.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04M.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#donluc #sound #simplekeyboard #synthesizer #mozzi #programming #arduino #fritzing #electronics #microcontrollers #consultant #vlog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04a.png\" alt=\"Thumb Joystick\" width=\"720\" height=\"500\" class=\"alignnone size-full wp-image-2511\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04a-300x208.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\/2020\/11\/DL2011Mk04b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04b.png\" alt=\"Thumb Joystick\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2512\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04b-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\/2020\/11\/DL2011Mk04c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04c.png\" alt=\"Thumb Joystick\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2513\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04c-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\/2020\/11\/DL2011Mk04d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04d.png\" alt=\"Thumb Joystick\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2514\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2020\/11\/DL2011Mk04d-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Thumb Joystick<\/strong><\/p>\n<p>This is a joystick very similar to the analog joysticks on PS2 controllers. Directional movements are simply two potentiometers, one for each axis. Pots are 10k Ohm each. This joystick also has a select button that is actuated when the joystick is pressed down. This is the breakout board for the thumb joystick. Pins are broken out to a 0.1&#8243; header and includes 4 mounting holes in the corners.<\/p>\n<p><strong>Mozzi<\/strong><\/p>\n<p>Mozzi synthesis wave packet double, selects 2 overlapping streams. In a wave packet is a short burst of localized wave action that travels as a unit. A wave packet 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. Synthesizer and used a capacitor to store and slowly release voltage produced. He refined the design to remove the need to push a separate button one to produce the control voltage determining pitch and the other to trigger the envelope generator. The envelope generator became a standard feature of synthesizers. <\/p>\n<p><strong>Arduino<\/strong><\/p>\n<p>Joystick vertical potentiometer a fundamental, joystick horizontal potentiometer a bandwidth, potentiometer centre frequency and a select button that is actuated when the joystick is pressed down a random number.<\/p>\n<p><strong>DL2011Mk04<\/strong><\/p>\n<p>1 x Arduino Uno<br \/>\n1 x Thumb Joystick<br \/>\n1 x SparkFun Thumb Joystick Breakout<br \/>\n1 x Potentiometer<br \/>\n1 x Knob<br \/>\n1 x Audio Jack 3.5mm<br \/>\n1 x SparkFun Audio Jack Breakout<br \/>\n1 x Speaker<br \/>\n5 x Wire Solid Core &#8211; 22 AWG<br \/>\n3 x Jumper Wires 3in M\/M<br \/>\n4 x Jumper Wires 6in M\/M<br \/>\n1 x Half-Size Breadboard<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Arduino Uno<\/strong><\/p>\n<p>SPK &#8211; Digital 9<br \/>\nJSV &#8211; Analog A0<br \/>\nJSH &#8211; Analog A1<br \/>\nPO2 &#8211; Analog A2<br \/>\nSEL &#8211; Digital 13<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2011Mk04p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\r\n\/\/ ***** Don Luc Electronics \u00a9 *****\r\n\/\/ Software Version Information\r\n\/\/ Project #16: Sound - Thumb Joystick - Mk10\r\n\/\/ 11-04\r\n\/\/ DL2011Mk04p.ino 16-10\r\n\/\/ 1 x Arduino Uno\r\n\/\/ 1 x Thumb Joystick\r\n\/\/ 1 x SparkFun Thumb Joystick Breakout\r\n\/\/ 1 x Potentiometer\r\n\/\/ 1 x Knob\r\n\/\/ 1 x Audio Jack 3.5mm\r\n\/\/ 1 x SparkFun Audio Jack Breakout\r\n\/\/ 1 x Speaker\r\n\/\/ 5 x Wire Solid Core - 22 AWG\r\n\/\/ 3 x Jumper Wires 3in M\/M\r\n\/\/ 4 x Jumper Wires 6in M\/M\r\n\/\/ 1 x Half-Size Breadboard\r\n\/\/ 1 x SparkFun Cerberus USB Cable\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Mozzi\r\n#include <mozzi_analog.h>\r\n#include <WavePacket.h>\r\n#include <RollingAverage.h>\r\n#include <AutoMap.h>\r\n\r\n\/\/ Store the Arduino pin associated with each axis X of the joystick input\r\n\/\/ FUNDAMENTAL\r\nconst int JoystickVert = A0;\r\n\/\/ Store the Arduino pin associated with each axis Y of the joystick input\r\n\/\/ BANDWIDTH\r\nconst int JoystickHorz = A1;\r\n\/\/ Set the input for the potentiometer for volume to analog pin 2\r\n\/\/ CENTREFREQ\r\nconst char PotCENTREFREQ = A2;\r\n\/\/ Select button is triggered when joystick is pressed\r\nconst int SEL = 13;\r\n\/\/ Variables for reading the pushbutton status\r\nint selState  = 0; \r\n\r\n\/\/ for smoothing the control signals\r\n\/\/ use: RollingAverage <number_type, how_many_to_average> myThing\r\n\/\/ FUNDAMENTAL\r\nRollingAverage <int, 32> kAverageF;\r\n\/\/ BANDWIDTH\r\nRollingAverage <int, 32> kAverageBw;\r\n\/\/ CENTREFREQ\r\nRollingAverage <int, 32> kAverageCf;\r\n\r\n\/\/ Min and max values of synth parameters to map AutoRanged analog inputs to\r\n\/\/ FUNDAMENTAL\r\nconst int MIN_F = 10;\r\nconst int MAX_F = 200;\r\n\/\/ BANDWIDTH\r\nconst int MIN_BW = 10;\r\nconst int MAX_BW = 1000;\r\n\/\/ CENTREFREQ\r\nconst int MIN_CF = 60;\r\nconst int MAX_CF = 2000;\r\n\r\n\/\/ Auto Map\r\n\/\/ FUNDAMENTAL\r\nAutoMap kMapF(0,1023,MIN_F,MAX_F);\r\n\/\/ BANDWIDTH\r\nAutoMap kMapBw(0,1023,MIN_BW,MAX_BW);\r\n\/\/ CENTREFREQ\r\nAutoMap kMapCf(0,1023,MIN_CF,MAX_CF);\r\n\r\n\/\/ Wave Packet\r\n\/\/ DOUBLE selects 2 overlapping streams\r\nWavePacket <DOUBLE> wavey;\r\n\r\n\/\/ Random Number\r\nlong randNumber;\r\n\r\n\/\/ Software Version Information\r\nString sver = \"16-10\";\r\n\r\nvoid loop() {\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=\"generic\">\r\n\/\/ Mozzi\r\n\/\/ Update Control\r\nvoid updateControl(){\r\n\r\n  \/\/ Wavey\r\n  \/\/ Fundamental\r\n  int fundamental = mozziAnalogRead( JoystickVert )+1;\r\n  fundamental = kMapF(fundamental);\r\n  \r\n  \/\/ Bandwidth\r\n  int bandwidth = mozziAnalogRead( JoystickHorz );\r\n  \/\/ Select button is triggered when joystick is pressed\r\n  bandwidth = kMapBw(bandwidth);\r\n\r\n  \/\/Centre Frequency\r\n  int centre_freq = mozziAnalogRead( PotCENTREFREQ );\r\n  selState = digitalRead( SEL ); \r\n  if (selState == HIGH)\r\n  {\r\n    \r\n    randNumber = random(300);\r\n    centre_freq = randNumber;\r\n\r\n  }\r\n  centre_freq = kMapCf(centre_freq);\r\n  \r\n  \/\/ Wavey\r\n  wavey.set(fundamental, bandwidth, centre_freq);\r\n\r\n}\r\n\/\/ Update Audio \r\nint updateAudio(){\r\n\r\n  \/\/ >>8 for AUDIO_MODE STANDARD\r\n  return wavey.next()>>8;\r\n \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\r\n\/\/ Setup\r\nvoid setup() {\r\n\r\n  \/\/ Select button is triggered when joystick is pressed\r\n  pinMode(SEL, INPUT_PULLUP);\r\n  \/\/ Start Mozzi\r\n  startMozzi();\r\n\r\n}\r\n<\/pre>\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>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\/DLHackster\/LucPaquinCVEngMk2020a.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\/DLHackster\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<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\/luc.paquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #donluc #sound #simplekeyboard #synthesizer #mozzi #programming #arduino #fritzing #electronics #microcontrollers #consultant #vlog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Thumb Joystick This is a joystick very similar to the analog joysticks on PS2 controllers. Directional movements are simply two potentiometers, one for each axis. Pots are 10k Ohm each. This joystick also has a select button &#8230; <a title=\"Project #16: Sound &#8211; Thumb Joystick &#8211; Mk10\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2509\" aria-label=\"Read more about Project #16: Sound &#8211; Thumb Joystick &#8211; Mk10\">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,7,58,10,43,51],"tags":[6,102,4,19,85,24,25,9,27,120,109,8,33,129,34,108],"class_list":["post-2509","post","type-post","status-publish","format-standard","hentry","category-sound","category-arduino","category-digitalelectronics","category-fritzing","category-microcontrollers","category-musical-instruments","category-arduino-programming","category-projects","category-sparkfun","category-synth","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-musical-instruments-2","tag-programming","tag-projects-2","tag-sound","tag-sparkfun","tag-synth","tag-technology","tag-thumb-joystick","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2509","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=2509"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2509\/revisions"}],"predecessor-version":[{"id":2515,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2509\/revisions\/2515"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}