Git Product home page Git Product logo

bpm's Introduction

bpm

GoDoc

Library and tool for dealing with beats per second detection in Go

This is a direct port of Mark Hills bpm-tools.

For that reason, it is also under the same licence as that utility, ( GPLv2 ).

You can use this version as a libary too, In testing you may find it produces slightly different results than bpm-tools. This is because both tools use a random float on mid point selection, Ideally it would use a static one, but I won't replicate drand exactly to just get 1:1 matching with the offical tools.

Usage of the command line util

You need to feed the command line utility PCM 32 bit little edian floats (mono), there are two easy ways to do this:

Sox:

sox "$FILE" -r 44100 -e float -c 1 -t raw - | ./cmd /dev/stdin

ffmpeg:

ffmpeg -v quiet -i 1479012090.ts -f f32le -ac 1 -c:a pcm_f32le -ar 44100 pipe:1 | ./cmd /dev/stdin

You can also ask for a "snapshot" per second of the BPM calculated, using progressive mode:

$ ffmpeg -v quiet -i 1479012090.ts -f f32le -ac 1 -c:a pcm_f32le -ar 44100 pipe:1 | ./cmd -progressive=true /dev/stdin
179.020979
193.086109
191.044776

The first value is the BPM for the first 10 seconds, the 2nd for 10-20 seconds, 3rd is the 20-30th (and more until you stop giving it data)

bpm's People

Contributors

benjojo avatar patagonicus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.