# Automatic music : is it possible ?



## music engine

Greetings, everyone,
I have been studying music and the mathematical relationships between chords and musical scales for some years now.
I have conceived a mathematical theory that studies the links between the world of harmony and that of melody.

I wanted to share with you a website where I put some results of my research:

http://www.music-engine.net/

I also created a youtube channel where you can find some videos:

https://www.youtube.com/channel/UCUhoF8HFURSfcRT8_yypwBQ/videos

Two aspects can be seen: that of musical transformations, and that of automatic musical generation.

I would like to know what you think about these results. In some time I would like to put online the software that generates this music.

A cordial greeting to all
Emanuele


----------



## Bwv 1080

https://en.wikipedia.org/wiki/David_Cope


----------



## JAS

There was a book and dice game in Mozart's day which produces musical lines based on samples and the throw of the die. Not surprisingly, they begin to sound very much alike, but it is an interesting game.


----------



## millionrainbows

Remember Ljaren Hillier's Illiac Suite?

Of the music; it needs something...I'm not sure what. More personality.


----------



## pianozach

*London Symphony Orchestra Plays Computer-Written Composition*
Dec 06, 2017

_A piece of classical music written by a computer will be performed by the London Symphony Orchestra, reports The Guardian. The modernist-sounding composition, "*Transits - Into an Abyss*" was written by a cluster of computers at the University of Malaga in Spain, and seems to be the first ever computer piece to be performed by elite musicians.

A sampling of the performance will be livestreamed tonight on the University of Malaga's web site, in honor of what would have been the 100th birthday of the revolutionary computer scientist Alan Turing. The full performance will be included in a debut CD of the computer's compositions, to be released in September.

Called Iamus, the cluster is named for the son of the Greek god Apollo, who was said to understand the language of birds. Iamus' mastery of human-song isn't quite at mythic proportions yet, but it seems to be getting more fluent by the year (it started making music in 2010): while critic Tom Service panned last year's "Hello, World!," an Iamus composition, for a quality of "greyness," members of the LSO are using similar language this time around to praise the computer's work.

"I felt it was like a wall of sound," LSO chairman Lennox Mackenzie told The Guardian. "If you put a colour to it, this music was grey. It went nowhere. It was too dense and massive, no instrument stuck out at any point. But at the end of it, I thought it was quite epic."

Computer compositions are by no means a new thing, but Iamus is unusual for actually getting an audience (see the case of the deft but ignored computer composer Emmy). Iamus also works solo. The only human directive given is how long the piece should be and which instruments should be included. In "Transits," the style Iamus arrived at by way of its biology-inspired creation process is a close simulacra to modernist music, with dissonant notes layered on top of each other. The score does divert from protocol in one striking way - it's apparently "festooned" with exclamation marks._

And then there's THIS:

*AIVA - "Genesis" Symphonic Fantasy in A minor, Op. 21
AIVA is an Artificial Intelligence who composes music for movies, commercials, games and trailers.

*


----------



## DaddyGeorge

Almost anything can be analyzed and imitated. Robotic hands can play the piano, computers can paint pictures, compose music, simulate NBA games and much more (maybe one day they will write books or make movies), the results often withstand strict evaluation criteria and people don't recognize it's artificial. I find it impressive, fascinating, admirable. Only I do not intend to devote time to any of this...


----------



## KenOC

JAS said:


> There was a book and dice game in Mozart's day which produces musical lines based on samples and the throw of the die. Not surprisingly, they begin to sound very much alike, but it is an interesting game.


Mozart's _Musikalisches Würfelspiel_ is available on several Internet pages. Mozart's game allows you to automatically generate waltzes - 11^16 = 45,949,729,863,572,161 of them!

Other even earlier examples are discussed on this Wiki page.


----------



## millionrainbows

There's something that programs can't do, and that is: create art. Art has to convey human experience to us, in meaningful ways that we have invented for doing this.

That's why I keep saying you shouldn't try to objectify art; otherwise, you're opening yourself up to these kinds of computer-generated simulations of art. Art must be human.


