24hourcampfire.com
24hourcampfire.com
-->
Previous Thread
Next Thread
Print Thread
Hop To
Page 1 of 2 1 2
Joined: Dec 2002
Posts: 17,278
Barak Offline OP
Campfire Ranger
OP Offline
Campfire Ranger
Joined: Dec 2002
Posts: 17,278
I have an interesting music math problem that I'm trying to solve.

I have a tempo map, drawn with straight line segments on a Cartesian plane where the X axis represents time (say, minutes) and the Y axis represents tempo (say, beats per minute). The tempo varies over the length of the song.

Example. Suppose a part of the map says that at 1.00min, the tempo is 60bpm, and that from there it rises linearly so that at 1.10min, the tempo is 120bpm.

Okay: now, what I have to do is mark off beats. Suppose I know that a beat begins at exactly 1.00min. What time is exactly one beat after that? Exactly two beats? (The tempo is increasing, you see.)

Since the X units are minutes, and the Y units are beats per minute, the units of the area under the "curve" are beat-minutes per minute, or just beats. So I need to determine the X value at the point where the area under the curve and to the left of the X value equals the number of beats I'm after.

So far, I've derived an equation for the area under the "curve" (in terms of the X value I want to find) by dividing it into a rectangle and a triangle, and adding them together. (The area under the curve, of course, is a right trapezoid turned on its side.) Then I've solved the equation for the X value I want.

