Category Archives: Autonomous Bassline

Updating firmware on AVR chips

A number of 4ms devices use an AVR microcontroller. These chips run a small program. On most 4ms devices that use an AVR chip, there’s a 6-pin header (2 rows of 3 pins) near the chip. This header lets you update, upgrade, or hack the AVR chip.

Here’s how to do it:

You will need…

  1. AVR ISP mk2
    AVR ISP mk2

    ISP (In-circuit Programmer): I recommend the AVRISP2 (also known as AVR ISP MKII) available from atmel.com, or Mouser for $34, or ebay and amazon sometimes. In Europe, try Farnell

  2. A computer with a USB port. Windows actually has the most seamless installer, but I also use Mac and Linux to burn code. Download and install one of these:
    • Windows: AVR Studio 4.19. Download it here: AVR Studio Archives. (Note that the latest version is AVR Studio 6, which will probably work, but these instructions are geared for AVR Studio 4)
    • Mac OS X:
      • Method 1: Install homebrew by following this guide (a one-line installation). Then type “brew install avrdude” into the Terminal and press enter. Then you can install AVRFuses (see below for how to set the AVR Fuses preferences)
      • Method 2: Download and install Crosspack-AVR and then AVRFuses
    • Linux: You just need the avrdude program to burn code, but can install the whole avr-gcc toolchain if you might be compiling your own firmware.
  3. The hex file: This is the actual file that contains the firmware update. If you’re upgrading a device, this will be available for download on the device’s web page, or you can find alternative firmwares on the 4ms github. If you’re an advanced hacker, you’ll probably compile your own code using avr-gcc (part of AVR Studio and Crosspack) which will generate a hex file for you. The file should be in intel hex format, ending in .hex

Specific instructions for PEG:

If you’re programming a PEG, read this article specifically about the PEG before continuing.

Click the image for instructions specific to the PEG

Specific instructions for QCD:

The QCD has four ATtiny85 chips: one for the tap button and one for each of the four channels. Each chip has its own 6-pin ISP header.

The tap button chip can be programmed normally. It’s marked with a white dot and is located under the tap button and jack. (At this time, the firmware for the tap button is not available)

To program the channels, you must apply a gate signal to the Reset and CLK IN jack for the channel you’re programming. The gate signal should be 5V or more. Note: It’s usually fine to use a passive mult to split one gate signal to all the Reset and CLK IN jacks.

Specific instructions for QPLFO:

The QPLFO has four ATtiny85 chips: one for each channel. Each chip has its own 6-pin ISP header.

To program the channels, you must apply a gate signal to the Reset and Ping jack for the channel you’re programming. The gate signal should be 5V or more. Note: It’s usually fine to use a passive mult to split one gate signal to all the Reset and Ping jacks.

 

Detailed Instructions:

PLuig the AVR ISP mkII into the 6-pin header of your device, making sure to line the red stripe up with the printed white box on the PCB

Windows (AVR Studio 4):

  1. Download and installAVR Studio 4.19 from the AVR Studio Archives. 
  2. Run the installer and click OK/Next to everything. Yes, you want the “Jungo/USB” driver to be installed.
  3. Plug in your AVR ISP mkII into the USB port and make sure Windows finds it, and automatically installs the drivers. The green light near the USB plug should come on.
  4. Power your device up (that is, plug your Rotating Clock Divider into your Eurorack system, or power up your Bend Matrix, etc…). Your device should be running normally, but don’t plug any patch cables into it
  5. Plug the 6-pin ISP header of the AVRISP mkII into your device. Note the orientation: the red stripe should go towards the white box that’s printed on the PCB: see photo above.
  6. The light near the 6-pin cable on the AVRISP mkII should turn green, indicating that it detects power. If you plugged it in backwards, it might flash orange. Nothing’s damaged, just flip it around…
  7. Run AVRStudio 4
  8. Click the little “AVR Programmer” icon: AVR Programmer
  9. If it doesn’t automatically detect your AVR ISP mkII, then select it from the box on the left, and click “USB”, and then click “Connect…”
  10. Click on the “Main” tab, and select “ISP mode” from the bottom box. Click “Settings” and choose an ISP Frequency of 125kHz.
  11. Select the chip you’re programming under “Device and Signature Bytes”:
    • Select “ATmega168” for the RCD or SCM
    • ATtiny84 for the Auto Bass Gen
    • ATmega32 for the Bend Matrix
    • ATmega328 for the PEG
    • ATtiny85 for the QPLFO or QCD channels
    • ATtiny2313 for the QPLFO tap controller
  12. Click “Read Signature” and it should say “Signature matches device”
  13. Click the “Program” tab. Under “Flash” click the “…” button next to “Input HEX File” (the top one). Make sure you’re not under EEPROM! Select your hex file that you downloaded (or compiled yourself)
  14. Now, click “Program” (under the Flash section, not under the EEPROM section). It should give you no errors at the bottom of the window
  15. Unplug your ISP 6-pin header and you should be good to go!

