// // Programmer: Craig Stuart Sapp // Creation Date: Thu Apr 12 18:50:21 PDT 2001 // Last Modified: Thu Apr 12 18:50:25 PDT 2001 // Filename: ...sig/examples/all/kern2notelist.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/kern2notelist.cpp // Syntax: C++; museinfo // // Description: Generates a list of notes from the input along with their // absolute position in the music, their duration and // the metric level // #include "humdrum.h" #include #include #include // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void usage (const char* command); void fillDataArrays (HumdrumFile& infile, Array& absbeat, Array& pitch, Array& duration, Array& level); // user interface variables Options options; // database for command-line arguments int quietQ = 0; // display only data table or not int verboseQ = 1; // display only data table or not int compoundQ = 1; // used with the -c option /////////////////////////////////////////////////////////////////////////// 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 absbeat; Array pitch; Array testset; Array duration; Array level; Array coef; int i, j; for (i=0; i& absbeat, Array& pitches, Array& durations, Array& levels) { absbeat.setSize(infile.getNumLines() * 100); pitches.setSize(infile.getNumLines() * 100); durations.setSize(infile.getNumLines() * 100); levels.setSize(infile.getNumLines() * 100); absbeat.setSize(0); pitches.setSize(0); durations.setSize(0); levels.setSize(0); absbeat.allowGrowth(1); pitches.allowGrowth(1); durations.allowGrowth(1); levels.allowGrowth(1); Array scorelevels; infile.analyzeMetricLevel(scorelevels); int firsttime = 1; int i, j, k; int ii, jj; int ccount; static char buffer[1024] = {0}; int pitch; double beatvalue; double duration; double level; for (i=0; i