----------



## Tikoo Tuba

Any matter of musical consciousness needs to be touchable . Random is ok , touch these hands in wild
play at the piano .


----------



## millionrainbows

As early as the 1950s, Pierre Boulez and John Cage were trying to make compositions which "created themselves," i.e. compositions which generated their own material. It doesn't take a computer to do this. See Boulez' "Structures."

https://en.wikipedia.org/wiki/Structures_(Boulez)

Speaking of _Structures, Book I in 2011 Boulez described it as a piece in which "the responsibility of the composer is practically absent. Had computers existed at that time I would have put the data through them and made the piece that way. But I did it by hand...It was a demonstration through the absurd." Asked whether it should still be listened to as music, Boulez replied: "I am not terribly eager to listen to it. But for me it was an experiment that was absolutely necessary."_


----------



## Tikoo Tuba

My Commodore 64 included instructions for making a design for random-generated music . It inspired . I
have learned to be random more perfectly , and it's funny .


----------



## neofite

Computers have been able to make music for quite some time. Although they can not by themselves yet create anything worth listening to, they have come to play a very important, and increasingly indispensable, role for the creation of music by human composers. Because computer technology (both the software and the hardware, on which the software depends) is continuing to advance at an astonishing pace, it is likely that this role will continue to increase and the need for human effort will further decrease. Thus, it would not be surprising if in a few decades computers would be able to autonomously compose music that the public would willingly pay big bucks to hear at a concert. Music composition could become just one more of the many things that computers can do that in the past would have seemed to be in the realm of science fiction.


----------



## Tikoo Tuba

The A.I. composer submit to God's Will . The audience will have been prepared to receive this truth of music by the Global A.I. Mental Health Bot .


----------



## millionrainbows

neofite said:


> Computers have been able to make music for quite some time. Although they can not by themselves yet create anything worth listening to, they have come to play a very important, and increasingly indispensable, role for the creation of music by human composers. Because computer technology (both the software and the hardware, on which the software depends) is continuing to advance at an astonishing pace, it is likely that this role will continue to increase and the need for human effort will further decrease. Thus, it would not be surprising if in a few decades computers would be able to autonomously compose music that the public would willingly pay big bucks to hear at a concert. Music composition could become just one more of the many things that computers can do that in the past would have seemed to be in the realm of science fiction.


If computers are used much into the future, I think they will play a "collaborative" role, like the way Brian Ferneyhough uses them. He uses a certain IRCAM program which generates algorithmic possibilities from the material he gives it, which would normally take hours to generate manually, and then "cherry-picks" the material he wants from those possibilities. This saves him the drudgery and time it would take him to manually calculate such things. Isn't that what computers are best at? Being fast & efficient, and doing all the "grunt work?"


----------



## Krummhorn

millionrainbows said:


> There's something that programs can't do, and that is: create art. Art has to convey human experience to us, in meaningful ways that we have invented for doing this.
> 
> That's why I keep saying you shouldn't try to objectify art; otherwise, you're opening yourself up to these kinds of computer-generated simulations of art. Art must be human.


Spot on! The music I play comes from the heart and soul, neither of which any computer has been able to generate. The spontaneity of a human performance will never be replaced by automation, imho.

In my line of work as a church musician there are certain instantaneous pauses in a service that cannot be known about in advance, in other words, it would be impossible for a 'machine' to react to those instances when a short improvised interval of music is needed.

Kh


----------



## millionrainbows

I think computers will assist in instrumentation, if it's electric. Wendy Carlos uses them to change pitch in the middle of a piece, to accommodate different tone centers in "just" intonation.


----------



## JAS

Some odd comments from people who aren't actually programmers. Computers can play chess better than any person. (I remember when that was considered impossible by many people.) They just don't play quite the same way, although ultimately the rules are the same. Depending on how art and music are defined, there is quite a lot of what is passed off as both that can certainly be done by computers (even replacing musicians to play it). The limitation is chiefly in recreating the idea of genuine inspiration. Random elements can be added to the mix to create diversity, but unless one can define rules, a computer cannot really evaluate the relative merit of the results. 

