Archive: Solution for beat detection


22nd October 2002 11:54 UTC

Solution for beat detection
I posted this in another forum too, so excuse the repetition.

I have read many posts about AVS beat detection being pretty worthless.. Instead of (or to supplement) complex beat detection algorithms, it would be really nice to be able to tap a key or a mouse button to the beat, and AVS would get the BPM from that. It seems like a simple enough solution. Can it be created easily through the SDK? Does something like this already exist? Please let me know...
Thanks.


22nd October 2002 13:03 UTC

1) You *almost* got it to the right forum (err or subforum :weird: ) This should be in the wishlist section i think.

2) Although it sounds simple im pretty sure it wouldn't be possible or a wise thing to do. For starters would you be tapping the example: Space Bar all the time? Or save some bpm's as "presets" for different songs? What about if you have 2000 songs? hell even over 50 songs is too much to manually set the bpm. And besides how the hell are you going to be able to make AVS presets if you are all the time tapping the what-ever-button. :blah:

AVS beat detection isn't so good, but it does it's job and sometimes i don't even notice that it doesn't follow the song so well...

You can always try to "fix" it by creating your own "beat detection code" by using something like:

ob=if(above(getspec(0,0,0),0.5),1,0) ;
t=t+ts ; ts=if(equal(ob,1),rand(300)/1000-0.15,ts)

But this method doesn't work so good either, because different songs are... well different :p


Personally im pretty happy with the beat detecion winamp/avs offers, because it seems to work with the music i listen.


22nd October 2002 13:19 UTC

After getting over a severe laughing fit, here is what I have to say.

Reasons why its a bad idea:


Reasons why its a good idea:
Let me get back to you on that... I'm sure I can think of one good reason if I give it enough time

22nd October 2002 13:22 UTC

Of course it would be a bad idea for a completely automated system; however, if I am VJing for some event, I tend to be manually controlling AVS, so I am at the keyboard anyway. I didn't mean that you'd need to tap a key for _every_ beat... maybe just the first 5 beats, and then the bpm can be calculated from timing the key presses.

So if you are using live audio input, you'd just have to tap a key a couple times whenever the beat/song changes to sync up the visuals. Really doesn't seem like much work to me, considering you'd have perfect beat synchronization.


22nd October 2002 13:28 UTC

maybe just the first 5 beats, and then the bpm can be calculated from timing the key presses.
And the Custom BPM that avs features doesn't do this because...?

22nd October 2002 13:32 UTC

Originally posted by Tuggummi

And the Custom BPM that avs features doesn't do this because...?
Ouch. Thats sharper than a page of Oscar Wilde rolled up neatly into a cone, dipped into a small cup of lemon juice and then promptly stabbed into the eye.

22nd October 2002 13:45 UTC

And the Custom BPM that avs features doesn't do this because...?
Because it wouldn't work for live input, which is primarily what I use AVS with.

All I am saying is that key taps could be used to _supplement_ the current beat detection code - to give it a hint when it hasn't figured it out, or to nudge it into the correct BPM when it loses the beat. That way, human intervention is only required when you want to be precise with your visual sync, otherwise it will operate automatically like usual.

I don't know why you feel the need to be caustic towards an idea. Maybe you think it's worthless, but I can see a definite advantage in having such a function available.

22nd October 2002 14:09 UTC

Well Custom BPM works even without music... why shouldn't it work with live situations? :confused: :weird:

Ok i think im going to just wait until UnConeD replies to this post to see what is "right" :rolleyes:


22nd October 2002 14:20 UTC

Well Custom BPM works even without music... why shouldn't it work with live situations?
A custom BPM will "work" with live input, but a fixed value will not be able to adapt to changing BPM of the live input, and therefore the visuals will not be synced to the beat, which is sorta my point in using it.

22nd October 2002 15:31 UTC

Just adjust the presets to match the certain song and only play the preset with that song? hmm ok so in a live situation that would be a little too complicated i guess... i have to admit, although i don't know anything about playing avs live it sounds hella complicated...

But putting that kind of feature in avs when it serves only vj's... i don't think it's a good idea, but maybe someone (if possible) could do you an APE that works like that, then just apply the ape to every preset you are going to play.

But im against the idea that avs should support that by standard. Just read Jheriko's post why :D


22nd October 2002 16:00 UTC

Good idea because:
- It doesn't remove anything, it's just an extra feature
- AVS' advanced beat-detection is based on prediction of beat samples. Adding a beat 'tap' allows for more accurate information when needed, without having to do much extra coding. For example, if the user starts tapping, it disables the built-in detection for a few seconds, otherwise it would get double-beats when it *is* correct (i.e. the tapped beat, and the detected beat).

I don't see why you people are against it :)

However, it cannot be made as an APE, because APEs cannot change AVS values (e.g. render mode, bpm, etc)

