Skip to main content

TeacherTool.org Manifesto

By creating the curriculum that we teach we choose the sort of society that we want.

This is true in three ways:

  1. In creating the content of a curriculum we are capturing our society's culture, values, knowledge and traditions so that they can be passed on to others.
  2. The means of sharing a curriculum reflects how our society engages with its citizens.
  3. The process by which we choose to define a curriculum is itself a reflection of our society's values.

TeacherTool.org is a means of collaborating in the creation and sharing of an open and evolving curriculum.

This is how it works:

  • The content and curriculum found on TeacherTool.org is created and edited entirely by its registered users.
  • Anyone can become a registered user. It is free and takes only two minutes. The only requirement is a valid email address. Registration is required so everyone can see who has contributed to TeacherTool.org. TeacherTool.org only uses email addresses to confirm user registration and to provide administrative information (such as password reminders).
  • Everybody (including non-registered users) is free to download and use the curriculum contained within TeacherTool.org.
  • All the content found within TeacherTool.org is made available under a creative commons licence.
  • TeacherTool.org's curriculum consists of units that contain lessons, assessments and resources.
    • Units encompass a particular aspect of the curriculum and contain a brief description with aims and objectives, the prerequisites for embarking on the unit and an indication of the target audience.
    • Lessons describe the various learning interactions / activities involved in the unit.
    • Assessments define how to measure students' progress against the unit's aims and objectives.
    • Resources are either multimedia (audio, video or images), electronic versions of printed material (such as PDF or Word documents) or links to a resource elsewhere on the Internet (such as software to download, an article on another website or even a link to a book on a site such as Amazon, music file on iTunes or video on YouTube).
  • Creating, editing and accessing the curriculum is done entirely through the TeacherTool.org website (www.teachertool.org).
  • So that users can find what they need, the curriculum is organised by its users with a simple yet powerful tagging system.
  • TeacherTool.org includes commenting, feedback, request-for-help and friends-list tools to engage individual users with the wider TeacherTool.org community.
  • Users can "clone" existing units and modify them to create a bespoke unit just for themselves.

The source code for TeacherTool.org is freely available under an open-source licence and includes instructions for modifying the code and running a collaborative curriculum planning site of your own.

All Change

On the 27th of October my current contract as a software consultant comes to an end. I will then take a holiday from working for other people and spend the next four or five weeks working for myself.

This is what I am going to do with my time (in no particular order):

The World's Easiest Candidate Management System

For the past twelve months I have been contracted to produce bespoke vacancy / applicant management systems and job-site portals. My impression of this market is that the products on offer are overly complex, difficult to use, expensive and cumbersome.

As a result I'm going to develop a web-based candidate management system that is:

  • Simple and elegant in form and function
  • Easy to use and learn
  • Cheap
  • Agile and adaptable to user's requirements

I intend to write such a system by concentrating on only the essential features required in the process of filling a job vacancy and presenting these features as simply and elegantly as possible.

In order to save time and effort, this project will share a lot of code with:

TeacherTool.org

The concept of TeacherTool.org has evolved from a "Learning Management System" (LMS) with wiki-like features into a collaboration tool for the creation and distribution of an open and evolving curriculum.

TeacherTool.org will be released under a free-software licence with the aim of fostering a community of developers as well as users.

Program# v2.0 and ProgramR Chatterbots

My original Program# AIML chatterbot is definitely long in the tooth. The fact that it was my first project in C# also means that it does not make full use of the features available to a developer in the .NET and MONO platforms.

ProgramR is another AIML based chatterbot but written in the Ruby programming language. Ruby is wonderfully powerful and I am very excited about using it in this project.

I aim to provide updates of both versions of these AIML bots. I'll then use them as the foundations for my own "modifications" to the basic AIML standard.

A Web-Based Expert System

I've already written an expert system in a previous role as Artitificial Intelligence developer. It was built to meet a very specific need in an even more specific way and made use of custom "in-house" tools for doing so.

On reflection this was a bad thing to do: the expert system could have been a generic and standards-based product show-cased within the company's other products and delivered as a subscription service to customers. This lack of vision (on my own and my then employer's part) means that I now have the opportunity to start again and learn from these mistakes.

The expert system I am about to write is a complete re-design and re-implementation in .NET 2.0 with a SQL2005 backend. It will be the expert-system as it should have been. Delivered through a simple web-service based API and a web-based interface (with perhaps even a multi-platform smart-client). I aim to make it a classic example of software as a service.

Learn Lisp

Something I've always wanted to do but never had the time or opportunity.

I want to experiment with musical composition software. This seems like an ideal opportunity to add this fascinating language to my box of tricks as it strikes me that Lisp is a language well suited to solving the problems encountered in algorithmic music composition.

Read / Watch the Following

