You are on page 1of 15

Writing a strict Canon

(the easy way)

24/july/2012

Abstract
This article presents a tutorial on how to write decent sounding canons.
To do so it is proposed to start from a chord progression or choral, and
then systematically transform that material into a canon. The end result
is a canon that sounds OK by construction. The basic method is simple enough that it can easily be automated.

The tutorial subsequently

deals with ways to systematically improve the generated canons. Those


improvements partially depend on having a musical ear.

While I made

up this method without reference to other works, I'd be surprised if the


method is new (given that it is so obvious). Probably it's just a rediscovery of an existing technique invented shortly after the middle ages ;) I'd
appreciate references if this is indeed the case.

Contents
1 License

2 Changelog

3 Introduction

4 The starting point

4.1

Write a choral or a chord progression . . . . . . . . . . . . . . . .

4.2

A Choral? I don't know how to write a choral?! . . . . . . . . . .

4.3

Serializing the choral to a canon

. . . . . . . . . . . . . . . . . .

5 Adding rythmic variation

6 Better melodies

6.1

Basic technique . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.2

The nishing touch . . . . . . . . . . . . . . . . . . . . . . . . . .

10

6.3
6.4

But I have this melody in my head that I want to turn into a


canon. How does your method help me? . . . . . . . . . . . . . .

12

Ideas for further experimentation . . . . . . . . . . . . . . . . . .

12

7 Conclusion

12

8 Appendix A: using lilypond to generate the score and .midi


les
12
9 Appendix B: rendering to audio using LMMS

14

References

14

1 License
This document is available under a CC-BY-SA 3.0 license[2].
You are free to

share this document (copy, distribute and transmit),

to remix it (adapt it), and

to use it in commercial context,

as long as you

attribute the original work to Stefaan Himpe:

You must attribute the

work in the manner specied by the author or licensor (but not in any
way that suggests that they endorse you or your use of the work.

share alike:

If you alter, transform, or build upon this work, you may

distribute the resulting work only under the same or similar license to this
one.

2 Changelog
This is version 2 of the document. The latest version of the document can be
found on my blog[3].

Version 1 (24/july/2012)

initial version

Version 2 (25/july/2012)





added the appendices on lilypond and lmms


spellcheck
using bibtex for the references

3 Introduction
For the longest time I've been amazed at musicians writing canons. I wanted to
be able to write one myself: I tried to write a melody, but as soon as it started
playing against itself it would quickly start to sound awkward.

By changing

one note in one place I would mess up the harmonies in another place...

neverending frustrating puzzle. Then, suddenly and out of the blue I saw the
light (ahem :-) ). Writing a canon is quite doable if you look at it in a certain
way. This article is intended to explain how, without much hassle, I suddenly
was able to conceive several canons in 3,4,5 voices in only a few minutes time.
For the sake of illustration, we will build a non-trivial canon with a 3 measure
melody in this tutorial. On each measure the melody can start to play. If you
are a bit like me, you should be amazed at the end result, given what we start
from and what limited eort goes into writing it.

4 The starting point


4.1 Write a choral or a chord progression
The end goal is to have dierent voices that sound well together: design them
to t together from the start (correct by construction).

Don't be afraid to

keep it simple: even simple chorals can result in suprisingly interesting canons.
This choral is the starting point for just about everything we will do in this
document.

4.2 A Choral? I don't know how to write a choral?!


Fear not! You can take a lead sheet o the internet and write out the notes,
e.g. using a resource like [6].
Here's an example:

C F G

   


Et voila! You have a simple choral. It consists of three beats: the rst beat
is a C chord, the second beat is an F chord and the third beat is a G chord.
To prove that simple chorals suce, we will use this choral as starting point for
our tutorial. I have given the notes colors, because I will refer to them again in
the following sections.

4.3 Serializing the choral to a canon


Here we explain the core of the method. The choral is our starting point. While
enhancing certain aspects of the canon in later sections of this tutorial, we will

always refer to the original choral again. A basic method to transform the choral
to a canon is explained now:

Serialize the chords to a melody as follows:

First take all the upper notes of each successive chord and write those
as successive notes.

