Cowbell Detector

A neural net trained on 800 drum-annotated songs

About this project

I built this program using Claude Code for my Creative Code class during my Creative Technology and Design Master's program at the ATLAS Institute at the University of Colorado Boulder. I was inspired by the famous SNL sketch More Cowbell.

One of my favorite bands, LCD Soundsystem, headed by James Murphy, likes to feature cowbells here and there. One of their most famous uses of it is in the song Daft Punk Is Playing at My House. That song has a great cowbell solo, especially when performed live. He really goes ham and will say something like "bells" or "solo" before going into it. So I wanted to play off of cowbells.

With the help of Claude, we built a cowbell-detecting neural network. It seems to be decent at its job, although not anywhere near perfect. When you enter a YouTube link or give an audio file to Bruce Dickinson, he listens to the song, analyzes it for cowbells, and gives it a score based on how much cowbell there is and whether it satisfies him.

You can then go over to the studio to look at the spectrogram of the song, see where it identified cowbell hits and how confident it is that each one is a cowbell, and rate them yes or no. Those ratings are stored on a server that I can download from to retrain the model, hopefully for a more accurate detection system.

Audio

Or try a synthesized 808-style groove:

YouTube links work in the local version: run python3 server.py in the cowbell-detector folder, then open localhost:8808.

Nothing loaded

Verdict

Listening…

Analyzing the demo clip.

Cowbell evidence0%
Hits
–
Main pitch
–
Busiest minute
–
Strongest hit
–

How it listens

  1. Turns the audio into a spectrogram: 64 frequency bands, one slice every 10 ms.
  2. A small convolutional network reads it and scores every slice for "a cowbell was just hit here." It hears about 200 ms either side, so it catches the clank and the ring.
  3. It learned from STAR Drums: 800 real songs whose drums were replayed on sampled acoustic kits, with every cowbell, ride bell and clave hit labeled.
  4. Calls it cowbell when at least 10 hits land within one minute. 7 to 9 is a maybe.

Tested on 13 well-known cowbell songs, it says yes to 5 (Night Train, House of Jealous Lovers, Play That Funky Music, Little Sister, Mississippi Queen) and maybe to 2 (Don't Fear the Reaper, Drive My Car). It said no to all 15 rock songs without cowbell, All My Friends included. The cutoffs were picked looking at those same songs, so expect it to do a little worse on new music. It still misses Honky Tonk Women, New Body Rhumba and Daft Punk Is Playing at My House. Songs are analyzed up to 10 minutes. The demo cowbell is a VSCO-2 recording (CC0).