On computer generated tunes

On computer generated tunes

Greetings fellow trad enthusiasts,

I am a melodeon player, as well as a computer scientist at a university in London. We would to hear like your thoughts on the following.

We have extracted from the great tune collection at The Session some 23,000 tunes, trained a computer model on them using a particular machine learning method, and are now applying that model to generating an unlimited number of new tunes, many of which are in the same styles. We have synthesized about 40,000 of these, and serve them as "The Infinite Irish Trad Session": http://www.eecs.qmul.ac.uk/~sturm/research/RNNIrishTrad/index.html

Some of the tunes are quite close to being excellent, requiring only a little bit of editing:
https://highnoongmt.wordpress.com/2015/08/11/deep-learning-for-assisting-the-process-of-music-composition-part-1/

Some of the tunes are surprisingly different from what is at The Session: https://highnoongmt.wordpress.com/2015/08/12/deep-learning-for-assisting-the-process-of-music-composition-part-2/

Please have a listen, and if you like, tell us what you think about the idea, quality, etc.

Also, perhaps some locals would like to help us put together a session of such computer generated tunes?

Re: On computer generated tunes

Sounds interesting but for me the percussion is too annoying for more than a brief listen.

Re: On computer generated tunes

that’s what I thought, too. I’d loose the percussion and speed up the tempo a little on you tunes.

Re: On computer generated tunes

Neat! I think what it is lacking is the artistic conversation that usually exists around the composition of a work of art. It may be able to create Irishy tunes but its doing so essentially as an outsider albeit one with a deep understanding of the span of Irish tunes. There is no context beyond that though. Now limiting the inputs would be an interesting way to direct the random creation of tunes inside of particular context. Then the act of selecting and modifying those tunes that make sense would create real art.

Re: On computer generated tunes

Something about the tonality and beat of it all reminds me of a walk through China town. Personally, if I were writing a program to generate Irish style music, I would want to generate the one tune that surpasses all of the rest not another 40,000 of lesser nature. I could go so far as to say that I could write a unix shell script to go through all of the reels in the 17,000+ ABC files on my computer and find the highest incidence of a particular note for each position within a bar progressing through an entire typical reel structure and generate a tune of the most common notes. But I’m won’t. I bet it would sound horrid, trite and lack the involvement and tradition associated with tunes that exist now. Still, the effort of the computer program to generate the tunes is pretty impressive and I suspect it would be even better if some "randomization" akin to drinking a few pints were introduced into the process.

Re: On computer generated tunes

Nothing against the music or the the imaginative idea, but I can’t help thinking of the 100 chimpanzees randomly plonking away at their typewriters, trying to create some Shakespeare.

Posted by .

Re: On computer generated tunes

Jeez. A computer that noodles. That’s all we need.

Re: On computer generated tunes

‘A computer that noodles’ LOL - that’s about it :)

Re: On computer generated tunes

What motivated the selection of the learning algorithm? It seems like a simple n-gram or marlon chain type algorithm would have been much more natural than neural networks.

Re: On computer generated tunes

I listened to a couple and they sound — weird. I mean the melodies themselves, not the production. Nothing going on. I think you’d have to get a good musician or two to actually play a few of these for them to make sense, if they can make any sense. But for that you’d have to either pay someone, or maybe get someone on this board to do one up.

I’ll pass.

Posted by .

Re: On computer generated tunes

*Markov chain. Dang autocorrect.

Re: On computer generated tunes

Thanks everyone! Your comments are invaluable.

I agree with Scott that the music composition is far less putting symbols on paper and far more conversation, practice, and interaction within a community. The system doesn’t even know about playability, ornamentation, harmonies, instrumentation, etc. So, it is by definition a very naive one; but judging from the proportion of things it has generated which have an identifiable key, phrasing, structure, etc., I think it is more successful than rolling dice (or typing monkeys). :) It also titles the pieces, and most often generates correct ABC.

I am not attempting to create new and "better" trad, or "surpassing" what already exists. I don’t know what that would mean. :) At the heart of this research are the following questions: can this artificial system produce sensible models of the conventions underlying the music at The Session? And can we measure the sensibility of these models by using them to generate new material?

As Callison points out, adding chemicals to the mix was somewhat of a motivation for having the music synthesis get out of time. The drummer is a bit enthusiastic, and we can certainly move them to the back room. :)