After that take all the middle notes and write them after the upper
notes.

 Then take all the lower notes and write them after the middle notes.
 Continue until you have serialized all notes of each chord.
 Note: this way of working supposes that each chord has an equal

number of notes stacked on top of each other. If that is not the case
you should add notes to the chords with fewer notes (e.g. by doubling
existing notes)

Here's the result of applying this serialization to the C-F-G progression shown
above:

 43
This forms our melody.

Each new voice can start when you go back to

Note: in the
following music fragment three staves should be read/played simultaneously (this
is visible on the score because they are connected together with a solid line on
the left side of the system). Normally you would assign a dierent instrument
to each sta, and then the eect of having the red/yellow/blue notes on dierent
staves can yield a dramatically dierent resulting sound.

the rst chord (i.e. each time the color changes in the example).

 43

 43  

 43  









Rejoice!

For you've written your rst canon.

Note how, when all voices

sound together, we get the original choral again in dierent inversions (red,
yellow and blue notes sounding together). It has some limitations though:

Lack of rythmic variations make it less exciting than it could be.

The melodies derived from the upper, middle and lower notes in the chords
at times sound a bit contrived.

We will now proceed in improving on these aspects of the canon.

5 Adding rythmic variation


We start again from our original choral, and we enhance it rhytmically in such
a way that it still sounds good. This takes some experience, or some patience
to try out some combinations and come up with something that works for you.
You could e.g.

use a midi editor and play the chord progression in a loop,

modifying the notes while listening to the result. Strive for as much diversity
in rythms/notes as possible while still keeping it sound good.

You can also

replace chords with their inversions if you know what that means and if you like
that, although in the next section I will show a dierent way to do exactly that.
Here's one possible enhancement of the original C-F-G progression. Note how
the notation becomes a bit more complex. Don't let that scare you: I've kept
the color encoding to show you how each note was transformed into little note

groups (mostly adjacent notes) that add variation. In a piano roll editor in your
midi editor, this complexity would arguably be less apparent. You have innitely
many possibilities to spice up your choral. The more variation you can add, the
more interesting the end result can eventually sound. Example variations are:
rythmic variations or making some voices move up while others move down.
Here's a somewhat contrived example that has some characteristics that are
useful later in the tutorial.

Note that I deliberately didn't obey the classical

rules with respect to what harmonies are allowed. I have nothing against the
classical rules, but hey, this is the 21st century, right?

           



3

With the spiced up choral, you can proceed as in section 4.3 to convert this
spiced up choral to a canon. Here's the serialized melody:

 43

Note that the red notes go quite high. This is OK if you like that, but if you
prefer, at any point you can add/subtract an octave to any of the notes, e.g.
yielding the following sequence where I've put all red notes an octave down. In
general avoid too big jumps in melodies, since they can sound a bit awkward.
We'll come back to that in section 6.

 43

As before, creating the canon is now just a matter of letting the voice play
against itself, starting a new instance of the voice whenever the color changes
(i.e. whenever we return to the rst chord of the choral).

 43

 43  

 43  



 

     
   
 


    

I only show two repetitions here, but you can keep repeating each voice
as soon as it is nished, to let each motive play against the other motives in
the dierent staves (by dierent instruments).

Note that because we started

with a very short 3-chord choral (C-F-G, remember?) our canon still has quick
repetition of the motives. But listen to this result and hopefully realize that the
whole is more that the sum of its parts. Would you have imagined C-F-G to
sound like this without much eort from you? But wait, we're not done yet!

6 Better melodies
6.1 Basic technique
To create the melody used in our canon we rst took the upper notes, then the
middle notes and then the lower notes.

This can create unnatural melodies,

especially when we switch from the last chord back the next row of the rst
chord. Luckily it's really not needed to be so strict and rst take all the upper
notes, then all the middle notes then all the lower notes. I already hinted before
that it is possible to replace chords with chord inversions. This means that you
keep the same notes but you put them in dierent places on the sta, e.g.

 

  


becomes one of:

or whatever you can think of :) Here's a more sensible way of doing exactly
that while considering the creation of the melody. During the serialization of
the choral to a melody, we are free to choose those notes from each chord that
make our melody sound smoother, e.g. starting with the spiced up choral from
section 5, we could make the following melody instead:

 43

