[Algorithms] BPM changes (accel. or rall.)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beary605
    FFR Veteran
    • Oct 2008
    • 448

    #1

    [Algorithms] BPM changes (accel. or rall.)

    The best way to slow down (rall) or speed up (accel) is to do it with a constant rate of change, e.g. +9 BPM after 1 seconds, +18 BPM after 2 seconds, +27 BPM after 3 seconds...

    You are stepping something and thought a slowdown would make a great effect; but Stepmania only allows you to change BPM every beat. (i am aware you can now; problem still stands though)

    The problem is: To get from X -> Y BPM in T seconds, while minimizing the difference between each BPM and the expected BPM from the linear rate of change. BPM can only be changed on the beat.

    more formally: We want a list (b1, b2, ...., bn) where

    the time of the end of the last beat is exactly T: (60/b1 + 60/b2 + ... + 60/bn = T)

    We want to minimize the sum of the differences between the linear BPM change and the actual BPM.

    let N be where bn occurs (N = sum(60/bk, k = 1 -> n))

    = the wanted BPM - the actual BPM
    = (the starting BPM - the rate of change in BPM * seconds) - the actual BPM
    = (X - (Y-X)/T * N) - bn

    Is there a way of doing this, or a way that gets close but is not optimal?
    Last edited by beary605; 01-6-2014, 07:08 PM.
  • Wayward Vagabond
    Confirmed Heartbreaker
    FFR Simfile Author
    • Jul 2012
    • 5866

    #2
    Re: [Algorithms] BPM changes (accel. or rall.)

    Ddream

    Comment

    • Xiz
      TWG Chaos
      FFR Simfile Author
      • Feb 2012
      • 3399

      #3
      Re: [Algorithms] BPM changes (accel. or rall.)

      Originally posted by Wayward Vagabond
      Ddream

      Comment

      • beary605
        FFR Veteran
        • Oct 2008
        • 448

        #4
        Re: [Algorithms] BPM changes (accel. or rall.)

        Comment

        • benguino
          Kawaii Desu Ne?
          • Dec 2007
          • 4185

          #5
          Re: [Algorithms] BPM changes (accel. or rall.)

          The thing I'm worried about is that it seems you're only considering how well the bpm matches up on the last beat. However, you also want to make sure the bpm is matching up as you go through the entire time period, i.e., you want to look at your partial sums too. Taking this approach, the first partial sum is trivial since you'd only have one variable, b1. Solve for b1. Then for the partial sum up to b2, you have the variables b1 and b2. But you already solved for b1. Thus you can solve for b2. Then continue this process until you reach bn.

          At least that's what I got out of it just by taking a quick glance. I'll take a closer look tomorrow; what I said above is just kinda speculation, I work better with pencil/paper which I don't have at the moment :P
          AMA: http://ask.fm/benguino

          Not happening now! Don't click to join!



          Originally posted by Spenner
          (^)> peck peck says the heels
          Originally posted by Xx{Midnight}xX
          And god made ben, and realized he was doomed to miss. And said it was good.
          Originally posted by Zakvvv666
          awww :< crushing my dreams; was looking foward to you attempting to shoot yourself point blank and missing

          Comment

          • igotrhythm
            Fractals!
            • Sep 2004
            • 6535

            #6
            Re: [Algorithms] BPM changes (accel. or rall.)

            Originally posted by beary605
            The best way to slow down (rall) or speed up (accel) is to do it with a constant rate of change, e.g. +9 BPM after 1 seconds, +18 BPM after 2 seconds, +27 BPM after 3 seconds...

            You are stepping something and thought a slowdown would make a great effect; but Stepmania only allows you to change BPM every beat. (i am aware you can now; problem still stands though)

            The problem is: To get from X -> Y BPM in T seconds, while minimizing the difference between each BPM and the expected BPM from the linear rate of change. BPM can only be changed on the beat.

            more formally: We want a list (b1, b2, ...., bn) where

            the time of the end of the last beat is exactly T: (60/b1 + 60/b2 + ... + 60/bn = T)

            We want to minimize the sum of the differences between the linear BPM change and the actual BPM.

            let N be where bn occurs (N = sum(60/bk, k = 1 -> n))

            = the wanted BPM - the actual BPM
            = (the starting BPM - the rate of change in BPM * seconds) - the actual BPM
            = (X - (Y-X)/T * N) - bn

            Is there a way of doing this, or a way that gets close but is not optimal?
            Sounds like a job for least-squares regression. Only that's a way to fit a line to a set of data points, but it sounds like you want the other way around.
            Originally posted by thesunfan
            I literally spent 10 minutes in the library looking for the TWG forum on Smogon and couldn't find it what the fuck is this witchcraft IGR

            Comment

            • 21992
              Proud Indian 7-11 Owner
              • Jul 2009
              • 466

              #7
              Re: [Algorithms] BPM changes (accel. or rall.)

              from my understanding (although I wouldn't know too much about this) is that ths could be interpreted like Riemann sums. The more times you alter the BPM accurately the better the transition. But I'm assuming SM doesn't accept non-integer beat values for BPM transitions.
              Zakvvv666's Graduation Tournament Division 3 1st place

              6th FFR Official Tournament Division 3 6th Place

              Silly/Sax's Summer Sensation Division 4 2nd Place

              Dragon Fury's Custom Tourney 8 Division 5B 4th Place


              Just Your Amatuer Simfilier

              Comment

              • Fission
                no
                FFR Simfile Author
                • Jan 2004
                • 1850

                #8
                Re: [Algorithms] BPM changes (accel. or rall.)

                sure it does

                Comment

                • Wayward Vagabond
                  Confirmed Heartbreaker
                  FFR Simfile Author
                  • Jul 2012
                  • 5866

                  #9
                  Re: [Algorithms] BPM changes (accel. or rall.)

                  Definitely does

                  Comment

                  Working...