// // Programmer: Craig Stuart Sapp // Creation Date: Mon Feb 10 08:12:05 PST 2003 // Last Modified: Mon Feb 10 08:12:09 PST 2003 // Filename: ...sig/examples/all/vlcontext/vlcontext.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/vlcontext.cpp // Syntax: C++; museinfo // // Description: Voice leading context. Identifies the note before // and after the current note. // // Note: Spine changes are not allowed for this program. // // #include "humdrum.h" // function declarations: void checkOptions (Options& opts, int argc, char* argv[]); void printAnalysis (HumdrumFile& infile, int spine); void example (void); void usage (const char* command); // option variables: Options options; // database for command-line arguments int debugQ = 0; // for debugging int appendQ = 0; // for appending analysis data to input data int spine = 0; // which spine to analyze (0 offset) /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { HumdrumFile infile; checkOptions(options, argc, argv); // process the command-line options // if no command-line arguments read data file from standard input if (options.getArgCount() < 1) { infile.read(cin); } else { infile.read(options.getArg(1)); } infile.analyzeRhythm(); printAnalysis(infile, spine); return 0; } //////////////////////////////////////////////////////////////////////////// ////////////////////////////// // // printAnalysis -- print the analysis of the given spine. // void printAnalysis(HumdrumFile& infile, int spine) { int i; const char* lastptr = ""; const char* nextptr = ""; for (i=0; i