Note how the melody still features some awkward jumps. In general: any
jump bigger than four notes further on the sta can easily sound awkward/dis-

1 We can remedy those awkward jumps by transposing

turbing/out of context

the oending notes one octave up/down, e.g. yielding the following melody:

 43

So just like before we can now write the enhanced melodies in canon:

 43

 43  

 43  


3





1 Unless

you do it religiously throughout your piece :) In the classical rules such large jumps

in a melody line are totally forbidden. I don't want to teach the classical rules, therefore my
advice is to just trust your ears!


3


7



9

     



  

     

         
3

  


     

Listen to the result to appreciate how far we've come starting from our
original C-F-G progression. In the section 6.4 we will improve even further on
this canon to make it sound really smooth.

6.2 The nishing touch


Note that after serialization of the choral to a melody the rst beat of each
measure still stems from our original C chord, the second beat stems from the
F chord and the third beat stems from the G chord (as was explained in section
4.2). As a result, you can patch up the melody where it still sounds too awkward
by using a dierent note that would sound good in the original chord.
A striking example is the d in the third beat of the second measure of the
melody. Despite all the tricks we applied to make the melody smoother while
not removing too much variation, it still sounds awkward to my ear. The third
beat in each measure comes from the G-chord in our original choral, so I could
replace that d with e.g. a g. This will make the melody smoother and won't
break the harmonies.

Note that what we really do in that case is to modify

our original choral, to replace the d with a g. The resulting melody is much
smoother, and as a result the resulting canon is much more beautiful as well.
As a result, here is the nal version of the Canon:

 43

 43  



 43  





10


3


7



9









11

6.3 But I have this melody in my head that I want to turn


into a canon. How does your method help me?
Well, you can harmonize your melody rst: turn it into a choral then proceed
as before. If you don't know how to harmonize a melody, perhaps the easiest
way is to reuse existing music: get the chords from an internet site and write
the melody on top of them. Yes, you probably need some music theory for this.

6.4 Ideas for further experimentation


If you 've understood how to apply the technique and why it yields good sounding canons out of the box, you will now also understand that we've only tipped
our toes in the world of possibilities.

You can decide to start the second or the third voice after waiting double/triple/quadruple... the time we'd normally wait in the basic method.
You can choose dierent delays for each voice. As long as you start a voice
when the melody notes are derived from the rst chord in the choral you
are certain the end result will sound good by construction.

You can take your original choral, and make two or more spiced up versions
of it, then concatenate and mix up measures from the dierent spiced up
versions to create more variation between the voices.

By all means, start from longer chorals, use jazz progresssions, use phat
chords, do whatever your heart desires, and please drop me a note if you
created something using this method :D

7 Conclusion
We started from a dead simple C-F-G progression and we ended up with a cute
canon in C. You can hear the nalized canon on [4]. You should now be able
to amaze your friends by writing a canon :) By all means, keep experimenting
and trust your ears!
Feel free to contact me with questions and suggestions regarding this tutorial.

8 Appendix A: using lilypond to generate the


score and .midi les
Here's a lilypond[5] version of the nalized canon. Lilypond is like a programming language specialized in creation of musical scores.

I really like using

frescobaldi[1] as a lilypond editor, because it makes working with lilypond very


user friendly. The code shown here is based on a template included with the
frescobaldi editor (it comes with a handy exible wizzard to set up new scores).
In the listing below, I've removed the code to color the note heads and to draw
the slurs.

12

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

