From the help for Tune Smithy
Skip navigation Overview Seeds etc User guide Main Window Musical note intervals Scales Midi in Analyse sound
Hide Contents

Fibonacci rhythms and tonescapes

Skip navigation Seeds Options

Fibonacci Rhythms and tonescapes

Bs | Seeds Options

Fibonacci rhythm , Custom 2 or 3 beat fractal rhythm , Fibonacci tonescapes .



Fibonacci rhythm

Bs | Seed Options | Fibonacci rhythm

This is one of David Canright's ideas - to adapt this discovery of pure maths to generate a rhythm. See his Fibonacci Gamelan Patterns.

First try the original rhythm - just select Fibonacci rhythm . There are two sizes of beats in this rhythm, a long one L and a short one S.

Each voice plays the same rhythm, at varying speeds, so again we get an augmented canon in FTS, but for a completely different reason.

Here is what it sounds like


This is how it works:

Starting from the slowest voice, and working up to faster voices, it works like this, where L means a long beat for that voice, and S means a short beat:

            L     |    S
        L      S  |    L
     L    S |  L  |  L    S
    L S | L | L S | L S | L

Each row has an L S for the L of the line above, and an L for the S of the line above. So an L plus an S beat togehter is the same length as an L beat of the slower voice above it. An L beat is the same length as an S beat of the slower voice.

L (slow) = L + S (faster)

S (slow) = L (faster).

Each row plays the rhythm a little faster, but all the rows are playing the same pattern of beats L S L L S L S L ...(for as far as it goes for the row). Also, whenever one of the slower voices plays a note, all the faster voices come together to play one of their notes at the same moment.

The interesting thing about this rhythm is that it never repeats, ever. Larger and larger chunks of it do recur, but the whole pattern never repeats. Such a pattern is known to mathematicians as a non periodic, or aperiodic pattern. Though we used only a finite number of layers in this pattern, the original mathematics works by continuing this process to endlessly many row, so you end up with a never repeating but endlessly played rhythm, and all the parts are playing this same rhythm at varying speeds

Now, if we want the rhythm to sound identical for all the rows, we are going to make a very special choice for the length of the L and the S beats. The ratio of the length of the long beat to the short beat has to be the same in each row.

A little mathematics will give us the answer we need:

One needs to find an r with

L*r = L + S

S*r = L

where r is the amount by which each row is faster than the next one.

From this one can figure out that

L*r = L + L/r

so r = 1 + 1/r.

A mathematician will instantly recognise this as the defining equation for the golden ratio, so the two beats need to be in proportion according to the golden ratio.

Select Long beat first to play the rhythm exactly as described here.

In FTS you have at most 50 layers. So the rhythm is a finite one rather than the theoretically infinite one of the mathematicians, but it will last for a long time if the number of layers is high enough, and it is the same as the infintite one as far as it goes (the entire pattern FTS plays is contained within a single beat at the 50th layer)..

The melody line is played using the seed notes- in order for this to work, the seed has to have at least two notes. Only the first two notes, or first note, of the seed are played,- for the L, or the L S in the rhythm.

Optionally, one can choose to play the seed normally in the first layer or first few layers, and use the fibonacci rhythm only at higher layers.

To try this, set First Fibonacci layer to 2. You also need to set Rhythm Fractal to layer to 1 , as that will ensure that the seed for the first layer will be slowed down, or speeded up to fit within a single short or long beat of the fractal rhythm of the second layer. Then, since those beats are in the correct ratio to each other, all the other layers will play the same fibonacci rhythm at various speeds as before..

An interesting variation on this is to have two seeds for the first layer instead of one, and use one for the long beat of the second layer, and one for the short beat.

To do this, select Seed for long beats of first Fibonacci layer as Seed for one layer higher , choose Use multiple seeds from the Multiple Seeds window, and select the seed for the long beats into the second layer in the Multiple Seeds window.

As an example of what it sounds like with two seeds, try listening to


This one has a three note seed for the long beats, and a five note seed for the short beats. The five note seed is played a lot faster to fit into the time available to it. (If it was the other way round, five notes for the long, and three for the short, the beats would be roughly equal, since 3, and 5, are successive fibonacci numbers, so 5/3 is a first approximation to the golden ratio).

Short beat first is basicly the same rhythm as Long beat first played backwards, except, each voice starts with a long followed by a short to get it started.

This variation, together with the third, especially interesting rhythmic variation, long beat next to most deeply reinforced beat , is given by David Canright in Fibonacci gamelan rhythms .

For a more relaxed melodic golden ratio tune, try


This time, the rhythm is spread over many instruments, and it uses two seeds at the first layer, one for the long, and one for the short beat.

