// // Programmer: Craig Stuart Sapp // Creation Date: Fri Mar 18 22:08:55 PST 2005 // Last Modified: Sat Jun 3 18:46:57 PDT 2006 (changed tempo interp direction) // Last Modified: Sat Jun 3 18:46:57 PDT 2006 (added fill option) // Filename: ...sig/examples/all/time2tempo.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/time2tempo.cpp // Syntax: C++; museinfo // // Description: // #include "humdrum.h" #include #include // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void printAnalysis (HumdrumFile& infile, Array& timings, Array& tempo); void getTimings (HumdrumFile& infile, Array& timings, Array& tempo); void usage (const char* command); // global variables Options options; // database for command-line arguments int appendQ = 0; // used with -a option int prependQ = 0; // used with -p option int fillQ = 0; // used with -f option int roundQ = 0; // used with -R option int debugQ = 0; // used with --debug option /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { HumdrumFile infile; Array timings; Array tempo; // 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& timings, Array& tempo) { infile.analyzeRhythm("4"); int i; int j; timings.setSize(infile.getNumLines()); tempo.setSize(infile.getNumLines()); timings.setAll(-1.0); tempo.setAll(-1.0); double atime; int secondsQ = 0; // get the timing values from the **time spine. for (i=0; i& timings, Array& tempo) { int tempomark = 1; // disabled for now double lasttempo = -1.0; int i; int m; for (i=0; i