Please let me know if you have any problems!

Mac OSX (AVR Fuses) –the easy way to upgrade your firmware:

Method 1: Install homebrew by opening up Terminal and typing:

 

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

(all on one line). Then press enter. When it’s done, type:

  1. brew install avrdude

    and press enter.
    Or… do Method 2: Download and install Crosspack-AVR

  1. Download and install AVR Fuses.
  2. Select File->Preferences in AVR Fuses.
    1. Set the location of avrdude (it probably will be /usr/local/bin/avrdude).
    2. Set Programmer to “avrispmkII”
    3. Set Port to usb
    4. Set Bit Clock to 8
  3. Download the hex file for your upgrade from 4mspedals.com
  4. Plug in your AVR ISP mkII. The green light by the USB plug might not come on.
  5. Do steps 4, 5, and 6 of the Windows installation (power up your device, plug in the AVR ISP mkII, make sure the green light comes on)
  6. Open up AVR Fuses.
  7. Select the AVR chip type that you’re using (the name of the chip is also printed on the chip itself, use a flashlight to read the tiny letters!)
  8. Pingable Envelope Generator (PEG) uses ATMEGA328
    Bend Matrix uses ATMEGA32 or ATMEGA32A
    RCD and SCM: ATMEGA168 or ATMEGA168P
    AutoBassGen: ATTINY84
  9. Select the hex file you downlaoded in step 2, and burn it onto your chip!

Mac OSX (Crosspack) –the advanced way to hack your code:

  1. Download and install Crosspack from here: http://www.obdev.at/products/crosspack/index.html]
  2. Download the hex file for your upgrade. Save the file in your Home directory, so you can find it easily with the Terminal.
  3. Plug in your AVR ISP mkII. The green light by the USB plug might not come on.
  4. Do steps 4, 5, and 6 of the Windows installation (power up your device, plug in the AVR ISP mkII, make sure the green light comes on)
  5. Open up your Terminal program (in Utilities folder)
  6. In Terminal, type “ls” and hit enter. You should see the name of the hex file that you saved in your Home directory (along with everything else in your Home directory). If not, you didn’t save it in the right place.
  7. Now tell it to burn the code. For the RCD, type this command (all on one line)
    avrdude -P usb -c avrispmkII -p atmega168  -U flash:w:clocker.hex -v -v

    And press enter. This assumes your hex file is named “clocker.hex”. It should say “avrdude: Thank you” and have no errors above that. If all goes well, unplug your 6-pin cable and your RCD is updated!

    If you’re using a fresh chip, you’ll need to use this command to burn the fuses:

    avrdude -P usb -c avrispmkII -p atmega168 -U hfuse:w:0xd7:m -U lfuse:w:0xef:m -U efuse:w:0x01:m -U flash:w:clocker.hex

Linux:

  1. Install avrdude. You can probably install it with your package manager, such as Aptitude: (type “sudo aptitude install avrdude”), or Ubuntu’s Synaptic
  2. Follow the OSX instructions starting at step 2. Hint, if avrdude is not finding a usb connection, you might need to type “sudo” before the avrdude commands. Then it’ll ask you for your password before running avrdude.

Guitchurn

Making butter and basslines
Making butter and basslines

Michael Merck asked me to collaborate on upgrading his Guitchurn, which was (at the time) an acoustic musical instrument coupled to the shell of a common hand-built olde tyme kitchen appliance. Naturally I thought any cottage churner would enjoy electronic basslines while doing the deed, so we connected an Autonomous Bassline Generator to it for the Cantanker Magazine show (issue 7) at the Big Medium Gallery in October ’09, and then later at the Creative Research Gallery.

The Guitchurn works by a little paddle on the arm breaking an infrared light beam each time you bring the arm down. The Bassline Generator detects the broken beam and plays the next note in the autonomously-generated melody. So you only get music if you’re making butter and vice-versa.

Bread was set out, with a note asking you to “wait until the butter comes”, which surely was incentive to take a turn on the churn. For some people it was their first time churning butter and playing electronic bass! Imagine! Copious amounts of hand-sanitizer, wine bags hanging from framed art, banana pudding in lettered mugs, and Marcel Duchamp speaking backwards also added to the festivities.

Guitchurn Installation at Big Medium Gallery
Guitchurn Installation at Big Medium Gallery

Handmade Music Austin #3