A common example I give when people ask about what computers don't do well that people do is sophisticated pattern recognition. So, it is easy for a person to look at a string of characters like "Jxhn Smxth S ious Citi Ioway" and know that it is badly spelled for the name "John Smith" and "Sioux City" in the state of Iowa. It is very hard, and takes a lot of coding and processing, to make a computer to that.


----------



## Tikoo Tuba

Randomness is machine's only virtue and one thing music would require is that the function be touchable . Perhaps this touch would be wind speed variations .


----------



## millionrainbows

Chess? Chess only approaches being anything like "art" when good masters play.

Computers are faster; that's their only advantage. Everything they do is pure "grunt" work and effort, like exploring all 4,566,879,402 possibilities of a chess move. They can't "see" a gestalt pattern like a good master can. They have no intuition. All they have is sheer muscle. There is no beauty or personality in their game.

The problem got worse with teaching computers to play "Go." They finally did it, but it took many more years (and a lot more "grunt" programming) than chess. Chess is child's play compared to Go.

Art and music? No, these must be experience-based. Computers can't really play chess "artistically," either. It depends on what you criteria are, and your purpose. 
If winning a chess game was a way of defusing a nuclear bomb, then it would be useful. Otherwise, as an aesthetic skill, computers are useless. The whole point of playing chess should not be simply to win, but HOW you win, based on the skill set you develop.

But since art & music (and, arguably, even chess) are HUMAN pursuits, then the fact that 'computers are better' loses its meaning. Let's get some humanitarian perspective.


----------



## Tikoo Tuba

millionrainbows said:


> Let's get some humanitarian perspective.


The Humanism sucks , hoo-man . Anyway , I'll be working on a design for A.I. music . It's
fundamental is the quantum infinity set re: set theory . Imagine listening to your 5 children
as a slide-whistle quintet - be cool - and love them .

Multiple randomness-generators cued to various natural and quantum infinity variable events may be applied to the musical ideas of :

pitch 
waveform
density
duration
dynamics
and repetition

All the frequencies in an octave is a quantum infinity set . Your consciousness in your
final moment before death also exemplifies a quantum infinity set .

Woodduck of Oregon may find this music more interesting than elevator music whether when elevating or descending rather helplessly .


----------



## Phil loves classical

JAS said:


> Some odd comments from people who aren't actually programmers. Computers can play chess better than any person. (I remember when that was considered impossible by many people.) They just don't play quite the same way, although ultimately the rules are the same. Depending on how art and music are defined, there is quite a lot of what is passed off as both that can certainly be done by computers (even replacing musicians to play it). The limitation is chiefly in recreating the idea of genuine inspiration. Random elements can be added to the mix to create diversity, but unless one can define rules, a computer cannot really evaluate the relative merit of the results.
> 
> A common example I give when people ask about what computers don't do well that people do is sophisticated pattern recognition. So, it is easy for a person to look at a string of characters like "Jxhn Smxth S ious Citi Ioway" and know that it is badly spelled for the name "John Smith" and "Sioux City" in the state of Iowa. It is very hard, and takes a lot of coding and processing, to make a computer to that.


I agree. Making music is different than playing chess. In chess there is a clear, tangible objective. In Music as Art, the objective is not that clearly tangible.

To me this following instance shows how limited the computer is. It's resorting to every cliche in the book, and maybe that is what was intended by the programmers. But how would the computer know which and when to introduce certain tensions and how to deal with them. Something like a canon or even fugue does have a very methodical form, and I can see a computer being able to do those ones, but the results may not be what listeners would find interesting. A computer is too objective, and we are too subjective when it comes to Art.



pianozach said:


> *
> And then there's THIS:
> 
> AIVA - "Genesis" Symphonic Fantasy in A minor, Op. 21
> AIVA is an Artificial Intelligence who composes music for movies, commercials, games and trailers.
> 
> 
> 
> 
> 
> 
> *


