{"id":3695,"date":"2021-11-05T19:10:33","date_gmt":"2021-11-05T18:10:33","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=3695"},"modified":"2025-10-08T17:33:20","modified_gmt":"2025-10-08T15:33:20","slug":"arduino-audio-tools-audio-effects","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/","title":{"rendered":"Arduino Audio Tools: Audio Effects"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>I was playing with the thought of building some <strong>Arduino Based Guitar Effects Pedals<\/strong>. With that in mind, I have added some <strong>simple sound effects<\/strong> to my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tools Library<\/a> and this is fitting quite nicely into the overall design.<\/p>\n<h2>Overall Design<\/h2>\n<pre><code>SineWaveGenerator&lt;int16_t&gt; sine;\r\nGeneratedSoundStream&lt;int16_t&gt; stream(sine); \r\nAudioEffectStream effects(stream);\r\n<\/code><\/pre>\n<p>The audio effects are applied to an input stream: Here in order to test the functionality, I just use a <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_sine_wave_generator.html\">SineWaveGenerator<\/a> provided to a <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_generated_sound_stream.html\">GeneratedSoundStream<\/a> class which turns it into an Input Stream source.<\/p>\n<p>This is assigned to the <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_audio_effect_stream.html\">AudioEffectStream<\/a>.<\/p>\n<p>Next we need to define the effects that we want to use. Each effect has parameters:<\/p>\n<pre><code>\/\/ Contorl input\r\nfloat volumeControl = 1.5;\r\nint16_t clipThreashold = 4990;\r\nfloat fuzzEffectValue = 6.5;\r\nint16_t distortionControl = 4990;\r\nint16_t tremoloDuration = 800;\r\nfloat tremoloDepth = 0.9;\r\n\r\n<\/code><\/pre>\n<p>After having the input parameters defined we can create and assign the individual subclasses of <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_audio_effect.html\">AudioEffect<\/a>:<\/p>\n<pre><code>\/\/ setup effects\r\neffects.addEffect(new Boost(volumeControl));\r\neffects.addEffect(new Distortion(clipThreashold));\r\neffects.addEffect(new Fuzz(fuzzEffectValue));\r\neffects.addEffect(new Tremolo(tremoloDuration, tremoloDepth, sample_rate));\r\n<\/code><\/pre>\n<p>The effects are processed sequentially in the defined sequence. You you don&#8217;t want any specific effects you can leave them out or set them as not active.<\/p>\n<p>Finally we can just output the data in one of the usual ways&#8230;<\/p>\n<h2>Outlook<\/h2>\n<p>In the final sketch, the generated sine wave will be replaced with the input from a ADC. But I leave this to a future Blog.<\/p>\n<p>I think with the current design is is quite easy to add additional new Effect implementations: You just need to create a subclass of <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_audio_effect.html\">AudioEffect<\/a> and implement the process() method which receives an input value and provides the resulting output value.<\/p>\n<h2>Complete Example<\/h2>\n<p>You can find a <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/examples-communication\/http-server\/streams-effect-webserver_wav\/streams-effect-webserver_wav.ino\">full example on Github<\/a>, that sends the output to a Webbrowser.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction I was playing with the thought of building some Arduino Based Guitar Effects Pedals. With that in mind, I have added some simple sound effects to my Arduino Audio Tools Library and this is fitting quite nicely into the overall design. Overall Design SineWaveGenerator&lt;int16_t&gt; sine; GeneratedSoundStream&lt;int16_t&gt; stream(sine); AudioEffectStream effects(stream); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20,22],"tags":[29],"class_list":["post-3695","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound","tag-guitarpedals"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino Audio Tools: Audio Effects - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino Audio Tools: Audio Effects - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Introduction I was playing with the thought of building some Arduino Based Guitar Effects Pedals. With that in mind, I have added some simple sound effects to my Arduino Audio Tools Library and this is fitting quite nicely into the overall design. Overall Design SineWaveGenerator&lt;int16_t&gt; sine; GeneratedSoundStream&lt;int16_t&gt; stream(sine); AudioEffectStream effects(stream); [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-05T18:10:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-08T15:33:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"240\" \/>\n\t<meta property=\"og:image:height\" content=\"320\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino Audio Tools: Audio Effects\",\"datePublished\":\"2021-11-05T18:10:33+00:00\",\"dateModified\":\"2025-10-08T15:33:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/\"},\"wordCount\":246,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/tenson-mini-electric-guitar.jpg\",\"keywords\":[\"GuitarPedals\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/\",\"name\":\"Arduino Audio Tools: Audio Effects - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/tenson-mini-electric-guitar.jpg\",\"datePublished\":\"2021-11-05T18:10:33+00:00\",\"dateModified\":\"2025-10-08T15:33:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/tenson-mini-electric-guitar.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/tenson-mini-electric-guitar.jpg\",\"width\":240,\"height\":320},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2021\\\/11\\\/05\\\/arduino-audio-tools-audio-effects\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino Audio Tools: Audio Effects\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino Audio Tools: Audio Effects - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/","og_locale":"en_US","og_type":"article","og_title":"Arduino Audio Tools: Audio Effects - Phil Schatzmann","og_description":"Introduction I was playing with the thought of building some Arduino Based Guitar Effects Pedals. With that in mind, I have added some simple sound effects to my Arduino Audio Tools Library and this is fitting quite nicely into the overall design. Overall Design SineWaveGenerator&lt;int16_t&gt; sine; GeneratedSoundStream&lt;int16_t&gt; stream(sine); AudioEffectStream effects(stream); [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/","og_site_name":"Phil Schatzmann","article_published_time":"2021-11-05T18:10:33+00:00","article_modified_time":"2025-10-08T15:33:20+00:00","og_image":[{"width":240,"height":320,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino Audio Tools: Audio Effects","datePublished":"2021-11-05T18:10:33+00:00","dateModified":"2025-10-08T15:33:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/"},"wordCount":246,"commentCount":2,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg","keywords":["GuitarPedals"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/","url":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/","name":"Arduino Audio Tools: Audio Effects - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg","datePublished":"2021-11-05T18:10:33+00:00","dateModified":"2025-10-08T15:33:20+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2021\/02\/tenson-mini-electric-guitar.jpg","width":240,"height":320},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2021\/11\/05\/arduino-audio-tools-audio-effects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino Audio Tools: Audio Effects"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=3695"}],"version-history":[{"count":20,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3695\/revisions"}],"predecessor-version":[{"id":6850,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/3695\/revisions\/6850"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/2595"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=3695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=3695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=3695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}