// // Programmer: Craig Stuart Sapp // Creation Date: Wed Oct 22 16:33:21 PDT 2008 // Last Modified: Wed Oct 22 16:33:25 PDT 2008 // Filename: ...sig/examples/all/hum2allegro.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/hum2allegro.cpp // Syntax: C++; museinfo // // Description: Converts a Humdrum file into Allegro data. // #include "humdrum.h" #include #include #include #ifndef OLDCPP #include #else #include #endif #ifndef VISUAL #include #endif #define TOLERANCE 0.00001 // function declarations: void checkOptions (Options& opts, int argc, char** argv); void example (void); void usage (const char* command); void convertToAllegro (ostream& out, HumdrumFile& infile); void printKernTokenData (ostream& out, HumdrumFile& infile, int row, int col, int& outputcounter, int& currentbeat, int measurenum); // User interface variables: Options options; int beatQ = 0; // used with -b option double beatduration = 1.0; // used with -b option ////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { checkOptions(options, argc, argv); // process the command-line options HumdrumFile infile(options.getArg(1)); infile.analyzeRhythm("4"); convertToAllegro(std::cout, infile); return 0; } ////////////////////////////////////////////////////////////////////////// /////////////////////////////// // // convertToAllegro -- // void convertToAllegro(ostream& out, HumdrumFile& infile) { int i, j; int measurenum = -1; int outputcounter = 0; int currentbeat = -100; for (i=0; i