Skip to page content. |Motivate home.  
Google



Back to : Maths and Music Main Page

Display maths using:

fonts images
Need help?

Maths and music

Fibonacci numbers
Random numbers
Other number patterns
Using numerical ratios
Number composition spreadsheet

C major scaleComposing with numbers

On the right, you can see the scale of C major written out in musical notation and with the corresponding notes on a keyboard shown, for reference. To find out more about musical notation, see Reading music.

You can use number patterns, and even random numbers, to compose music. Two examples are shown below. To convert numbers directly into music, however, we have to take into account the fact that there are only 8 notes in an octave. This table is one way to do this (there are other ways you could use if you wish):

Number

Note

1

C (the lower C shown)

2

D

3

E

4

F

5

G

6

A

7

B

0

C' (the upper C shown)

I chose to start at 1, then go back to 0 after 7, because I want to use 'clock arithmetic', or modular arithmetic, as it is more formally known.

If we do addition sums on a 12-hour clock, whenever the answer goes beyond 12, we have to subtract 12 to find the answer. For instance 3 + 8 = 11 as normal, but 3 + 10 = 1 not 13, and 8 + 7 = 3 not 15. This is known as working mod 12 - you do all your calculations in the normal way, but remove all multiples of 12 from the final answer.

For music, we can work mod 8. This means we remove all multiples of 8, so that the only final answers we can possibly obtain are 0, 1, 2, ... 7. 8 is replaced by 0, 9 by 1, and so on.

Fibonacci numbers

These are the first few Fibonacci numbers:

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ...

Can you see how they are formed? Given the first two numbers, the rest are formed by adding the previous two together. We can express this in the following formulae:


\begin{displaymath}F_3 = F_2 +F_1, F_4 = F_3 + F_2, F_5 = F_4 + F_3, ... \end{displaymath}

or more generally

\begin{displaymath}F_n = F_{n-1} +F_{n-2} \end{displaymath}

where Fn is the nth Fibonacci number.

Now we can apply mod 8 arithmetic each of our Fibonacci numbers:

1, 1, 2, 3, 5, 0, 5, 5, 2, 7, ...

Note that it makes no difference if you convert each Fibonacci number, or if you add the two previous numbers, using mod 8 arithmetic.

We can now convert our mod 8 Fibonacci numbers into music, and the result is shown below:

music obtained from Fibonacci numbers

The notes C, C, D, E, G, B, G, G, ... correspond to the Fibonacci numbers mod 8: 1, 1, 2, 3, 5, 0, 5, 5, ... It is common to start and finish with the key you are writing in, and we are working in the key of C major - hence my decision to make this equivalent to number 1. The lengths of the notes is arbitrary, although you could use some kind of number pattern for this as well.

Q1 Make your own tune from Fibonacci numbers. You might find this spreadsheet (Fibonacci numbers tab) helpful. You can vary:

  • the two starting numbers for the Fibonacci numbers
  • how you change from numbers to musical notes
  • how you choose the lengths of the notes

When you have composed a tune, try it out on a keyboard, or other musical instrument. What do you think of it?

If you are not very familiar with spreadsheets, can you work out what each column does?

Go to top

 

Random number music

We can do the same kind of thing with random numbers. I used a spreadsheet to generate random numbers, or you could use a calculator. My spreadsheet gave me random numbers between 0 and 1 (not not including 10), so I first multiplied them by 10, to get random numbers between 0 and 10. Then I removed the decimal part, leaving a whole number between 0 and 9 inclusive. Finally, I converted these into mod 8 numbers, so that 8 = 0 and 9 = 1.

As an example, suppose you obtained the random number 0.3748173. Multiplying by 10 gives 3.748173, removing the decimal part gives 3, and this stays as 3 mod 8. Then substituting the numbers with musical notes gave the following:

music obtained from random numbers

Again, the note lengths are chosen fairly randomly, although you could use a particular pattern for these.

You can find another example of music composed using random numbers at http://sunsite.univie.ac.at/Mozart/dice/. This site allows you to compose a minuet in the style of Mozart from random numbers!

Q2 Make your own tune from random numbers. You might find this spreadsheet (random numbers tab; use the F9 key to generate a new set of random numbers) helpful. You can vary:

  • the numbers
  • how you change from numbers to musical notes
  • how you choose the lengths of the notes

When you have composed a tune, try it out on a keyboard, or other musical instrument. What do you think of it?

Again, can you work out what is happening in each of the spreadsheet columns?

Go to top

 

Using your own number pattern

Use a number pattern of your own to compose music. Can you design a spreadsheet to help you generate all the numbers you need?

 

music composed with a ratio of note lengthsUsing a numerical ratio for the lengths of notes

You can use numbers to determine the lengths of notes (see Reading music for help with this). A 20th century Estonian composer, Arvo Pärt, composed a piece of music using the ratio 1:2:4:8:16 for the lengths of the notes he used. The piece of music shown on the right is a very simplified version of his idea, written to be played on a keyboard with two hands. Alternatively, if you have five instruments available, each could take one set of notes to play.

The filled in notes with stems (crotchets) are worth one beat each. The open notes with stems (minims) are worth two beats each. The open notes without stems (semibreves) are worth four beats each. Where these are tied (with a line) to another note, you play the first note, but not any that are tied. So if you have two semibreves tied together, you actually have a note worth 8 beats, and where you have four semibreves tied together, you have a single note worth 16 beats.

 


 top of page

Back to : Maths and Music Main Page
contact | accessibility
© 2002 Millennium Mathematics Project, University of Cambridge