Zach Capalbo.com Resume Projects Music Art Banjos

Electronic Hurdy Gurdy

What it is

The Hurdy Gurdy

A hurdy-gurdy is a musical instrument that hearkens from medieval Europe. Notably, it is played by turning a crank and pressing keys.

My electronic hurdy-gurdy is an attempt to capture some of the spirit of the hurdy-gurdy in the form of a modern electronic instrument that is both fun (for me) to play and to tinker with. Ideally it sounds good, too.

The hurdy gurdy from another angle In an ideal world, this would win all the contemporary music awards…

How it works

The hurdy gurdy is powered by an Esquilo microcontroller. The Esquilo is nifty because it has more IO than an arduino, you program it using Squirrel rather than some ugly C/Java imitation, and it's got built-in wifi / http / RPC.

All of the buttons are connected to GPIOs on the esquilo. The buttons on the front of the instrument control the pitch. Right now it's monophonic, so whichever the highest pitched button is pressed, that's the pitch that's played. The two buttons on the side of the instrument will shift all of the available pitches up or down.

The pitches are defined by the current tuning. A tuning is just a mapping of which buttons correspond to which notes and what happens when you shift those notes up and down. All the different tunings are defined in a JSON file, and you can switch between them using the knob on the side of the instrument, near the shifter buttons. There's even an RGB led that changes color depending on which tuning you select, so you can know what key you're playing in. This is especially helpful if you want to play with other people.

There are three switches on the front which let you choose a pitch to be played as a drone. There are 2^3 - 1 available drone pitches per tuning. When all switches are off, no drone is sounded.

Hurdy Gurdy Top

The soul of the thing comes from the DC motor attached to the make-shift crank. When the crank is turned, the motor generates a voltage, which is read by the esquilo's ADC and used to set the volume of the pitch being played. The voltage is proportional to the rate at which the crank is turned, so if you turn it quickly, it will be loud, and if you turn it slowly, it will be soft. If you don't turn it at all, it will be off.

Currently, the pitch is generated using a PWM pin (see the TODOs below). There's an on-board piezo speaker, and a 3.5mm jack for connecting to headphones—or the nifty detachable battery powered speakers for some real volume.

The frame was put together using MakerBeam anodized T-Slot aluminum beams for that slick, futuristic look along with some black ABS plastic. The crank is a hodge-podge of MakerBeam and moldable thermoplastic.

I dislike soldering, so the innards are full of alligator clips, breadboards, and jumper wire. There's also one of those big USB battery packs to power the whole thing, so you don't even have to plug it in!

How it sounds

Sort of like a cross between a bagpipe, an accordion, and a cheap guitar amplifier.

What doesn't work yet

Where's the source

The source code is available at: https://gitlab.com/zach-geek/hurdy-gurdy

The schematic:

Schematic

Why I did it (& Old Versions)

Real, professionally made hurdy gurdies are expensive. Cheap knock-offs are non-existent. Therefore, I started making my own.

The original version was put together for a 3-hour electronics lab and looked something like this: Original Design

It used an Arduino to generate a pitch, which was played through a speaker. It had two buttons to change pitch, and, the real hurdy gurdy kicker, a motor salvaged from an old printer connected to the gate of an amplifying transistor. When you cranked the motor, it allowed the current from the arduino to pass through the transistor to the speaker in porportion to how fast you cranked, making it feel like a real hurdy gurdy (or at least, how I imagine a hurdy gurdy feels.)

After class was over, I got to work. Using supplies from the ever helpful Radioshack, I managed to rig together a portable contraption with four buttons, a duck tape hand strap, and a crank that you could actually crank. However, four buttons was really not enough to get through all the melodies that I wanted to play, so I added a fifth, thumb button. The fifth button acts as a shifter for all of the other buttons, shifting all of the pitches to a higher register (defined by the user). This strained the resemblance to a real hurdy gurdy quite a bit, but made the thing tremendously more fun to play.

Old Videos

And here it was, in all its duck-tapey glory:

Old Source and Schematic

The Arduino source code is below:

  //A Real Live HURDY GURDY!!
  //
  // Zach Capalbo
  #define SPEAKER 9
  #include "pitches.h"


  int freq = 261;

  void setup() {
    pinMode(SPEAKER,OUTPUT);
    for (int i=2; i<=8; i++)
    {
      pinMode(i,INPUT);
      digitalWrite(i,HIGH);
    }
  }

  void normal_notes()
  {
    freq = NOTE_G4;
     if (digitalRead(2)==HIGH)
      freq = NOTE_A4;
    if (digitalRead(3)==HIGH)
      freq = NOTE_B4;
    if (digitalRead(4)==HIGH)
      freq = NOTE_C5;
      if (digitalRead(5)==HIGH)
      freq = NOTE_D5;
    tone(SPEAKER,freq);
  }

  void high_notes()
  {
    freq = NOTE_E5;
     if (digitalRead(2)==HIGH)
      freq = NOTE_F5;
    if (digitalRead(3)==HIGH)
      freq = NOTE_G5;
    if (digitalRead(4)==HIGH)
      freq = NOTE_A5;
      if (digitalRead(5)==HIGH)
      freq = NOTE_C6;
    tone(SPEAKER,freq);
  }

  void loop() {
    if (digitalRead(8) == HIGH)
      normal_notes();
     else
       high_notes();
  }

I don't have a real schematic yet, but here's a (much cleaned up!) diagram of the original breadboarded circuit created with the very friendly Fritzing. If you couldn't tell by now, I'm not an electrical engineer.

Breadboard Diagram