// // Programmer: Craig Stuart Sapp // Creation Date: Thu Dec 6 23:09:26 PST 2001 // Last Modified: Thu Dec 6 23:09:33 PST 2001 // Filename: ...sig/examples/all/attacksum.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/attacksum.cpp // Syntax: C++; museinfo // // Description: Generate a rhythmic summary of each measure by // generating a binary number based on note attacks. // // Options -f field numbers separated by dash for range and/or comma // Gives the fields to use for analysis. // -d Divisions per quarter note duration to provied analysis // -b binary form only -- do not sum number of attacks // // Example analysis: 400321530043204 // // Status: Not yet finished // #include "humdrum.h" typedef Array ArrayInt; // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void usage (const char* command); void ZeroArray (Array array, int value); // 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 double qdiv = 4.0; // number of divisions per quarter note Array fields; // **kern fields to decide attacks /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { HumdrumFile infile; // process the command-line options checkOptions(options, argc, argv); // figure out the number of input files to process int numinputs = options.getArgCount(); Array analysis; Array line; for (int i=0; i& analysis, Array& line, double divisions) { line.setSize(infile.getNumLines()); line.setSize(0); line.allowGrowth(1); infile.analyzeMetricLevel(); Array measuresum; int currentLine = -1; int i; for (i=0; i array, int value) { for (int i=0; i& analysis, Array& line, double divisions) { cout << "GOT HERE" << endl; } ////////////////////////////// // // usage -- gives the usage statement for the quality program // void usage(const char* command) { cout << " \n" << endl; }