YouTube via EA78751
“Video from Handmade Music Austin #3, Dec. 20th 2009. At this workshop 13 people built the free project, Mini Space Rockers. After that we witnessed live electroacoustic sound by Lustigovi. And then 19 people built the upper division project, Andromeda Mk-4 Analog Bass Drum. And last there was an open jam with DIY bassline and drum machines from this workshop series, plus acid lines from a MIDIbox SID.”

Andromeda Space Rockers interactive jam

4ms Pedals and Eric Archer teamed up to present an interactive bass&beats installation at the Hope Center last night in Austin, TX. There were four stations around a table, each station had three Andromeda MK analog drum machines and one Autoanomous Bassline Generator. Each station also had four LEDacle bendy-light tentacles courtesy of Bleeplabs, which you could  shine on the photocells to sweep the filter sounds. Each device kept in time with an IR beam, and a MIDI clock ran between each board to bridge Nathan Wooster’s MIDI-IR Sync devices. It was packed!!

We’ll break it out again at the next Handmade Music Austin event Dec. 20 at the Salvage Vanguard Theater…. Maybe some more events too?

Autonomous Bassline kit

I finally finished the ABG kit! The boards are here and we’re ready to roll for the Nov 14 workshop at Handmade Music Austin…

You can purchase the kit, the PCB, or a programmed AVR chip here
Basic Demo:

What it does with default settings:

IR Sync Demo:

Handmade Music Austin

Church of the Friendly Ghost presents

Handmade Music Austin

A series of DIY electronic music workshops, with expert instructors from Bleep Labs, 4ms Pedals, and Eric Archer.

SYNTHS AND DRUM MACHINES?

In a friendly workshop setting, we’ll present a newly-designed series of miniature electronic instruments, called Andromeda Space Rockers. No bigger than a credit card, these projects are designed for DIY’ers like you. They can be built in a couple of hours to make a working drum machine, bass generator, or micro-synthesizer. These fun little instruments love to jam together, and they do it by forming a wireless network to keep the rhythm! They react to the environment as well… for example, the drum machines‘ filter, pitch, and envelope are controlled with light-reactive photocells.

Each workshop will feature a different instrument.
The full series of kits will be available online as well (to be announced soon).

BEGINNERS ARE WELCOME TOO

Basic classes are offered for beginners free of charge, where you can learn to solder and build an easy music project that will prepare you for Andromeda Space Rock.

Or you can skip straight to the ‘Upper Division’ and build one of the Andromeda Space Rockers instruments. Soldering equipment will be provided. To participate in the Upper Division classes you should be familiar with assembling printed circuit boards. An understanding of electronics theory is not required; just patience, hand-eye coordination, and enthusiasm for DIY music.

OPEN JAM AT EVERY WORKSHOP

Of course, there will be an open jam / performance once the instruments are built. We encourage you to bring some pedals and a small amp to plug in your new synth or drum machine and participate in an exciting musical experiment. Huh? Since the Andromeda Space Rockers communicate with each other using infrared wireless, they keep the rhythm automatically – the space will be filled with synchronized sound as you tweak the tones and control the arrangement. The network supports an unlimited number of instruments; we are building a musical organism that reacts to its environment, part human and part machine, and containing the love built into it by your own hands.

Performances are FREE to attend.

CLASS SCHEDULE

All workshops are on Sundays.

4PM – 5:30 Beginner’s Workshop
6PM – 8 Upper Division instrument building class
8:30 – ? Open Jam and featured performance

CLASS DATES

2009

October 18
November 15 (coincides with East Austin Studio Tour)
December 20

2010

January 17
February 28
March 14
April 18

LOCATION

Salvage Vanguard Theatre
2803 Manor Rd
Austin, TX

HOW TO REGISTER

Beginner’s Workshop is free. Upper Division registration is $45 and includes materials. We’re accepting workshop preregistration for Oct 18th and Nov 15th. The first 2 workshops are filling up quickly!

REGISTER VIA EMAIL AT: churchofthefriendlyghost@gmail.com

Autonomous Bassline Generator

This is the first draft of an Autonomous Bassline Generator. The melodies are generated by a mathematical algorithm using the value of the Melody control as a seed. So it’s deterministic, not random.

An ATtiny44/84 chip generates Pulse-Width Modulated waves, into an analog resonant band-pass filter, whose frequency is modulated by a photocell. The ATtiny also is flashing an LED to the envelope of the notes, so you can either point the photocell at this LED to get cool old-skool analogue filter sounds, or point it at light/darkness in the room to control it manually. There’s Tap Tempo, as well as IR send/receive for syncing up to other devices!

Continue reading Autonomous Bassline Generator