{"id":5227,"date":"2023-01-11T17:22:17","date_gmt":"2023-01-11T16:22:17","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=5227"},"modified":"2024-03-10T02:56:48","modified_gmt":"2024-03-10T01:56:48","slug":"arduino-audiotools-audio-effects","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/","title":{"rendered":"Arduino AudioTools &#8211; Audio Effects"},"content":{"rendered":"<p>I was never quite happy with my old implementation of the <strong>AudioEffects class<\/strong> because it was not very intuitive with the required type parameters and I thought it is about <strong>time to improve<\/strong>.<br \/>\nSo I finally managed to provide a <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/html\/classaudio__tools_1_1_audio_effect_stream_t.html\">proper Stream implementation<\/a> that works like many other converting Streams, so that we can now apply the <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/html\/classaudio__tools_1_1_audio_effect.html\">effects<\/a> both on the input and the output side:<\/p>\n<h3>Effects on the Input Side<\/h3>\n<p>We just provide an input stream from which the audio data will be read to the AudioEffectStream constructor<\/p>\n<pre><code>SineWaveGenerator&lt;int16_t&gt; sine;\nGeneratedSoundStream&lt;int16_t&gt; stream(sine);            \nAudioEffectStream effects(stream);\nI2SStream out;\nStreamCopy copy(out, effects);\n<\/code><\/pre>\n<p>We create a stream that generates a sine wave and apply the effects. Then the result is copied to the I2S output.<\/p>\n<h3>Effects on the Output Side<\/h3>\n<p>We just provide the final output Stream\/Print to which the audio data will be written, after applying the effects to the AudioEffectStream constructor:<\/p>\n<pre><code>SineWaveGenerator&lt;int16_t&gt; sine;\nGeneratedSoundStream&lt;int16_t&gt; stream(sine);            \nI2SStream out;\nAudioEffectStream effects(out);\nStreamCopy copy(effects, stream);\n<\/code><\/pre>\n<p>In this case we copy the sine wave data to the effects and after applying the effects the output is passed to the I2S output.<\/p>\n<p>You can easily replace the generated sound with any other sound source.<br \/>\nThe complete documentation can be found in the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/wiki\/Audio-Effects\">Wiki<\/a><\/p>\n<p>You can also listen to some effects using <a href=\"https:\/\/nbviewer.org\/urls\/pschatzmann.github.io\/Resources\/jupyter\/JupyterEffects.ipynb\">the Jupyter nbviewer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was never quite happy with my old implementation of the AudioEffects class because it was not very intuitive with the required type parameters and I thought it is about time to improve. So I finally managed to provide a proper Stream implementation that works like many other converting Streams, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"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-5227","post","type-post","status-publish","format-standard","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 AudioTools - 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\/2023\/01\/11\/arduino-audiotools-audio-effects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino AudioTools - Audio Effects - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I was never quite happy with my old implementation of the AudioEffects class because it was not very intuitive with the required type parameters and I thought it is about time to improve. So I finally managed to provide a proper Stream implementation that works like many other converting Streams, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-11T16:22:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-10T01:56:48+00:00\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino AudioTools &#8211; Audio Effects\",\"datePublished\":\"2023-01-11T16:22:17+00:00\",\"dateModified\":\"2024-03-10T01:56:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/\"},\"wordCount\":204,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"keywords\":[\"GuitarPedals\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/\",\"name\":\"Arduino AudioTools - Audio Effects - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"datePublished\":\"2023-01-11T16:22:17+00:00\",\"dateModified\":\"2024-03-10T01:56:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/01\\\/11\\\/arduino-audiotools-audio-effects\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino AudioTools &#8211; 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 AudioTools - 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\/2023\/01\/11\/arduino-audiotools-audio-effects\/","og_locale":"en_US","og_type":"article","og_title":"Arduino AudioTools - Audio Effects - Phil Schatzmann","og_description":"I was never quite happy with my old implementation of the AudioEffects class because it was not very intuitive with the required type parameters and I thought it is about time to improve. So I finally managed to provide a proper Stream implementation that works like many other converting Streams, [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/","og_site_name":"Phil Schatzmann","article_published_time":"2023-01-11T16:22:17+00:00","article_modified_time":"2024-03-10T01:56:48+00:00","author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino AudioTools &#8211; Audio Effects","datePublished":"2023-01-11T16:22:17+00:00","dateModified":"2024-03-10T01:56:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/"},"wordCount":204,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"keywords":["GuitarPedals"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/","url":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/","name":"Arduino AudioTools - Audio Effects - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"datePublished":"2023-01-11T16:22:17+00:00","dateModified":"2024-03-10T01:56:48+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/01\/11\/arduino-audiotools-audio-effects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino AudioTools &#8211; 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\/5227","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=5227"}],"version-history":[{"count":20,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5227\/revisions"}],"predecessor-version":[{"id":6143,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5227\/revisions\/6143"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=5227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=5227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=5227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}