Calculate track's key at current tempo? How-to ideas?

Discuss music production with Ableton Live.
Post Reply
muthafunka
Posts: 2247
Joined: Fri Jan 10, 2003 5:28 pm
Location: Tokyo

Calculate track's key at current tempo? How-to ideas?

Post by muthafunka » Sun Dec 07, 2008 6:45 am

Pretty much stopped using Live for djing and using Traktor again, no real problems, just a matter of taste. Anyways, I have key and tempo info for all my tracks and was wondering if it'd be possible to make an Excel doc. or something that would allow you to calculate a track's key at the current tempo ie I know track A is in E at its original 124bpm, but what would the closest key be if synced to the currently playing track's 126.3bpm?
I know the math roughly but some kind of on-the-spot calculator would be filthy good. even better were it built into Traktor but don't see this happening anytime soon. Posted this as a feature request at NI but seeing as there's no shortage of smart 'uns here and this would be pretty useful generally, figured I'd ask here too.

xherv
Posts: 180
Joined: Mon Oct 27, 2008 1:42 am

Post by xherv » Sun Dec 07, 2008 9:23 am

The pitch shift applied by playing something in a known key at X bpm, at Y bpm, can be expressed in terms of ratios:

key/x bpm = newkey/y bpm

and can be rewritten:

(key * y bpm) / x bpm = newkey

Since we don't need a numeric value for 'key', we can consider it to equal 1 for the purpose of this calculation.

126.3/124 ~ 1.018.

Western music has very clearly defined semitones* that are neat ratios of two fairly low integers (http://en.wikipedia.org/wiki/Interval_(music) has a good table, but doesn't want to sit inside a url tag here). For example a full octave is 2:1 (2, which results when y = 2x in the above context); a fifth is 3:2 (1.5 - try putting an Operator osc @ 500 to hear this). Here is where it gets tricky though; the semitone scale is logarithmic, not too easy to calculate in your head (well, at least not my head). The difference between the first and second semitones is 16:15 versus 9:8, not something I could tell without a calculator.

So if you're doing an Excel sheet I guess I'd suggest calculating the 11 semitones by solving:

+1 semitone :: 16/15 = z / 124(bpm, just an example) :: (z ~ 132.3)
+2 semitone :: 9/8 = z / 124 :: (z = 139.5)
...

My guess is this would give you the information you want, I think at this point guesstimates would be reasonably accurate.

* - There are a few tricks to the ratios underlying semitones as well, that result in some concrete audible effects resulting from how notes in a polyphonic context can modulate a little against each other, but culturally we live in one that has semitones.

I have a question here - how closely do keymatching DJs follow the rules? It seems to me like you're likely to find some harmonic / modal structures that might not look to be in 'key' with each other but can mesh in interesting ways, but also possible to have some accidents doing it this way.
http://www.soundcloud.com/xherv
I know EVERYTHING that I know and you don't know, and don't know what I don't know that you know, so I'll ignore that stuff. Wassup now?

8O
Posts: 5502
Joined: Fri Mar 28, 2008 9:29 am
Location: Berlin

Post by 8O » Sun Dec 07, 2008 10:03 am

For a single excel formula, would this work:

Semitones Difference to New Key = LOG((NewBPM/CurrentBPM),2)*12

Examples:
CurrentBPM = 124
NewBPM = 132
Formula result = 1.08
So you're just over one semitone up compared to current key e.g. A -> Asharp

CurrentBPM = 124
New BPM = 104
Formula result = -3.04
So you're just over three semitones down compared to current key e.g. A -> Fsharp

xherv - you want to confirm whether I'm just talking rubbish or not? :)
Image

chapelier fou
Posts: 6039
Joined: Mon May 15, 2006 12:15 pm

Post by chapelier fou » Sun Dec 07, 2008 10:37 am

8O, it seems right... I guess.
xherv : it is almost right, but in the pythagorician system, which is not the temperated system. But it can do an easy approximation.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

xherv
Posts: 180
Joined: Mon Oct 27, 2008 1:42 am

Post by xherv » Sun Dec 07, 2008 11:00 am

That's pretty clever and more accurate than using the ratios listed in the Wiki . . . I haven't visited this topic in quite a while, since I was in high school tuning a guitar a couple times a day, Wiki is really fascinating.

I'm tempted to demand Live 8 include Just, Even, Well Temperament as well as all other mathematical and cross-cultural tuning maths. It's kinda like MPC swing, right? edit: Not even kidding, in the case of something like Tension modeling a guitar, I wonder if this is accounted for, I think you can definitely feel and hear some of those micro-tuning issues on the 'real' thing.
http://www.soundcloud.com/xherv
I know EVERYTHING that I know and you don't know, and don't know what I don't know that you know, so I'll ignore that stuff. Wassup now?

muthafunka
Posts: 2247
Joined: Fri Jan 10, 2003 5:28 pm
Location: Tokyo

Post by muthafunka » Sun Dec 07, 2008 11:52 am

Wow, thankyou for all that, now to figure out how to apply all that in some kind of in-the-mix kind of format/process that my brain can deal with. For sure there are many uses for key-matching and not simply like-with-like. The Mixed In Key software uses an interesting non-musical notation which suggests 4 mix-friendly keys at the most basic level. In a software such as Traktor which will displays tempo and key info. in the browser this kind of functionality would seem to be a very logical step.

blastique
Posts: 180
Joined: Wed Nov 23, 2005 7:52 pm
Location: Kuala Lumpur, Malaysia

Post by blastique » Sun Dec 07, 2008 12:27 pm

A 6% change in tempo results in approximately a semitone shift in key.

When mixing, it's just a matter of doing a quick calculation in your head. Eventually when you've been doing it often enough, you kinda tend to get a rough idea as to which situations will and won't work

i.e. a track in B minor is going to work with a track in C minor, if say Bn is 125 and Cn is 130, or a F Minor at 132 may work with a B minor at 126. If you work out the bpm difference between the two however, you'll find that they are 4% and 4.7% respectively. As long as the difference is a bit more than 3%, there will be a discernible shift, and likewise, if it is leaning towards something less than 3%, there won't be a majorly discernible shift in pitch during your mix. However, I've noticed that some tracks are in fact keyed/detuned by as much as 50cents which puts the tune in a lil bit of a limbo zone, but it's always bound to work with something :)
milehighsounds.com | blastique.com
Ableton Certified Trainer
Malaysia

soundcloud.com/blastique

Post Reply