Frank: Indeed, modeling by n-grams and markov chains are other possibilities, and can provide suitable comparison models. For instance, here is one discussion contrasting n-grams and RNN: http://nbviewer.ipython.org/gist/yoavg/d76121dfde2618422139 The inputs to our RNN are characters (ABC).

Thank you all! You have great experience in the music here, judging by all your transcriptions, commentary, and regular participation. You have the "golden ears" that can provide the expertise we need in future experiments. (I am a mere noodler on my pokerwork. :) If any of you live in London and would like to chat, or if you want to be involved, please send me a mail!

Re: On computer generated tunes

Are the diatonic modes something that’s included in the basic programming, or is that part of what the computer is supposed to learn? Same thing with an understanding of the different dance types. For myself, when I try and compose a tune, I say "I want to write a (whatever dance type) in (whatever mode and key)". Then I pick up an instrument and start trying notes and rhythms. It doesn’t always stay with what I started with, but that’s the beginning. The description of your computer’s process sounds completely backwards from that

Also, in your discussion of "The Doutlace" you mention searching the database for a certain figure. You neglect to search for the same figure transposed to a different key (look at the first measures "Drowsy Maggie", for example), although how you’d go about that I have no idea. But maybe examining how your program treats transposition and key and including some instructions about that would help. I’m not a programmer, but as musician, I’d say the intervals between the notes are more important than a specific pitch

Re: On computer generated tunes

Hi Chad. Thanks for reading!

The system knows only what we feed it, i.e., a bunch of ABC. It seems to have learned that certain notes occur with other notes, that certain notes occur at the end of phrases (resolution), that phrases tend to be 8 measures long and repeated, etc. It is almost magic how it works.

To make it generate a piece from its model, we have it produce one symbol at a time. These symbols are fed back to it, which is a form of memory. It starts by producing a "T: " and it makes up a title, then it produces a "M: " and chooses a meter, then produces a "L: " and chooses the length of the quaver, then it produces a "K: " and picks a key, and then it begins to write the notes, barlines, repeats, numbered endings, etc etc. We are not constraining it or correcting its mistakes. We have not hard coded it to understand scales, melodies, etc. It is only manipulating the ABC characters it has learned. In "The Doutlace," it actually repeats the figure with which it begins. It also ends the turn on the root. We have not taught it to do these things; it seems to have learned it by itself from the tunes at The Session.

I agree that intervals are what matters. It would just be a bit of programming to perform such a search over the tunes. Maybe "The Doutlace" is a frakenstein of many other tunes…

By the way, what do you think of my "corrections" to "The Doutlace"? I have been playing it for the past few days and find it fits well under my fingers. (G/C pokerwork).

Re: On computer generated tunes

Damn, I was going to do that! No seriously, very interesting. I don’t know too much about those deep search algos (except for the recent popular science stuff about that google "deep dream" and all)… so you didn’t give it any guidelines at all did you?

The thing is, most of the time the "tunes" just sound like going nowhere. Maybe the results would be better if you first fed the computer with some common phrases (there aren’t *that* many actually) and train it to concatenate them in a reasonable way, given a certain tune type and maybe mode and key.

That’s how I’m composing tunes anyway. :~/

Re: On computer generated tunes

"…Please have a listen, and if you like, tell us what you think about the idea, quality, etc…."

Tell me this: Are you lads listening to all 29-thousand-s0omething tunes yourselves? I’ll bet you’re not. Maybe your next project can be an application that will do the listening.

Posted by .

Re: On computer generated tunes

"We have extracted from the *great* tune collection at The Session some 23,000 tunes"
Everyone knows you start with Dow’s 60. Why not begin with an established foundation & build on it.
You merely took the express elevator to the penthouse & now you’re walking your way down the stairwell.
Remember your penance too ~ 5 trad tunes for every computer generated composition.

Posted by .

Re: On computer generated tunes

Hi Bob, Re my earlier response:- I realise that your design is far more complex than the completely random typing of Chimps, and I apologise if my image seemed derogatory to your efforts. My original thought on that analogy though was more that I love the idea of creating the possibility of eventually finding something that you couldn’t have ever imagined in the first place. This is an interesting post and I hope you intend to keep us informed in the future. I just wonder though,… why did you pick this particular music?

Posted by .

Re: On computer generated tunes

Teach it to dance first?! :-/

Re: On computer generated tunes

Go ‘figure’, right?

Posted by .

Re: On computer generated tunes