When making tunes using the golden ratio rhythm patterns, it's good to set the number of layers high (maximum 50). Since each seed has either one, or two notes, the total duration of the tune will be much less for a fibonacci rhythm than it is even for a two note seed.

For instance, for note length 1, and 11 layers , and playing the golden ratio rhythm at all layers ( First golden ratio layer of 1), the total duration is 5 minutes, 22 seconds . compared with 34 minutes 8 seconds for a two note seed. For the same note length, and 30 layers , the length of the tune for the fibonacci rhythm is 13 days 7 hours 24 minutes 11 seconds (this was calculated by saving it as a midi file of the entire tune, then looking at the total file time saved).

Btw if you want to know the exact file time saved for a midi clip of this length, since there isn't space in the main window file time field to show all the numbers, enter #time into the time for one note box.

To find out more about the Fibonacci numbers, visit this site: Lots of information about Fibonacci numbers .

The Long beat first version of the rhythm is used in the study of Penrose tilings, and in this field, is known as the "musical sequence", by a coincidence - mathematicians often use names like this for their sequences not necessarily suggesting any non-mathematical significance - basically the idea is just to have a memorable name for them (you run out of people's names if the same mathematician invents many sequences, and anyway a name like this is more memorable than Conway II or something) - perhaps it's rather like the naming of asteroids. But here we find after the event that there is a musical connection after all.

Penrose tiling, with one of the rows of rhombs shown in yellow

(picture drawn using a program I wrote myself to explore the Penrose tilings and some generalisations of them).

To explain the connection, follow one of the rows, for instance, the one shown shaded in yellow.

As you go along it, notice that some of the rhombi are wide, and some are narrow.

These correspond to the long and short beats of the fibonacci rhythm. If you continue the long beat first rhythm for long enough you will eventually find this particular pattern, which we see, reading from the picture, is L S L L S L L S L S L L S L (including the two rhombs that go off the edge of the picture, and are clearly wide ones).

More about Penrose tilings and the Fibonacci rhythm

There is no need to keep to two sizes of beat.

Let's try three, L, M and S:

Then one method that works is:

S (slow) = L (faster)

M (slow) =L + S (faster).

L (slow) = L + M + S (faster).

To hear this particular rhythm, select Try a three beat rhythm .

One can work out the pattern of beats starting from the slowest layer, as before:

          L             M        S
   L      M    S |   L     S |   L  
 L M S | L S | L | L M S | L | L M S

(for the long beat first type rhythm)

Instead of the golden ratio, we have another ratio r, where, as it turns out, r is a solution of

r 3 - r 2 - 2r - 1 = 0

This makes r = 2.1478990357047873

One can show that if S = 1, then L = r, and M = 1+1/r.

So the three sizes of beat are

1, 1.68232780382802, and 2.1478990357047873

For more details, see next section, under How FTS finds the solution .

You can make your own custom rhtyhms using the Custom rhythm window - just enter any combination of Ls, Ms and Ss into the three text fields, and see what happens.

You can have a seed for each beat with the three beat rhythms just as you do with the two beat rhythms. If you select Seed for one layer higher , you use the seed for the next layer up for the middle size beat, and the seed for two layers up for the long beat.

Try three_beats_ex.ts

(played on flute with non melodic percussion, and with three seeds for the three beats).



Custom 2 or 3 beat fractal rhythm

Bs | Seed Options | Fibonacci rhythm | Custom rhythm

The idea is to find suitable values for the ratio of long to short beats, and middle to short beats, such that all the layers can play the same rhythm at varying speeds.

Select Custom 2 beat rhythm , or Custom 3 beat rhythm .

In the Replace L by box, enter the beats you want to replace a long beat by.

For instance if you want

L (slow) = L + M + S (faster).

then enter L M S.

Enter the values for the Replace M by and Replace S by boxes in the same way.

Fractal Tune Smithy will search to find suitable sizes for the beats automatically.

If a solution is found, then you will see found solution below the Ratio of long to short beats box.

All the layers will then play exactly the same rhythm.

start of section


Other effects

If you use the preset rhythms, then S, M and L are the shortest, middle sized, and longest beats.

However for your own custom maps, they need no longer be like this, as the actual lengths of the beats depend on what the ratios are.

The Short beat first , Long beat first , and long beat next to most deeply reinforced beat radio buttons in the Golden ratio tune window also work for the custom rhythms. However the way they work is that Long beat first plays the rhythms just as you entered them into the text field. If you want the first beat in each grouping to be long, make sure that you enter them with the actual longest beat first.

If you enter your rhythmic patterns starting with the longest beats first, these options will match their descriptions. For instance, you would enter L M S with the L first (assuming L really is the longest beat), but can have M or S second. You can find out which really is the longest beat by looking at the ratios, and if necessary, reverse some of the patterns so that the longest is first.

Note that when some of the rhythm patterns have more than two beats in them, long beat next to most deeply reinforced beat needs further clarification before one can decide on the order for any of the beats in the middle - because the notes that start and end those beats will both be unreinforced. When this happens, FTS interprets it as long beat closest to nearest most deeply reinforced beat . Closest here means in terms of the number of beats rather than the time interval.

The exact interpretation of this is that FTS will play all the sub-divisions of beats in the first half of a three or more note beat pattern normally, and reverse all the sub-divisions for the second half. When there is a beat exactly in the middle of the pattern, FTS plays its subdivisions reversed or unreversed depending on whether the pattern itself is a subdivision of a beat at the next layer up which is reversed or unreversed.

You can try out many other rhythmic effects, try reversing one or more of the rhythm.

For instance, if you want to try short beat next to most deeply reinforced beat , choose long beat next to most deeply reinforced beat and enter all the rhythmic patterns with the short beat rather than the long beat first. To do this for the preset three beat rhythm, enter S M L and S L as the beat patterns for L and M instead of L M S and L S.

If you want the rhythmic pattern to be identical at all the layers, the L rhythm needs to start with an L as its first beat, so that all the layers can start with an L. The Short beat first , and long beat next to most deeply reinforced beat , substitutions are applied to beats after the first L which starts everything off.

If instead, you start the L rhythm with S or M, then the patterns at all the layers will still be identical in the sense that any sequence of beats of any length that you find in one will turn up eventually in all the others. For instance, the exact pattern of the first hundred beats of the first layer will occur eventually in all the other layers if you wait long enough. However, maybe it will take a while for it to turn up!.

If you see no solution found , this means the ratio of short to long, and short to middle beats will vary with the layer. You can still play the tune - it just means that the ratios of the beats to each other will no longer be identical in all the layers.

FTS looks for a solution whenever you select Custom 2 beat rhythm , or Custom 3 beat rhythm or whenever you change the values in the Replace L by , Replace M by or Replace S by boxes.

If you want to make your own choices for the ratios, enter the L M S type rhythmic patterns you want to use first, and then enter your new values for the ratios. Then at this point, if the values you enter produce the same rhythm for all layers, you will see found solution below the boxes - this means FTS has checked your values and found that they provide a solution.

start of section


Ah, but is it a repeating rhythm, or a non repeating one?

Here, one is talking about the rhythm for any particular layer, say, the first layer. Some rhythms you can make in this way repeat, and others are non repeating.

For the two beat rhythms, to get a first idea of which type you have, click Show beat length analysis .

This shows the numbers of each type of beat that one can expect after a large number of substitutions. First it shows the actual numbers resulting from doing the substitutions, then a calculation of the ratio of the two numbers using a formula.

Look at the formula for r. This is the ratio of 'L's to 'S's. If it involves the square root of a number, then your rhythm never repeats. If it does repeat, then there has to be some specific number of 'L's and 'S's in each cycle of the rhythm, and if that happens one has to have a pure numbers ratio here like 13/8 (say).

To do the same thing for the three beat pattern, you will have to derive the formulae yourself - at present FTS only does this for the two beat patterns. You can see the substitution results as before, with the ratio to about 15 decimal places, which may give a preliminary idea.

This won't necessarily settle the question for all non repeating patterns; it is just a convenient method that works for some of them. That's because it only works one way. If you find that the ratio of the beat lengths is a pure number ratio like 13/8 then it remains a possibility that it might repeat, or might not.

So sometimes, one has to do a more detailed investigation.


S (slow) = M (faster)

M (slow) =L + S (faster).

L (slow) = L + M + S (faster).

It doesn't show any signs of repeating, but the ratios of the numbers of beats for the Show beat length analysis are all 1, i.e. it has the same numbers of 'L's, 'M's and 'S's.

The sizes of beats are very straightforward too: each M is two 'S's, and the L is three 'S's.

Try listening to


Surprisingly dance-like music for a rhythm that never repeats exactly at any time scale!

How can one tell that this rhythm will never repeat ?

It is easiest to prove this if you have Long beat first selected, rather than Long beat near most deeply re-inforced beat . from the Fibonacci rhythm window. I'll work through an example - then other ones can be analysed in much the same way.

Here is the rhythm we want to prove to be non periodic - with the first layer played only, all the beats played on claves.


You can show the rhythm as 'L's, 'M's and 'S's in

Bs | Seed Options | Fibonacci rhythm | Custom rhythm

To see just the first layer, make sure you have Show all layers played unselected.

Try playing it for a while, remove all the '~'s that show how the beats are made from the ones at the next layer up, and look at the resulting pattern, something like this:

L M S L S M L M S M L S L M S L S M L S L...

The beats are all different sizes, so one can tell which is which just by listening. So one could also transcribe this rhythm, just by listening - playing the rhythm somewhat slower doubtless. (Maybe you'd like to give it a go...).

At this point, if two beats were the same size, one could change them all to the same letter, e.g. if the S and M are the same size, replace the 'M's by 'S's.

The first part of the proof is to show that you can look at (or listen to) the rhythm, and put all the '~'s back in again. We have to find a method that works for this particular rhythm. So lets look at how it is defined again:

S (slow) = M (faster)

M (slow) =L + S (faster).

L (slow) = L + M + S (faster).

If you see (or hear) an L followed by an S , then it has to come from an M at the next layer up.

L M S ~ L S ~ M L M S M ~ L S ~ L M S ~ L S ~ M ~ L S ~ L M S M L M S ~ L S ~ M L M S M ~ L S ~ L M S M L M S

If you see an L followed by an M , it comes from an L at the next layer up

L M S ~ L S ~ M ~ L M S ~ M ~ L S ~ L M S ~ L S ~ M ~ L S ~ L M S ~ M ~ L M S ~ L S ~ M ~ L M S ~ M ~ L S ~ L M S ~ M ~ L M S 

Then all the remaining 'M's come from 'S's at the next layer up.

So we can find out what the next layer up was (and then the next layer after that too, and so on) like this:

L M S ~ L S ~ M ~ L M S ~ M ~ L S ~ L M S ~ L S ~ M ~
L       M     S   L       S   M     L       M     S 
L S ~ L M S ~ M ~ L M S ~ L S ~ M ~ L M S ~ M ~ L S ~
M     L       S   L       M     S   L       S   M     
L M S ~ M ~ L M S
L       S   L 

In other words, even though only the first layer is playing, one can figure out from it where to play all the beats of the next layer up, and work back up as many layers as one likes in this way.

At each stage there is only one way of proceeding. It may perhaps be clear to you by now that the pattern can't repeat at any layer (after some thought doubtless). However, unless you are a mathematician by training, or have some experience of mathematical ways of doing things, you may be hard pressed to explain why in rigorous terms.

Here is the way a mathematician will set about it, and sorry if it seems complex and unintuitive for those not used to it - it is just a matter of familiarity with the techniques needed for a particular type of situation, one that doesn't turn up that often in ordinary day to day activities, but frequently happens in mathematical contexts.

The easy way to show this sort of result is to prove that you can never find a counter example. All well and good, but the way you prove that is to see what would happpen if you ever did find a counter example, derive a contradiction from that, and so conclude that you can't ever find one. This way of working takes some getting used to.

The first step is to notice that if the rhythm were to repeat at the first layer, it would have to repeat at all the higher layers too. That would be our counter example - a repeating pattern.

So - suppose one were to find a repeat at the first layer of some definite length.

You could then work back from that first layer to the higher layers, just as we have done and find the rhythm at slower and slower speeds. The beats get longer and longer each time you do that. Eventually you would reach a point where the entire repeat of the original fast rhythm is within a single beat of our slower rhythm.

Now if you shift the original rhythm forward by one repeat in the fastest layer, you shift the rhythm at all layers by the same amount of time.

At the slower layer, this shift is only a fraction of a beat.

So the rhythm at this layer has to repeat already before our single long beat has finished playing.

Clearly impossible!

So the thing we were looking for is something that can never happen since if it did it would lead to this absurd conclusion.


The rhythm can never repeat.

If this method of proving things is unfamiliar to you (as it will be for most non mathematicians), you may need to think it over a fair number of times before you get the idea.

The method it uses is an extremely common technique in mathematics.

FAQ for this type of proof: Since one knows that there is no counter example - in this case one knows that there is no repeating pattern - what is the point in supposing that there is one?

Answer: The thing is that one may have a guess or hunch that there is no counter example. But in mathematics even the best mathematicians sometimes find that their hunches go awry when they investigate more closely. So one has to show it for sure. This is how one sets about proving it. Until one shows the absurdity of the possibility in this way, one doesn't know for sure that there is no counter example. And actually it isn't that strange, if you think, for instance how can you know for sure that you can't ride a bicycle as a child? You get on a bike and try and you fall off. Similarly here we try to make a repeating pattern, find out that it is impossible and so know that it can't be done. The main difference is that in the cases of the bicycle you cant do it yet perhaps, but it is worth trying again and maybe eventually you can do it - while here we have shown in our proof that it is completely impossible, because it leads to a contradiction to suppose that it is possible. So there is no use in trying to fnd a repeating pattern, not with this particular arrangement of L, M and S beats, it just can't be done.

If you don't understand, try coming back to it later, and maybe the penny will drop. It is quite common in maths that one finds a new method of proof extremely puzzling because it uses a new idea, then suddenly one day, all becomes clear. Then you wonder what the problem ever was. Anyway, one can't really say any more - that is it presented as clearly as I can do it. Either you get it or you don't. If you don't, and want to understand, just look it over again at some later date...

For the same rules, but with Long beat near most deeply re-inforced beat , one needs an extra step. For all we know, it's possible that just changing that might make it from a non repeating pattern to a repeating one, so we need to prove it as a separate case. Here is an example of the rhythm:

L M S L S M L M S M S L L M S L S M S L M S M L L M S L S M L M S M S L M S M L L S M S L S M L 

If one can find a single place to break the sequence, the rest will be easy. One just needs to work outwards from that point, subdividing as one goes.

Working outwards like this, the rest of the process is easy - each L or S will start a new L or S at the next layer up. One can easily recognise which is which - an L or S followed by an M comes from an L at the next layer up, and all the others come from 'M's. Since one is working outwards step by step, any M one reaches which hasn't been recognised as part of an L at the next layer up has to come from an S at the next layer up.

So one just needs to know where to start the process.

For a complete proof, it's not sufficient to just find a break point in that particular example - one needs to show that one always can find a break point.

Here is one way to do it:

Any rhythm will contain some sections that come from an 'M' three layers up.

This expands to

L S (or S L)


L M S ~ M (or M ~ S M L)


L M S ~ L S ~ M ~ S L (or L S ~ M ~ S L ~ S M L)

In this last step, the L S of L M S ~ L S ~ M will be this way round with Long beat near most deeply re-inforced beat as it is the M of the layer above, which is the middle beat of the L of the layer above that, which is the first beat of the M from three layers up.

In this pattern the M with an S to either side is a recogniseable break point, because it has to come from an S at the next layer up. The pattern will always occur somewhere in our rhythm, and so will provide us with the break point we need.

Let's find it in our sequence:

L M S L S M L M S ~ M ~ S L L M S L S M S L M S M L L M S L S M L M S M S L M S M L L S M S L S M L

Break there as shown, then work outwards to find the rest of the subdivisions:

L M S ~ L S ~ M ~ L M S ~ M ~ S L ~ L M S ~ L S ~ M ~ S L ~ M ~ S M L ~ L M S ~ L S ~ M ~ L M S ~ M ~ S L ~ M ~ S M L ~ L S ~ M ~ S L ~ S M L

And we are done.

One can then find the next layer up, and go up as many layers as one likes, as before.

(there are many other recognisable breakpoints one could use instead, such as the double L - use whichever you like).

The proof that it is non periodic is exactly the same as before.

Here is the sequence again in David Canright's notation from his article, which shows all the beats as vertical lines, with the letters positioned in the middle of the beat.

This notation shows the way Long beat near most deeply re-inforced beat works particularly clearly.

L | M | S | L | S | M | L | M | S | M | S | L | L | M | S | L | S | M | S | L | M | S | M | L |
    L     |   M   | S |   L       | S |   M   |     L     |   M   | S |   M   | S |     L     |
              L       |         M     |   S   |               L       |  S    |     M         |
                      L                       |                M              |     S         |
                                  L                                                           |

Here it is again, leaving out some of the vertical lines in the first row to show a larger region.

L M S | L S | M | L M S | M | S L | L M S | L S | M | S L | M | S M L | L M S | L S | M | L M S | M | S L | M | S M L | L S | M | S L | S M L |
    L |  M  | S |   L   | S |  M  |   L   |  M  | S |  M  | S |   L   |   L   |  M  | S |   L   | S |  M  | S |   L   |  M  | S |  M  |   L   |
        L       |     M     |  S  |          L      |  S  |     M     |          L      |      M    |  S  |     M     |  S  |      L          |
                  L               |               M       |     S     |                        L          |     S     |        M              |
                                   L                                  |                        M                      |    S                  |
                                                                      L                                                                       |

Notice how a beats is reversed if followed immediately by a more deeply re-inforced beat. Also notice that it is reversed if the nearest most deeply reinforced beat comes after it rather than before it.

This can mean going back a fair number of layers before one knows which way round to play a beat. See for instance the second | S L | in the first row (shown in red).

This comes from an M in the second row, an S in the third row, and this is from the second half of an M in the fourth row, which in turn is the middle beat of an L in the fifth row.

The first half of the M in the fourth row is played longest beat first because it is closer to the beat that starts the L of the fifth row (not in elapsed time, but in terms of the way the rhythm is defined). However the second half of it is closer to the beat that ends the L, so it is played shortest beat first.

Remember that when there are more than two subdivisions of a beat, it's interpreted as long beat closest to nearest most deeply reinforced beat .

Here it is played on bongos and congas, various bell sounds, triangles, and a Chinese Cymbal.


start of section

How FTS finds the solution

Bs | Seed Options | Fibonacci rhythm | Custom rhythm | Ratio of long to short beat and Ratio of middle to short beat

For the curious, here are the equations Fractal Tune Smithy uses to find the ratios - this needs a little bit of maths, but not that much. Everyone else can skip to the next part of this section, or the next section, another method.

You have three equations. Let's take the example of the preset three beat rhythm:

S' (slow) = L (faster)

M' (slow) = L + S (faster).

L' (slow) = L + M + S (faster).

Then using r for the ratio of the slower rhythm to the faster one, you have

S' = rS = L

M' = rM = L + S

L' = rL = L + M + S

Solving these equations:

By the first two equations,

M = S + S/r

So from rL = L + M + S

r 2 S = rS + S + S/r + S


r 3 - r 2 - 2r - 1 = 0

To find r , one needs the solution for this cubic equation.

There are two methods one can use, the analytic or the iterative. You can try both here: Solution of cubic

For more about the cubic, see this page by Carsten Magnusson. To find a solution to the cubic by the algebraic method, see his javascript applet here. and for c-code (if you are a programmer) see

FTS uses the analytical solution. Here, r = 2.1478990357047873

Then we get

M/S = 1 + 1/r = 1.68232780382802

and L/S = r

That's it done.

The general procedure then is to solve the simultaneous equations to obtain a cubic in r , then solve the cubic to find r , then substitute back into the formulae for L and for M to find the desired ratios.

Some of the rhythms may have more than one solution if the cubic has several roots. In this case, FTS finds one of them (usually, the one with the largest value of r).

This method usually works, but sometimes FTS isn't able to find the cubic from the simultaneous equations by juggling the coefficients. This is one of the ones it misses (which does in fact have a cubic equation, but FTS misses it):

L (slow) = M + S (faster)

M (slow) =L + M (faster).

S (slow) = L (faster).

However, it is able to solve this one by another method - see another method.

If you see no solution found , it means that FTS couldn't find a solution with the methods it uses, but there might still be solutions to find by other methods. So you might like to have a try to see if you can solve the equations by hand yourself.

Show beat length analysis - click this to find out what cubic equation FTS found (if any).

Sometimes you will see several cubics listed, (quadratics sometimes) arising from various ways of solving the equations.

The way FTS tries to find the cubic is to permute the L, M and S in the original equations in all possible ways. For each combination, it tries to solve the resulting equations, then undoes the permutation to get the answer. This often leads to the same equation, so you may also sometimes get the same one listed up to six times, with only the formulae for the ratios changing. This approach sometimes leads to new solutions, and was easy to program. The extra work involved of course is no problem for FTS, though one would never do it that way by hand.

You can show as many of these messages as you like - each is launched in a separate thread, so they stay on the screen until you click their OK buttons or exit from FTS.

start of section


Another method

FTS will also try another method, of repeated substitution .

Starts with L, M and S all set to length 1.

Then uses the equations to build these up to make larger and larger versions of the beats.

First time round:

L = M = S = 1
S' = L = 1
M' = L + S = 2. 
L' = L + M + S = 3

Second time round:

L = 3, M = 2, S = 1
S' = L = 3
M' = L + S = 3 + 2 = 5
L' = L + M + S = 3 + 2 + 1 = 6

Often, after about twenty or thirty iterations, the ratios between the numbers have converged to a stable value, to at least 15 decimal places.

Then FTS tries these ratios to see if they solve the original equations. If the numbers have settled down to a stable value, then they will do.

The idea behind this method is that on a slow enough time-scale, the percentage of beats of each type probably doesn't vary much. So you can estimate large enough time intervals just by counting the total number of beats played, whatever their size. So the relative sizes of two slower beats can be approximated using the number of faster beats they are made up out of, ignoring their relative sizes.

In practice, it seems to work most of the time, and helps to solve a few more of the cases.

For instance, with

L (slow) = M + S (faster)

M (slow) =L + M (faster).

S (slow) = L (faster).


rS = L

rM = L + M

rL = M + S

One can derive from these equations

r 3 - r 2 - 2r + 1 = 0

(difference from previous cubic is that it has + 1 instead of - 1)

FTS doesn't find this cubic. However, since it can solve the equations by the iterative method, it still finds a solution.

start of section



Fibonacci tonescapes

Bs | Seed Options | Fibonacci tonescapes

The idea here is to go up or down in pitch, depending on the the current beat played in the Fibonacci rhythm. So for example if the interval for the L is a 5/4, then whenever you play an L, you go up by 5/4 first.

L , M (for three beat rhythms) and S columns - use these to enter the ratios.

If one sets all the intervals to use by hand, one will find that nearly always,the pitch rapidly rises out of range, (or falls, depending).

The Pitch drift column gives you an estimate of the amount by which it will rise or fall. It shows the drift expected in the average time between successive short beats, in cents.

For the golden ratio rhythm, one pair of ratios that works well is L: 10/11 and S: 7/6 . The pitch drift is 0.111544 cents.

4/3 and 5/8 work reasonably well as a simpler set of ratios, with a drift of -7.83255 cents, but this is large enough for a fairly noticeable slow drift as the tune goes on.

16/15 and 9/10 have a much less noticeable pitch drift of -1.618695 cents.

It's not so easy to find such good sets of ratios by hand. But FTS will find them automatically for you.

Keep all first row ratios optimised for pitch drift . (this is the standard setting) re-finds the first row ratios whenever you change the fibonacci rhythm. If unselected, use the button Find all first row ratios

Keep companion ratios optimised for pitch drift (this is the standard setting) whenever you edit one of the L, M, or S values, the remaining value (or values) will be changed to the best available. If unselected, use the button Find companiont ratios to minimize pitch drift

First Fibonacci layer - if this is the first layer, then the tonescape completely overrides the scale and arpeggio, and the main window seed is ignored. If it is one of the higher layers, the scale and arpeggio is used for the lower layers, and FTS shifts seeds for lowers layer up / down in pitch whenever a new beat is played in the first fibonacci layer.

Tonescape layers Standard setting here is 1, which means all the Fibonacci layers rise and fall in pitch by the first row ratios. If it is set to two, you have two rows of tonescape ratios. Odd numbered layers use the first row ratios and even numbered layers use the second row ratios. Similarly if it is set to a higher number n, then every nth row uses the first row ratios.

B s | Seed Options | Fibonacci tonescapes | Optimisation Options

When FTS looks for the best ratio, it looks for one with the specified Max prime factor , Maximum number of distinct prime factors , and Max denominator or denumerator . Set the Max prime factor to 0 to allow any numbers up to the Max denominator or denumerator .

The Max for ratios > 1 and Min for ratios > 1 boxes are needed when using the Find first row ratios now button. This finds all three (or all two) ratios, so you need to specify something about the range of values you are interested in.

If you select Keep all first row ratios optimised for pitch drift then a new search is made automatically whenever you change the fibonacci rhythm, or change anything else that could affect the outcome of the search: the Max prime factor etc, or the Max / Min for ratios > 1 . The automatic search is continued for at most a tenth of a second (with the standard setting), and if it hasn't finished at that point, will show the best result found so far. You can increase this time out using the Max time per calc. box.

When editing the ratios, Find first row ratios... has same effect as Find companion ratios... .

How FTS finds the ratio for the two beat patterns :

Suppose r is the ratio of the number of 'L's to number of 'S's in your pattern.

Now replace all the 'L's and 'S's using:

L maps to m 1 'L's + m 2 'S's
S maps to n
1 'L's + n 2 'S's

So result of subdividing is that an average region containing r 'L's and a single 'S' maps to

m 1 r 'L's + m 2 r 'S's + n 1 'L's + n 2 'S's

Idea is to try to keep the ratio of 'L's to 'S's the same after the map.

So one wants

(m 1 r+n 1 ) / (m 2 r+n 2 ) = r


m 2 r 2 +(n 2 -m 1 )r-n 1 =0

One can then solve this quadratic equation to find r.

To see this equation, and its solution if it has a positive solution, click Show pitch drift analysis .

This also shows the result of actually doing the substitutions, for comparison.

start of section


How FTS finds it for three beat patterns

For these, it doesn't try to solve any equations. It just does the substitutions repeatedly (starting with one each of L M and S, all equal to 1), and then finds how many it has of each type of beat at each step, and the resulting values for the ratio of L to M and L to S, and sees if these values will work. Often it is able to get the correct results to fifteen decimal places after about twenty or thirty substitutions.

You can still use the Show pitch drift analysis button, but this time it only shows the result of repeated substitution, not the actual formula.


L -> L L M M M S

S -> L M S

M -> L M M

FTS finds the ratio of L to S to be 2, and of S to M to be 1.

Note, since the ratio of S to M is 1, this is the same as the two beat fractal rhythm

L -> L L S S S S

S -> L S S

However, since FTS doesn't try to solve the equations for three beat patterns, it won't recognise this fact.

So, let's see if it gets the correct result?

After repeated substitution, FTS finds the ratio of Ls to Ss to be 3, and the ratio of Ms to Ss to be 5.

It finds suitable ratios to be 64/81 for L, and 9/8 for M and S. It shows a pitch drift of 0 for this choice.

Checking, one finds that (9/8)*(9/8)^5*(64/81)^3 = 1.

This means that if one did the number of substitutions that FTS tried out, the fibonacci tonescape would work. The number of substitutions here corresponds to the number of layers in the fractal tune.

However, it doesn't prove that it works if you do arbitrarily many substitutions, though it strongly suggests it.

If you want the formulae, then for the time being anyway, you have to work them out by hand. There are so many cases to consider that it would take a fair amount of programming to do them all in one go (unless I happen on some brilliant short cut for it).

I'll work through one example, for those who are interested in such things, as I know that some are, and some may want to try out similar derivations for their own three beat tonescapes. For those who aren't so mathematically inclined, it's okay to skip the rest of this section as it has nothing more of interest; just a whole lot of equations working it out.

start of section


Here is how one might do it for the preset three beat rhythm (a fairly simple case as it happens)

Again, this description has some maths. It uses straightforward algebraic methods for solving equations, but it goes on for a bit longer than the one at the end of the last section.

Suppose the ratio of 'L's to 'S's is r, and the ratio of 'M's to 'S's is r 2 .

One wants the ratios to remain the same after subdividing the slower rhythm into faster beats using:

S (slow) = L (faster)

M (slow) =L + S (faster).

L (slow) = L + M + S (faster).

So result of subdividing is that on average,

r 'L's map to r'L's + r'M's + r'S's

r 2 'M's map to r 2 'L's + r 2 'S's

'S' maps to 'L'

Result of subdividing

r 'L's + r 2 'M's + 1 'S'


(r+r 2 +1) 'L's + r 'M's + (r+r 2 ) 'S's

Since one wants the ratios to remain the same after the map, one wants

(r+r 2 +1) / (r+r 2 ) = r


r / (r+r 2 ) = r 2

From the second equation,

r + r 2 = r/ r 2


r 2 2 = r - r 2 r


r = r 2 2 / (1 - r 2 )

From the first equation,

r + r 2 + 1 = r 2 + r 2 r


r 2 + (r 2 - 1)r - r 2 - 1 = 0

Substituting for r, one gets

r 2 4 / (1 - r 2 ) 2 - r 2 2 - r 2 - 1 = 0


r 2 4 = ( r 2 2 + r 2 + 1) (1 - r 2 ) 2

= ( r 2 2 + r 2 + 1) (r 2 2 - 2 r 2 + 1)

= r 2 4 - r 2 3 - r 2 + 1

The two fourth powers cancel, leaving

r 2 3 + r 2 - 1 = 0

So using the cubic applet ,

r 2 = 0.6823278038280194

There were a number of lucky breaks in this derivation which made it particularly easy.

start of section


Solving this cubic analytically

Actually this cubic equation is pretty simple, so let's go all the way, and try doing it analytically from first principles by Scipione de Ferro 's method (1465 - 1526).

(link is to the mathematician's biography in the extensive Univ. of St Andrew's history of maths web site).

Solution method described on this web page: The cubic formula (from S.O.S. math)

Cubic is in form

x 3 + Ax = B

where A = B = 1

We want to find s, t with

3st = A

s 3 - t 3 = B

If we can do this, (s-t) will solve the cubic.

This is why it works:

x 3 + Ax = B

Substituting (s-t) for x , and the formulae for A and B into left hand side:

(s-t) 3 + 3st (s-t) = (s 3 -3s 2 t+3st 2 -t 3 ) + (3s 2 t-3st 2 )

= s 3 - t 3 .

which is B , the required right hand side.

So now we need to find s and t.


3st = 1

we get,

s = 1/3t

Then substituting this into

s 3 - t 3 = 1

we get

1 / (27t 3 ) - t 3 = 1


1 - 27t 6 = 27t 3


27t 6 + 27t 3 - 1 = 0

This is a quadratic in t 3

Solving it, we get

t 3 = (-27 sqrt(27 2 + 4 27) )/ (2 27)

= (-9 sqrt(3 27 + 4 3) ) / 18 (after dividing top and bottom by 3)

= -0.5 sqrt(93) / 18

= -0.5 0.53575837561

= -1.03575837561, or 0.03575837561

t is the cube root of this

-1.01178014187 or 0.329452338049

Then s = 1/3t

-0.329452338049 or 1.01178014187

and the required solution is


s - t = 0.682327803828 (repeated root - both the same).

start of section