Custom BPM is a workaround, but it has to be included in every preset. I'd much rather have a global option for this.


22nd October 2002 16:12 UTC

Ok what ever you say UnConeD...

This preset doesn't work if you don't tap the beat detection XX times before viewing this!!!!11!!!1!11!!
Just a thought...

22nd October 2002 16:49 UTC

Originally posted by Tuggummi
Just read Jheriko's post why :D
Don't assume that I actually know anything. About 95% of my AVS knowledge is interpolated.

EDIT: Oddity: I was just in a 'caustic' mood earlier :p. I still think its a bit pointless, a much better solution would be to make the AVS beat detection better, I think its fine the way it is though.

22nd October 2002 18:56 UTC

Well...
I honestly don't know what the deal is. It's a feature request... is there something wrong with that?

I have wished for manual beat detection for a long time. It doesn't sound like a bad idea. I plan to use AVS for live concerts (as soon as I get a projector ;) ) and this would be a very useful feature.

However, the spacebar wouldn't work because it's mapped to selecting a random preset.

Oh, and this would have to be implemented in AVS for Winamp2. I don't like Winamp3... it is so much slower, AVS and all.


22nd October 2002 19:19 UTC

This sounds like a good idea to me. I would only be against such an option if it would slow down avs when not used or it took nore than one hour to code(there are many more importand whishes).


22nd October 2002 20:20 UTC

One other thing: The computer wouldn't know that the actual beat is between frames. So when you tap in the beat it will be slightly off, and over a short period of time the beat detection will be extremely off. Basically it's multiplying irrational numbers while using low decimal precision.

Besides that, the user is much less perfect at hitting the key at the exact time of the beat than the computer would be, despite how imperfect the computer might be at registering the beat in the first place. IF the song has a good beat (which is what you'd be playing at dances anyway), AVS's advanced beat detection works almost perfectly.

So a better question would be: "How can I get live input for AVS?" which I believe is answered in the FAQ


22nd October 2002 23:33 UTC

The thing is, you can't use advanced beat-detection for live dj'ing, because AVS will never re-adapt the beat. It'll think it's just one huge song playing.

A hotkey to readapt the beat would do miracles too.


23rd October 2002 08:33 UTC

If you use Advanced Beat detection and then you use some kind of a track mixer plugin (or the crossfade, lol) Wouldn't it work then? Why does it have to be one big song if the problem is that it is one big song...

Any of this make any sense? :p

Mix the track
Cut the track in pieces
Use Crossfade to smoothly change between tracks
Use Advanced Beat Detection: everytime a track changes it readapts the beat.

In all my common sense i don't see a reason why this shouldn't work.


23rd October 2002 12:26 UTC

Yeah, but I think we're talking about live performances here.


23rd October 2002 12:36 UTC

hmm... uhm...

*rubs his head and thinks it all over again*



oh... So in live performances it "records" it to a one huge track eeh? which is played at the same time? like in internet radio or something... So that's why :rolleyes:

I really don't know too much about this stuff :p
There should be a "stupid me" icon like in devart :D

/me hits himself with a hammer in the head
:stupidme:


23rd October 2002 21:54 UTC

The problem is that AVS only re-adapts the beat when the song's title changes. However when you're streaming from linein://, the title stays the same, so it thinks it's one huge song. It doesn't really 'record', I simply used that term to describe it reading the data from your sound card's input and using that as vis-data.


24th October 2002 21:52 UTC

And you could reset the advanced beat detection(reset button).


24th October 2002 22:25 UTC

Maybe I should rephrase that
Actually, I do NOT want AVS to calculate the beat for me. Since it would be live work, I wouldn't have anything else to do, so I'd like to be able to tap the beat in and have AVS rely on my input exclusively.

Basically, AVS wouldn't try to find the beat; it would only turn on the beat flag if the button is down, if you get my drift.

I don't see how this could slow AVS down, either. The other hotkeys don't seem to affect the speed.


25th October 2002 05:28 UTC

If AVS isn't detectinc a beat it should speed up. It wouldn't have to do the math to detect a beat.


25th October 2002 06:32 UTC

Actually, no. AVS doesn't really have to do that much math do detect a beat. I doubt it is much more than this (ignore the dots, they're for indentation):

if(averageVolume<=beatVolume)
{
.for(int i=0,i<=6,i++)
.{
..beatTime[i]=beatTime[i+1];
.}
.beatTime[7]=currentTime;
.bps=beatTime[7]-beatTime[0];
}

You have no idea how fast that calculates. And that's crappy n00b code. Imagine MMX enhanced addition of two numbers :p
Even if you're talking about the on-beat code being excecuted, it's still fast as a mofo. I seriously doubt it affects AVS's performance.


25th October 2002 08:12 UTC

The question is: Does the average user want to tap the key for beat detection?

My answer is no and that's my opinion.

I have said enough.