So, are these "tunes" going to be the basis for copyright lawsuits? I’m not sure which way they would go, particularly as perhaps they might be considered derivative works (from the input)? Or may we take them and adapt them royalty-free?

Oh yeah, the drumming needs to go. Totally unnecessary & a really bad fit.

Re: On computer generated *sample* tunes

Frankly when I listened to the samples the percussion was the only bit which may have redeeming value. The tunes, as they were, weren’t. Tunes that is.
Basically it’s crude turntabling without the sense of a musician familiar with the significance of various motifs & phrases.

Posted by .

Re: On computer generated tunes

This has to be a windup, they’re terrible!!

hahaha

Re: On algorithmic samples derived from a disparate online collection of abcs

This windup begins with the input criteria. What is that criteria?

Posted by .

Re: On computer generated tunes

Thanks everyone!

Ergo: No way, we are not listening to all of them. However, one of my research aims is exactly what you describe: getting machines to listen to music and describe it in useful ways. :)

AB Steen: Duly noted! :) What do you mean "Dow"? Is that a particular collection? Is this Dr. Dow (https://thesession.org/members/4763)? As for your comment of a lack of musicianship, I completely agree. These are really raw materials, and certainly there are many "losers" in the output. I try not to say the pieces are "composed"; they are generated, and then need composition if they are ever to become music.

Gobby: No offence taken! My computer has a hard shell. :) Anyhow, the comparison to monkeys (or other naive processes) is appropriate — as is "horses" (http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6847693). :)

Why we picked this particular music? 1) the plethora of ABC data makes it very attractive; 2) the music has identifiable characteristics and goals; 3) I like playing it!

kkrell: No nefarious intellectual property aims here! Your question of authorship is a real good one, but adapt away if you find something you like.

d>j<f and AB Steen: Not a windup, but there is no guarantee of quality! :) At best, our system is a very poor student shifting characters on paper with an incomplete understanding of the rules — but enough unerstanding to produce proper ABC.

There is no explicit input criteria. The model was trained by showing the system a portion of ABC from The Session and saying, predict the next character. When it guesses wrong, the model is adjusted in a way to make it more correct. We repeat this many times for the 12,334,950 characters of 1,957,960 lines of ABC code we scraped from The Session. (Training took about 5 days using parallel computing.) Then, to generate new ABC code, we just start by feeding the system a single character, and having it sequentially predict X characters of ABC. (In our last case, X=21,217,460 characters, which produced over 70,000 ABC segments beginning with "T:".)

Thanks for your comments, sarcasm and all! :)

Re: On computer generated tunes

Ah fair dues to you Bob - it’s an interesting idea and project, even if a bit meaningless at the end of the day in terms of humans and music.

Re: On computer generated tunes

Regardless of the results, I think this is a fascinating project!

Bob, I’m curious, did you use the CSV files from here for the tunes?
https://github.com/adactio/TheSession-data

Or were you making multiple API calls?
https://thesession.org/api

Anyway, I love the idea of a trad version of Brian Eno’s generative music. :-)

Re: On computer generated tunes

As an extension of your project it would be interesting to have some players learn a few of the computer-generated tunes and play them along side authentic tunes at a session to see if people could hear the difference.

Re: On computer generated tunes

I thought about doing this once, using Markov chains (as already alluded to above) instead of a machine learning method. Alas my actual PhD work got in the way.

It’s interesting, but to me the take-home point is that phrasing is all-important - some of the tunes may have taken popular patterns or whatever, but ABC alone as it stands doesn’t really encode stresses, volume, phrasings, and without that I don’t think you’ll get a tune to pass the ITM equivalent of the Turing test without that.

Re: On computer generated tunes

Thank you all.

Kilcash: Hopefully it is a step in a more meaningful direction, but we don’t know that yet. :)

Jeremy: Looks like multiple calls to the API. Here is the code my colleague used: https://github.com/jfsantos/trad-rnn. Thank you for maintaining and making the data here so accessible!

Sligo: Indeed, that is one direction in which to go. It would be nice to have a mechanism to feed back to the model the "errors", like the problems I fix in "The Doutlace" (https://highnoongmt.wordpress.com/2015/08/11/deep-learning-for-assisting-the-process-of-music-composition-part-1/). It’s future work. Also, what may sound fine synthesized may not play fine given the limitations of the instrument.

Toem: Indeed! ABC is a very incomplete description of the music. At most, it implies some stresses by the bar lines and meter specification. Same for common practice notation. Just marking symbols on paper can hardly qualify as composing music. :)

