FourVoices: an automatic music generator for four-part writing.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Table of Contents

  1. About
  2. GitHub
  3. Prerequisites
  4. How to Run
  5. Contact
  6. History
  7. Acknowledgements

1. About

FourVoices is an automatic music generator for four-part writing (Soprano, alto, tenor, bass).

For a description of the capabilities of FourVoices, including instructions on how to use it, please read the FourVoices Wiki.

This software is particularly useful for music theory students, eg for four-part writing homework assignments.


  • Automatic generation of correct four-part harmonizations
  • Specify lines for each singer, eg provide the soprano line, and have the FourVoices fill in the rest of the voices.
  • Chord modifiers: major/minor, seventh chords, diminished.
  • User interface, as well as a command-line interface
  • Audio playback
  • Export vocal parts to PDF (Coming soon...)

FourVoices is an open source project: GNU GPL (ver3) license.

2. GitHub

FourVoices is on GitHub:

3. Prerequisites

Tested on Windows 7, Ubuntu (12.04).

  • Minimums:

  • Optional:

    • Mingus
      • Used for MIDI playback: Mingus
    • FluidSynth

4. How to Run

If you're in Windows, double-click the file.

If you're in Unix, simply do:


There is also a command-line interface (CLI) available in the core/ subdirectory:

cd core/
python PROBLEM

PROBLEM is the path to a harmonic problem - see core/tests/TEMPLATE for an explanation on the file format. Additionally, core/tests/ contains example harmonic problems.

5. Contact

You can reach erickim555 either by messaging me via GitHub:

Or by e-mailing me at:

6. History

FourVoices was originally written by Eric Kim in Winter 2009 while he was an undergraduate at the University of California, Berkeley. An avid musician and composer, Eric was inspired to merge his love for music with his passion for computer science after taking an Artificial Intelligence course (cs188). Recognizing that the rules of four-part writing can be easily expressed as a constraint satisfaction problem, Eric spent the winter break hacking together a four-part generator featuring a user interface.

7. Acknowledgements

FourVoice is powered by a Constraint Satisfaction Problem library written by Gustavo Niemeyer: Python Constraint