Has anyone figured out a way to do BPM/Tempo detection of loops in Reaktor?

2

Comments

  • Studiowaves
    Studiowaves Member Posts: 451 Advisor

    Yep. or just make a tap tempo in core, how hard can it be to average the time capture between each of your taps. I take it, it's the dead of winter where your at too. I forget, think your in Scotland or something. To think Rolando is out grazing in the grass. lol Remember the time he was ****** about it being so hot. Those were the good old day. Then came our semantically messed up issue with my fm program. What an idiot I was, I didn't realize you were talking about the simple fm operator. That is easy, I was talking about the entire process of making decent sounding instruments with all the envelope generators, note scaling, velocity curves per operator and other stuff. That was a true case of the problems with semantics. Sorry about that. Also, that was really great thinking on your part on the lookup tables. They truly are slower than simple mathematics. In fact I proved it by inserting the lookup sine tables into the FM synth when it was done. There are 12 oscillators running per voice. I replaced all 12 or Rolando's super clean sine wave shapers and it ran like a dog. I guess the processors local cache couldn't hold all 12 lookup tables or they didn't get into the cache like they did with the simple tests we were doing. I'm not sure how a processor decides on what to put into the cache but it certainly did on the simple tests. But your final example with the more complex ensemble surely did. I still remember you saying, now if your computer can get this into the cache, I want your computer. Those were the good old days. Oh well, back to the dead of winter, time to play with Reaktor before I get boarded to death. lol Talk later my friend.

  • Paule
    Paule Member Posts: 1,328 Expert

    If you once analized the wave file write in front of the name the BPM, please.

    You can collect the waves in differents folders.

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    i've racked my brain about this and come to the conclusion that i can't think of one. i have a transient detector that is solid as one could be and would be great for beat slicing but the problem is if there is staccato or weird backbeat or some kind of samba you won't be looking for a steady pulse that is there but something implied


    probably the best bet is like what colin said about getting something like autocorrelation or BIG enough fft to look for dominant frequency as if it was a pitch, but it still has the same fundamental problems


    if you could get it split up into four pieces so that each pulse happens the same distance from the last, ig you could look at the last piece and see if it was a bit too long or had overhang, but meeting the requirements of 4 splits and having them occur at clean divisions seems like something you could try but would be riddled with problems

  • Studiowaves
    Studiowaves Member Posts: 451 Advisor

    Yep. or just make a tap tempo in core, how hard can it be to average the time capture between each of your taps. I take it, it's the dead of winter where your at too. I forget, think your in Scotland or something. To think Rolando is out grazing in the grass. lol Remember the time he was ****** about it being so hot. Those were the good old day. Then came our semantically messed up issue with my fm program. What an idiot I was, I didn't realize you were talking about the simple fm operator. That is easy, I was talking about the entire process of making decent sounding instruments with all the envelope generators, note scaling, velocity curves per operator and other stuff. That was a true case of the problems with semantics. Sorry about that. Also, that was really great thinking on your part on the lookup tables. They truly are slower than simple mathematics. In fact I proved it by inserting the lookup sine tables into the FM synth when it was done. There are 12 oscillators running per voice. I replaced all 12 or Rolando's super clean sine wave shapers and it ran like a dog. I guess the processors local cache couldn't hold all 12 lookup tables or they didn't get into the cache like they did with the simple tests we were doing. I'm not sure how a processor decides on what to put into the cache but it certainly did on the simple tests. But your final example with the more complex ensemble surely did. I still remember you saying, now if your computer can get this into the cache, I want your computer. Those were the good old days. Oh well, back to the dead of winter, time to play with Reaktor before I get boarded to death. lol Talk later my friend.

  • Studiowaves
    Studiowaves Member Posts: 451 Advisor

    What I get a kick out of is that app that tells you what song your listening. It takes about 10 seconds or something and bam it's done. A friend had that on his phone and we were listening to the car radio. Amazing, we couldn't begin to think of the algorithm used to do that. In this case it's obvious you need to break the spectrum down with an fft. Then analyze each band. They have a factory fft but I haven't seen one made with reaktor. The factory one might be written in computer language or something but displayed in Reaktor. I think a tap tempo is the easiest.

  • Michael O'Hagan
    Michael O'Hagan Member Posts: 93 Helper
    edited January 2023


    It needs to auto detect BPM when you import the sample so that the internal timestretch will work properly.


    It's not about organizing by tempo, it's about how to calculate and stretch internally on drag and drop.

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    oh yeah, reaktor's fft is legit, one of my primary implements actually. the only trouble here is it doesn't go very high in bin size... 2048 is just about ideal for pitched musical signals but what colin's talking about needs to go waaaaaaay longer down looooooooow where handclaps start to register as a measurable pitch instead of events in time

    \

    What I get a kick out of is that app that tells you what song your listening.

    youtube's version of this for content ID is kinda spooky. i uploaded some obscure acoustic live recording of a song and it matched with the album version... like matching the same exact recording is neat enough but to actually lift features and be able to abstract them enough so it matches with an album version with a totally different arrangement freaks me out a little. would mean its actually listening not just looking for exact matches

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    honestly autocorrelation is prolly your best easiest chance. it takes the signal and compares it against itself along every possible offset in time and ranks where it matched the highest


    actually scratch that, the very easiest is probably just you could do it by hand by lining them up visually and the BPM will just be some multiple of how far along you had to shift it

  • Studiowaves
    Studiowaves Member Posts: 451 Advisor

    Michael, I think you would be better off letting a daw do this. It seems lots of them have time stretching capabilities. I think ACID loops were the big thing at one time. My friend made a song with some John Bonham's loops. It worked pretty good. I think they took his drumming of the master tapes with Led Zeppelin or something. We laughed thinking he played on the song but didn't know it. Acid has changed hands over the years. It looks like Magix has it now, At least now I see what your trying to do.

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    just noticed you said that when its off by half or double? if so that sort of changes the problem from BPM detection to something more like 'playspeed doubling detection'


    I would advise looking at the difference in spectrum and seeing if there is something there that could be taken advantage of, so that the detected BPM is halved or doubled depending on whether the it sounds like a drum set for ants (or giants)

  • Michael O'Hagan
    Michael O'Hagan Member Posts: 93 Helper

    It's for a reaktor sample slicer and time stretcher, the DAW can't do this part of it.

  • colB
    colB Member Posts: 761 Guru

    the only trouble here is it doesn't go very high in bin size... 2048 is just about ideal for pitched musical signals but what colin's talking about needs to go waaaaaaay longer down looooooooow where handclaps start to register as a measurable pitch instead of events in time

    That's why I suggested down sampling first.

    So if you first apply an envelope follower, then run every 100th sample (or whatever?) Through a 2048fft driven by a divided clock (SR.C/100) then something that the fft reports as 200hz would actually be 2hz or 120bpm. You might have to do some anti aliasing... not sure... maybe not if this is just to get a better starting point for autocorrelation...

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    there's another tricky thing with that as well (assuming everything else would work) which is that now you'd have find the fundamental frequency of the detected waveform


    one way to do that is to take the Fourier transform of the Fourier transform (cepstrum), that way you can be mostly sure the highest peak corresponds to the fundamental, but this is introducing another layer of uncertainty (generally the detected peak will only be accurate to the nearest bin)

  • Studiowaves
    Studiowaves Member Posts: 451 Advisor

    I was thinking of using a series of narrow band pass filters. I think the old filters resonated and they built up amplitude with a sustaining tone and resonated afterwards as they decay. In music something is generally on the down beat before an upbeat can be established. Something of substance like a kick drum that is strong in volume. It could be hand claps too. I guess the trick is to detect this like your brain does when you start jamming along with a beat. I mean we sense the rhythm, tap our feet and play along. But what is it that we pick up on. Maybe Colin's got a point, AI might be the only solution. But what is AI in this case. For starters something has to be repetitive. Well the loop is already repetitive so why not use the loop duration for starters, then try to pick out the tempo from something dominant the we pick up on a something to follow. Maybe take samples of amplitudes every 1/12 of the loop time. This way you can pick up on things that are triplets or quarters. In other words lets say the loop was 4 seconds long. I could be a tempo of 60 with four beats being present on every 3rd of the readings. It strong pulses were on every 6th reading it could be a tempo of 120. Something along those lines.

Back To Top