Melodeon.net Forums

Discussions => Tunes => Topic started by: Broadland Boy on July 31, 2015, 12:48:53 AM

Title: Computer generated Melodeon tune
Post by: Broadland Boy on July 31, 2015, 12:48:53 AM
I like to refresh my acquaintance with some of the diverse players who appear on Guy's Youtube videos from time to time, and see what new delights are to be found, well I just found this, composed and named by a computer and played by GbH himself

https://www.youtube.com/watch?v=hmvbr8U5yb0

Have we reached the 'roll over Playford you are obsolete' point in Human history?
What ought such a new genre of algorythmic compositions be called ?? 
Should existing and budding composers / arrangers be worried ???
Who should the PRS send their numerous and bountiful cheques to, the software developer or the PC operator ????
What equivalents to the Asimov three Laws of Robotics should be imposed on the programmers ?????
(ed why have some of me strings of incremental questioning marks turned into grotesque faces)

These and many other challenging questions require multiple letters to the Times and much discussion on Melnet

All joking apart, it sounded more 'human' than some of the computer generated 'music' I have heard previously.



Title: Re: Computer generated Melodeon tune
Post by: Grape Ape on July 31, 2015, 01:08:46 AM
Tonight, I think I will sleep UNDER the bed.
Title: Re: Computer generated Melodeon tune
Post by: Matt (Kings Norton) on July 31, 2015, 03:16:53 PM
It would be interesting to know what the seeds were, the tune sounded to me a bit English and a bit Irish.  It got me thinking about what would come out with other inputs.  Experimenting with different seeds and listening to the results might give us a clue about how different musical styles work.  Or it might be just as hard to pin down as ever.

Anyway GbH is a genius, even if, or maybe because, I often have no idea what he had in mind in one of his videos.
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on July 31, 2015, 03:20:07 PM
Yes - f.i. wondering where the mixolydian progression later on had been coming from...
Title: Re: Computer generated Melodeon tune
Post by: Pete Dunk on August 01, 2015, 11:19:50 AM
"Developed and Nurtured by Ben Potton". There's your answer right there then! He's a well known associate of 'Derek the Nutter', 'Jimbo' and 'Selam', a collection of lunatics from the morris community. Now getting himself mixed up with the terminally experimental 'GbH', no good will come of I tell ya!  >:E :M :|glug
Title: Re: Computer generated Melodeon tune
Post by: GBbox on August 01, 2015, 11:22:04 AM
The so called generative programs, and in general those using the fractals or other mathematical functions to generate musical data, aren't the only choice. Also, even if you can end up with some inspiring raw melodic material to manipulate, it's unlikely you'll be able to generate structured compositions resembling a folk tune. They usually produce music that falls in the avant-garde category – say the “math” compositions of Iannis Xenakis -, or i8  the ambient genre (Brian Eno's music for airports/elevators/toilets...).

The other approach is to use a number of compositions as a database to deduct rules to apply to the composition process. This way you are more likely to produce music that fits a genre, and even the idiom of a specific composer. The best know example is probably David Cope's Emily Howell (link below), but there are others. The interaction of the men with the machine in composing is inversely proportional to the level of detail of the analysis.

http://www.bbc.com/future/story/20140808-music-like-never-heard-before

I assume the free/cheap programs currently available to composer music mainly work relying on a simplified similar approach – basic diatonic harmony rules, predefined rhythmic patterns, frequency of the appearance of the notes in a given key/genre...

It would be nice to know which program has been used to generate the tune in the video... maybe we could ask it to the (hem...) author? To me, it's sound more like the fruit of a program like Microwork CAMPS, that strictly speaking is not a composition tool, but offers a re-composition function that could produce interesting variants of a given melody. Or even like one of the counterpoint voices generated by Tonica Fugata.

Given this, I dare say that a huge quantity of the music that's currently produced – even if the humans that claim to be the copyright holder will never admit it – hes been written, or at lest co-written, by some computer software. Not to tell that the border between a computer generated composition and an arrangement is vague, and there are programs like Band in a Box that claim to do both (don't think much of the Irish tunes produced with it I had a chance to listen to, but the ragtimes really sound excellent!). If this is not the case in the folk music world, I fear that's just because of the conservative attitude of the majority of the musicians toward the computers.
Title: Re: Computer generated Melodeon tune
Post by: Broadland Boy on August 02, 2015, 01:00:03 AM
Tonight, I think I will sleep UNDER the bed.