Re: On computer generated tunes

what you need to do with your algorithm is not to predict the next symbol…that’s why you are noodling. What you have to do is to look at larger phrases. Look through the tunes and identify 2 bar patterns and then look at how those patterns show up in 4 bar phrases and 8 bar sections. Transpose the ABC tunes to a small set of common modes so you can identify the same patterns regardless of what mode that actually show up in

Then when you go to generate you tune, use the building blocks of the phrases to fill out your tune’s form. You could salvage your present work and use that algorithm to generate bits to link your common phrases together

Re: On computer generated tunes

This sounds like evil devil work. A database of infinite computer generated tunes? It’s madness! I hope the end goal you all have in mind is something other than contributing to the already infinite repertoire. My head already wants to explode at the thought.

Re: On computer generated tunes

There might be some good in data mining a lot of ABC data. That’s why I said he should get away from just predicting the next note and actually look at an analysis of 2 bar patterns.

Re: On computer generated tunes

Interesting, but the results sound rather dull.
And the drummer… take him out behind the woodshed!
Whatever made you include that drumming in your ABC to MIDI conversion?

I think your algorithm suffers from the same problem as a similar project many years ago at the University of Uppsala, where a guy let a computer generate pieces of music which were supposed to be in Mozart’s style. They had a superficial "mozarty" feeling to them, but… The main problem was that it just didn’t sound like Mozart. This was pointed out at the dissertation by Sweden’s foremost expert in Mozart’s music, much to the dismay of the author and his colleagues.

Re: On computer generated tunes

hnorbeck - great comment as I was searching for some Mozart on my PC the other day and dug up a program I’d completely forgotten about. It takes Mozart’s well-known set of tunes for musical dice - basically you throw a number and then look up the phrase it generates. Not random exactly as Mozart has "programmed" the snippets of music, but randomly put together by the dice (or computer in this case).

I don’t know where I got the program - it’s ancient! If anyone’s interested there’s a slightly strange online version here - click on the word "generate" on the image of Mozart: https://scratch.mit.edu/projects/1516316/

Don’t know if it works on a tablet / phone - oh, and refresh the page if you get more than one tune going at once. Maybe there’s a less flaky version somewhere.

Re: On computer generated tunes

Thank you all again for your helpful comments!

Nate: That is a good idea to remove the factor of key. That would hopefully increase the generalisation of the model. As for the system predicting the next note, it is a little more complex because of the recurrent nature of the model, as well as the memory. Every note it picks has implications for the dozens to follow, so it is in a sense picking several notes at once. Sometimes it is noodling, but sometimes it is producing phrases, like in "The Doutlace". However, I agree with you that doing this correctly will involve working at several time scales at the same time.

Jerone: At the heart of our research are the following questions: Can this artificial system produce sensible models of the conventions underlying the music at The Session? And can we measure the sensibility of these models by using them to generate new material?

hnorbeck: Yes, the drummer is a bit aggressive. :)))) Or rather, my ABC to bodhran conversion is unsatisfactory. It seems our decisions in the synthesis of the generated ABC is unfortunately distracting from the underlying material that we wish to judge. I am going to fix that now, and resynthesize everything without the timing issues.