Write the Following

  • A new version of my CV.
  • An update to the my Guide to Species Counterpoint.
  • A single article providing more details for each item described in this article.
  • Snippets on various subjects ranging from algorithmic music composition to a modern setting for Gesamtkunstwerk (I'll leave you to look that term up).

Find Out More About the Following

Continue to…

  • Be a husband and father.
  • Play music to a high level (get the Vaughan-Williams tuba concerto re-learned for a performance next year, get the finer points of the dijeridu under my belt, learn some more Bach on the piano and go to orchestra every week).
  • Train at Karate (with the aim of getting 4th Kyu in December).
  • Jog regularly. (Try and do at least 2 miles a day.)
  • Cook and consume freshly prepared vegetarian food.

I realise that I won't be able to do all these activities in the time span I've allowed so my next task is to prioritise this list and plan exactly what I'm going to do. I'll save that job for another post – although all the "Continue to…" items will definitely be in there.

Program# - An AIML Chatterbot in C#

Nota Bene: This project is now obselete because there is a new version of Program#

This is a .NET implementation of the ALICE chatterbot using the AIML specification. Put simply, this software will allow you to chat (by entering text) with your computer using natural language.

Program# is a complete re-write of an earlier C# AIML implementation called AIMLBot. It is available under the Gnu GPL. This means that you are free to download, modify and share it. Links to download Program# can be found at the bottom of the page.

Acknowledgments

First, thanks to Dr.Richard S.Wallace the inventor of AIML.

Thanks also to the many free software developers who have already implemented an AIML bot. The liberty to study how it was done is much appreciated.

Project description

The AIML specification was used as the vade mecum for this project. Read it to understand how this project and AIML works. For a less formal introduction, read on…

"AIML: Artificial Intelligence Markup Language

AIML (Artificial Intelligence Markup Language) is an XML-compliant language that's easy to learn, and makes it possible for you to begin customizing an Alicebot or creating one from scratch within minutes.

The most important units of AIML are:

  • <aiml> : the tag that begins and ends an AIML document
  • <category> : the tag that marks a "unit of knowledge" in an Alicebot's knowledge base
  • <pattern> : used to contain a simple pattern that matches what a user may say or type to an Alicebot
  • <template> : contains the response to a user input

There are also 20 or so additional more tags often found in AIML files, and it's possible to create your own so-called "custom predicates". Right now, a beginner's guide to AIML can be found in the AIML Primer.

The free A.L.I.C.E. AIML includes a knowledge base of approximately 41,000 categories. Here's an example of one of them:

<category>
    <pattern>WHAT ARE YOU</pattern>
        <template>
            <think><set name="topic">Me</set></think>
            I am the latest result in artificial intelligence,
            which can reproduce the capabilities of the human brain
            with greater speed and accuracy.
    </template>
</category>

(The opening and closing <aiml> tags are not shown here, because this is an excerpt from the middle of a document.)

Everything between <category> and </category> is—you guessed it—a category. A category can have one pattern and one template. (It can also contain a <that> tag, but we won't get into that here.)

The pattern shown will match only the exact phrase "what are you" (capitalization is ignored).

But it's possible that this category may be invoked by another category, using the <srai> tag (not shown) and the principle of reductionism.

In any case, if this category is called, it will produce the response "I am the latest result in artificial intelligence…" shown above. In addition, it will do something else interesting. Using the <think> tag, which causes Alicebot to perform whatever it contains but hide the result from the user, the Alicebot engine will set the "topic" in its memory to "Me". This allows any categories elsewhere with an explicit "topic" value of "ME" to match better than categories with the same patterns that are not given an explicit topic. This illustrates one mechanism whereby a botmaster can exercise precise control over a conversational flow."

The above text is Copyright© A.L.I.C.E. AI Foundation, Inc.

http://www.alicebot.org

Minimum requirements

Written and tested on .NET runtime v1.1

Also tested on Mono (http://www.mono-project.com/Main_Page)

The directory structure of the Program# project follows the standard Visual Studio 2003 template.

When the cBot class is instantiated for the first time from within another program it searches for two directories in the application's root directory:

  • aiml – where you put the aiml files
  • bots – where you put the DEFAULT.bot (predicate) file (and in future versions any other bot settings files)

If these directories are not found the bot will attempt to create them and populate them with a default predicate file and a copy of the Salutations.aiml file (so your bot can at least say hello!).

Usage instructions

To use in your own projects add the DLL as a reference. All the classes are found under the AIMLBot namespace.

Instantiate the cBot class thus:

cBot myBot = new cBot(false);

or

cBot myBot = new cBot(PathToAIMLFiles,false);

The boolean value designates if debug mode is on. Setting this to true will output lots of useful information to the console.

The time the cBot class takes to initialize, like all the other AIML implementations, depends upon the number of nodes to be read and mapped into the cGraphmaster object. This can vary from a few seconds to minutes. This is an area where the code can definitely be made more efficient.

To chat to the bot simply call the "chat" method thus:

cResponse reply = myBot.chat(InputString,"UserID");

InputString is obviously the input from the user and "UserID" can be changed to uniquely identify them. The cResponse encapsulates all sorts of useful information about how the "InputString" was processed.

To get the actual reply simply call the "getOutput" method:

Console.WriteLine(reply.getOutput());

And thats about it!

Download

Two downloads are provided:

  • AIMLBot.zip (978kb) – Containing the documentation, project files, source code and some zipped up default aiml files for the AIMLBot dll.
  • AIMLGui.zip (656kb) – The source-code for a .NET windows application using Program# to provide a simple chatterbot.

Notice of GPL / copyleft

Program# – An implementation of the AIML specification found at http://www.alicebot.org/

Copyright© 2006 Nicholas H.Tollervey

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place – Suite 330, Boston, MA 02111-1307, USA.

Computational Creativity

Abstract

I am fascinated by creativity and artificial intelligence.

This article, based upon an unpublished academic paper, is a very short summary of work completed as part of my MSc dissertation.

An exploratory model of creativity is demonstrated by implementing a genetic algorithm that attempts a type of musical creativity called species counterpoint (see my guide to species counterpoint).

Initial results are of comparable quality to counterpoint composed by humans. I conclude by describing areas and techniques for further development.

A Model of Creativity

One of the ways in which Margaret Boden characterizes creativity is by making a distinction between exploratory and transformational creativity. Exploratory creativity is explained as a search for new points in a conceptual space whereas transformational creativity is a change to the conceptual space itself.

Responding to the criticism that Boden's model of creativity is vague, Geraint Wiggins has attempted to make it clearer and more precise. He formalises Boden's ideas and provides an example of how they might be applied (Wiggins, 2001). This is achieved by introducing the following elements:

  • U – The universe of possibilities. The set of all possible concepts (for a given domain).
  • L – A language to express rules and constraints.
  • R – A set of rules in L that constrain the search space.
  • T – A set of rules in L that define traversal of the search space.
  • [[.]] – An interpretation function for selecting concepts from U according to rules such as those defined in R.
  • <<.>> – A search function for traversing a search space according to rules such as those defined in T.
  • E – A set of rules in L that evaluate the quality of points within the search space.

Wiggins uses these elements to define conceptual spaces ( C ) – subsets of U that contain concepts considered in particular forms of creativity – in the following way:

C = [[R]](U)

The means by which the conceptual space C is to be explored is defined thus:

ci+1=<< R∪T >>(ci)

Exploratory creativity can therefore be characterized as an exploration of the search space C, using the search rules defined in T to find new points in C (ci) that are evaluated by the rules defined in E. Thus, an exploratory system can be described by the following sextuple:

< U, L, [[.]], <<.>>, R, T, E >

Wiggins then demonstrates that transformational creativity is merely exploratory creativity at a meta-level:

As transformational creativity is the search for new R or T or both and both R and T are expressed in L, then L becomes the space of all possible concepts. Consequently, a new language LL is required to construct new sequences in L. In addition, RL, a set of constraints in LL that define the search space of R's and T's is needed as is TL, a set of rules in LL for moving around that space. Furthermore, corresponding interpreters for selection and searching are needed (although if one uses a common general specification language for the rule-sets then it is possible to use the same interpreters at different meta-levels). Finally, EL, a set of rules in LL is used to assess the quality of the R's and T's. As a result, transformational creativity can be described by a sextuple that matches the characterization of exploratory creativity:

< L, LL, [[.]], <<.>>, RL, TL, EL >

Implementation

Ultimately the aim of both Boden and Wiggins is for an AI to simulate creativity. As a result, a move from the abstract realm of the model described above into a concrete implementation can be demonstrated by using a genetic algorithm to compose species counterpoint based upon exploratory creativity:

Genetic Algorithms

Genetic algorithms (GA) encode candidate solutions to a problem and optimize them through the process of evolution.

Candidate solutions are represented by a string of data called a chromosome. Chromosomes are subdivided into blocks called genes that encode specific elements or traits within the candidate solution. The different settings that a gene may possess are called alleles, and their location in the chromosome is called the locus. The state of the alleles in a particular chromosome is called the genotype. It is the genotype that provides information about the state of the actual candidate solution. The candidate solution itself is called a genome.

The GA attempts to find an individual genome with the best genetic material within a search space. This is achieved by testing the genome against a fitness function that evaluates the quality of each individual. The part of the search space being examined during an iteration of the GA is called the population.

The primary means by which populations transform between iterations of the GA is through the use of three operators: selection, crossover and mutation. These fulfill different roles in the GA:

  • Selection chooses genomes in the current population for processing by the other two operators. The fitter the genome, the more likely it is to be selected. Fitness is a value given by the fitness function for each genome.
  • Crossover is used to increase the average quality of the population through the mixing of genetically encoded information.
  • Mutation is used to explore new states. It also avoids closing in on a locally occurring optimum solution by introducing random changes in the genetically encoded information between generations.

Of further consideration is the stopping condition for the GA. These tend to be one of the following three types:

  • Iterating the GA through a predefined number of generations.
  • Taking into account the uniformity of the population (i.e. the population has converged on a solution within the search space).
  • Defining the criteria for a winner and iterating indefinitely until such an individual is found.

A description of the life cycle of a GA can be summarized thus:

  1. Start with a randomly generated population.
  2. Iterate through various populations (using the three operators previously described).
  3. Repeat step 2 until the stopping condition is met.

Species Counterpoint

Species counterpoint was devised by J.J.Fux as a means of teaching good compositional technique. Based upon the stylistic conventions of the great Italian composer Palestrina, it has been successfully used as a pedagogical technique for over 300 years. Students of species counterpoint have included Mozart, Beethoven, and Brahms. Species counterpoint is still taught in music conservatoires to this day.

It consists of a set of strict rules of increasing complexity concerning the valid pitch and duration relationships between notes found in contrasting melodic parts. Rules are introduced over five separate species with fifth species producing music almost as complex as free counterpoint.

The counterpoint is initially of two parts, one of which, the cantus firmus (Latin: fixed line) is a melody consisting of mainly step-wise movement using notes of semi-breve duration. It is provided for the student as a stimulus over which they set their melody using the rules of a particular species.

Thus, a species problem is set and the student practices and improves their compositional technique by providing a solution. The intention is that the rules defined in each species promote and encourage good compositional practises whilst being flexible enough to give the student a chance to be original (and thus creative).

After completing all five species in two part counterpoint the student then starts again but with three and then four part counterpoint (one part always being the cantus firmus).

Mapping Elements

For a GA to compose species counterpoint as exploratory creativity, elements from Wiggins's formal definition must be mapped onto the elements described above. This can be achieved in the following way:

  • U: All possible pitch and duration combinations.
  • L: A simple language related to Western music notation that is capable of representing both pitch and duration.
  • [[.]]A means of selecting valid pitch / duration combinations from U according to constraints specified in L (a means of creating the initial population)
  • <<.>> A means of traversing U according to constraints specified in L (the selection, crossover and mutation functions).
  • R: The rules of a particular species of counterpoint as expressed in L.
  • T: The rules expressed with L that constrain the selection and crossover operators.
  • E: The rules and heuristics defined in L that evaluate the potential solutions (the GA's fitness function).

L solves the problem of representing pitch and duration in such a way that musical information can be encoded and processed by the genetic algorithm:

Pitch is a measure of magnitude in that notes are higher or lower than each other. If one limits L to using just diatonic notes (i.e. those within a particular key) then numeric values can be used as an alphabet to represent pitches (pitch name at the top, numeric value underneath):

The tonic note (note of the key) is always denoted by the numeric value 5. This allows notes to be represented as both above and below the tonic. In the above example the key is the Dorian mode with the tonic being D. Thus, a melody starting with the pitches D, F, E, D, G and F would be represented with the numeric values 5, 7, 6, 5, 8 and 7.

With regard to the representation of duration in the first four species of counterpoint, given the number of notes in the cantus firmus, it is possible to work out the number of notes and their durations from the requirements of the species being used. For example, first species counterpoint only uses semi-breves whereas third species only uses crotchets. As a result, the representation (genome) merely records the order and value of the various pitches that make up the output since duration is defined by the species.

In the case of fifth species counterpoint, given the number of notes in the cantus firmus and by using the smallest possible note duration as a unit of measurement (crotchet), one is able determine the maximum number of possible notes in the output counterpoint. Furthermore, through the use of special pitch values (17-20) one is able to extend the small duration values into longer ones (synonymous with the tie in Western musical theory) and denote special, strictly defined decorative quaver-figures.

Thus, L consists of an alphabet of numeric values that can be ordered in such a way to represent pitch, certain decorative figures and duration. As a result each genome consists of alleles containing values from the alphabet of L.

With regard to the execution of the GA, upon creating the initial population each genome is populated with randomly generated but valid values for a given species of counterpoint. As a result the initial population can be thought of as a subset of the conceptual space defined by [[R]](U).

The means by which the GA traverses the search space (selection, crossover and mutation) works by evaluating each genome (with E – the fitness function) and choosing genomes for crossover and mutation with a roulette-wheel selection algorithm. A single point crossover is implemented in order to preserve the order of the values within genomes so the order and duration information in L is preserved. These constraints are synonymous with T. The mutation operator is constrained by R so alleles can only be mutated to valid values in L. As a result the GA's traversal mechanism can be expressed in the same way as Wiggins's means of exploring a conceptual space:

ci+1=<< R∪T >>(ci)

where c is synonymous with an individual population of genomes.

E (the fitness function) checks each genome against rules for the specified species. It sums together weighted scores given for meeting (or failing) different rules. The weights can be adjusted to change how the fitness function performs.

Finally, two stopping criteria are used. Because of the relative simplicity of first and fourth species counterpoint it is possible to tell if a solution is completely correct. When this occurs the GA stops. Second, third and fifth species counterpoint is much harder to evaluate in this way so the GA stops when one of two situations arises: the population has converged on a solution or a pre-set number of generations have passed.

Results

The GA described above is able to respond to any valid cantus firmus. However, the following results make use of a single cantus firmus in the Dorian mode. This is so a variety of computer generated results can be compared with counterpoint by Fux and Mozart. When interpreting these results in terms of Wiggins's model of creativity, E is the reader's response to counterpoint created by the GA when compared to that composed by humans. L is, of course, Western musical notation.

First Species Counterpoint

The GA consistently produces first species counterpoint that is indistinguishable from that generated by humans. However, this is probably due to the limiting nature of the rules of first species counterpoint.


Computer Generated First Species Counterpoint – Listen to this extract [midi]


First species counterpoint composed by J.J.Fux – Listen to this extract [midi]

Second Species Counterpoint

Second species counterpoint is far more complex:


Computer Generated Second Species Counterpoint – Listen to this extract [midi]


Second species counterpoint composed by W.A.Mozart – Listen to this extract [midi]

When comparing these extracts, what is remarkable is their similarity. The opening two bars are swapped and bars 7 and 8 are exactly the same. Another interesting feature is the forbidden (but pleasing) use of a suspension between the third and second-to-last bars in the computer generated counterpoint. The GA has somehow stumbled upon this compositional mistake (the rules in R or T were obviously not constraining enough).

Third Species Counterpoint

Third species counterpoint also produces striking similarities between human and computer generated results:


Computer Generated Third Species Counterpoint – Listen to this extract [midi]


Third species counterpoint composed by J.J.Fux – Listen to this extract [midi]

Notice how both results start in the same way and continue to use scalic movement. Nevertheless, there are problems with the computer generated counterpoint: forbidden parallel octaves exist between bars 3 and 4 and there is a highly discouraged octave to fifth movement between bars 6 and 7. This demonstrates that the weighting for rewarding scalic movement is set too high in comparison to that for punishing parallel fifths and octaves.

Fourth Species Counterpoint


Computer generated fourth species counterpoint – Listen to this extract [midi]

Fourth species results tend to be very similar as the rules concerning the predominance of suspension figures in the music dictate a very limited range of solutions. This is demonstrated by the above example where the genetic algorithm produced a solution that was (except for the first note) exactly the same as that produced by Fux.

Fifth Species Counterpoint


Computer generated fifth species counterpoint – Listen to this extract [midi]


Fifth species counterpoint composed by J.J.Fux – Listen to this extract [midi]

Fifth species counterpoint produces results that are more contrasting. Whilst the computer generated counterpoint is correct it makes heavy use of 7/6 suspensions and quaver neighbour note figures. In comparison Fux's is better counterpoint due to greater melodic variety. This suggests the fitness function's weightings require optimization. Yet encouraging similarities exist between the results such as the final five bars and bars 3 and 4.

Conclusion and Further Work

These promising initial results show that the exploratory model of creativity, as implemented by a genetic algorithm, is capable of producing contrapuntal output of a similar quality to human experts.

However, they cannot hide the following facts:

  • Species counterpoint is both constraining and of little artistic value due to its pedagogical roots.
  • One would expect a computer to perform well when compared to humans in such constrained conditions.
  • The GA is not always consistent in the quality of its results and sometimes produces output containing obvious mistakes no human would make (such as the parallel octaves described earlier).

Future work will address such issues in the following ways:

  • Applying exploratory creativity to creative domains that are less constraining and more artistically valued than species counterpoint. (Musical domains might include free counterpoint or 20th century serial composition).
  • Attempting computational creativity within a domain that a computer would find hard to process.
  • Exploring and evaluating different evolutionary algorithms as well as other AI techniques for implementing exploratory creativity.
  • Devising and applying alternative models of creativity should the exploratory model prove to be inadequate.

Species Counterpoint

"Josephus – I come to you, venerable master, in order to be introduced to the rules and principles of music.
Aloysius – You want, then, to learn the art of composition?
Josephus – Yes.
Aloysius – But are you not aware that this study is like an immense ocean, not to be exhausted even in the lifetime of a Nestor?"
Johann Joseph Fux (1660-1741), Gradus ad Parnassum (1725)

Counterpoint is a term derived from the Latin punctus contra punctum (note against note). It is a piece of music combining two or more contrasting melodies; each of which is an individual melody when played on its own. Pleasing results are achieved when the constituent contrapuntal melodies fit together and complement each other. The integral complexities associated with counterpoint make it, perhaps, the most complicated compositional technique to learn. Yet if it is to sound good and go beyond mere technique, composing counterpoint requires great skill and aesthetic insight.

Nevertheless, the composing of counterpoint is not based on fortuitous chance melodic combinations, nor is its practise restricted to only those possessing musical genius. Rather, it is the result of applying specific rules and guidelines. In other words, it is a skill that can be learned. The most famous means of teaching counterpoint is that developed by Johann Joseph Fux and explained in his dialogue ‘Gradus ad Parnassum' (Latin for "Steps to Parnassus").

In Greek mythology Parnassus was the mountain dwelling of the gods. A composer, having climbed Parnassus, would, according to the metaphor, have achieved a perfect compositional technique. This is achieved by learning species counterpoint.

Species counterpoint is based upon the stylistic conventions of the great Italian composer Palestrina. It has been successfully used as a pedagogical technique for over 300 years. It provides a set of strict rules of increasing complexity concerning the "valid" pitch and duration relationships between the notes found in contrasting melodic parts. The rules are introduced over five separate species of counterpoint. The counterpoint is initially of two parts, one of which, the Cantus firmus (Latin for fixed line; a melody consisting of mainly step-wise movement using notes of a semi-breve duration), is provided for the student. It is over the cantus firmus that the student sets their part using the rules of whatever species of counterpoint has been requested. Thus, a species counterpoint problem is set and the student improves their compositional technique by providing a solution. The intention is that the rules defined by the species counterpoint promote and encourage good compositional practices.

Before describing each of the five species some basic musical theory must be introduced:

Musicians call the differences in pitch between notes an interval. The interval is expressed numerically in terms of the number of notes between the two notes inclusive of the outer notes.

For example, the interval between two notes adjacent in pitch (‘C' and ‘D' for example) is a second (i.e. there are two notes; the lower and the upper). However, the interval between ‘C' and ‘F' is a fourth (as there are four notes between ‘C' and ‘F': C, D, E and F).

The illustration below shows the intervals used in species counterpoint within one octave (any larger intervals can be described as an octave and an xth for example).

It is important to notice that intervals are subdivided into two sets: consonances (that sound ‘nice') and dissonances (that don't). Consonances are further subdivided: the unison, fifth, and octave are called ‘perfect' consonances whereas the sixth and the third are ‘imperfect'.

In addition to the vertical (pitch) differences expressed as intervals, musicians also describe the horizontal movement of and relationship between notes. These can be summarised as follows:

Parallel motion is when two or more parts ascend or descend in pitch by the same distance in the same direction by skip or by step. Below is an example:

The above example is a very specific form of similar (or direct) motion. This is when parts ascend or descend in pitch in the same direction by skip or by step but may include a movement of different distances in each part. The illustration below makes this distinction explicit:

Contrary motion is when parts move by skip or by step in opposite directions to each other. This is demonstrated below:

Oblique motion is when one part moves by skip or by step while the other remains stationary thus:

We are finally in a position to be able to describe and give examples of each species of counterpoint. It must be noted that the rules and conventions that follow have been extracted from two types of source:

  • Explicit definitions of species counterpoint rules; where the rule in question is given in a treatise such as Fux's Gradus ad Parnassum or another source on musical theory.
  • Implicit conventions or heuristic practices; where the rule in question is derived from a common practice or convention that is often viewed as ‘obvious' within western musical conventions yet is not so obvious to those with little or no musical training (or a computer).

Finally, unless stated otherwise, the rules are compound. For example, the rules for the first species of counterpoint hold over, with certain modifications, into subsequent species.

Generic Features

Species counterpoint rules mainly concern melodic motion and the intervals between the voices. (A voice is a line of music intended for a singer[s] or instrument[s]).

With regard to the combination of intervals and the motion of parts almost any succession of intervals is allowed if the motion between the voices is contrary or oblique, but for similar and parallel motion there are basically two explicit restrictions:

  • Parallel motion is only allowed in parts that are separated by imperfect consonances (thirds and sixths).
  • Voices must not move in similar motion in parts that lead to either perfect fifths, octaves or unisons.

Further rules (both implicit and explicit) that are concerned with ensuring an interesting yet conventionally sounding result include:

  • The range (distance between the lowest and highest possible notes) of a voice should not be more than an interval of a tenth (in keeping with a comfortable range for the human voice).
  • Stepwise motion should predominate (to encourage a smooth melodic line).
  • In all but third species counterpoint, avoid more than five consecutive notes in the same direction (to make sure the melody has an undulating, and thus interesting, shape). In third species counterpoint avoid more than nine consecutive notes in the same direction.
  • Avoid simultaneous leaps (i.e. if one voice leaps the other should move stepwise).
  • A leap greater than a third should be followed by either a move back to the originating note (only possible if the leap is a fourth) or a leap in the opposite direction that does not exceed the original leap (only possible if the leap is a fifth with the subsequent leap usually being a fourth) or a step in the opposite direction (by far the most predominant solution).
  • Do not cross voices (i.e. do not let the upper voice's notes stray below the lower voices and vice versa).
  • Avoid repetitions of notes (to ensure variety in the melodic line).
  • Begin and end on the same note as the cantus firmus (although counterpoints above the cantus firmus may begin with an interval of a fifth).
  • Approach the final note by step in contrary motion to the cantus firmus.
  • Approach the penultimate note by step or small leap(i.e. no larger than the interval of a third).

It should be noted that when writing out species counterpoint it is common practice to write a number denoting the size of the interval between the notes in the separate lines of music. Thus, ‘5' means an interval of a fifth, ‘3' a third and ‘8' an octave. In addition to making the relationship between the melodic lines explicit it also forces the person writing the species counterpoint to think about the various rules relating to musical intervals.

First Species

First species counterpoint can best be described as note for note counterpoint. In other words, for every note in the cantus firmus the first species provides a note to compliment it. As a result the first species of counterpoint provides the same number of semibreves as the cantus firmus.

The rules for this species can be summarised thus:

  • Use only consonances.
  • Unisons can only occur at either the beginning or end of the piece.
  • The only leaps allowed are thirds, perfect fourths and fifths and an ascending minor sixth, but step movement is preferred.
  • Use no more than three intervals of a parallel third, sixth (or tenth) in direct succession (to encourage differentiation in musical texture).

Second species

The second species of counterpoint adds two important features to the writing of a melody:

  • The introduction of oblique motion where one has to provide two notes in the counterpoint for each note in the cantus firmus. Thus two minims are provided in the counterpoint for every semibreve in the cantus firmus.
  • The use of dissonant notes (intervals of a second, fourth or seventh) is allowed in certain circumstances.

The rules for second species counterpoint can be summarised thus:

  • The use of dissonant notes is allowed on the second minim of a bar only when connecting two notes by a solely stepwise motion.
  • The use of parallel perfect consonances (intervals of a fifth and octave) on the first minim of consecutive bars is not allowed (as this gives the impression of parallel motion between perfect consonances which is not allowed in the rules defined previously).
  • A stepwise connection between two instances of the same (consonant) note may be used if and only if the middle note is also a consonance, this is often called a neighbour-note figure.
  • The counterpoint may start with a single minim's rest.
  • The final note is always the same length and name as that used in the cantus firmus.

Third Species

In third species counterpoint the oblique motion is subdivided into four notes in the counterpoint against one note in the cantus firmus. The rules for this species are very similar to the second species but include some modifications to incorporate the new rhythmic texture.

  • The counterpoint can start with a crotchet rest.
  • The final note of the counterpoint conforms to the practice defined in second species counterpoint.
  • The first note of every bar should be a consonance.
  • Notes on the second, third and fourth beats can also be consonant or unison.
  • Dissonances can occur on the second, third and fourth beats only when part of a stepwise movement between consonances.
  • Dissonances cannot be adjacent to each other (implied by the above rule).

There are only two exceptions to the above rules concerning the placement of dissonances.

  • The so-called double-neighbour rule that consists of a four note figure starting on the first beat that begins and ends on the same note with the second note a step above the original and the third note a step below the original. This will sometimes lead to a (legal) leap from a dissonance.
  • Nota cambiata (translated as exchanged note) is a five note figure acting as an embellishment to the melodic contour from beat one (or three) to the next beat one (or three) inclusive. The contour of a nota cambiata is a step down, a leap down a third followed by two upward steps. The first, third and fifth notes must be consonances but the second and fourth can be dissonant. There are only two possible starting intervals for counterpoint written above or below the cantus firmus. An upper counterpoint's nota cambiata can begin on either an interval of an octave or a sixth whereas a lower counterpoint's nota cambiata can begin on either an interval of a fifth or a third.

Both the above exceptions to the rule may be inverted in pitch (turned upside down). However, this is rarely used and also causes the starting intervals that can be used to be inverted from the upper to lower (and vice versa) practice. (An inverted nota cambiata in an upper counterpoint can only start on an interval of a fifth or a third whereas in a lower counterpoint the starting intervals can only be an octave or a sixth.)

Fourth species

Fourth species counterpoint introduces the concept of a suspension. This is when a consonance in the counterpoint is held over as the cantus firmus changes note so that it becomes a dissonance. Furthermore, it is essential that the now dissonant note ‘resolves' in a downwards direction onto an adjacent consonant note. Thus, a suspension can be thought of in three parts:

  • A preparation that must be a consonance.
  • The suspension itself that is a dissonance.
  • A resolution down to an adjacent consonance.

As a result, the fourth species introduces the possibility of a dissonance at the start of a bar.

When writing fourth species counterpoint one changes pitch in the second half of the bar with a minim note (the preparation) that is tied over to another minim of the same pitch (the suspension) before moving to a new pitch that acts as both the resolution for the current suspension and preparation for the next.

Strictly speaking a suspension includes a resolving dissonance. However, one need not tie notes together to cause a dissonance and thus form a suspension. It is quite possible to leave out a suspension and tie notes of the same pitch that form consonances with the two different notes in the cantus firmus. In other words, step two of the suspension is changed into a consonance.

Fourth species counterpoint can be summarised with the following rules:

  • The counterpoint starts with a minim rest. The first heard note follows normal conventions.
  • The final note conforms to the practice defined in second species counterpoint.
  • Use tied notes (as described above) as much as possible. If this is not possible one should revert to second species counterpoint for as short a period as possible.
  • The only dissonances allowed as suspensions are the movement of an interval of a seventh down to a sixth or the movement of a fourth down to a third. Sometimes a movement of a ninth to an octave is used (infrequently).
  • If the note that is tied over is a consonance (i.e. there is no suspension) then the note need not resolve down. As a result, movement in any direction by step or leap is allowed so long as it moves to a consonance and follows the generic species counterpoint rules concerning movement.
  • The penultimate bar must include a move from a seventh down to a sixth type suspension.
  • Include as many suspensions as possible but do not allow more than three of the same type in succession (to avoid repetitiveness and an endlessly downward moving counterpoint).
  • Use leaps of an octave if the two parts are getting close to each other.
  • Use leaps after consonances to add interest to the the counterpoint.

Fifth species

Fifth species counterpoint is a combination of the other four types with a few new decorative techniques introduced. As J.J.Fux stated in Gradus ad Parnassum, "As a garden is full of flowers so this species of counterpoint should be full of excellences of all kinds…" (Fux ed. Mann, 1943, p.64). In other words, a liberal mixture of all the previous species will produce the best results.

The most obvious new technique is the use of quavers as decoration to the counterpoint. Nevertheless, as in all things to do with species counterpoint, their use is specific and very clearly defined.

Fifth species counterpoint can be summarised as follows:

  • The opening note of fifth species counterpoint should use the same conventions as the fourth species starting note.
  • The penultimate and final bars should also use the same conventions as the fourth species.
  • Quavers (always used in pairs) are only allowed on the ‘weak' second and fourth beats.
  • They can only be used in two possible ways:
    • As a neighbour-note figure (a stepwise connection between two instances of the same (consonant) note may be used if and only if the middle note is also a consonance).
    • As passing notes that connect two consonant notes an interval of a fourth apart (rarely used).
  • All quaver notes should be entered into and left by step.
  • Only use quaver figures once in a bar.
  • Do not over use quaver figures. Do not use them more than once every three bars.
  • Suspensions that make use of a movement from a seventh to a sixth sound especially good if the suspension is decorated with a neighbour-note quaver figure.
  • Further embellishments to fourth species suspensions come from its combination with elements of the third species:
    • The resolution can be anticipated by a crotchets worth duration. In other words, whereas before a suspension consisted of two minims of the same pitch tied together, this is replaced with a minim tied to a crotchet of the same pitch on the first beat followed by the resolution on the second beat.
    • Make use of an &eactue;chappée (escape) note. This is where the minim preparation note is tied to a crotchet suspension that is followed by a crotchet note a step directly above the suspension note followed by the appropriate resolution note.
    • Finally, the crotchet suspension note can be temporarily abandoned with a descending consonant leap to a crotchet consonant note before leaping back up to the expected consonant resolution note.

The above three rules are demonstrated in the following illustration:

  • As in the fourth species the preparation of a suspension always starts on the third beat of a bar and ties over to the first beat of the next bar.
  • Do not make use of semibreves in any part of the counterpoint except the last bar. To do so would cause the counterpoint to sound empty and dilatory.
  • The use of minims starting on the second or fourth beats of a bar (as tied crotchets) is not allowed.
  • The rhythm of two crotchets and a minim in one bar is not good unless it is preceded by a bar ending with two crotchets.

Concluding Remarks on Counterpoint

By digesting the information on this page it is hoped that the reader will have reached their own Parnassus of understanding concerning the five species of counterpoint. Nevertheless, it should be pointed out that the only way in which one can truly claim understanding is if a successful completion of practical species counterpoint problems can be demonstrated.

This can only come with practise and a process of evolving one's technique so that a solution is derived from a creative and intuitive process as opposed to a clumsy adherence to a set of rules.