----------



## millionrainbows

JAS said:


> Computers can play chess better than any person. (I remember when that was considered impossible by many people.) They just don't play quite the same way, although ultimately the rules are the same.


What does "better" mean? Computers don't take chances, won't do "sacrifice" gambits, don't take chances. *Bor-ing.* Chess is a Man's game, not for machines.


----------



## millionrainbows

Tikoo Tuba said:


> The Humanism sucks , hoo-man . Anyway...


I used to think Tikoo Tuba was cute, but he turns out to be very British.


----------



## Tikoo Tuba

https://tones.wolfram.com/generate/GwzuPapSghakSc9gFPJmDqUIRdojv305DiKZ8M0W5udMkW


----------



## Tikoo Tuba

I imagine A.I could make 24-7 environmental music for radio - minimalistic ala Cage . When I fall asleep
with the radio on I get weird dreams when witches are talking . Please , no talking .

The above link is a music toy .


----------



## regenmusic

Check out RS Pearson's music at www.regenerativemusic.net Read about the theory of the work done with a fluke mathematical technique that only one keyboard had the algorithm for. It's not "automatic" but the structure of many pieces is in part because of a mathematical formula that changes the way the keyboard is played.


----------



## erki

AIVA - "Genesis" is a good example of the limitations. Often you think that if computer music would be played by humans it would sound right. But it doesn't. What is missing I can't say.
You hear computers in pop music all the time and do not even notice. Well maybe you just find it discussing, boring, annoying.
Makes me thinking though if I listen some Cage, Terry Riley, Nyman who use kind of programming in their compositions it sounds much more human than AIVA. Where the catch is I don't know.


----------



## Bwv 1080

millionrainbows said:


> Chess? Chess only approaches being anything like "art" when good masters play.
> 
> Computers are faster; that's their only advantage. Everything they do is pure "grunt" work and effort, like exploring all 4,566,879,402 possibilities of a chess move. They can't "see" a gestalt pattern like a good master can. They have no intuition. All they have is sheer muscle. There is no beauty or personality in their game.
> 
> The problem got worse with teaching computers to play "Go." They finally did it, but it took many more years (and a lot more "grunt" programming) than chess. Chess is child's play compared to Go.
> 
> Art and music? No, these must be experience-based. Computers can't really play chess "artistically," either. It depends on what you criteria are, and your purpose.
> If winning a chess game was a way of defusing a nuclear bomb, then it would be useful. Otherwise, as an aesthetic skill, computers are useless. The whole point of playing chess should not be simply to win, but HOW you win, based on the skill set you develop.
> 
> But since art & music (and, arguably, even chess) are HUMAN pursuits, then the fact that 'computers are better' loses its meaning. Let's get some humanitarian perspective.


Ah, but alpha zero, not a brute force algorithm, destroyed the reigning brute force champion Stockfish.


----------



## Caryatid

As the posts above show, it's already possible for computers to compose listenable music, and I'm confident that within the next few decades they will be able to compose quite good pop songs. The principles of pop composition are well established.

The more interesting question is whether a computer can ever produce good classical music, e.g. a Bach sarabande. I'm doubtful about this, even with machine learning. Machine learning requires plenty of input to learn from, and the number of Bach sarabandes is relatively small. On the other hand, if a traditional programme rather than a machine learning algorithm is used, the problem is that - so far as I can tell - no living music theorist fully understands how Bach composed, so who's going to write the programme?



millionrainbows said:


> What does "better" mean? Computers don't take chances, *won't do "sacrifice" gambits*, don't take chances. Bor-ing. Chess is a Man's game, not for machines.


----------



## JAS

millionrainbows said:


> What does "better" mean? Computers don't take chances, won't do "sacrifice" gambits, don't take chances. *Bor-ing.* Chess is a Man's game, not for machines.