However, because of the interpolation necessary to include the area of the triangle, I end up with a nasty-looking quadratic equation that simplifies to an only slightly less nasty-looking expression using the Quadratic Formula. (So far I've done it several times, and I've only gotten the same expression twice: apparently my algebra isn't everything it used to be.) In general, this expression has two real roots, with one of them being negative...meaning it's not the one I want. However, the one I do want is wrong.

For instance, in the example above, in the six seconds between x=1.00 and x=1.10 there are exactly nine beats; however, if I ask my expression to give me the time value that's nine beats after x=1.00, I get something significantly less than 1.10 that is not related to it in any clear way.

How would you approach the problem?

Attached Images
7719-Photo_061807_001.jpg (32.07 KB, 77 downloads)
Last edited by Barak; 06/19/07. Reason: add reference to Quadratic Formula

"But whether the Constitution really be one thing, or another, this much is certain--that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist." --Lysander Spooner, 1867

Joined: Mar 2006
Posts: 1,269
Campfire Regular
Offline
Campfire Regular
Joined: Mar 2006
Posts: 1,269
'How would you approach the problem?'

with a headache


I didn't understand a word you said, but whatever it was I'm right there with you.
Joined: Dec 2000
Posts: 29,348
Campfire Ranger
Offline
Campfire Ranger
Joined: Dec 2000
Posts: 29,348
Originally Posted by Barak
� How would you approach the problem?

� with a stamped envelope addressed to Barak �

smile


"Good enough" isn't.

Always take your responsibilities seriously but never yourself.



















Joined: Dec 2002
Posts: 17,278
Barak Offline OP
Campfire Ranger
OP Offline
Campfire Ranger
Joined: Dec 2002
Posts: 17,278
C'maaaan, it can't be that hard: it's linear!

If there were bicubic curves between the tempo values, okay, that'd be tougher...but hey!


"But whether the Constitution really be one thing, or another, this much is certain--that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist." --Lysander Spooner, 1867
Joined: Jul 2004
Posts: 13,250
Campfire Outfitter
Offline
Campfire Outfitter
Joined: Jul 2004
Posts: 13,250
Originally Posted by Barak
C'maaaan, it can't be that hard: it's linear!

If there were bicubic curves between the tempo values, okay, that'd be tougher...but hey!


I just knew there'd be a test. frown

IC B2

Joined: Oct 2004
Posts: 25,843
D
Campfire Ranger
Offline
Campfire Ranger
D
Joined: Oct 2004
Posts: 25,843
I'd just divide the Franastrate by the Combobulate and then multiply that value by the square root of a Flexnard...simple crazy


My dog is a member of the "Turd Like Clan"

Covert Trail Cameras are JUNK

3 Time Dinkathon Champion #DinkGOAT



Joined: Aug 2003
Posts: 13,547
JOG Offline
Campfire Outfitter
Offline
Campfire Outfitter
Joined: Aug 2003
Posts: 13,547
Barak,

It looks like what you're trying to calculate is acceleration - some web searching based on that term should provide the calculations you need. If you're still stuck this evening I'll take a whack at it.


Forgive me my nonsense, as I also forgive the nonsense of those that think they talk sense.
Robert Frost
Joined: Apr 2006
Posts: 5,687
Campfire Tracker
Offline
Campfire Tracker
Joined: Apr 2006
Posts: 5,687
Barak,

Sort of like finding the time of a throw objects height location. You have to get to the point where you know the height location and then reconfigure and then solve the equation where time is the only unknown.

You know the acceleration, which is linear. You integrate once and you get the beat velocity as a function of time. AT this point you would plug in the boundary conditions, the beginning and ending beat velocities. Then you can solve for the integration constants. Then you integrate again and get beats as a function of time. Then you would solve for the location of each individual beat.


I think. Been a while since I did any old fashioned ODEs.

Will

Last edited by Penguin; 06/19/07. Reason: Screwed up

Smellin' a lot of 'if' coming off this plan.
Joined: Aug 2002
Posts: 907
Campfire Regular
Offline
Campfire Regular
Joined: Aug 2002
Posts: 907
Hey Barak,

What you've got is the equivalent to a linear motion problem with constant acceleration. Like the dropped apple in physics you plot the position of it using

x = x0 + v0*t + 0.5*a*t^2

x is the current position (in your case the beat number)
x0 is the initial position (the first beat)
v0 is the initial velocity (1 beat per second)
a is the acceleration (dv/dt = 1/6 beats per sec^2)
t is the time

So, for your example you've got 0.1 min = 6 sec for the total time, let x0=1 (for beat #1), v0=1 and therefore after 6 seconds you'd have

x-x0 = 1 * 6 + 0.5 * (1/6) * 6^2
x-x0 = 9 beats

You can then just substitute in the appropriate number of beats for x in the equation and you'll get a quadratic equation to solve that should give you the time duration (from start) to get to the nth beat.



B.I.C.
'tikka
Joined: Apr 2006
Posts: 5,687
Campfire Tracker
Offline
Campfire Tracker
Joined: Apr 2006
Posts: 5,687
Come on. It's no fun when you do the math for him. Now we can't rib him when he is working his way through the integral. smile

Will



Smellin' a lot of 'if' coming off this plan.
IC B3

Joined: Jan 2004
Posts: 3,767
7
Campfire Tracker
Offline
Campfire Tracker
7
Joined: Jan 2004
Posts: 3,767
WOW

Last edited by 721_tomahawk; 06/19/07.
Joined: Jul 2006
Posts: 4,527
R
Campfire Tracker
Offline
Campfire Tracker
R
Joined: Jul 2006
Posts: 4,527
It is so simple, the answer is "C" and occasionally 3

Joined: Jan 2001
Posts: 59,170
Likes: 2
R
Campfire Kahuna
Offline
Campfire Kahuna
R
Joined: Jan 2001
Posts: 59,170
Likes: 2
You lost me at 'tempo map'....


I HATED math in school...


Best of luck. But wait; call your closest university and ask for the math dept. There should be a professor who can help. If not, you know where NOT to send your kids... laugh


Ex- USN (SS) '66-'69
Pro-Constitution.
LET'S GO BRANDON!!!
Joined: Jan 2001
Posts: 28,390
Likes: 1
Campfire Ranger
Offline
Campfire Ranger
Joined: Jan 2001
Posts: 28,390
Likes: 1
It's a simple slope calculation, you just have to find X.


Attached Images
7720-FindX.jpg (22.75 KB, 2 downloads)

Gunnery, gunnery, gunnery.
Hit the target, all else is twaddle!
Joined: Feb 2001
Posts: 560
M
Campfire Regular
Offline
Campfire Regular
M
Joined: Feb 2001
Posts: 560
You can sure tell whose calculus is fresh. I might have been able to do that when I was in college, but that was way too long ago.

Joined: Apr 2006
Posts: 5,687
Campfire Tracker
Offline
Campfire Tracker
Joined: Apr 2006
Posts: 5,687
Wannatikka must have his mechanics books right by his workstation. He was right on top of this one. Worst thing is though he is an old timer around here. He ought to know this was a good occasion to get in a little good natured ribbing on Barak. smile

Integrals ain't that hard. He'd have got the right equations eventually but now we don't get to watch him scratch his head once or twice. You're right about getting rusty though. When I took my qualifiers I could derive the Navier-Stokes equations from scratch in just a few minutes. Man that seems like a lifetime ago. Pride wouldn't let me attempt it now. smile

Will


Smellin' a lot of 'if' coming off this plan.
Joined: Oct 2004
Posts: 16,916
2
Campfire Ranger
Offline
Campfire Ranger
2
Joined: Oct 2004
Posts: 16,916
Originally Posted by Jim in Idaho
It's a simple slope calculation, you just have to find X.




[Linked Image]


Pyelograms theorem.

Gonna take a stab at it out of memory.

Wish me luck laugh

X= the square root of (a squared + b squared )


Joined: Aug 2002
Posts: 907
Campfire Regular
Offline
Campfire Regular
Joined: Aug 2002
Posts: 907
Drat! You're right, I missed a golden opportunity to have some fun at keeping Barak scratching his head. My bad, and I'll try to not let it happen again. wink

Regarding the equation, that one just was floating around in my head back from undergrad physics ... what? 22 years ago? I've been accused of having way too much diverse & esoteric information floating around inside the old noggin'. I figure it's good insurance in case I ever end up as the life-line call on a game show.

Funny you should mention N-S equations too. I spent a whole bunch of time using the general form eq. of motion for polymeric flows back in my research/disseration. I too doubt I could derive that one today without a handful of 'trial run' force balances. (of course I'd be too lazy and that one I would just go to Bird's book)


B.I.C.
'tikka
Joined: Apr 2006
Posts: 5,687
Campfire Tracker
Offline
Campfire Tracker
Joined: Apr 2006
Posts: 5,687
Aha! I knew they got those game show answer guys from somewhere. Now we know. smile

Bird, Stewart, and Lightfoot. You must have went to school at Madison. I think it is a right of passage for anyone majoring in engineering to have to purchase that book. I still have mine. There is another poster here, Cacciatore, who along with me went to school there. We'll have the SEC guys outnumbered when football season starts.

Will


Smellin' a lot of 'if' coming off this plan.
Joined: Aug 2002
Posts: 907
Campfire Regular
Offline
Campfire Regular
Joined: Aug 2002
Posts: 907
Yup, Badger red here. Good to hear there's more of us around here, though Steelhead is pretty tough to compete with when he's toutin' his gators. I'm hopin' this year I don't have to see Albert at any national championship games.

BSL is pretty much a required reference in my field (ME with ChemE minor) as well as Bird Armstrong & Hassager for polymeric flow. I still have both sitting around the office somewhere.


B.I.C.
'tikka
Page 1 of 2 1 2

Moderated by  RickBin 

Link Copied to Clipboard
AX24

388 members (10Glocks, 10ring1, 17CalFan, 12344mag, 160user, 1badf350, 36 invisible), 1,896 guests, and 1,194 robots.
Key: Admin, Global Mod, Mod
Forum Statistics
Forums81
Topics1,192,633
Posts18,493,125
Members73,977
Most Online11,491
Jul 7th, 2023


 


Fish & Game Departments | Solunar Tables | Mission Statement | Privacy Policy | Contact Us | DMCA
Hunting | Fishing | Camping | Backpacking | Reloading | Campfire Forums | Gear Shop
Copyright © 2000-2024 24hourcampfire.com, Inc. All Rights Reserved.



Powered by UBB.threads™ PHP Forum Software 7.7.5
(Release build 20201027)
Responsive Width:

PHP: 7.3.33 Page Time: 0.336s Queries: 57 (0.015s) Memory: 0.9083 MB (Peak: 1.0423 MB) Data Comp: Zlib Server Time: 2024-05-06 11:55:01 UTC
Valid HTML 5 and Valid CSS