[ Music.SoftWare.Design ]



An Interactive App for Beat Detection

Author: Kai-Chieh Huang | Version: 1.0 | Date: Oct.14,2014

TempoHeart is a fun C++ program designed for users to experience realtime interaction between Audio sounds and Visual animation. TempoHeart contains two Modes:1. Visualize Audio Signal wave form and also the Frequency Spectrum in real-time using Pot-Smoking graphics. 2. A Beat Detection mode with beautiful firework view and a beating heart in the middle tracking the music beats. In the first mode, users can see how the ambient sound interacts with the spectrum in real-time, and also using some commands to rotate the screen or add history water flow of the spectrum. In this mode, spectrums are arranged as spiral shape simulating the basilar membrane in human ears. In the Second mode, users can interact with the firework animation and heart beat in the middle of the screen by playing music. When music is played, the heart in the middle of the screen detects the general bpm of the song, and the fireworks launch when each instantaneous impulses are detected. Please read the user manual to learn the commands and have fun!


TempoHeart contains two modes:

1.Spiral Spectrum Mode:

In is mode, each spiral represents a frequency domain spectrum, with the lowest frequencies on the outer circumference, and highest frequencies in the most inner circle. This idea came from the basilar mambrane of human ears. When detecting a increasing frequency, the peak will move from outer circle to the inner circle in a spiral path. Each spiral is a spectrum in different moment. With the current frequency domain spectrum starting on the right side spiral, and the history of the frequency domain spectrum information will go counter clockwise. In this mode, users can use 'r' or 'e' to rotate the screen in y axis and also use shift + '+' to add more siprals and shift + '_' to decrease the number of spirals. For more instructions, please visit user manual. In the middle of the screen, waveform of the the instantaneous input signal is presented in horizontal axis and the normal frequency domain spectrum is presented in vertical axis with the lower frequencies at the bottom and higher frequencies at top.

Screenshot of speaking sound

Screenshot of constant frequency whistle sound

2.Beat Detection Mode:

This mode is designed to perform a fun realtime visual-sound interaction experience. It is a beat detection program with beautiful firework view and a heart beating at the tempo of the music playing in the middle of the screen tracking the music beats. This mode can also track instantaneous impulses such as claps. When an instantaneous impulses was detected, the program will launch a firework to the screen. The users can also press 'h' to rotate the beating heart at the middle of the screen. When no music is playing, the screen shows a "MUSIC PLEASE" instruction to instruc user to play music. When music is played, the beat detection and firework animation will start to show. For more instructions, please visit user manual

Screenshot when no music playing

Screenshot of heartbeat and firework animation when music playing


    press q - quit visualization
    press r - rotate the screen in y-axes (CounterClockwise)
    press e - rotate the screen in y-axes (Clockwise)
    press (shift)'+' - increase number of spectrum spirals in Mode 1
    press (shift)'_' - decrease number of spectrum spirals in Mode 1
    press c - change between Beat Detect/Spectrum mode
    press h - rotate the background heart in Beat Detect mode

« Download the Code »

© Music256A, Stanford, Kai-Chieh Huang, Fall 2014