วันพฤหัสบดีที่ 9 กรกฎาคม พ.ศ. 2552

Expert Systems

There are now computer musical composition systems that are able to convince experts and average listeners that the computers are expert humans playing music. The listeners can't see that the music is being played by a computer. The people programming the systems are able to teach something as dumb as a computer to create music good enough to fool experts and the average listener. They can teach us a thing or two.

What are the programmers teaching the computers to do? The programmers teach the computers what expert humans do. Research indicates that people who have composing careers tend to start with the big picture and work down toward the details. Amateurs do the opposite but pros are able to think up and compose several parts at once while considering the relationship between them and even to compose from the top down and from the bottom up simultaneously. Amateurs write one bar at a time and have no idea how that part affects the others. Pros have a rhythmic approach to melody writing and amateurs don’t. Frequently amateurs only focus on pitches. The pitches are of secondary importance to rhythmic considerations. Actually, the form, overall length, section lengths, and phrase lengths are just larger rhythms. They are periodicities that occur infrequently compared with individual notes and rhythms but are just as important as the smaller details and help give the smaller details somewhere to reside. Although an expert may know how to do many seemingly complex things, one of the things that separate him or her from the amateur is how to simplify and categorize their vast knowledge into a structure that is small and manageable.

In the beginning of the history of expert systems, programmers thought if they just asked experts and also observed them, that it would be easy to find out what the experts were doing.
It turned out to be much more difficult. Experts sometimes can’t communicate what they’re doing or the variables are so numerous that a busy person can’t take the time to cover EVERYTHING they know how to do. The other issue is that the programmers didn’t know the right questions to ask.
This isn’t any different than a teacher with a student. Only in that case, the student is a computer. Some people say that composition can’t be taught, yet even with all of the difficulties, people still try to teach it and to learn it from a mentor of some sort.

The field of expert systems has grown a lot since the beginning. Experts have dug deeper into their psyches and more intimately revealed their thought processes and the programmers have started asking better questions. It’s still not perfect but it doesn’t need to be perfect for our purposes.
I’ve got a Boss BR1180 Digital Recording Unit. Acquaintances said it’s not good enough nowadays. I said that I have a Mac G4 computer and ProTools recording software also but didn’t always need to use them in many cases because the Boss BR1180 is better than anything the Beatles ever had. Clearly, it’s good enough.

An experienced recording engineer will know what to do with a cheap SM57 microphone and make it sound the best it can. Often, an amateur won’t be able to make a $400 mic sound as good as the pro with a cheaper mic.

If you convert a music file to mp3, it leaves out a lot of data but most non-musicians can’t tell the difference. The reason is because it presents the most important aspects with more detail, the less important aspects with less detail and leaves out the rest. Again, the amount of data not being used might be fairly large but the difference is virtually imperceptible. This course on melody and solo composition is similar to those examples.

If you’re in a band and you want to play your own original material, how do you create the music? You don’t just pull it out of thin air. Your thoughts as a musician have been existing in a historical context since the day you were born. What did your favorite musicians do to start creating their own original music? Usually, people start out copying their favorite groups and artists. But if you just copy them, it’s not original. To make it original you have to change something. Maybe you keep the rhythm for the rhythm guitar part but you change the chords or you keep the chords and change the rhythm.

This is similar to what the programmers of expert systems are teaching their computers. But it has to be done in a way that doesn’t turn the good input into crappy output. That’s part of the difficulty. Lots of people have tried just changing things a bit and have been unsuccessful in consistently putting all of the elements together in an aesthetically pleasing direction. Only a lucky few make that work. There are a lot of things you can screw up in the process of creating a song. And you only need to screw up one of them to put a blight on all the rest.

It might take a normal person studying alone ten years to get a handle on composing. But a programmer can download all of an expert’s or several expert’s knowledge over the course of only a few days. Then the computer can integrate that into its function very quickly. But only if the programmer knows what the computer will be able to do effectively. Computers aren’t people. Early on in the history of computer music composition, too much of the output was inferior to a normal person’s expectations and the programmer had to wade through tons of crappy music to find something passable at the end of it all. Why was that the case?

Randomness
In the Classical era Mozart played a game that chose pitches at random. If a computer does this for an entire phrase, it produces very angular melodies with awkward leaps and changes of direction.
Since then things have slowly become more sophisticated.
Here is a chart with truly random data which is generated from the decay of a radioactive isotope which you can use to prove to yourself just how bad music created this way really sounds. You can read it forwards, backwards, diagonally and even change direction. It won’t matter because it’s random.

36AC20D21D08302E7C005F96EDD46E625084F3C9D6C0D04F294DA755D3F8111B
886C03EC54728F39F093F19DC46235CB451F7A2DBABB2D93F899EBC0CEBD4404
7692D7AC44C5AFD1E4500AE7D2628D37E804155F190CAD994C7B949D3A2790BB
FCFB6C1E300C715AF01D90F968691857FB814CFCAB46F7A505D34B7268E4CF0D
65014D38083996BACB8E2BC26C78F989787D99B11D4184B80246394867470394
2AFFD91610D9C97FC3809D8B9E81A105DD8C972321BB839E5B8FAC3F07A2407B
CFB00042DB9A69C10011767E8C00430A4D5064C2BF00B37156D30312B56B480F

