Code Monkey home page Code Monkey logo

Comments (6)

jsantell avatar jsantell commented on September 26, 2024

Dancer's beat detection is moderately simple -- it looks for a peak that meets the requirements of the beat object (correct frequency, amplitude greater than threshold, amplitude greater than the decaying previous beat). Essentially a beat can be thought of as a bass drum kick. If there's a lot of double bass going on, you'll have more than one "beat detected" than per music-theory-beat.

Perhaps the current beat functionality should be turned into a "kick" feature, with beat detection focusing on triggering once per "beat" (4 times a measure in a 4/4 song).

from dancer.js.

 avatar commented on September 26, 2024

Thanks for ur reply!

Have you got some ideas?
Code in particular to implement?

Sorry to ask for this, but i'm quite ignorant about sound management.
I'vr seen there is a library called beatdetektor.js, can be useful to implent it in dancer.js? but i don't know how to use it :).

Then...how can i connect dancer to soundmanager?

Thanks,

Marco

Il giorno 07/ago/2012, alle ore 19:01, Jordan Santell [email protected] ha scritto:

Dancer's beat detection is moderately simple -- it looks for a peak that meets the requirements of the beat object (correct frequency, amplitude greater than threshold, amplitude greater than the decaying previous beat). Essentially a beat can be thought of as a bass drum kick. If there's a lot of double bass going on, you'll have more than one "beat detected" than per music-theory-beat.

Perhaps the current beat functionality should be turned into a "kick" feature, with beat detection focusing on triggering once per "beat" (4 times a measure in a 4/4 song).


Reply to this email directly or view it on GitHub.

from dancer.js.

cesutherland avatar cesutherland commented on September 26, 2024

Maybe it does make sense to change beat to kick.

I think beat detection (as in BPM) could get very sophisticated, but this would be neat to implement. Here's one starting place: http://stackoverflow.com/questions/657073/how-to-detect-bpm-of-the-song-by-programming but I think academic sources would be better.

It should be trivial to implement a metronome-type event for when the time signature and tempo of a song are known.

The complication with either is managing the event loop... if someone is doing something even a little complex on each 'beat' the events would pile up, but maybe that's up to the user to sort out.

from dancer.js.

 avatar commented on September 26, 2024

mmhhh another question:

  • which is the uom of the frequency parameter? by default 0-10 what does it mean?

I'm now experimenting with a sort of filter checking time when a beat occours...

from dancer.js.

Yahav avatar Yahav commented on September 26, 2024

yeah i would like to know as well what are frequency and threshold? i think i need to better understand those in order to know which values will do best.

from dancer.js.

jsantell avatar jsantell commented on September 26, 2024

@circlegarage The frequency array is an ordered list of frequencies -- each element represents i_40hz to i_40+40hz (roughly, I have to look up again what the range of each slice is), with the normalized value of that element being that frequency's amplitude. The frequency param in beat is what frequency range to focus in for the detection, usually something low.

Currently, it uses SM2 to fallback on if HTML5 audio APIs are not supported. Plans in the future to be able to pass in an SM2 object so it can be tied into another SM2 player already on the site.

@Yahav Threshold is a minimum normalized amplitude a frequency must reach in order to be considered a 'beat'. Once a beat is detected, the amplitude of the previously detected beat must be overcome by the amplitude of the next beat, and the previously detected beat's amplitude decays at the decay rate set.

@cesutherland Agreed, "beat" should be renamed to "kick" -- beat detection (as in firing a callback four times every measure in a 4/4 song), can be implemented otherwise, but this feature is more of detecting a kick drum.

from dancer.js.

Related Issues (20)

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.