{"id":16088,"date":"2020-04-02T23:04:47","date_gmt":"2020-04-03T03:04:47","guid":{"rendered":"http:\/\/scruss.com\/blog\/?p=16088"},"modified":"2024-09-15T15:26:58","modified_gmt":"2024-09-15T19:26:58","slug":"protodomes-wonderful-chiptunes-how-to-play-them-on-your-own-attiny85-chips","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2020\/04\/02\/protodomes-wonderful-chiptunes-how-to-play-them-on-your-own-attiny85-chips\/","title":{"rendered":"PROTODOME&#8217;s wonderful chiptunes: how to play them on your own ATtiny85 chips"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"600\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/protodome_player.jpg\" alt=\"electronics breadbord with battery, speaker and sound generated by an 8-ping ATtiny85 mincrocontroller. Additional chips on the board are spares holding other tunes\" class=\"wp-image-16089\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/protodome_player.jpg 800w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/protodome_player-320x240.jpg 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/protodome_player-160x120.jpg 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/protodome_player-768x576.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">Six whole tunes ready to play  on this tiny chiptune player; a couple are included at the end of this article!<\/figcaption><\/figure>\n\n\n\n<p class=\"has-drop-cap\">I love the ingenuity that goes into making very tiny projects do very big things. I also love chiptunes. So when I read the <a href=\"https:\/\/www.metafilter.com\/186249\/one-bit-music\">metafilter post about PROTODOME&#8217;s compositions<\/a> for the ATtiny85, I was very much there for it.<\/p>\n\n\n\n<iframe style=\"border: 0; width: 350px; height: 470px;\" src=\"https:\/\/bandcamp.com\/EmbeddedPlayer\/album=3590915140\/size=large\/bgcol=ffffff\/linkcol=0687f5\/tracklist=false\/transparent=true\/\" seamless=\"\"><a href=\"http:\/\/protodome.bandcamp.com\/album\/4000ad\">4000AD by PROTODOME<\/a><\/iframe>\n\n\n\n<p>The circuit to play this is no more than a $2 microcontroller, a lithium coin cell and a speaker or piezo buzzer. The microcontroller has 8 KB of program space and 512 bytes of RAM. The output is a single pin, but with very clever pulse width modulation tricks, sounds like three channels plus percussion.<\/p>\n\n\n\n<p>The album is cool enough on its own, but Blake \u201cPROTODOME\u201d Troise has not only published the <a href=\"https:\/\/github.com\/protodomemusic\/mmml\">source code<\/a>, but also written an academic article on 1-bit music: &#8220;<a href=\"https:\/\/online.ucpress.edu\/jsmg\/article\/1\/1\/44\/2337\/The-1-Bit-InstrumentThe-Fundamentals-of-1-Bit\">The 1-Bit Instrument: The Fundamentals of 1-Bit Synthesis, Their  Implementational Implications, and Instrumental Possibilities.<\/a>&#8221; <em>Journal of Sound and Music in Games<\/em> 1.1 (2020): 44-74.<\/p>\n\n\n\n<p>I remembered I had bought a tube of ATtiny microcontrollers a while back. I knew I had a coin cell and tiny speaker. \u201c<em>I can do this!<\/em>\u201d, I thought.<\/p>\n\n\n\n<p>So what follows is tutorial on compiling embedded code for an ATtiny85 microcontroller on Linux. There are larger tutorials out there, there are better tutorials: but there are also many out-of-date and misleading tutorials. This isn&#8217;t a general ATtiny development tutorial, but one specialized on getting PROTODOME&#8217;s tunes playing on <span style=\"text-decoration: underline;\">your<\/span> microcontroller.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware<\/h2>\n\n\n\n<p>The very minimum you will need to <em>play<\/em> the music is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a prototyping <strong>breadboard<\/strong>. Half size with power rails <\/li>\n\n\n\n<li>a Microchip\/Atmel <strong>ATtiny85 microcontroller<\/strong> (from now on, <em>\u00b5c<\/em>). You want the 8-pin PDIP version, as other ones are for production soldering, not breadboards. Its fancy name on Digikey is <a href=\"https:\/\/www.digikey.ca\/product-detail\/en\/microchip-technology\/ATTINY85-20PU\/ATTINY85-20PU-ND\/735469\">AVR\u00ae ATtiny Microcontroller IC 8-Bit 20MHz 8KB (4K x 16) FLASH 8-PDIP<\/a>, but other suppliers have it too:  SparkFun <a href=\"https:\/\/www.sparkfun.com\/products\/9378\">AVR 8 Pin 20MHz 8K 4A\/D &#8211; ATtiny85<\/a><\/li>\n\n\n\n<li>a tiny <strong>speaker<\/strong> or <strong>piezo buzzer<\/strong>. Either will do, and will be pretty quiet \u00e2\u20ac\u201d you&#8217;re not getting room-filling fidelity out of this project. I used a 28 mm headphone driver I got surplus years ago. The <a href=\"https:\/\/www.thingiverse.com\/thing:4248579\">snazzy speaker horn<\/a> in the picture above is designed to fit this and not much else, alas.<\/li>\n\n\n\n<li>a <strong>battery and battery holder<\/strong>. Pretty much anything from 3\u20135 V will do. I used a CR2032 coin cell in a simple holder to feed 3.2 V to the circuit:  SparkFun <a href=\"https:\/\/www.sparkfun.com\/products\/783\">Coin Cell Battery Holder &#8211; 20mm (PTH)<\/a>. Note you&#8217;ll need a battery and something to connect it to the breadboard.<\/li>\n\n\n\n<li>a <strong>10 k\u03a9 <\/strong>or higher<strong> resistor<\/strong> is highly recommended. All this does is prevent the chip resetting accidentally. Value is not important: I&#8217;ve been using a 4.7 k\u03a9<strong> <\/strong>one without problem. These are so generic I&#8217;m not going to list suppliers (along with the rest of the parts on this list)<\/li>\n\n\n\n<li>a <strong>10 nF ceramic capacitor<\/strong>, while optional, likely makes the power into the \u00b5c a tiny bit smoother<\/li>\n\n\n\n<li><strong>jumper wires<\/strong> to connect everything up.<\/li>\n<\/ul>\n\n\n\n<p>But that&#8217;s not all: you&#8217;ll need much more kit to <em>program<\/em> these tiny chips:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a <strong>computer running Linux<\/strong>. Yes, you can do this under Windows and Mac OS, but I don&#8217;t know how and there are search engines that care about that more than I do. I tested all of this on a Raspberry Pi 4. Tablets and phones are out, sorry<\/li>\n\n\n\n<li>an <strong>AVR programmer<\/strong>. You can use an <a href=\"https:\/\/www.arduino.cc\/\">Arduino<\/a> for this (either an <a href=\"https:\/\/elmwoodelectronics.ca\/products\/arduino-uno-r3?variant=14194532803\">official one<\/a> or a cheaper <a href=\"https:\/\/www.universal-solder.ca\/product\/arduino-uno-r3-atmega328p-atmega16u2-compatible-free-battery-cable\/\">clone<\/a>) but you&#8217;ll need <a href=\"https:\/\/www.arduino.cc\/en\/tutorial\/arduinoISP\">some additional fiddling and a 10 \u00b5F capacitor to get that going<\/a>. I used a dedicated <a href=\"https:\/\/www.adafruit.com\/product\/46\">USBtinyISP<\/a> programmer just because I had one, but it&#8217;s not really necessary. Whatever you use, you&#8217;ll need a USB cable for it<\/li>\n\n\n\n<li>probably more <strong>jumper wires<\/strong>. <\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Software<\/h2>\n\n\n\n<p>There are two separate toolchains involved \u2014 one to build the mmml-compiler to convert PROTODOME&#8217;s compositions to \u00b5c embedded C code, and another to compile that to ATtiny85 instructions. We can install it all in one go:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install avrdude gcc-avr binutils-avr avr-libc build-essential git<\/pre>\n\n\n\n<p>Building mmml-compiler is easy enough:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone https:\/\/github.com\/protodomemusic\/mmml.git<br>cd mmml\/mmml-compiler<br>gcc -o mmml-compiler mmml-compiler.c<\/pre>\n\n\n\n<p>You can then run the compiler on each of the songs; the album title track, for example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd ..\/demo-songs\/4000ad\/<br>..\/..\/mmml-compiler\/mmml-compiler 4000ad.mmml<\/pre>\n\n\n\n<p class=\"has-drop-cap\">\u26a0\ufe0f If you get <strong>[ERROR 14] Too few channels stated!<\/strong> instead of <strong>Successfully compiled!<\/strong> it seems that the compiler isn&#8217;t too happy running on some 64-bit systems. I did all my compilation on a Raspberry Pi 4 running Raspbian and all was well. If you can&#8217;t get them to compile, I&#8217;ve pre-compiled them for you and they&#8217;re at the end of this article. (<strong>Update: <\/strong>this has been fixed. If you still have the problem, are you running old code?)<\/p>\n\n\n\n<p>You should now have a musicdata.h file that contains all the tune data. Copy it to the same folder as the mmml-player C code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cp musicdata.h ..\/..\/mmml-player\/<br>cd ..\/..\/mmml-player\/<\/pre>\n\n\n\n<p>That folder now contains the player and one tune data file. Now you need to compile it into AVR instruction to write to your chip:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">avr-gcc -g -Os -mmcu=attiny85 -DF_CPU=8000000 -o mmml.bin mmml.c\navr-objcopy -j .text -j .data -O ihex mmml.bin mmml.hex\nrm mmml.bin<\/pre>\n\n\n\n<p>The end result of what that just did is create a single small file <strong>mmml.hex<\/strong> containing the ATtiny85 program instructions for the 8+ minute track <a href=\"https:\/\/protodome.bandcamp.com\/track\/4000ad-2\">4000AD<\/a>. If you&#8217;re compiling for a different \u00b5c, you&#8217;ll need a different avr-gcc line:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>-mmcu=attiny85<\/em> will need to be changed for your \u00b5c. avr<em>-gcc &#8211;target-help<\/em> lists the supported targets in the \u201cKnown MCU names\u201d section way up at the top of its too-copious output. If you&#8217;re using the <a href=\"http:\/\/ww1.microchip.com\/downloads\/en\/DeviceDoc\/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf\">ATmega32P<\/a> chip made popular by Arduinos, that option should be <em>-mmcu=atmega328p<\/em><\/li>\n\n\n\n<li><em>-DF_CPU=8000000<\/em> tells the compiler that the CPU frequency should be 8 MHz. The AVR \u00b5cs can run at a huge range of speeds, but PROTODOME&#8217;s music is timed to work at 8 MHz only.<\/li>\n<\/ul>\n\n\n\n<p class=\"has-light-blue-background-color has-background\">\u2192\u2192\u2192 <em>aside<\/em><\/p>\n\n\n\n<p class=\"has-light-blue-background-color has-background\">If you find yourself compiling a few simple AVR projects but want to stop short of a fine-but-overly-complex Makefile project for AVR development, this script to create a hex file from a single embedded C source file might be useful:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-background has-light-blue-background-color\">#!\/bin\/bash\n# avrbuild.sh - build a simple AVR project - scruss, 2020-04\n# usage: avrbuild.sh file.c mcutype freq\n# eg: avrbuild.sh mmml.c attiny85 8000000\n\nb=\"${1%.c}\"\nrm -f \"$b.bin\" \"$b.hex\"\navr-gcc -g -Os -mmcu=\"$2\" -DF_CPU=\"$3\" -o \"$b.bin\" \"$b.c\"\navr-objcopy -j .text -j .data -O ihex \"$b.bin\" \"$b.hex\"\navr-size --format=avr --mcu=\"$2\" \"$b.bin\"\nrm -f \"$b.bin\"<\/pre>\n\n\n\n<p class=\"has-light-blue-background-color has-background\">In addition to creating a hex file, it also runs the <em>avr-size<\/em> tool to show you much memory your program uses. The 4000AD tune uses 98% of the ATtiny85&#8217;s 8192 byte program space \u2014 not quite enough to include that 14 minute extra bass solo, sorry \u2026<\/p>\n\n\n\n<p class=\"has-light-blue-background-color has-background\">\u2190\u2190\u2190 <em>end aside<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Flashing the chip<\/h2>\n\n\n\n<p>So now we do some wiring. If you&#8217;re using a dedicated programmer, use jumpers to connect its ICSP port to the ATtiny 85 like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">                        ________              \n                       |o   A   |             \n               Reset  -+ 1  T  8+-  VCC       \n                       |    t   |             \n                      -+ 2  i  7+-  SCK       \n                       |    n   |             \n                      -+ 3  y  6+-  MISO      \n                       |    8   |             \n               GND    -+ 4  5  5+-  MOSI      \n                       |________|             \n                                              \n\n                 MISO    o1 2o   VCC   \n                 SCK     o3 4o   MOSI     \n                 Reset   o5 6o   GND \n\n                          ICSP\n                        Connector\n<\/pre>\n\n\n\n<p>Wire VCC to VCC, MISO to MISO, MOSI to MOSI, SCK to SCK, Reset to Reset and GND to GND. If you&#8217;re using an Arduino, you want to do this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"844\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/ArduinoNanoISP-ATtiny85.png\" alt=\"\" class=\"wp-image-16107\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/ArduinoNanoISP-ATtiny85.png 586w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/ArduinoNanoISP-ATtiny85-222x320.png 222w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/ArduinoNanoISP-ATtiny85-111x160.png 111w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><figcaption class=\"wp-element-caption\">This is \u201c<em>OLD_STYLE_WIRING<\/em>\u201d for using ArduinoISP, apparently. But it works!<\/figcaption><\/figure>\n\n\n\n<p>The wiring for that is:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Arduino D10 \u2192 ATtiny Pin 1 (Reset)<\/li>\n\n\n\n<li>Arduino GND \u2192 ATtiny Pin 4 (GND)<\/li>\n\n\n\n<li>Arduino D11 \u2192 ATtiny Pin 5 (MOSI)<\/li>\n\n\n\n<li>Arduino D12 \u2192 ATtiny Pin 6 (MISO)<\/li>\n\n\n\n<li>Arduino D13 \u2192 ATtiny Pin 7 (SCK)<\/li>\n\n\n\n<li>Arduino 5V \u2192 ATtiny Pin 8 (VCC)<\/li>\n\n\n\n<li>You&#8217;ll also need to put a 1-10 \u00b5F electrolytic capacitor between the Arduino&#8217;s Reset and GND pins, but only <span style=\"text-decoration: underline;\">after<\/span> you&#8217;ve programmed it with the ArduinoISP sketch.<\/li>\n<\/ul>\n\n\n\n<p>You&#8217;re almost there!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up the programmer: USBtinyISP<\/h3>\n\n\n\n<p>If you haven&#8217;t used one with your computer before, you need to do a little bit of prep so your computer recognizes it. These are modified from a <a href=\"https:\/\/gist.github.com\/Stefan-Code\/d09914ffed09cf5790b0a89227857349\">gist<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>do <code>sudo vi \/etc\/udev\/rules.d\/41-usbtiny.rules<\/code><\/li>\n\n\n\n<li>add the line <code>SUBSYSTEM==\"usb\", ATTR{idVendor}==\"1781\", ATTR{idProduct}==\"0c9f\", GROUP=\"plugdev\", MODE=\"0666\"<\/code><\/li>\n\n\n\n<li>save and exit<\/li>\n\n\n\n<li>do <code>sudo udevadm control --reload<\/code> then <code>sudo udevadm trigger<\/code><\/li>\n<\/ul>\n\n\n\n<p>Your system should automatically recognize the device and give you permission to use it without <em>sudo<\/em> privileges.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Setting up the programmer: ArduinoISP<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Load the <strong>ArduinoISP<\/strong> sketch (it&#8217;s in <em>File<\/em> \u2192 <em>Examples<\/em>)<\/li>\n\n\n\n<li>Add (or find and uncomment) the line <code>#define USE_OLD_STYLE_WIRING<\/code><\/li>\n\n\n\n<li>Upload the code to your Arduino<\/li>\n\n\n\n<li>Connect the 1-10 \u00b5F electrolytic capacitor between the Arduino&#8217;s Reset and GND pins<\/li>\n<\/ul>\n\n\n\n<p>To program the <strong>mmml.hex<\/strong> you created earlier, you&#8217;ll need one of these avrdude commands:<\/p>\n\n\n\n<p><strong>For USBTinyISP:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>avrdude -c usbtiny -p attiny85 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -U flash:w:mmml.hex:i<\/code><\/pre>\n\n\n\n<p><strong>For ArduinoISP:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>avrdude <code>-c arduino<\/code><\/code> <code><code>-P \/dev\/ttyUSB0 -b 19200<\/code> -p attiny85 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -U flash:w:mmml.hex:i<\/code><\/pre>\n\n\n\n<p>What all that means:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>-c usbtiny<\/code> or <code>-c arduino<\/code>: programmer type. In addition, the <em>arduino<\/em> programmer takes additional parameters <code>-P \/dev\/ttyUSB0 -b 19200<\/code> which specify the port (usually <code>\/dev\/ttyUSB0<\/code> or <code>\/dev\/ttyACM0<\/code>) and the baud rate (always 19200, unless you changed it in the source of ArduinoISP)<\/li>\n\n\n\n<li><code>-p attiny85<\/code>: the chip type, as used in the avr-gcc compiler call way up the top<\/li>\n\n\n\n<li><code>-U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m<\/code>: fuses are AVR&#8217;s confusing name for configuration bits. You might just have to take my word that this sets an ATtiny85 to use the internal 8 MHz oscillator (as opposed to an external crystal)  we told the compiler to use further back. A guide to fuse settings is available at the <a href=\"http:\/\/www.engbedded.com\/fusecalc\/\">Engbedded AVR Fuse Calculator<\/a><\/li>\n\n\n\n<li><code>-U flash:w:mmml.hex:i<\/code>: the hex file we prepared, <code>mmml.hex<\/code>.<\/li>\n<\/ul>\n\n\n\n<p>If everything went right with your flashing process, you should see lots of \u201c<em>avrdude: verifying \u2026 done<\/em>. <em>Thank you<\/em>\u201d. If you don&#8217;t, likely you missed a connection somewhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u266b Playing the tunes! \u266b<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"925\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/Protodome_player-ATtiny85.png\" alt=\"\" class=\"wp-image-16109\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/Protodome_player-ATtiny85.png 723w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/Protodome_player-ATtiny85-250x320.png 250w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/Protodome_player-ATtiny85-125x160.png 125w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><figcaption class=\"wp-element-caption\">This circuit&#8217;s a lot simpler than it looks!<\/figcaption><\/figure>\n\n\n\n<p>I already described all of the bits in the bill of materials in the <strong>Hardware<\/strong> section. If you want it in ASCII art, here&#8217;s all there is to it:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">                        ________              <br>                       |o   A   |             <br>          VCC--(10k\u03a9)--+ 1  T  8+--VCC        <br>                       |    t   |             <br>                      -+ 2  i  7+-            <br>                       |    n   |             <br>                      -+ 3  y  6+-      (     <br>                       |    8   |      ((     <br>                  GND--+ 4  5  5+--(SPKR(--GND<br>                       |________|      ((     <br>                                        (     <br><br>          Pin 1: RST - held high through pull-up to prevent reset<br>          Pin 4: GND<br>          Pin 5: PB0 - through speaker\/buzzer to GND<br>          Pin 8: VCC - can be a CR2032 Lithium coin cell<br><br>          Not shown: 100 nF decoupling capacitor between VCC and GND<br>          Short Pin 1 to GND to restart song<br><br><\/pre>\n\n\n\n<p>If you weren&#8217;t able to compile the tunes, I&#8217;ve included (with Blake&#8217;s permission) source for any AVR \u00b5c plus hex files for ATtiny85s here: <a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/protodome-mmml-examples.zip\">protodome-mmml-examples.zip<\/a><\/p>\n\n\n\n<p>Last but not least, there are a couple of tracks included in the source that aren&#8217;t on the 4000AD album. Blake gave me permission to include them here, too:<\/p>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/fly_me_to_the_moon.mp3\"><\/audio><figcaption class=\"wp-element-caption\"><strong>Fly Me to the Moon<\/strong> by Bart Howard, arranged for ATtiny85 microcontroller by <strong>PROTODOME<\/strong>, 2020.<br>Download: <a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/fly_me_to_the_moon.mp3\">fly_me_to_the_moon.mp3<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-audio\"><audio controls src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/till_there_was_you.mp3\"><\/audio><figcaption class=\"wp-element-caption\"><strong>Till There was You<\/strong> by Meredith Willson (from the musical \u2018The Music Man\u2019), arranged for ATtiny85 microcontroller by <strong>PROTODOME<\/strong>, 2020.<br>Download: <a href=\"http:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/till_there_was_you.mp3\">till_there_was_you.mp3<\/a><\/figcaption><\/figure>\n\n\n\n<p>These weren&#8217;t recorded from a tiny speaker (that went badly), but directly to a Marantz solid state recorder. The rig&#8217;s the same as the playback one, with the speaker replaced by a potentiometer (for level control), a 100 \u00b5F capacitor (to take off some of the DC bias and also to cut some of the very high frequencies) and a headphone socket. Have fun!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"800\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/chiptune_player.jpg\" alt=\"\" class=\"wp-image-16114\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/chiptune_player.jpg 800w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/chiptune_player-320x320.jpg 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/chiptune_player-160x160.jpg 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/04\/chiptune_player-768x768.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption class=\"wp-element-caption\">it&#8217;s the most awkward walkman!<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love the ingenuity that goes into making very tiny projects do very big things. I also love chiptunes. So when I read the metafilter post about PROTODOME&#8217;s compositions for the ATtiny85, I was very much there for it. 4000AD by PROTODOME The circuit to play this is no more than a $2 microcontroller, a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":16086,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"@PROTODOME's wonderful chiptunes: how to play them on your own ATtiny85 chips. Also includes a couple of demo tracks not on the 4000AD album!","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12,7],"tags":[3216,2092,2415,3217,1913],"class_list":["post-16088","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-audblog","category-computers-suck","tag-avr","tag-chiptune","tag-microcontroller","tag-protodome","tag-retro"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/03\/sunday-morning-chiptunes.jpg","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-4bu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=16088"}],"version-history":[{"count":20,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16088\/revisions"}],"predecessor-version":[{"id":17656,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16088\/revisions\/17656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media\/16086"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=16088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=16088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=16088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}