It’s possible to find truly inspirational music in random methods but first you’d have to wade through literally thousands if not millions of cases to find even one brilliant case. As expert system programmers say nowadays, it’s better to be consistently effective than to only occasionally create a more stellar example.

Weightedness

Weighted Pitches

Below is a chart used by some computer systems which shows the likelihood that a musical pitch will occur in "normal" melodies they sampled. Each is weighted with a number. In the key of C Major the notes are weighted like this;
C=5, D=3.5, E=2, F=4, G=4.5, A=3.5, B=4.

note,probability,probabilities

As you can see, the note C will occur more often than note E. If you roll weighted dice to create a melody or draw from a group of tiles, the pitch frequency method has the problem of not placing important pitches on important beats. It creates large leaps frequently. Even worse, it does not create enough motion by step or third.

Weighted Interval
Another method used is to weight the likelihood that one INTERVAL will follow another interval instead of one note following another note.
Below is a chart with the frequency of intervals that occur within "normal" western melodies. They are weighted like this;

Unison=5 (when the next note is the same as the previous note), Minor Second=5.5, Major Second=15, Minor Third=2.5, Major Third=2, Perfect Fourth=3, Tritone=0, Perfect Fifth=1.5, Minor Sixth=.125, Major Sixth=.25, Minor Seventh=.25, Major Seventh=.25, Octave=1

intervals,probability,probabilities

As you can see, it’s most common for one note to move a Major Second to another note.
This method produces smoother lines than the random pitch method but without enough surprises in the right place. One big problem with this interval method is that it gets trapped in a back and forth motion, for example going between G and A or F when it’s calling for all those Major seconds. It also does not place important pitches on important beats.

For this interval method, when the computer is calculating where to go, if it has drawn an interval of a major second it’s supposed to use, then if we’re assuming the male vocal range and it’s starting at the bottom of that range on C, obviously the melody cannot descend since that would take it outside the range. Therefore the next note must ascend to D. Also, if you’re trying to stay in a C Major scale then the Bb below C which is a major second below, if it were in the range, still would not be an option since it’s not part of the C Major Scale.

But if you’re on G, then you can either go to the A above or the F below. However, it’s best if the computer does not try to pick which line it’s going to follow yet and just keeps track of where each line goes. There may be some situation where one of the lines terminates because there is an interval combination that won’t work for that line such as if it’s on D and the interval it should travel from there is a Major third. There is no scale step in C Major that is a major third from D, so then it would have to abandon that line.

One way of evaluating the fitness of anything put out by the interval method is by simply counting notes. So, if there aren’t enough ones, fives and threes, aka C’s G’s and E’s not being anywhere near the ballpark of the called-for parameters for the percentage of occurrences of each, then what the interval method has produced is probably bad.

We could also use the interval method to evaluate the fitness of anything produced by the pitch frequency method. If the percentage of minor and major seconds to other intervals is not within a certain parameter...something like 80% of the ideal, then we can probably say with some confidence that a melody created with the pitch method is not a good melody without even listening to it. In other words, if the melody has too many intervals of a fifth, sixth and seventh but only a couple of intervals of a second and third then it’ probably not good.

Placing Pitches on Beat

Another technique that is applied increases the likelihood that the most frequent pitches; 1, 5, 3, 4, 7, 2, and 6, in that order, will occur on the down-beat by a factor of three, on beat three by a factor of two and on beats two and four by a factor of one. The off beats are not affected. It means that if a note falling on the down beat currently is the pitch number two, then you have to move it back three places in this string of numbers: 1,(5,3),(4,7),2. Start on pitch number two and count backward three places. That will change it to pitch number three, a more important pitch. Some pitches were placed in parenthesis because they have the same weight and so can be interchangeable. This pitch ranking was taken from a different sample of melodies than the previous example of pitch probabilities.

Combined Pitch and Interval Method

There are also systems that combine the random pitch method and the random interval method. It takes the input of several thousand tunes and gives them all the same starting pitch.

On one chart there were 3,282 instances of C going to C again and only 1 instance of C going to C#, and 2,661 instances of C going to D. All of the data makes sense if we think about it in terms of voice leading. Because C is the most important note of the scale, it wants to stay where it is. Therefore C will often repeat. C# is not in either the C major or the C minor scales so it occurs only once out of thousands of melodies. C goes to D less frequently than C repeating itself but more frequently than going to C#. That’s because D is part of the right scales and since D is a close neighbor to C.

Then the computer’s internal dice are weighted appropriately so that the computer chooses to go to the most common next note more frequently than uncommon next notes without eliminating them from the realm of possibility.

This method can be improved even further if the previous two or more notes are taken into consideration when trying to decide what the next note should be. The words usually invoked to give a name to this are Second Order Markov chain but the results are a vague approximation of a style and are not a fully adequate solution.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น