Ah, you progressed to watching 'The Final Plough', 'Strange Practice' or similar then Grape Ape ?

GbH's abilities and inventiveness are the antithesis of mine, as a younger person I wished I could play the melodeon really badly, sadly, those in charge of granting such things must have paid more attention to punctuation than myself  :(
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 10, 2015, 07:44:17 AM
Hello all,

I'm afraid I'm the one responsible for this program. Thank you for your interest in it. I thought I'd take this opportunity to clear up some misconceptions and explain a little on how it works.

First off, it's not a fractal music generator or anything like that. I've not given it any rules on how music (or Irish music in particular) works, there are no seeds (if I understand what you mean by that term). It's a recurrent neural network which learns the probability of which characters follow other characters in a piece of text. The closest system you probably use everyday is the auto complete on an IPhone, where you can keep pressing the suggested word and it will generate some random sentence. By being trained on a large amount of input data it can effectively learn the grammar of a format like ABC, along with the common strings of characters you get in an "Irish abc tune"

It has no knowledge of musical structure, it is trained on pure text ABC, and outputs pure ABC (including header fields and titles). You simply tell it how many characters of text you want and it happily whirs away outputting tune after tune. It generates Irish music because there is a huge amount of training material easily accessible on the web. I used a combination of all the reels from the most popular collections (thesession, norbeck etc...) which amounted to around 10,000 tunes (some being duplicates or variations).

Yes is does produce a load of old guff as well as the more interesting tunes, so that's where the human input comes in. It has a surprisingly reasonable hit rate though. It's pretty hard to tell how it works after it has been trained, as neural networks are effectively a black box. You can get some inkling of what its doing under the hood by analysing some of the mistakes it makes, and by checking out the kind of tune titles it generates.

So anyway, its an interesting project but I don't quite think we're ready to hand over our composition duties to our robot overlords quite yet. However if you write very generic tunes you may well be worried.

If anyone has any further questions (or would like some tunes written!) let me know,
Ben
Title: Re: Computer generated Melodeon tune
Post by: Nick Collis Bird on August 10, 2015, 08:22:39 AM
Wow! Welcome to the Forum Ben. What a great addition to our ever knowledgable world wide gang you are.
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on August 10, 2015, 10:19:10 AM
Ben, this is amazing stuff..!

I seem to understand that you're not giving the network any further information - be it extra random seed or, say, increase of uncommon phrasing or modulating...

Would that be a way to go in order to expect more imagination or novelty then?

Best wishes - Wolf
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 10, 2015, 10:53:40 AM
Yes it does have an element of randomness (and a seed in this regards). You can choose how 'safe' you want the results to be, and getting this value right appears to be key. Too high and it strays away from listenable music (and often valid ABC), and too low it can result in plagiarism, or some very odd and interesting mistakes. So at any point in the output, it will have a probability value for each character that could be output next. As an example if you're at the start of a tune and the current character is 'X' you have an extremely high probability that the next character will be ':'. Later on, in the tune data or the title field for instance, you'll have a range of possible characters with a range of probabilities assigned to each one.

As an indication of how the system works, and the use of randomness in generation, I had an early run where I trained on a much smaller data set, and chose a very safe output. In one tune this resulted in the program getting stuck on a particular sequence of four notes. I seem to remember this being a simple arpeggio or similar that you hear often in Irish music. It had presumably learned that this particular phrase is often repeated, so that's what it decided to do, again and again, in fact around 60 times or so in the middle of the tune, after which it promptly stopped and continued with the rest of the tune. It's the crazy stuff like this that gives you insight into how the generation works.
Title: Re: Computer generated Melodeon tune
Post by: Broadland Boy on August 10, 2015, 11:37:08 AM
Absolutely fascinating Ben, thanks for coming up and giving us an idea of how it works.

Would you consider this type of learning as similar to muscle memory?
Title: Re: Computer generated Melodeon tune
Post by: brazilian.BOX on August 10, 2015, 12:43:29 PM
https://www.youtube.com/watch?v=hmvbr8U5yb0

Nice clothes and mask!   (:)
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 10, 2015, 12:48:41 PM
It's an interesting thought. I've considered this a bit already, and I actually think this form of music generation isn't a million miles away from how some humans would approach the task. In my opinion composition is largely a remixing task, rather than the generation of truly unique content. A great composer of Irish music for instance has to be completely immersed in the tradition, with a head full of the kind of phrases and turns that are a signature of the style. The composition process is then a case of evaluating the possible opportunities at each point in the tune, and then picking from their library of phrases. The truly great composers would then incorporate their own particular stylistic elements, which I think is a more directed task. You can hear this quite clearly with someone like Liz Carroll for instance, with lots of extremely familiar Irish motives, but always a unique twist in there somewhere which makes it undeniably a Liz Carroll tune.

Compared to a human, this program falls down in three main areas.

Firstly, the complexity of the network doesn't appear to be great enough to keep track of some higher level elements of the tune, such as the structure. This means it can end up putting in extra bars where it shouldn't for instance. This isn't surprising as deducing the correlation between musical length of a chunk of ABC and the text is actually quite difficult.

It can't really evaluate how pleasing a tune or phrase is, apart from knowing how often it appears in other tunes. A human might make a judgement call that a particular phrase is too clichéd, or too quirky.

It can't really add that extra unique twist in a directed way, although the random element does mean it sometimes comes up with some surprisingly inventive tunes.

If anyone's interested I'll stick up some additional tunes it created.
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on August 10, 2015, 12:51:12 PM
If anyone's interested I'll stick up some additional tunes it created.

Yes, please do so...!
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 10, 2015, 01:40:55 PM
Ok, here's a small selection of tunes. I've generally chosen the ones that sound the most convincing, or that are reasonably interesting in some way. If you look at the titles it generates, you can get some idea of what it might be doing with the music. BTW I've not checked these thoroughly to see if they are plagarised, so bear that in mind.

I really like this rather odd tune. I did cheat a little by removing the C part which was pretty ropey.  I recorded a rough and ready version of it here (although I think I fudged the E to a more natural sounding F).
https://www.facebook.com/ben.potton/videos/10153505025364258/?l=5008640309213018926
X:9630
T:Chorolie
M:4/4
R:reel
K:Gdor
G,2B,D GFGA|BG~G2 ABGA|BGAF GBdg|1 fdcA G2GE:|2 fdcA G2Bc||
|:d2gd fdgd|fd~d2 efge|d2BG cG~G2|Addc AGFG|
~G2Bd gdBd|g2dg fgag|fdcA BGAF|GBAF G3z||

X:3965
T:Jenny's Reel
M:4/4
R:reel
K:G
G2BG DGBG|AGFD EFGA|BG~G2 Bcde|1 fdcA BGG2:|2 fdcA GABc||
|:dB~B2 GBdB|~G3B defg|agfe dBed|1cAFA G2GG:|2cAFA G2Bd||

X:5505
T:Mintront Road To Coushey
M:4/4
R:Reel
K:Adorian
eA~A2 eddB|~c2Bc AGEG|~A3A ~B3d|cAAG EAAB|
c2Bc AcBA|GE~E2 cBAB|cBcd efge|dBGB cAA2:|
|:ea~a2 c'bag|eaag edcd|ea~a2 c'2ab|c'bag edBd|
c'bag ea~a2|gedB GABd|eaag egdc|BAGB A2AG|

X:972
T:Brench Of The Reel, The
M:4/4
R:reel
K:Ador
A,2EA, G,A,CD|EA,~A,2 EA,CE|DEFG ABce|dBAG FDD2:|
|:defg afdf|gfed edBA|~G3A Beed|eddB A2Bd|
ea~a2 bgaf|g2fg edBd|e2de gedB|ABdf edBA|

Here's an example of a not quite so successful one. The b part has an extra bar in it.

X:5091
T:Mrivereass
M:4/4
R:Reel
K:Dmixolydian
AD~D2 AGFA|dcAG FDDC|DEFG AddB|cAGE FDD2:|
|:dg~g2 ag~g2|fdcA AGGB|cA~A2 GAFA|dg~g2 dggf|dcAF G2:|
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on August 10, 2015, 02:14:17 PM
Thank's a lot Ben!

Having had a glimpse at "Mintront Road To Coushey" (because I immediately fancied the title) it might be said that it's sort of promising; guess I will give it a try in the evening..., and maybe try out the some more of them...

Maybe one's a winner as is, or requiring resp. allowing some accomodation or variation - who knows?

Best wishes - Wolf
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on August 11, 2015, 08:44:17 AM
Too tired from work to play any tune last evening - the human factor in dealing with computer-generated music...  :|glug

Scheduled for this evening once again...

Best wishes - Wolf
Title: Re: Computer generated Melodeon tune
Post by: Matt (Kings Norton) on August 23, 2015, 08:27:50 PM
Well this is unsolicited, unauthorised and the playing is of no value but I found some evidence today of the mrs's involvement with computer generated music in the 1970s, and I liked the title of this one, a bit of Finnegans Wake, maybe a reference to Tony Macmahon's opinions of popularisations of the music, and a bit of radiography, so here's what I did with my first half hour on any box this year. http://youtu.be/jZpxaBaaZvc
Title: Re: Computer generated Melodeon tune
Post by: gettabettabox on August 23, 2015, 09:47:49 PM
Well this is unsolicited, unauthorised and the playing is of no value but I found some evidence today of the mrs's involvement with computer generated music in the 1970s, and I liked the title of this one, a bit of Finnegans Wake, maybe a reference to Tony Macmahon's opinions of popularisations of the music, and a bit of radiography, so here's what I did with my first half hour on any box this year. http://youtu.be/jZpxaBaaZvc

29 minutes and 43 seconds of my life spared.  ;)
Title: Re: Computer generated Melodeon tune
Post by: Matt (Kings Norton) on August 23, 2015, 09:56:28 PM

29 minutes and 43 seconds of my life spared.  ;)

:-)

Yeah don't say I never do anything for you.
Title: Re: Computer generated Melodeon tune
Post by: gettabettabox on August 23, 2015, 10:02:58 PM
 :|glug   (:)
Title: Re: Computer generated Melodeon tune
Post by: KLR on August 24, 2015, 07:54:43 PM
Cripes, two tunebots in one week:  On computer generated tunes on The Session (https://thesession.org/discussions/37800)  I find automata really intriguing but just play warhorses by and large.  Somebody has to do it!  The world's already overrun with flesh and blood tunesmiths, there was a Cape Breton fiddler who composed about 33 thousand tunes over the course of only five years.  Why not play one of his?  Or not.  He had to devise a code to keep them straight, too.  "Let's hear XUG674, John!"   :o
Title: Re: Computer generated Melodeon tune
Post by: blue eyed sailor on August 26, 2015, 10:35:13 AM
I gave the one mentioned above in my former posts a try - quite nice-sounding in parts, but I didn't seem to be able to really get it going in its entirety... Maybe reducing the lenght of both the A and B music would enhance the chances of getting a pleasant reel...

However, my interest in this matter is remaining in force... (:)
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 26, 2015, 04:20:55 PM
Cripes, two tunebots in one week:  On computer generated tunes on The Session (https://thesession.org/discussions/37800)

Yes, I did see the other AI tune writer. Strangely enough, they've used almost exactly the same technique and at least some of the same training data as I did. I think I got the jump on them by a couple of months though. I'm not hugely impressed by the tunes I heard on the infinite session website link, but then the stuff there is unfiltered by human ears. It might also be down to the fact that they train with all tunes from the session database, whereas I've been restricting the type of tune, used multiple databases and did quite a bit of pre-sanitising of the input data. Some of the tunes on the blog seemed quite good though.

I did drop the guy a mail in case he wanted to combine forces but he didn't appear to be interested.
Title: Re: Computer generated Melodeon tune
Post by: Clive Williams on August 26, 2015, 11:10:03 PM
Hi Ben - is your program online or available anywhere? I'd love to see it in action!
Title: Re: Computer generated Melodeon tune
Post by: Ben Potton on August 27, 2015, 04:42:15 PM
Hi Ben - is your program online or available anywhere? I'd love to see it in action!

Not easily I'm afraid. I didn't have the hardware to run it at home, so it's sat on an amazon virtual machine. I pay every time I spin it up, so can't leave it running online permanently.
SimplePortal 2.3.5 © 2008-2012, SimplePortal