{"id":5494,"date":"2023-03-06T15:13:57","date_gmt":"2023-03-06T14:13:57","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=5494"},"modified":"2023-10-04T12:19:44","modified_gmt":"2023-10-04T10:19:44","slug":"playing-commodore-46-sid-audio-files","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/","title":{"rendered":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop"},"content":{"rendered":"<p>In the old days I was rather a <strong>Commodere PC<\/strong> guy, but I know of colleagues of mine that were addicted to the <strong>Commodore 64<\/strong> and knew it inside out. So, here is another project that makes you <strong>feel nostalgic<\/strong>:<\/p>\n<p><strong>Sound Interface Device (SID)<\/strong> is a audio format used by the <strong>Commodore 64<\/strong>.<\/p>\n<p>To get some SID files, I can recommend The <a href=\"https:\/\/www.hvsc.c64.org\/\">High Voltage SID Collection (HVSC)<\/a> which is a freeware hobby project that organizes Commodore 64 music into an archive for both musicians and fans alike.<\/p>\n<p>Unfortunately we can not feed SID files incrementally to a codec, so this does not fit with my audio codecs that are used e.g. in the AudioPlayer of the AudioTools library.<\/p>\n<p>Therefore I created a separate project, that provides a dedicated <strong>SID stream<\/strong> and a <strong>SID player<\/strong> that can play SID from files or from in memory hex dumps <strong>on Arduino<\/strong>. The player is based on the AudioPlayer from the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">Arduino Audio Tools<\/a>, so you can use <strong>different audio sources and audio sinks<\/strong>.<\/p>\n<p>The SID emulation is based on cSID light by Hermit (Mihaly Horvath), (Year 2017).<\/p>\n<h2>Arduino Sketch<\/h2>\n<p>Here is a simple demo sketch that plays a SID hex file:<\/p>\n<pre><code>#include \"AudioTools.h\"\n#include \"SIDStream.h\"\n#include \"AudioLibs\/AudioKit.h\" \/\/ only when using AudioKit\n#include \"audio\/commando.h\" \n\nuint16_t sample_rate=32000;\nuint8_t channels = 2; \nAudioKitStream out; \/\/ or replace with other class\nSIDStream sid(music_Commando_sid, music_Commando_sid_len);\nStreamCopy copier(out, sid); \n\n\/\/ Arduino Setup\nvoid setup(void) {  \n  \/\/ Open Serial \n  Serial.begin(115200);\n  AudioLogger::instance().begin(Serial, AudioLogger::Info);\n\n  \/\/ start I2S\n  Serial.println(\"starting I2S...\");\n  auto config = out.defaultConfig(TX_MODE);\n  config.sample_rate = sample_rate; \n  config.channels = channels;\n  config.bits_per_sample = 16;\n  out.begin(config);\n\n  \/\/ Setup SID\n  auto scfg = sid.defaultConfig();\n  scfg.copyFrom(config);\n  sid.begin(scfg);\n  \/\/sid.setSID(music_Commando_sid, music_Commando_sid_len);\n\n}\n\n\/\/ Arduino loop - copy sound to out \nvoid loop() {\n  copier.copy();\n}\n<\/code><\/pre>\n<p>I have used an AudioKit to test this sketch.<br \/>\nThe <a href=\"https:\/\/github.com\/pschatzmann\/SIDPlayer\">project<\/a> and <a href=\"https:\/\/github.com\/pschatzmann\/SIDPlayer\/examples\">further examples<\/a> can be found on Github.<\/p>\n<p>The project supports cmake, so you can also build and run it on the desktop!<\/p>\n<h2>Final Comments<\/h2>\n<p>If your microcontroller does not support I2S you can use the following output classes instead:<\/p>\n<ul>\n<li>I2SStream<\/li>\n<li>AnalogAudioStream<\/li>\n<li>PWMAudioOutput<\/li>\n<li>VS1053Stream<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In the old days I was rather a Commodere PC guy, but I know of colleagues of mine that were addicted to the Commodore 64 and knew it inside out. So, here is another project that makes you feel nostalgic: Sound Interface Device (SID) is a audio format used by [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5495,"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":[44],"class_list":["post-5494","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound","tag-uno"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - 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\/03\/06\/playing-commodore-46-sid-audio-files\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"In the old days I was rather a Commodere PC guy, but I know of colleagues of mine that were addicted to the Commodore 64 and knew it inside out. So, here is another project that makes you feel nostalgic: Sound Interface Device (SID) is a audio format used by [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-06T14:13:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-04T10:19:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\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\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop\",\"datePublished\":\"2023-03-06T14:13:57+00:00\",\"dateModified\":\"2023-10-04T10:19:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/\"},\"wordCount\":263,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Commodore-64.jpg\",\"keywords\":[\"UNO\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/\",\"name\":\"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Commodore-64.jpg\",\"datePublished\":\"2023-03-06T14:13:57+00:00\",\"dateModified\":\"2023-10-04T10:19:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Commodore-64.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Commodore-64.jpg\",\"width\":1200,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/03\\\/06\\\/playing-commodore-46-sid-audio-files\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop\"}]},{\"@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":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - 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\/03\/06\/playing-commodore-46-sid-audio-files\/","og_locale":"en_US","og_type":"article","og_title":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - Phil Schatzmann","og_description":"In the old days I was rather a Commodere PC guy, but I know of colleagues of mine that were addicted to the Commodore 64 and knew it inside out. So, here is another project that makes you feel nostalgic: Sound Interface Device (SID) is a audio format used by [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/","og_site_name":"Phil Schatzmann","article_published_time":"2023-03-06T14:13:57+00:00","article_modified_time":"2023-10-04T10:19:44+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.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\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop","datePublished":"2023-03-06T14:13:57+00:00","dateModified":"2023-10-04T10:19:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/"},"wordCount":263,"commentCount":2,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.jpg","keywords":["UNO"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/","url":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/","name":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.jpg","datePublished":"2023-03-06T14:13:57+00:00","dateModified":"2023-10-04T10:19:44+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.jpg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/03\/Commodore-64.jpg","width":1200,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/03\/06\/playing-commodore-46-sid-audio-files\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Playing Commodore 64 SID Audio Files on Microcontrollers or the Desktop"}]},{"@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\/5494","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=5494"}],"version-history":[{"count":20,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5494\/revisions"}],"predecessor-version":[{"id":5899,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5494\/revisions\/5899"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/5495"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=5494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=5494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=5494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}