How a little mathematics can help create some beautiful music