life of mendel (lifeofmendel) wrote in maxpatches,
life of mendel

boy, am i a MSP novice.

so i do fine when it comes to Max, but i stopped using it around MSP's introduction. I bought a copy, but my school had Kyma, and that ended up being my tool of choice. i'm not in school anymore, so now i'm going back to MSP, and i'm running into some issues.

what i'm trying to build goes like this:

a soundfile gets played, something with a pretty constant beat, but a fluxuating BPM (by fluxuating i mean milliseconds - the tempo doesn't change, but the performance isn't "metronome accurate", as most performances are not). i want to capture a "strong beat" from the sound file with bangs and then measure the ms space between the bangs.

how do i get MSP to reliably measure my dB and then find 'spikes' in the dB to translate to a bang? How can i get MSP to measure only the spikes that i want and ignore other things such as syncopation that also hit that dB range?
  • Post a new comment


    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.

Deleted comment

Deleted comment

i actually built something like that thinking it would work, and it didn't work so well, mainly because the only thing i was doing was an amp peak check and many more things other than the beat threshed at that amp. So i got bangs that would push out what all of the strong beats were, but not something that could actually give me a strong BPM unless i did strong derivation, and the threshold was so tricky, it misfired every now and again.

i'm going to see what happens with the bonk object mentioned below, and then if not, i'll go back to that tutorial to see if it fills any gaps from what i tried to build from scratch.

thanks. :)

Deleted comment


it's a bit complicated for no great reason. It has to do with the DDR/stepmania tourney that Tyler and i are going to put together this coming summer.

in brief: For a player to execute a "Fantastic!" on an arrow, they need to step on it in a window of about 20 ms. The only kinds of songs this works absolutely perfectly for are ones in which the songs have bene generated against an elecetronic-based strict BPM. A song that is created in Fruity Loops or Reason or general 'electronic' based music that has a BPM of 180 or 150 or even 148.56 is easy to 'sync' up to against the stepmania "template" to ensure that the 'fantastic window' for stepmania always stays absolutely in line with what actually happens in the song. Even if a song has a BPM fluxuation of two hundredths over the period of a 4/4 measure it can be "off sync" enough that's noticeable to a player trying to stay within the window.

But using electronic only songs is limiting. We want to widen our scope, but we need to keep within the strict BPM accuracy that stepmania needs.

Tyler has created a "tap" program in Java that will capture ms data between his taps and then calculate what the BPM will be per quarter note based on that with some extra calculation thrown in that he calls "weight" and "tolerance" i believe, and he can run it against as many passes as he likes and therefore get closer and closer to what the template needs to stay with the fluxuating music. But the big flaw with this is that tyler has to manually tap through the song in real time in multiple passes in order to arrive at that figure.

i'm looking for an automated version, and thought that max/msp would be the best tool to get it in one pass and absolutely accurately.

Deleted comment

i've never messed with beat correction in live, as i've never really messed with live itself that much. Is that present in Live 4? i think that's the copy that i have on my machine.
there is an object called bonk that can be downloaded (search for it) that detects attack in an audio stream. it is quite good at detecting drum hits. with that, you could do some sort of timing on the messages output from it.
thanks. :) i'll check it out.
This kind of thing is always tricky.

I would try filtering the input to whatever beat detection scheme you use, if you know the frequency range the main hits are gonna be in.

Also, since you say the tempo is only going to fluctuate a tiny amount, only start looking for the beat a little before you expect it's going to happen, and stop a little after. That will prevent it from registering the syncopations.

I agree with ruxtomikron though, it would be easier to warp marker the songs in Live and then bounce them out perfectly in time.
sounds much easier. if i can go that route, i will, but if not, then what you say about limiting what max is looking for is probably the one thing i don't have right now that i should.

thanks. :)