The work of which you speak (generating Mozart) is from 1995, and much progress has been made since then. For instance, David Cope has done fantastic work in building a system that can emulate the styles of many composers (http://artsites.ucsc.edu/faculty/cope/mp3page.htm). The field of meta-creation (http://metacreation.net/) is pushing the boundaries even further.

Re: On computer generated tunes

"Jerone: At the heart of our research are the following questions: Can this artificial system produce sensible models of the conventions underlying the music at The Session? And can we measure the sensibility of these models by using them to generate new material? "

What would be the real-world use for this?

Posted by .

Re: On computer generated tunes

"Every note it picks has implications for the dozens to follow, so it is in a sense picking several notes at once. Sometimes it is noodling, but sometimes it is producing phrases," - You need to have your algorithm better model the process for creating a musical phrase. Every note is not equal. This is probably why sometimes you get a phrase and sometimes you get noodling. Yes, you need to be working on more than one level of time. but you also need to be working with this more like a language. These small phrases that recur over and over in tunes are the vocabulary of this music. Its the same with other styles. If you want to sound like Irish music, you have to "say" things that are idiomatic. That is what an extensive catalogue of the repeated small phrases in the ABC tunes will give you: your dictionary of "words" and "phrases" to then put together in a larger form to generate the tune.

BTW, I think this work you’re doing is very interesting and if you could find a way to model the process of composing tunes, it really would be fascinating stuff.

Re: On computer generated tunes

"Can this artificial system produce sensible models of the conventions underlying the music at The Session?"

I’m not sure there’s *music* at The Session < https://thesession.org/tunes >. The closest the abc database has to music would be the YouTube links & other recorded versions. Next would be individual settings with articulation included. The abcs by themselves might give you recurring motifs & phrases, variation of those; but absent any particular style of say how a polka is played. Abc code by itself gives you no comprehension of the conversation in the music. That’s what the algorithm is looking for, listening for; isn’t it? The one thing abcs would be very helpful for is mimicking & plagarism. If you can bottle that you can create new tunes. ;-)

As a human I would think one has to learn to play music, or sing, before composing; not to mention developing a style. But, of course, I cannot apply the necessary algorithm for CGTs in my head

Posted by .

Re: On computer generated tunes

Nate Ryan, that to my mind is a good observation. It’s what the Mozart Dice game is doing in a sense: choosing phrases which are already written but combining them in new ways.

From the more computer-generated side, I had a listen to some of the Bach-like generated music on David Cope’s page linked to by Bob Sturm at http://artsites.ucsc.edu/faculty/cope/mp3page.htm and while very nice to listen to, it somehow also seems very sterile. I found it just unsatisfying but can’t put my finger on why. But one thing I’ve learned from playing (for example) the "real" works of J.S. Bach, is that he constantly amazes you in doing things you didn’t expect and that satisfies at a deep level. The computer-generated stuff, not so much. At the moment. But fascinating research all the same, if it gives an insight into the process.

Re: On computer generated tunes

@Bob Sturn, have been having fun on your wordpress site playing some of these tunes. I wonder if there’s mileage in having a link that just grabs you one of the compositions at random so you can listen / download / have a go at playing. That might lead to some interesting discoveries? A sort of crowd-sourcing? Maybe that’s what you’re getting at. It’s intriguing enough - have been enjoying playing particularly The Doutlace on the harp. PS unless I missed it (I confess I went straight to the music) does it generate the titles too?

Re: On computer generated tunes

after listening to both Douthlace’s I should say the second is a lot better than the first one. But…

like so many said, it’s not really going anywhere. Music is about question and answering, building up and releasing tension, creating emotions (grief anger relief speed relaxation) and this like Nate Ryan said within phrases of two to four up to eight measures. Also the B part has to be an answer or a turn of the A part, a prolongation of the A part, not a new tune.

That’s what music is about for me, that’s what give people their strong emotions about it.

Nevertheless a composer could pick nice ideas out of it and start working with it to create a really beautiful session tune.

Re: On computer generated tunes

Thanks again for your great comments and ideas.

Ergo: Good question! Machines that learn from data have a variety of uses, from autocomplete on your phone, to medical diagnostics, and everything in between. The field is called "machine learning," "data mining," or more broadly "artificial intelligence." (One buzzword you might have heard is "big data.") We start by assuming there to be a process that produced the data, and that it is not just noise. Now, can we make an artificial system uncover that process automatically? It may be that we are having an artificial system process a bunch of ABC data, but the bigger picture is that it can be any data. A major problem is knowing whether a system has found real aspects of that process. How can we know? Does the model really match the process? Or, how well does it match the process? By producing more data from that model, we can perform a sanity check, and learn how to improve the system (some of which you experts have pointed out!). That is what I am most interested in here. We can also do interesting things like, "autocomplete" for music composition (https://highnoongmt.wordpress.com/2015/08/15/deep-learning-for-assisting-the-process-of-music-composition-part-4/), generating or remixing music to fit people’s needs (http://www.jukedeck.com/), and so on. There are also applications to musicology (http://dml.city.ac.uk/), flexible search and retrieval of music data (http://www.shazam.com/), automatic music transcription (imagine going from a YouTube video to ABC!), and so on.

AB Steen: Indeed, I agree with you 100%. Composing music requires many more things than writing symbols. Painting requires many more things than making marks and adding colors.

Mark and Nate: Thank you! The system does generate the titles! That is a very funny aspect of it. I would be happy to share all the ABC generated. If you find a tune in here (http://www.eecs.qmul.ac.uk/~sturm/research/RNNIrishTrad/Session/), let me know and I will post the ABC. I am interested in the process of "correcting" the algorithm output. Or email me (b.sturm@qmul.ac.uk) and we can chat offline.

stefanremy: Yes! I think "Off to California" and "Speed The Plough" are two good examples of that. It is a common problem with algorithmic music composition that on the short time scale things seem ok, but at longer scales it begins to fall apart. :)

Re: On computer generated tunes

Old discussions here have included the idea that a lot of the interest a tune comes from it not going where we expected but somewhere else that we like.

With a "question-answer, question-different answer" structure we want the second answer to be consistant with the first one but not quite predictable.

What we expect comes in large part from what we have heard before. Your machine has some information about what we expect a tune is the idiom to sound like. Can it recognise that the same information carries what we *don’t* want to hear in a competely new tune ?

It may have been said above, but I wonder if given half of the tunes (not settings) at random it could come up with anything in the other half.

Re: On computer generated tunes

… tune in the idiom …

Re: On computer generated tunes

Dow’s 60 is https://thesession.org/sessions/1311#comment241459; other essential tune lists have been posted over the years, but this one has stuck. Starting with a body of standards as your learning corpus could make the tunes more likely to sound authentic. A bigger corpus than 60 might help, like, the several hundred in https://thesession.org/discussions/110/ .

TheSession.org contains ABC from many authors with more or less knowledge of the ABC standard and different approaches to embedding ornamentation for different instruments (or choosing not to do so). Narrowing your selection, or even choosing a different ABC source like Henk Norbeck or Bill Black’s collections where there’s a consistent author of the ABC, might make your machine learning more effective, maybe?

Re: On computer generated tunes

I’ve had a romp round the archive of mp3s. It’s a slightly surreal experience, like you are listening to the output of someone locked in a cell and forced to write tunes! That’s what I’m imagining anyway. Interesting to listen to a few - normally you know pretty much immediately whether a tune’s going to be good or not, but there is quite a lot of variation during the tune - not "totally unexpected variation" but not simple repetition either.

In the tune below, the first two phrases are quite fun as a generative idea to "human-compose" the rest of it! I know that’s not quite the point of course. Still had fun trying the opening of this one on the harp, and may see what other goodies I can extract from later on in the same tune:

http://www.eecs.qmul.ac.uk/~sturm/research/RNNIrishTrad/Session/The%20Mal’s%20Copporim%2011680.mp3

Re: On computer generated tunes

Good comments all around!

Mark: Yes, Bach, Mozart, Beethoven, etc. are far from being imitated by a machine. Good analogy of locking my machine in a room to generate an unlimited amount of symbols it doesn’t really understand. :) To be sure, I am giving it lots of positive reinforcement.

"The Mal’s Copporim" is a good one! I like its lilt. Here is the exact output of the machine:
T: Mal’s Copporim, The
M: 4/4
L: 1/8
K: Dmaj
|: a>g | f2 f>e d2 d>B | A>BA<F A2 d>e | f2 d>f e<ac>d | e>dc>B Agfe |
f2 f>e d2 d>B | A2 A>G F2 F2 | G2 B>A d2 c>d |[1 e>dc>A d2 :|[2 e2 d2 d2 ||
|: f<g | a>Ag>A f>Ae>A | d>gd>B d2 g>A | f>Af>e d>ed>c | e>ed>c (3Bcd (3efg |
a2 a>g f2 e2 | d2 A>d f2 f>g | a2 g>f e2 f>g | a2 A2 D2 ||

It has not made the turn repeat, so that should be corrected. One point of my work _is_ to use the machine to generate material for composition. I explore this idea today here: https://highnoongmt.wordpress.com/2015/08/15/deep-learning-for-assisting-the-process-of-music-composition-part-4. Please, feel free to "correct" "The Mal’s Copporim", and call the piece yours! :) (I would like to know how you adapt it though, so please tell me: b.sturm@qmul.ac.uk.)

David50: Thanks for the comments, and the idea of seeing how the machine completes pieces. I do that today with the opening to "The Seven Stars": https://highnoongmt.wordpress.com/2015/08/15/deep-learning-for-assisting-the-process-of-music-composition-part-4

benhockenberry: Thanks for the links and advice!

Re: On computer generated tunes

Just as a suggestion : for the program, I’d probably look at it from the point of view of numbers and other ‘measurements’.

For the moment, let’s just concentrate on the melody, forget about accents and ornaments and stick to the 4/4 time sig family.

What I mean is, if you look at a typical 2-part reel, what does it tell you? You already know the number of bars, but -

What about the relationship between the notes?
Are the intervals close or far apart?
By how many degrees?
How often does this happen?
Is there a sequence of them from bar to bar?
What’s the interval between the last note of a bar, and the first note of the next bar?
Is there a sequence for this entity?
Does the B part in a higher or lower register than the A part?

…and loads more.

Something for a machine to chew on …

There was a thread on here a while back on variation, improvisation and composition, and I had a go at doing something based on Dowd’s No 9 [ https://thesession.org/tunes/761 1st setting ].

I eventually came up with this :

https://www.dropbox.com/s/hn5c7heb223achl/dowds-no-nine-variation.JPG?dl=0

I didn’t use any of the ‘numbers and measurements’ I mentioned earlier, and it was just ‘composed’ on the spot.

Re: On computer generated tunes

Great example, Jim. That’s a valid tune in my ears, and much more "alive" than something a computer generated based on say, which notes are likely to be first, second etc. What the generated examples (the very few I listened to) lacked was simple things like call-and-response, phrases, arpeggios and endings.

Re: On computer generated tunes

Hi Jeff!

I’m still of the belief that a program can generate decent tunes. However, I think it will take a while to get it to a decent standard. There is a formula (or several) - no doubt about it, in my mind, that will be able to generate tunes based on rules.

If the patterns are working, fine. If they aren’t, and are producing nebulous bundles of tuneoids - then burst them! … and start again. I can’t think of any better systematic approach than that.

I guess it’s a bit ironic, but the quality of the tunes produced is ultimately dependent on the evaluation skills of the human at the top of the tunes chain :)

Re: On computer generated tunes

" the quality of the tunes produced is ultimately dependent on the evaluation skills of the human at the top of the tunes chain"
That seems logical, Jim. But it depends on what you mean by evaluation skills & quality of tunes. Your reasoning seems to dismiss any intuitive sense as part of composing tunes. Do composers (of quality tunes) have brief, passing moments of inspiration; without relying on their skills of evaluation?

Posted by .

Re: On computer generated tunes

A few of my editing suggestions for this page < http://www.eecs.qmul.ac.uk/~sturm/research/RNNIrishTrad/index.html >

"The Infinite Irish Trad Session"
~ The Endless Learner’s Session

"Music composed and titled by a recurrent neural network,"
~ MIDI generated and titled by a recurrent neural network

"trained on 23,962 tunes from The Session"
~based on 13,090+ tunes from abc code posted on The Session

"This set is performed by Barbalan Rog (playlist updated every 5 minutes)."
This set is performed by Barbalan Rog (playlist updated every 5 minutes)

Posted by .

Re: On Tune Generation

You can put this with Dow’s list > >
https://thesession.org/discussions/110
I don’t remember who posted it, but it’s deserves attention for anyone considering ITM based composition.

Posted by .

Re: On computer generated tunes

Great suggestions!

Jim and Jeff: What one hopes from an automatic learning system such as the one we are using is that it will figure out all of these things on its own. The rub is that one needs enough data. This "agnostic" approach is in opposition to the "expert-based" approach, where rules or pointers are specified based on our knwoledge of the problem. The rub there is that one needs to specify the rules in a way the machine can understand. A hybrid of the two approaches can also be made. For our system, we have given only a buch of ABC, and specified nothing about resolution, cadence, mode, tune/turn structure and repetition, meter, pickups, etc., and yet, the trained system generates many ABC outputs that exhibit these. For instance, see "The Mal’s Copporim" above for a stellar example, and I would say a tune that is near "session-ready." You can browse through all pieces so far generated here: http://www.eecs.qmul.ac.uk/~sturm/research/RNNIrishTrad/Session.

Of course, a few great ABC tunes of thousands of less-great or bad ones is likely to happen by chance. The system could then be labeled a "one-hit wonder". :) But maybe human composers have the same success rate?

Jim: Since music is a human-centred activity, humans must be in the loop! :) Evaluation of the success of a tune is still far outside the purview of machines. For instance, "hit song science" (https://en.wikipedia.org/wiki/Hit_Song_Science) hasn’t really succeeded.

AB Steen: Thank you for your suggestions! I have implemented several of them.

Re: On computer generated tunes

By the way, What is "ITM based composition"?

Re: On computer generated tunes

[*By the way, What is "ITM based composition"?*]

ITM - Irish Traditional Music.

Re: On computer generated tunes

Bob Sturm:
I think you might get better results if you preprocessed the ABC.
E.g. take just the actual ABC and convert it to pitches according to the K: field. Same for note lengths. And then expand repeats etc. Then you would generate a preprocessed text which would just consist of pitches and note lengths (and of course bar lines), in whatever internal text format suits your generation algorithm best (you might try something akin to how midi files represent notes).
When generating tunes, you would then of course get them in your internal format, which would then have to be retransformed into ABC.

Re: On computer generated tunes

This is a step towards artificial intelligence, but not towards better tunes in a human sense… once that sort of intelligence (artificial) is achieved, who knows what the tunes created would be like ? G

Re: On computer generated tunes

Bob : could I make a couple of suggestions - don’t use any backing, not at the moment anyway.

For all the tunes, use a MIDI piano for the output, with a bit of quantisation.

That variation I wrote and posted earlier on - here’s what it sounds like with those parameters :

https://www.dropbox.com/s/hn5c7heb223achl/dowds-no-nine-variation.JPG?dl=0

https://www.dropbox.com/s/d76sa2v4zxsj123/o-dowds-no-9-variation.mp3?dl=0

Granted, it still sounds like it’s been generated by a machine, but I’ve heard worse MIDI :)

Re: On computer generated tunes

"This is a step towards artificial intelligence, but not towards better tunes in a human sense… once that sort of intelligence (artificial) is achieved, who knows what the tunes created would be like ? G"

If they’d be anything like the quality of speech recognition (also using AI) that I have to deal with when I call my local utility then they’ll be horrible.

Posted by .

Re: On computer generated tunes

More advanced algorithm and tunes:
audio: http://irishabc.com/gallery/
ABC: http://irishabc.com/tunes/
As Jim Dorans suggested previously, there are ABC, MIDI and audio versions of each tune.
That seems that suggestion of the user hnorbeck is also worked - the key is in prepossessing of the initial ABC database.

Re: On computer generated tunes

Huh! I still don’t honestly know what a tweet is, apart from what my many bird friend s do in the morning. None of this has anything to do with playing my fiddle.

Posted by .

Re: On computer generated tunes

Re:- ""the pile of crap slowly swamping our pathetic society"…. No Steve, it isn’t slow mate. The tide is coming in fast and deep.

Posted by .

Re: On computer generated tunes

@Bob,
Add human feedback to help the machine learning process? Maybe a very simple swipe style app that ‘volunteers’ quickly decide if a phrase (or any other piece of a tune) sounds good or not.

Re: On computer generated tunes

Hi all. Please don’t confuse me or my work with that at http://irishabc.com . I have no connection with that. I don’t know what "more advanced algorithm and tunes" means, but from what I can tell they are using the same machine learning algorithm as folk-rnn (https://github.com/IraKorshunova/folk-rnn), but less training data expressed in a less musically meaningful representation. Several of the generated tunes posted at http://irishabc.com don’t possess characteristics of session music, e.g., "The Rub of the Green" (http://irishabc.com/tunes/reels/) is AABB, but A is 4.5 measures long, and the B part doesn’t answer the A part. Each part lacks consistency and character, and they do not fit together. Most of the transcriptions on those pages suffer similar problems.

Anyhow, have a listen to Irish musician Úna Monaghan (http://www.unamonaghan.com/) perform her lovely modern composition "Safe Houses" at our May 23 2017 concert here: https://www.youtube.com/watch?v=x6LS9MbQj7Y&feature=youtu.be . She writes about her work: "This tape piece is my response to “The folk-rnn Session Book Vol. 1 (of 10) http://www.eecs.qmul.ac.uk/%7Esturm/research/RNNIrishTrad/folkrnn/folkrnn_vol01of10.pdf ”. The title is because I was struck by the sense of unease felt by some musicians when I describe the work of the folk-rnn team and system. The tunes from the folk-rnn collection are all numbered, and I used the house numbers of places in Belfast I’d lived during my life as a starting point to select particular tunes. For example, 55 (Delhi Street); 34 (Malone Avenue). The melodies played here on concertina are composed by the computer, having learned from collections of notated traditional music. The piece played here by computer, is composed by me from recordings of my playing as I learned the computer’s compositions. We each play the other’s work, and the work is made from the process we each went through, of learning the other’s material."