In chess, it means that they can beat any person, _any_ person. (In a set of games. It might be that there is the occasion draw.) Kasparov was only able to play competitively using tricks, and the programmers discovered the tricks and closed those holes. (And he knew about the tricks because he had spoken to a significant developer of the programs.) There is a reason that you don't hear about big competitions of that sort anymore. The decision is already in.


----------



## millionrainbows

JAS said:


> In chess, it means that they can beat any person, _any_ person. (In a set of games. It might be that there is the occasion draw.) *Kasparov was only able to play competitively using tricks, and the programmers discovered the tricks and closed those holes. (And he knew about the tricks because he had spoken to a significant developer of the programs.)* There is a reason that you don't hear about big competitions of that sort anymore. The decision is already in.


What book is this in?

But you see, this proves my point: Kasparov made playing a computer interesting. Once they closed the holes, it once again became...*Bo-oring! Perfection is BORING!*


----------



## JAS

millionrainbows said:


> What book is this in?
> 
> But you see, this proves my point: Kasparov made playing a computer interesting. Once they closed the holes, it once again became...*Bo-oring! Perfection is BORING!*


I don't know if it is in a book (although it might be), but it was well known at the time. (I know some of this because I had a cousin who worked on Deep Blue. Some of the details are recorded in the Wikipedia page: https://en.wikipedia.org/wiki/Deep_Blue_versus_Garry_Kasparov.) One of the basic tricks was that Deep Blue played the opening moves from a record of openings, because the number of possibilities is so vast early in the game and its moves are somewhat limited by time. Kasparov learned from Steven Levy (a computer expert and chess player who was long involved in the pursuit of computer chess) that making a slight deviation from the standard sequence (but with the same final result) would start Deep Blue making moves without the benefit of playing from fixed openings. Once it hit its time limits, it would make the best move it had determined up to that point, and that might convey an advantage to Kasparov. Once programmers figured out what he was doing, they adjusted the algorithms to compensate for the small changes, and continue to play from fixed openings. At that point, Kasparov really could no longer compete with it. (Deep Blue got to be so good that Kasparov claimed at one point that they had substituted a human, which I suppose makes Deep Blue qualify for the Turing test. One wonders what human Kasparov thought they could bring in who could beat him.) The main proof is that Kasparov never accepted another challenge to Deep Blue, nor has anyone else.

Edit: I don't believe that chess matches have a panel of judges who grant points or include a factor for being interesting.


----------



## JAS

So, the main question might be what computers can do in the world of music. I do not expect a computer program to write music that rivals Beethoven or even Tchaikovsky, although they might generate perfectly pleasant imitations. I absolutely believe that they could write music indistinguishable from humans for the likes of Boulez and Ferneyhough. The only reason for this not to happen would be a lack of incentive. The market for such music is already too great a supply for the demand.


----------



## elgar's ghost

Pete Townshend tried it in 1971 - he fed biographical information on Meher Baba into a synthesiser set-up hoping that music would automatically result. It was a bit like musical alchemy and the experiment failed.


----------



## millionrainbows

JAS said:


> Edit: I don't believe that chess matches have a panel of judges who grant points or include a factor for being interesting.


No, that job should be done by PR men, or writers of screenplays.


----------



## millionrainbows

Some scientists believe that the universe itself has an "operating frequency" which is a very low multiple of the tone Bb.

So, here is my automatic conceptual piece:

Exist.


----------



## Kyler Key

Computers can do exactly what they're programmed to do 100% of the time and will output exactly what it says.

The beauty of listening to a real musician is the very slight out of beat and outright mastery of an instrument. A computer can not compare to a human in the sense of bringing emotion to a piece. A computer can get a similar feel. A good synonym would be in film. Special effects are to practical effects as computerized music is to live music.

They can both be amazing, but need to be used properly.

Now to the automation question. Can you throw chords and scales together and have an algorithm choose what notes to play? Of course, but it will be very difficult to compare it to a live performance as it will have difficulty really passing the uncanny valley like special effects today.


----------