\ version "2.14.2"
\ header {
title = " Canon Tutorial "
composer = " Stefaan Himpe "
arranger = "24/ july /2012" }
\ paper {
#( set - paper - size " a4 ") }
global = { \ key c \ major
\ numericTimeSignature
\ time 3/4 }
fragment =
{ \ times 2/3 { g8 a g } f16 e d f g8 f e4 a ,8 b g4 c8 d c g b c }
fragmentTwo = { \ times 2/3 {g '8 a g} f16 e d f g8 f e4 a ,8 b g4 c8 d c g b c}
violin = \ relative c ' ' {
% Music follows here .
\ fragment
\ fragmentTwo
\ fragmentTwo
}
violinPart = \ new Staff \ with {
instrumentName = " Violin "
midiInstrument = " violin "
}
{
\ global \ violin r2 . r2 . \ bar "|."
}
violaPart = \ new Staff \ with {
instrumentName = " Viola "
midiInstrument = " viola "
}
{
\ clef alto \ global r2 . \ violin r2 .
}
celloPart = \ new Staff \ with {
instrumentName = " Cello "
midiInstrument = " cello "
}
{
\ clef bass \ global r2 . r2 . \ transpose c c , \ violin
}
\ score {
<<
\ violinPart
\ violaPart
\ celloPart
>>
\ layout { }
\ midi {
\ context {
\ Score
tempoWholesPerMinute = #( ly : make - moment 50 4)
}
}
}
You can understand it as follows:
The \score element near the bottom of the score (line 39) species the score.
The score is created by instantiating the \violinPart, the \violaPart and the
\celloPart stas simultaneously (indicated by the << >> angular brackets).
The score section also instructs the midi generator to make a midi le out of
the complete score, and to do so with a tempo of 50 beats for a quarter note.
The \violinPart, \violaPart and \celloPart are dened a bit higher in the
score: they are given an instrumentName (that will be displayed next to the
sta at the beginning of the rendered score) and a midiInstrument that will
be used by the midi generator.

If you look closely you will see that all of

13

the \violinPart, \violaPart and \celloPart have been dened in terms of the
same \violin denition, with a dierent number of rests before/after the \violin
denition to make the voices start at a dierent time. \violin itself is dened in
terms of \fragment and \fragmentTwo.
Why do we need two dierent versions of fragment? That was not mentioned
in the tutorial, was it?
internally works.

The reason is a small technicality of how lilypond

If you look closely, the only dierence between \fragment

and \fragmentTwo is the denition of the rst note (g8 in \fragment, g'8 in
\fragmentTwo). The ' sign denotes adding an octave to a note. This is needed
because by default, lilypond uses relative notation meaning that the next note
is drawn as closely as possible to the previously drawn note. E.g. if you have {
c g c }, it would draw the g that lies under the c (and not the one above the
c, which you may prefer in some contexts). If you want to have another g
instead, you'd need to add/subtract octaves. The problem with \fragment in
this canon is that if you instantiate it twice, the second instance will be drawn
an octave lower than the rst one due to this system of relative notation, so the
second and further instances need the extra octave jump at the beginning.

9 Appendix B: rendering to audio using LMMS


Lmms[7] stands for Linux MultiMedia Studio. Despite its name it also works
on windows systems (and apparently also on MAC using WineBottler). I used
lmms here because it can import midi, render that .midi to .wav using (if desired)
a mixture of soft synths and soundfonts.
Here's the workow I used in creation of the rendered canon:
1. Start LMMS
2. Use Project -> Import to import the .midi le generated by lilypond.
Each part is now displayed in its own track using the SF2 instrument. I
assigned the Violin, Viola and Cello patches of the uidR3 soundfont.
3. Project -> Export to export to .wav le (I used the default settings).

Links
References
[1] Wilbert Berendsen. Frescobaldi. URL

http://frescobaldi.org.

[2] Creative Commons Corporation. Attribution-sharealike 3.0 unported, 2012.


URL

http://creativecommons.org/licenses/by-sa/3.0/.

[3] Stefaan

Himpe.

Tutorial

on

my

technique

for

writing

canon,

http://a-touch-of-music.blogspot.be/2012/07/
tutorial-on-my-technique-for-writing.html.
2012.

URL

14

[4] Stefaan Himpe.

Canon tutorial, 2012.

stefaanhimpe/canon-tutorial.

URL

http://soundcloud.com/

[5] Han-Wen Nienhuys and Jan Nieuwenhuizen. Lilypond... music notation for
everyone. URL

http://lilypond.org.

[6] pianoworld.com.

piano_chords.htm.

fun/vpc/piano_chords.htm.

URL

http://www.pianoworld.com/

[7] LMMS Team. Linux multimedia studio. URL

net/.

15

http://lmms.sourceforge.

You might also like