Hi Mohamed,
Maxime provided a lot of very useful information, especially from the
coding point of view. I would also just point out something from the
perspective of music theory. It is true you must find out which combination
of notes (frequencies) are being used in a particular track to find out the
key, but you also need to distinguish between the relative major/relative
minor.
I'll give you an example: Imagine you have a song that uses the notes A, B,
C, D, E, F and G. This song could be either in C Major or A minor. This
usually depends on a few important parts of the track/song/piece. It will
depend mainly on which chord or note the piece begins and ends with.
Generally speaking if the song begins with C and ends with C it will be in
C Major, whereas if it begins and ends with A, it will probably be in A
minor. An easy way determine which one it is, is to look at the bass note.
If we are talking about most music, the bass note will often tell you which
chord is being used and therefore give you a big clue about the key.
Now, especially for DJing, many people are going to be playing electronic
music, which will have many, many exceptions to this way of writing music.
The bass should still be a really useful thing to take into account though
and I would recommend you place special emphasis on the lower frequency
notes. Though even this might not be possible for every song, listen to
some dubstep or similar styles with really long glissando bass lines. The
bass line might actually be increasing or decreasing in frequency over a
long period instead of being made of individually pitched notes.
In short, I'd recommend reading more about the music theory behind
determine a particular song's key. You'll want to pay the most attention to
the beginning notes and especially the ending notes, as well as the bass.
Good luck!
Joey
p.s. You can often find me in the irc channel as 'Psyforce', feel free to
ask me more about the music theory aspects of keys if you see me online.
Date: Mon, 19 Mar 2012 18:50:05 +0000
> From: Mohamed Waheed <[email protected]>
> Subject: [Mixxx-devel] Question About Key Detection for Harmonic
> Mixing
> To: <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="windows-1256"
>
>
> hello , i want to work on this idea ( Key Detection for Harmonic Mixing )
> , but i don't know whats the required background and i don't know how to
> start , i would like anyone to push me towards the right direction , one
> more thing , i noticed that i will use an open source library to do the key
> detection , i also want to know how to do key detection in a low level way
> , with native code without libraries :)
> here is my background :
> C++ , computer graphics , physics simulation , game development ,
> programming contests ( acm and such ) , studied music & audio engineering
> and been working as a mixing engineer, music producer & dj for 7 years.
> i appreciate any help :)
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 4
> Date: Tue, 20 Mar 2012 00:21:26 +0100
> From: Maxime Bochon <[email protected]>
> Subject: Re: [Mixxx-devel] Question About Key Detection for Harmonic
> Mixing
> To: Mohamed Waheed <[email protected]>
> Cc: [email protected]
> Message-ID:
> <CAK6tYBkddmuUrm+RQJQr8Wb9QS3ah+SoiV-K1+vdx7jB4Z=r...@mail.gmail.com
> >
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Mohamed,
>
> Key Detection is part of the exciting Music Information Retrieval research
> field. So the best place to start getting thorough information on this
> topic is to browse the archives of related conference : ISMIR
> (International Society for Music Information Retrieval).
>
> Prior to the annual ISMIR conference, researcher are invited to evaluate
> their algorithm proposals against the MIREX procedures. Here it is for Key
> Detection in 2011:
> http://www.music-ir.org/mirex/wiki/2011:Audio_Key_Detection (rules) and
> http://nema.lis.illinois.edu/nema_out/mirex2011/results/akd/ (results).
>
> One thing to keep in mind when talking about M.I.R. is the nature of the
> input. Consider you are a musician reading a score. Using some music theory
> you could find the key by analysing relations between notes, by infering
> chords, etc. In this case, the nature of the input is symbolic (notes),
> providing a high abstraction level. On the other hands, when listening to
> the same score being played, you will have to turn what you hear (pressure
> variation) into spectral and temporal information using your ears and brain
> before being able to guess the key.
>
> Mixxx takes audio files as input (i.e. WAVE files for instance, not MIDI
> files), so you will have to apply some transformation on these low level
> data to jump to a higher level of representation. A widespread practice is
> to compute a kind of musical note histogram, providing a harmonic profile
> which can then be compared to the 24 known key profiles. (in related
> papers, the term "chroma" designates a 12-dimensional vector -- 1 value per
> semi-tone, from A to G# -- and the key profiles are referred to as
> Temperley pitch profiles).
>
> Here is an example of paper dealing with key detection:
>
>
> http://recherche.ircam.fr/equipes/analyse-synthese/peeters/ARTICLES/Peeters_2006_ISMIR_KeyHPS.pdf
>
> ...and an open source software with a serious project report:
> http://www.ibrahimshaath.co.uk/keyfinder/KeyFinder.pdf
> http://www.ibrahimshaath.co.uk/keyfinder/
>
> I hope this was helpfull.
>
> Regards,
>
> Maxime
>
>
>
> 2012/3/19 Mohamed Waheed <[email protected]>
>
> > hello , i want to work on this idea ( Key Detection for Harmonic Mixing
> )
> > , but i don't know whats the required background and i don't know how to
> > start , i would like anyone to push me towards the right direction , one
> > more thing , i noticed that i will use an open source library to do the
> key
> > detection , i also want to know how to do key detection in a low level
> way
> > , with native code without libraries :)
> >
> > here is my background :
> >
> > C++ , computer graphics , physics simulation , game development ,
> > programming contests ( acm and such ) , studied music & audio engineering
> > and been working as a mixing engineer, music producer & dj for 7 years.
> >
> > i appreciate any help :)
> >
> >
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > Mixxx-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mixxx-devel
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
>
> ------------------------------
>
> _______________________________________________
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
>
> End of Mixxx-devel Digest, Vol 70, Issue 19
> *******************************************
>
Message: 2
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel