Welcome to Fractal Forums

Fractal Art => Fractal Music => Topic started by: eiffie on March 28, 2013, 10:47:05 PM




Title: Sloth Canons to produce fractal music.
Post by: eiffie on March 28, 2013, 10:47:05 PM
I was inspired by www.robertinventor.com and his nice app TuneSmithy to produce my own simplified version. Or you could say I was inspired by the fact the evaluation period ran out on my copy :)

It algorithmically creates fractal music that sounds very "human". Which probably means we are subconsciuosly following similar rules when writing music. The idea is that musical phrases are repeated at different time scales and they build on top of each other. Hard to explain the actual mechanics and I am sure my version is different from TuneSmithy. I use a filter to keep the song within a chosen musical scale by simply tossing out the "bad" notes. This also creates a very natural rhythm.

All the samples here are based on random seeds and represent about 1/5 of all the tests I did. Not a bad "success" rate for randomly generated music.
http://youtu.be/tI2wfRvnIXM (http://youtu.be/tI2wfRvnIXM)

If anyone is interested in the code let me know - it was thrown together from previous apps so a bit of a mess.


Title: Re: Sloth Canons to produce fractal music.
Post by: cKleinhuis on March 28, 2013, 10:56:22 PM
lol, angelfire is still existant ???

true nice music you have done there :D


Title: Re: Sloth Canons to produce fractal music.
Post by: eiffie on March 28, 2013, 11:31:10 PM
Yes I think we have been grandfathered in and they can't kick us poor old farts off the internet now :)

The interesting part is I really didn't do anything! The algorithm does everything except pick the instruments and scale.


Title: Re: Sloth Canons to produce fractal music.
Post by: mclarekin on March 29, 2013, 02:26:52 AM
I agree you have generated good interesting music. The more I think of it, there seems to be a huge area of unexplored possibilities  for development of fractal music software on its own (e.g. putting certain basic amounts of  "music theory" order to the chaos)  and also the music interfacing directly with the generation of the fractal animation.


Title: Re: Sloth Canons to produce fractal music.
Post by: robertinventor on March 29, 2013, 11:19:51 AM
Hi Eiffie that's great and it worked really well :). I can't say how nice it is to see another programmer working on this.

To my knowledge you are the first programmer other than myself to work on the idea of a sloth canon musical fractal since I first released Tune Smithy in 2000 (earlier versions in the late 1990s not published). Lots of other forms of muscal fractals of course, but not these sloth canon type fractals.

As you say - it just kind of works :). You don't need to be a musician or composer to program it either. Just to have a good musical ear and enjoy music. Similar to visual fractals where you don't need to have the painterly skills of an artist with a brush, and all the things that artists need to learn in art school etc. to get started on their profession, to create visual fractals.

Keep up the good work :). Really interested to see where it goes. I am sure there are many ways the idea can be explored.

You might like this page where I show mathematically that these Tune Smithy sloth canons are just a tiny fraction of the variety that is possible by way of musical sloth canon sequences, and there may well be other interesting ones to explore:

http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences (http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences)

It suggested the idea - that since the sloth canon construction only determines some of the numbers from the initial seed, and you can vary other numbers without changing the sloth canon property - that you could give the user the option to vary any of the "free" numbers and generate a new sloth canon from it.

Tune Smithy already does that in a way with the options to reflect and invert seeds, some preserve the sloth canon property and some don't.

But the idea is that e.g. let the user vary any of the notes in say the second copy of the seed, so it is different from the first copy. Then again in the third copy too if they like, make small changes like that which propogate all the way through the tune through the sloth canon self similarity.

It's just an idea don't know if it would work and how good it would be, just mentioning it in case it is interesting - or for that matter might suggest something else.

I am pretty much totally caught up with my Bounce Metronome program right now and other software projects I'm committed to for the next few months at least, so there is pretty much no chance of exploring this in the near future. But maybe some time a few months from now I'll join in the frontier research on sloth canon sequences again :).



Title: Re: Sloth Canons to produce fractal music.
Post by: eiffie on March 30, 2013, 05:00:42 PM
I think my implementation is probably pretty dicey since this is all new to me. Thanks for bringing this field to my attention Robert! I will check out your link to learn more.

It would be interesting to take the idea of a morphing seed and apply a genetic algorithm - let users selectively "breed" good music.


