|
Working out the key is a trivially simple task that the human can do, either as an input to the program or later when editing its output. In fact, since the computer already knows the *pitches* of every note, a good heuristic would be to go through all keys and see which produces the least amount of accidentals in the resulting score.
The really hard bit, as you pointed out first, is isolating the sounds of different instruments.
|
|
|
|
|
destynova wrote: the least amount of accidentals
Or intentional notes outside the key. Dont forget, the OP asked for SW the could write the music onto staves, so the key is crucial. If it were to some kind of linear tabulature it would be easier.
As you say humans can detect the key, if they are musicians, because of the mood, or feel of a song. How do you teach a computer to understand mood?
|
|
|
|
|
Munchies_Matt wrote:
As you say humans can detect the key, if they are musicians, because of the mood, or feel of a song. How do you teach a computer to understand mood?
Indeed, this is difficult for computers, but it's easy for us and therefore not the problem we need them to solve -- accurate transcription (of heavily polyphonic music) is very hard for us and that's where we need help from the machine.
|
|
|
|
|
You would need to count the notes of each frequency of the whole piece, assume most are not accidentals, then compare the highest counts to a table of notes per key. If there is a question, you can look at the first and last notes of the piece to decide.
|
|
|
|
|
Yes, getting complex isnt it.
|
|
|
|
|
In a musical score you don't really show the key (the music could be in a mode instead) - you just apply the convenient number of sharps or flats after the clef sign. You'd just need a table of flats and sharps in the order they appear on the circle of 5ths.
The program can notice that there are way more b-flats and e-flats than naturals, and put them by the clef. You'd want the table so you wouldn't end up with non-western key signatures with just an a-flat and a c-sharp. Modulation would be more difficult, but noticing that now there are all b and e-naturals, with c and f-sharps would be an indication.
With instruments that throw out lots of overtones it would be difficult to determine which notes are actually being played. A Mixture Stop[^] on a pipe organ or an old Hammond drawbar would be pretty difficult to deal with.
|
|
|
|
|
Take the intro to Sweet Child in Time. What key is that in?
|
|
|
|
|
Munchies_Matt wrote: And how do you determine the key? There are only 12 notes. Working out the key is very difficult. The technology to do this has greatly advanced over the last 20+ years. There are several $100 pedals that do this very accurately. Many of them (Digitech, TC Helicon, BandInaBox) license the same software from a Canadian company (I forget the name).
/ravi
|
|
|
|
|
A guitar effects pedal? Why would that need to know what key the guitar is playing in?
|
|
|
|
|
Munchies_Matt wrote: A guitar effects pedal? Why would that need to know what key the guitar is playing in? To generate a harmony line and/or harmony vocals. Here are some examples:
Check out the videos on YouTube - they're pretty compelling! I used the DigiTech Harmony Man to create the harmony lead on this.
/ravi
|
|
|
|
|
Adding harmonics isnt the same as decoding music and working out the key it is in.
|
|
|
|
|
The device needs to know the key you're playing in, in order to generate harmonies.
/ravi
|
|
|
|
|
No it doesnt. It takes the input sine wave and adds thirds and fifths commonly.
|
|
|
|
|
Munchies_Matt wrote: It takes the input sine wave The control input to these devices is a chord played on a guitar, which (as I'm sure you know) is not a pure sine wave. The hardware (actually the software running on the hardware) determines the root note from the complex input waveform, and uses that to generate the selected harmonics.
/ravi
|
|
|
|
|
As hinted at above -- it's not even as simple as identifying the pitch (frequency) of the note of a particular instrument.
For example, a particular pitch could be considered a D# or an Eb, depending on the context.
As for the rhythm, one example is that swing 8ths are notated on the page exactly the same way as Bach or Mozart's straight 8ths (let's see... those are quavers on the other side of the pond, I think.... two quavers per crotchet, isn't it?).
And is it in 3/4 time or 6/8? That depends on where you the emphasis on those crotchets and quavers.
|
|
|
|
|
kholsinger wrote: As hinted at above -- it's not even as simple as identifying the pitch (frequency) of the note of a particular instrument.
For example, a particular pitch could be considered a D# or an Eb, depending on the context.
If the machine could just identify the pitches of each note, that would be a massive leap forward and would simplify transcription greatly. Fixing up enharmonic equivalents later wouldn't present any kind of meaningful problem to the user and is a piece of cake compared to trying to transcribe a whole song by ear.
That said, all automated transcription software I've tried to date has indeed done a really bad job at rhythmic dictation and tends to be produce a mess of rapid notes. This is more time-consuming to fix and badly obscures understanding of the music.
|
|
|
|
|
kholsinger wrote: For example, a particular pitch could be considered a D# or an Eb, depending on the context. True enough, most of my music friends are amateur musicians (but some of them at a quite high level). Very few of them distinguish beetween D# or Eb.
Music editors are usually quite bad at it, too, even though they know the key of the piece.
Expecting a program that only has the sound waves to do something similar is naively optimistic.
|
|
|
|
|
Some humans can do it, so it must be possible.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Such an assumption!
You really do believe computers can do everything a human can dont you?
Extraordinary belief!
|
|
|
|
|
Munchies_Matt wrote: You really do believe computers can do everything a human can dont you?
Except make more humans. That we'll still have to do for ourselves.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Computers are SO bad at thinking for themselves!
They are slaves to a program written by a man. And that program has to think of everything!
We dont even understand how our brains work, until we do we havent a hope in hell of replicating its ability/.
(We dont even understand how a baby can be formed in just 9 months, heck, we dont even understand how anaesthetics work!)
|
|
|
|
|
I already found several that do. They may not be able to differentiate an A440 by a guitar from a French Horn (though at least two do by analyzing timbre differences), but they all can analyze polyphonic musical sounds and differentiate.
Welcome to the 21st century!
|
|
|
|
|
MSBassSinger wrote: an A440 by a guitar from a French Horn
So they dont work.
Now, do they recognise the key the music is in?
|
|
|
|
|
Yes, they do work, and yes, they get the correct key.
|
|
|
|
|
If they cant identify separate instruments they do what was asked.
As for the correct key, prove it.
|
|
|
|