Reading List
The most recent articles from a list of feeds I subscribe to.
Bullet Train to Merlin's Grave
If this is the future, why are you the same?
My cousin Megeen got married two weeks ago. Instead of the traditional night-before-the-wedding welcome party, she and her now-husband David Pope hosted POPESTOCK - a musical celebration featuring a variety of family-and-friends acts.
It was amazing.
The location for POPESTOCK was the mysterious Elk's Lodge in Red Bank, New Jersey. This rectangular shack of a building stands next to Riverside Gardens Park with perfect views of the Navesink River - the primo of primo locations in my hometown. For years, my cousins and I have wondered what lay beyond its unassuming doorway. We soon learned the answer: a really big bar and an even bigger empty room. In other words, exactly what we needed.
Uncle Mike and Aunt Susan emceeded the festivities. They had one explicit rule: each act would be limited to one song. We've got a lot of musical cousins (see Buffalo Rose or Dark City Strings).
But there were three exceptions to that rule:
David's old band Lightninging performed the ENTIRE BACKSIDE of Abbey Road, straight-through. It was completely unreal. I felt like I was watching the Beatles, if the Beatles lasted into the 1970s and moved to Brooklyn and also worked at Vinny's Pizzaria. If you have the means, I highly recommend seeing Lightninging live.
Aunt Eileen (the mother of the bride) and her old friend (along with her son-in-law Greg) played two songs that they wrote years ago, one of which was last performed only at her own wedding. I've always been told that Aunt Eileen could give Joni Mitchell a run for her money, and I was told right. Their set was reminiscent of the MUSIC FROM MALLARD concert series that my aunts and uncles put together in the mid-1980s at my Nana and Grandpa's house on Mallard Road in Middletown, New Jersey. These concerts pre-date my appearance on Earth, but I've got a handful of the cassette tapes in my possession and I still wear the MALLARD III t-shirt all the time.
My set.
Although, one could argue (and I did) that my performance was really more of a medley than two distinct songs. Further, I think one could even argue that my set was less of a medley and more of a complete disaster.
Allow me to explain.
I've written a six-fingered handful of songs in my life, but the two that seem to echo in eternity are called MERLIN'S GRAVE and BULLET TRAIN. These two have been battle-tested and laughed at across many-a-campfire with my cousins over years.
You see, neither of them are very good. Nor am I a good singer. But you can't tell me that they aren't groovy.
My vision for the one-song set was this: I play the entire Merlin's Grave up to the jam section, which would turn into this epic Mike Oldfield's Tubular Bells style as I introduce additional instruments, one at a time. First, banjo by my cousin Jack. Then, mandolin by my cousin Michael. Finally, electric guitar by my cousin Peter. To cap it off, I'd come in with some harmonica on top of it all. I put together a quick-and-dirty take of my vision on my laptop a few days before the wedding and emailed it to my cousins, which you can listen to here:
So far, so good. Simple. One-song. No Bullet Train. I was attempting to be a rules-follower.
But you can't stop the bullet train once it goes off the rails...
We are Hotdog Johnny and the Shady Oaks:
- Charlie Harrington - Vocals, Acoustic Guitar, Harmonica
- Michael Byrnes - Mandolin, Vocals
- Jack Byrnes - Banjo
- Aidan Byrnes - Drums
- Peter Clabby - Electric Guitar
- Alex "The Grones" Groneman - Acoustic Guitar
- Some dude no one knew - Bass
- Tommy Clabby - Sound engineer
Summer Wind
Newport, Rhode Island
A film photo I took with my friend Kristen's old camera. Alternative title: Kite Armada.
Relay
I opened up Logic on a whim tonight and found the beginnings of this song, just sitting there, from a previous flight or some other bored evening. I think I probably ruined anything good about this song with the new middle section, but I swear it sounded good in my head(phones).
The bouncing ball animation was created with the p5.js web editor, which is both awesome and easy to use. Don't take my word for it -- try out this code (not exactly the same as in the video, but probably cooler) and you'll see how fun p5.js / processing can be for kids of all ages.
function setup() {
createCanvas(400, 400);
background(0);
}
function draw() {
circle(mouseX, mouseY,10);
}
An Afternoon with Arduino
For the last eight years or so, I've been carrying around an Arduino (not literally on my person, but, you know, amongst my treasures), waiting for just the right time to start tinkering with it.
That time, it turns out, was yesterday afternoon. This post outlines some of things I've learned so far.
Ard-what-now?
An Arduino is a microcontroller board. The board contains a CPU (central processing unit) along with some I/O (input / output) connections. You can think about it as a small circuit - a circuit that happens to contain a programmable computer on a chip. A chip that you can learn to easily program.
Here's a picture of my Arduino (of the Uno varietal):
I love the MADE IN ITALY mark in the upper left.
The microprocessor (the computer chip) is the long flat black rectangle near the bottom-right corner of the device. It has 28 pins (14 on each side). Along the top edge of the Arduino you can see a strip of black input pins - these are the Arduino's "digital" pins (meaning that they can either be "on" or "off"). Below the CPU on the bottom right you can see another 5 "analog" pins (meaning that they can receive analog / continuous signals), and then a few "power" pins to the left to provide voltage, ground, and some other stuff that I don't know about yet.
Arduino vs Raspberry Pi
At this point, you might be asking yourself, "How is an Arduino different from a Raspberry Pi?"
It's a good question, since both are affordable, adorable, tiny little computers that you can buy for about $30 bucks or less. But the Raspberry Pi is a full-on Linux computer. An Arduino is... not. Instead, the Arduino computer holds just one program at a time. It stores this program in durable memory, so that you can turn the Arduino on and off, and it will still "remember" its latest program. It's more like a single-purpose device -- except you can dream up and build that single-purpose as many times as you want.
Open-source roots
The company behind Arduino is a non-profit and the Arduino itself is open-source - which means that anyone can build an Arduino board themselves. The original idea behind Arduino was to make a simple device that designers and artists could use for rapid prototyping of physical computing projects that use sensors (aka inputs like a keyboard or mouse or motion detectors) and actuators (aka outputs like a display or printer or lights) to interact and communicate with us human beans. Cool.
Arduino is closely tied to the Processing community. In fact, that's a bit of an understatement, since you actually write Processing code when writing programs for the Arduino -- and, just like in Processing, these programs are also called Sketches. I was happy to see this, since one of my earliest computing classes was Jer Thorp's Introduction to Processing course (which I unabashedly recommend, by the way).
As I mentioned, anyone can download the open-source schematics for Arduino and build a board themeselves with basic components. But if you'd like to make your tinkering lifestyle easier, then I suggest picking up a pre-assembled Arduino from a retailer like Makershed or Adafruit. The kit I bought (eight years ago) is the MAKE: Getting Started With Arduino Kit -- the current version (v3) appears to be retailing for $79.99 bucks. IMHO, it's definitely worth it -- the kit comes along with a bunch of goodies that help you get started right away, like a breadboard, colorful wires, clickable switches, LEDs, sensors, and a friendly introductory book. I also picked up Arduino: A Quick-Start Guide by Maik Schmidt, and I've been enjoying this book as well.
Fun with LEDs
I believe you're legally required to write a program that blinks an LED on and off as your first project with Arduino.
If you asked me a few days ago about LEDs - yeah, sure, I know about LEDs. Those little red lights in things like my Game Boy. Stands for... light emitting... diode.
Great, you continue, what's a diode?
Um.
This is already one of the fun things about playing with Arduino. There are all sorts of basic electronics stuff that I sorta know about, but couldn't explain to a five-year-old or to a rubber duck on my desk. Or just don't know at all. But Arduino is helped me tackle these topics in a practical, tangible way.
So, let's take a look at an LED together.
See the longer pin / leg sticking out of the red part? That's the anode terminal. The anode is the positive end of the LED. The shorter leg is the cathode - the negative side. Electrons will flow from the anode to the cathode when connected. You'll want to connect the positive end to something providing voltage, and the negative end needs to be connected to ground. All diodes are polarized, meaning they have these distinct positive and negative sides. And LEDs (light emitting diodes) happen to provide illumination when they're connected to an active circuit.
And they can be lots of pretty colors, too.
Okay, so here's our legally-required sketch for blinking an LED connected to digital pin 13 every half-second.
const int LED = 13;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(500);
digitalWrite(LED, LOW);
delay(500);
}
Pretty simple, right? We first declare a constant variable for the pin we're using. The setup()
function will run once per program, right before the loop()
kicks off its infinite loop, so we'll just let the Arduino know that we want to set pin 13 to OUTPUT
mode. And then during our infinite loop, we'll toggle the voltage to the pin by passing HIGH
(5 volts) or LOW
(0 volts) to our pin 13 using the digitalWrite
function, pausing 500 milliseconds between these operations.
If you're coming from the Processing world, then this program structure of setup()
and loop()
should look very familiar, since it's literally the same.
The Arduino IDE provides an easy way to verify your programs compile before flashing them over to your actual Arduino, so I suggest clicking the Verify
button first. This will catch syntax errors, like pesky missing semi-colons.
Next, we can set up our physical device.
I'm going to stick the LED into the Arduino, with the anode leg going into pin 13 and the cathode leg into ground. Note here that pin 13 is a special pin on the Arduino that has a resister built-in. If you try this with any other pin the Arduino, then the LED will burn out.
Finally, we can send our program from our computer to the Arduino over a USB connection by clicking the Upload
button in the IDE. Your Arduino should flash happily once its complete, and then it's off to the infinite races.
Look at that blinker. Pretty great, huh? Note that this gif definitely speeds things up a bit.
Putting the "S" in USB
So, as I continued building stuff, I inevitably found myself wanting to console.log
the heck out of a program that wasn't working.
Let's talk about printing stuff with Arduino.
Your Arduino is connected to your computer via a USB cable. USB. USB. That has to stand for something, right? It does. It stands for "Universal Serial Bus." USB is a quote "industry standard" for communications between computers and peripherals. If you think back really hard to the time of Captain Marvel or even earlier, you might remember other ways that we connected peripherals to our computers -- like an dot matrix printer's parallel port or a PS/2 keyboard port. Well, in the time since Carol Danvers left us here to fend for ourselves, USB has taken over our hearts, minds, and wallets. But we're still using a "serial connection" when we're using USB devices - so we'll need to use the serial protocol to communicate with our Arduino.
In other words, if we want to send or receive info from our Arduino program, we need to establish a serial connection with the device. Here's how you do that in a Processing sketch:
const unsigned int BAUD_RATE = 9600;
void setup() {
Serial.begin(BAUD_RATE);
}
void loop() {
Serial.println("Hello, world!");
}
Baud rate, huh? I know this baud
term, too. Modems had baud rates, IIRC. Some Wikipedia-ing and Google-ing reveal that baud rates are the rates at which information is transferred in a serial channel. In this case, with a baud rate of 9600, we're transferring a max of 9600 bits per second. 9600 happens to be the standard baud rate for Arduinos, but I believe you can choose a different rate.
To view your "console", you can click the "Serial Monitor" button in the IDE.
In addition to viewing received information, you can also send messages back to the Arduino in this monitor using the text input on the top panel and the Send
button. For example, you might write a program that toggled an LED on or off based on a specific input key.
What if you don't want to use the Serial Monitor in the Arduino IDE? Maybe it's time to let the old ways die. I agree. If you're on a Mac, then you can try running the screen
command from your terminal, specifying both the name of your serial connection to your Arduino and the baud rate.
screen <name_of_serial_connection> 9600
In my case, the name of the connection was /dev/cu.usbmodem14101
, which you can find in the Tools/Port
menu of the Arduino IDE.
Word of warning, however. If you close this terminal window, it won't close the sesssion, and you'll be unable to Upload new programs to your Arduino. This is called a "detached screen" and it's annoying. You need to quit the screen somehow, and you can use this command to do so:
screen -X -S <name_of_session> quit
Oh, to get the name of the detached session, you can type:
screen -ls .
This whole serial communications thing opens up some interesting ideas, since you can have two way comms between your Arduino and something else. Forget Alexa. Not-okay, Google. Go away, Siri. Now you can build your own talking robotic best friend, instead. Hopefully gets some gears turning for you, too.
Counting in binary with LEDs
In general, life-goal-wise, I've been trying to get better at thinking and counting in binary, so I decided to build a little binary counter for my next Arduino project.
const unsigned int LED_BIT0 = 12;
const unsigned int LED_BIT1 = 11;
const unsigned int LED_BIT2 = 10;
const unsigned int LED_BIT3 = 9;
long result = 0;
void setup() {
pinMode(LED_BIT0, OUTPUT);
pinMode(LED_BIT1, OUTPUT);
pinMode(LED_BIT2, OUTPUT);
pinMode(LED_BIT3, OUTPUT);
}
void loop() {
result++;
if (result == 16) {
result = 0;
}
output_result(result);
delay(500);
}
void output_result(const long result) {
digitalWrite(LED_BIT0, result & B0001);
digitalWrite(LED_BIT1, result & B0010);
digitalWrite(LED_BIT2, result & B0100);
digitalWrite(LED_BIT3, result & B1000);
}
I'm not sure why the red LED isn't as bright as the other three LEDs. I tried swapping it out with another LED to no avail. But, hey, other than that, this thing works!
I also learned that breadboards are great. Being able to run all the cathode sides of the LEDs to the bottom negative row of the breadboard, and then only connecting that row once to the Arduino's ground port is pretty darn helpful. I have more to learn and appreciate here, for sure.
Also, this is the first time that I've really leveraged the power of the bitwise-and operator. I'm taking my result
and bitwise-and it with a binary number that represents a binary digit (1's, 2's, 4's, 8's) for each of the LEDs. The bitwise-and operation returns true
if result
and our binary number both contain a 1
for the given binary digit. For example, let's look at the number 3
3 & B0001; // true
3 & B0010; // true
3 & B0100; // false
3 & B1000; // false
The final trick here is that digitalWrite
function transforms true
boolean values into HIGH
(turn on the LED) and false
into LOW
(turn off the LED). So, for the number 3
the LED for the 1
's digit and the 2
's digit should be lit, and the 4
's and 8
's should be off.
That's pretty awesome and makes this code very concise. There's much more to explore here for me.
More tinkering
So, after a mere afternoon, I've learned a ton and had quite a bit of fun along the way.
What's next, you ask? Well, resistors are still perplexing. I'm not sure yet how to determine what level of resistence is needed for a given situation. I've already fried an LED (a delightful puff of smoke wisps out during its last gasp of life), likely for this very reason. It's also really hard to read those colorful bands to try to determine their resistance level. This seems like it could be a great little computer vision / deep learning app. Or perhaps I should just use my multimeter more regularly.
I'm also thinking more about the difference between analog and digital signals. Digital is binary (either on or off), whereas analog is continuous. Most of what we observe in life is an analog signal. So when we choose to digitize them, we need to choose specific moments to "sample" the values of the continuous signal. The Schmidt book explained that an audio CD takes a sample every 44,100 per second (or 44.1 kHz). Maybe this is why vinyl is back.
I thinking that my obvious next project here with Arduino is to make an alarm clock with binary numbers. There are tons of neat examples of this project across the web, and I think it could be a good way to learn / improve my soldering skills, as well as my quick mental binary counting, especially while groggy in the middle of the night.
Novels with Giant Possibly Magical Libraries
I'm currently reading a fantastic novel where the protaganist - who is in her teens and lives in a sort-of convent for sightseers in the middle of a glacier - is asked by the elders to choose a role for part-time work. Our hero considers two options:
- Become a pilot of paper-mache, semi-alive airplanes controlled by whistling
- Become a librarian
I held my breath as I read further: choose The Library!
Why Libraries?
There are two things that, when I encounter them in a book, immediately cause me to fall in love.
- The word
palimpsest
- A giant, possibly magic, library (extra points for a Forbidden Section or two)
The two are not unrelated. A palimpsest is a book that has been one or more books before, with the older knowledge hidden just beneath the surface of the parchment, waiting to be unearthed. A giant library must, invariably, contain books with once-known, now-forgotten knowledge, just beyond that locked door over there.
But I have the key...
I hereby present a list of the very best novels featuring giant libraries filled with secrets.
My List of Novels with Giant Libraries
- La Sombra del Viento (The Shadow of the Wind) - Carlos Ruiz Zafón
- The Kingkiller Chronicles
- The Name of the Wind - Patrick Rothfuss
- The Wise Man's Fear - Patrick Rothfuss
- The Name of the Rose - Umberto Eco
- Lirael - Garth Nix
- The Library at Mount Char - Scott Hawkins
- Jonathan Strange and Mr. Norrell - Susanna Clarke
- Harry Potter
- Harry Potter and the Sorcerer's Stone - J.K. Rowling
- Harry Potter and the Chamber of Secrets - J.K. Rowling
- Harry Potter and the Goblet of Fire - J.K. Rowling
- Rainbows End - Vernor Vinge
- A Fire Upon the Deep - Vernor Vinge
- A Deepness in the Sky - Vernor Vinge
- Anathem - Neal Stephenson
- Snow Crash - Neal Stephenson
- Mr. Penumbra's 24 Hour Bookstore - Robin Sloan
- A Discovery of Witches - Deborah Harkness*
- The Library of Babel - Jorge Luis Borges*
- The Pagemaster - Todd Strasser*
- The Strange Library - Haruki Murakami*
- Invisible Cities - Italo Calvino*
- Kafka on the Shore - Haruki Murakami*
- In the Stacks - Scott Lynch*
- Ink and Bone - Rachel Caine*
- The Colour of Magic (Discworld #1) - Terry Pratchett*
- If on a Winter's Night a Traveler - Italo Calvino
- Preludes & Nocturnes (The Sandman #1) - Neil Gaiman*
- Wireless - Charles Stross*
- The Book of the New Sun - Gene Wolfe*
- Eon (The Way #1) - Greg Bear*
- Protector - Larry Niven*
- The Book of Sand - Jorge Luis Borges*
*Indicates that I haven't read this book (yet), but rest assured that it was recommended by a semi-close friend, cousin of mine, or Hacker News commenter.
Let me know on Twitter (@whatrocks) if I'm missing anything and I'll update the list, almost like a palimpsest.