Title: Re: Sloth Canons to produce fractal music.
Post by: mr deforrest on March 31, 2013, 10:15:15 PM
interesting. I would like to hear what you have created. Not long ago I tried to upload an anigif with music. It was denied and I was informed dA didn't support that format. Have you had any better results. I have looked through your gallery and found none. Is it somewhere else?


Title: Re: Sloth Canons to produce fractal music.
Post by: eiffie on April 02, 2013, 05:36:57 PM
Just the youtube video in the first post.  I have uploaded an improved version of the app (with some samples) on the site linked in the video description. My deviantArt page is pretty sparse - no idea how to put music there :(


Title: Re: Sloth Canons to produce fractal music.
Post by: robertinventor on April 02, 2013, 06:01:16 PM
I really don't think that matters in this field if your programming is dicey :). The main thing is what you get as a result., what it sounds like. Though can be tricky when it comes to compatibility if you fix bugs and they change previously made tunes.

Also can be tricky if you get a sporadic bug so that you find you have several different versions of the tune, and you never know which one you get when you press the play button :). I've had that happen in the beta for Tune Smithy, kind of fun, but  you wouldn't want that in the release, well except as a randomization option or some such.

In Tune Smithy I have a couple of windows full of bug check boxes because sometimes users make nice tunes and then I fix a bug which makes their tune sound differently from the way it was before, so I have that window for backward compatibility so their tunes can continue to sound the way they did before.

Just a small bug can completely change the tune in this field :). Might even be a bug becomes a nice new feature too.

At one point it got rather out of hand because I was doing that in a beta where I was also changing the code a lot so inevitably a fair number of bugs to fix, ended up with a whole load of those check boxes. It got so out of hand that nowadays, I warn beta users that I don't guarantee backwards compatibility of tunes made in betas - so if the user is really keen on a particular beta bug,  they just have to use whatever version of the beta they used to create the tune originally.

That's a nice idea to link this in to genetic algorithms, and will be interested to see where it goes :).

I think my implementation is probably pretty dicey since this is all new to me. Thanks for bringing this field to my attention Robert! I will check out your link to learn more.

It would be interesting to take the idea of a morphing seed and apply a genetic algorithm - let users selectively "breed" good music.


Title: Re: Sloth Canons to produce fractal music.
Post by: eiffie on April 02, 2013, 11:09:16 PM
Robert - "Though can be tricky when it comes to compatibility if you fix bugs and they change previously made tunes."

Luckily I have a user base of 1 right now and I have already run into this! I made a good compromise so my original samples have changed but for the better. I see JWildfire (fractal flame software) already has genetic selection but it is easier to select from 20 pictures then 20 songs. Hadn't thought of that part :(


In case anyone is boycotting youtube http://vimeo.com/63194557 (http://vimeo.com/63194557)


Title: Re: Sloth Canons to produce fractal music.
Post by: robertinventor on April 02, 2013, 11:25:29 PM
Oh right. Yes I think the fractal tunes are particularly sensitive to this, more than any other coding I've done. Like usually a bug is something that doesn't make much of a difference to the output, either it works or doesn't, or it sort of works but not very well, and it is kind of linear, your objective is simply to fix the bugs and that improves the result.

But with fractal tunes the bugs can actually sometimes sound nicer than it does when you fix the bug :).

Anyway nice to hear you found a good compromise :).

I've no idea how genetic selection would work with fractal sloth canons, haven't thought about it at all and don't have any ideas about how to get started on it, just sounds like a neat idea.

With the randomization in Tune Smithy - I did that after I already had a lot of tunes already created that sounded nice and musical. And it just takes - the seed from one, the scale from another, the method for assigning parts to tune numbers from another etc, and does a kind of mix and match of them.

Which if you start with a database of tunes that are already pre-selected by humans to sound good works well. If you just leave it to itself without that kind of database then it could as easily just select a tune that repeats a single note endlessly or some such, actually that is one thing that I particularly added with the randomization - to avoid seeds that consist of just a single repeated note.

So expect a genetic approach would probably have a few filters like that to remove things that are obviously (or at least usually) not very musical for humans. But beyond that not got any ideas.

Robert - "Though can be tricky when it comes to compatibility if you fix bugs and they change previously made tunes."

Luckily I have a user base of 1 right now and I have already run into this! I made a good compromise so my original samples have changed but for the better. I see JWildfire (fractal flame software) already has genetic selection but it is easier to select from 20 pictures then 20 songs. Hadn't thought of that part :(


In case anyone is boycotting youtube http://vimeo.com/63194557 (http://vimeo.com/63194557)