All Projects → chrvadala → Music Beat Detector

chrvadala / Music Beat Detector

Licence: mit
music-beat-detector is a library that analyzes a music stream and detects any beat. It can be used to control lights or any magic effect by the music wave.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Music Beat Detector

Piano
🎹用键盘8个键演奏一首蒲公英的约定送给自己或月亮代表我的心送给她
Stars: ✭ 850 (+569.29%)
Mutual labels:  music, mp3
Android Youtubemp3
Download videos as mp3 directly from Youtube Android App
Stars: ✭ 124 (-2.36%)
Mutual labels:  music, mp3
Audioworks
A cross-platform, multi-format audio conversion and tagging suite
Stars: ✭ 35 (-72.44%)
Mutual labels:  music, mp3
Jiosaavnapi
An unofficial API for JioSaavn written in Python 3
Stars: ✭ 123 (-3.15%)
Mutual labels:  music, mp3
Id3tageditor
🎵🎸A Swift library to read and write ID3 Tag of any mp3 file. Supported ID3 tag version: 2.2, 2.3 and 2.4. Supported platform: iOS, macOS, tvOS, watchOS, Linux Ubuntu. 🎵🎸
Stars: ✭ 101 (-20.47%)
Mutual labels:  music, mp3
Httpms
Media server with RESTful API and Web interface. Think of it as your very own Spotify!
Stars: ✭ 18 (-85.83%)
Mutual labels:  music, mp3
Deprecated Lame Mirror
[DEPRECATED] Old, Semi-official mirror of the CVS repository of the LAME MP3 encoder.
Stars: ✭ 73 (-42.52%)
Mutual labels:  music, mp3
Spotify Downloader
Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
Stars: ✭ 6,957 (+5377.95%)
Mutual labels:  music, mp3
Musicott
JavaFX application that manages and plays music files.
Stars: ✭ 97 (-23.62%)
Mutual labels:  music, mp3
Av Converter
[av-converter.com] Audio and Video Converter, and YouTube downloader. Convert to MP3, MP4, AAC, FLAC, AC3, WAV, etc.
Stars: ✭ 97 (-23.62%)
Mutual labels:  music, mp3
Minimp3
Minimalistic MP3 decoder single header library
Stars: ✭ 898 (+607.09%)
Mutual labels:  music, mp3
Sbplayerclient
支持全格式的mac版视频播放器
Stars: ✭ 110 (-13.39%)
Mutual labels:  music, mp3
Mutagen
Python module for handling audio metadata
Stars: ✭ 760 (+498.43%)
Mutual labels:  music, mp3
Alltomp3 App
Download and Convert YouTube, SoundCloud & Spotify in MP3 with full tags (title, artist, genre, cover, lyrics 🔥)
Stars: ✭ 920 (+624.41%)
Mutual labels:  music, mp3
Videoshow
Simple node.js utility to create video slideshows from images with optional audio and visual effects using ffmpeg
Stars: ✭ 618 (+386.61%)
Mutual labels:  music, mp3
Musicdownloader
Material design YouTube mp3/mp4 downloader
Stars: ✭ 70 (-44.88%)
Mutual labels:  music, mp3
Eyed3
eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
Stars: ✭ 300 (+136.22%)
Mutual labels:  music, mp3
Simple Music Player
Simple Music Player - SimpleMP - Keeps it simple and plays your music
Stars: ✭ 298 (+134.65%)
Mutual labels:  music, mp3
Yandex Music Download
Yandex Music Downloader
Stars: ✭ 94 (-25.98%)
Mutual labels:  music, mp3
Getsong
Download any song mp3 with no dependencies except ffmpeg
Stars: ✭ 102 (-19.69%)
Mutual labels:  music, mp3

music-beat-detector

music-beat-detector is a library that analyzes a music stream and detects any beat. It can be used to control lights or any magic effect by the music wave.

npm Downloads Donate

Bundled with this library there are three components:

  • MusicBeatDetector is able to analyze any PCM 16bit Little Endian audio stream. It detects music peaks and realtime bpm.
  • MusicBeatScheduler is able to sync any detected peak with the listened audio. It's useful to control some lights or any other effect.
  • MusicGraph generates an SVG graph that displays every detected peak. It's useful to tune the peak detection.

music-beat-detector

Example

const fs = require('fs')
const Speaker = require('speaker')
const createMusicStream = require('create-music-stream') //read this https://github.com/chrvadala/create-music-stream#faq
const {MusicBeatDetector, MusicBeatScheduler, MusicGraph} = require('music-beat-detector')

const musicSource = process.argv[2] //get the first argument on cli

const musicGraph = new MusicGraph()

const musicBeatScheduler = new MusicBeatScheduler(pos => {
  console.log(`peak at ${pos}ms`) // your music effect goes here
})

const musicBeatDetector = new MusicBeatDetector({
  plotter: musicGraph.getPlotter(),
  scheduler: musicBeatScheduler.getScheduler(),
})

createMusicStream(musicSource)
  .pipe(musicBeatDetector.getAnalyzer())
  .on('peak-detected', (pos, bpm) => console.log(`peak-detected at ${pos}ms, detected bpm ${bpm}`))
  .on('end', () => {
    fs.writeFileSync('graph.svg', musicGraph.getSVG())
    console.log('end')
  })

  .pipe(new Speaker())
  .on('open', () => musicBeatScheduler.start())

Usage

You can play any music sound supported by the library create-music-stream. Note: The beat detection performs better on mp3 files than YouTube video.

node example.js ./track.mp3
node example.js https://www.youtube.com/watch?v=qeMFqkcPYcg
node example.js https://www.youtube.com/watch?v=Zi_XLOBDo_Y
node example.js https://www.youtube.com/watch?v=n_GFN3a0yj0
node example.js https://www.youtube.com/watch?v=59Q_lhgGANc

Reference

new MusicBeatDetector(options)

Param Default Description
options.sensitivity 0.6 Response to the music wave (value from 0.5 to 1)
options.plotter - Instance of MusicGraph
options.scheduler - Instance of MusicBeatScheduler
options.minThreashold 1638 Peaks under this level are ignored (usually they're noise)
options.debugFilter false Stream the filtered music throught the lowpass filter (for debug purpose)
  • getAnalyzer() - Returns a transformer stream that analyze the music

new MusicBeatScheduler(effectCallback)

  • getScheduler() - returns an instance used by MusicBeatDetector
  • start() - start effects (usually controlled by speaker events)

new MusicGraph(secondWidth, secondHeight)

  • getPlotter() - returns an instance used by MusicBeatDetector
  • getSVG() - returns a string with the SVG that displays the analyzed music

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].