// // Programmer: Craig Stuart Sapp // Creation Date: Tue Nov 21 14:12:11 PST 2000 // Last Modified: Tue Nov 28 18:20:08 PST 2000 // Last Modified: Wed Jan 1 22:59:39 PST 2003 (changed Maxwell function style) // Filename: ...sig/examples/all/chord.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/chord.cpp // Syntax: C++; museinfo // // Description: Determine if a vertical sonority is a chord or a subordinate // sonority according to rules given by John Maxwell. // // Reference: "An Expert System for Harmonizing Analysis of Tonal // Music." pp 335-353 in: "Understanding Music with AI: // Perspectives on Music Cognition." Ed. by Mira Balaban, // Kemal Ebcioglu, and Otto Laske. MIT Press; 1992. // [ISBN 0-262-52170-9] // #include "humdrum.h" #include #include #include // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void printAnalysis (HumdrumFile& infile, Array& chord); void usage (const char* command); // global variables Options options; // database for command-line arguments int debugQ = 0; // used with the --debug option int appendQ = 0; // used with the -a option int compoundQ = 1; // used with the -c option int analysisflag = 0; // used with -c and --debug /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { HumdrumFile infile; Array chord; // process the command-line options checkOptions(options, argc, argv); // figure out the number of input files to process int numinputs = options.getArgCount(); for (int i=0; i& chord) { int i; if (appendQ) { for (i=0; i