{"id":4635,"date":"2022-04-22T17:23:24","date_gmt":"2022-04-22T15:23:24","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=4635"},"modified":"2022-06-01T17:30:41","modified_gmt":"2022-06-01T15:30:41","slug":"using-faust-dsp-with-my-arduino-audio-tools","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/","title":{"rendered":"Using Faust with the Arduino Audio Tools Library"},"content":{"rendered":"<p>I managed to provide a simple Interface class to use <a href=\"https:\/\/faust.grame.fr\/\">Faust<\/a> in my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tools<\/a>.<\/p>\n<p><strong>Faust<\/strong> (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing applications and audio plug-ins for a variety of platforms and standards.<\/p>\n<p>The core component of Faust is its <strong>compiler<\/strong>. It allows to &#8220;translate&#8221; any Faust digital signal processing (DSP) specification to a wide range of <strong>non-domain specific languages such as C++<\/strong>, C, LLVM bit code, WebAssembly, Rust, etc. In this regard, Faust can be seen as an alternative to C++ but is much simpler and intuitive to learn.<\/p>\n<p>So we can just <strong>generate our DSP C++ Class<\/strong> and use it with the Arduino Audio Tools. A pinch of salt: I noticed that some implementations however are generating <strong>arrays that are too big for Microcontrollers<\/strong>!<\/p>\n<h2>Faust Compile Options<\/h2>\n<p>I suggest to use the following options:<\/p>\n<ul>\n<li>-lang CPP &#8211;language                 select output language,<\/li>\n<li>-single     &#8211;single-precision-floats   use single precision floats for internal computations (default).<\/li>\n<li>-inpl      &#8211;in-place                   generates code working when input and output buffers are the same (scalar mode only).<\/li>\n<li>-scal      &#8211;scalar                     generate non-vectorized code.<\/li>\n<\/ul>\n<p>See <a href=\"https:\/\/faustdoc.grame.fr\/manual\/options\/\">https:\/\/faustdoc.grame.fr\/manual\/options\/<\/a><\/p>\n<h2>Examples<\/h2>\n<p>I am providing some <strong>examples<\/strong> that demonstrate how to use Faust<\/p>\n<ul>\n<li>to <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/tree\/main\/examples\/examples-faust\/streams-generator-faust-i2s\">generate a signal<\/a> <\/li>\n<li>to <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/tree\/main\/examples\/examples-faust\/streams-i2s-faust_guitarix-i2s\">processes an input signal<\/a> <\/li>\n<li>to <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/tree\/main\/examples\/examples-faust\/streams-faust_flute-i2s\">use psram<\/a> <\/li>\n<\/ul>\n<p>Further information can be found in the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/wiki\/Faust\">Wiki of the AudioTools<\/a> project.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I managed to provide a simple Interface class to use Faust in my Arduino Audio Tools. Faust (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4636,"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":[],"class_list":["post-4635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using Faust with the Arduino Audio Tools Library - 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\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Faust with the Arduino Audio Tools Library - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I managed to provide a simple Interface class to use Faust in my Arduino Audio Tools. Faust (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-22T15:23:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-01T15:30:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"422\" \/>\n\t<meta property=\"og:image:height\" content=\"119\" \/>\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=\"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\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Using Faust with the Arduino Audio Tools Library\",\"datePublished\":\"2022-04-22T15:23:24+00:00\",\"dateModified\":\"2022-06-01T15:30:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/\"},\"wordCount\":252,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/faust.jpeg\",\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/\",\"name\":\"Using Faust with the Arduino Audio Tools Library - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/faust.jpeg\",\"datePublished\":\"2022-04-22T15:23:24+00:00\",\"dateModified\":\"2022-06-01T15:30:41+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/faust.jpeg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/faust.jpeg\",\"width\":422,\"height\":119},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/22\\\/using-faust-dsp-with-my-arduino-audio-tools\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Faust with the Arduino Audio Tools Library\"}]},{\"@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":"Using Faust with the Arduino Audio Tools Library - 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\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/","og_locale":"en_US","og_type":"article","og_title":"Using Faust with the Arduino Audio Tools Library - Phil Schatzmann","og_description":"I managed to provide a simple Interface class to use Faust in my Arduino Audio Tools. Faust (Functional Audio Stream) is a functional programming language for sound synthesis and audio processing with a strong focus on the design of synthesizers, musical instruments, audio effects, etc. Faust targets high-performance signal processing [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/","og_site_name":"Phil Schatzmann","article_published_time":"2022-04-22T15:23:24+00:00","article_modified_time":"2022-06-01T15:30:41+00:00","og_image":[{"width":422,"height":119,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg","type":"image\/jpeg"}],"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\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Using Faust with the Arduino Audio Tools Library","datePublished":"2022-04-22T15:23:24+00:00","dateModified":"2022-06-01T15:30:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/"},"wordCount":252,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg","articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/","url":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/","name":"Using Faust with the Arduino Audio Tools Library - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg","datePublished":"2022-04-22T15:23:24+00:00","dateModified":"2022-06-01T15:30:41+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/faust.jpeg","width":422,"height":119},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/22\/using-faust-dsp-with-my-arduino-audio-tools\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Using Faust with the Arduino Audio Tools Library"}]},{"@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\/4635","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=4635"}],"version-history":[{"count":22,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4635\/revisions"}],"predecessor-version":[{"id":4830,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4635\/revisions\/4830"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/4636"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=4635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=4635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=4635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}