Beispiel #1
0
int main(int argc, char* argv[]) {
   HumdrumFile    infile;
   Array<double>  timings;
   Array<double>  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<numinputs || i==0; i++) {
      infile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         infile.read(cin);
      } else {
         infile.read(options.getArg(i+1));
      }

      analyzeTiming(infile, timings, tempo);
      generateSwing(infile, timings, percentage);
      printAnalysis(infile, timings, tempo);
   }

   return 0;
}
Beispiel #2
0
int main(int argc, char** argv) {
	HumdrumFile infile;

	// initial processing of the command-line options
	checkOptions(options, argc, argv);

	if (options.getArgCount() < 1) {
		infile.read(cin);
	} else {
		infile.read(options.getArg(1));
	}

	if (removeQ || overwriteQ) {
		stringstream tempstream;
		removeStems(tempstream, infile);
		infile.clear();
		infile.read(tempstream);
		if (removeQ) {
			cout << infile;
			exit(0);
		}
	} 

	autostem(infile);
	cout << infile;

	return 0;
}
Beispiel #3
0
int main(int argc, char** argv) {
   HumdrumFile hfile;

   // process the command-line options
   checkOptions(options, argc, argv);

   // figure out the number of input files to process
   numinputs = options.getArgCount();
 
   const char* filename = "";

   for (int i=0; i<numinputs || i==0; i++) {
      hfile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         filename = "";
         hfile.read(cin);
      } else {
         filename = options.getArg(i+1).data();
         hfile.read(filename);
      }
     
      hfile.analyzeRhythm();
      displayResults(hfile, numinputs, filename);
   }

   return 0;
}
Beispiel #4
0
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<double> absbeat;
    Array<int> pitch;
    Array<int> testset;
    Array<double> duration;
    Array<double> level;
    Array<double> coef;

    for (int i=0; i<numinputs || i==0; i++) {
        infile.clear();

        // if no command-line arguments read data file from standard input
        if (numinputs < 1) {
            infile.read(cin);
        } else {
            infile.read(options.getArg(i+1));
        }
        infile.analyzeRhythm();
        cout << "(cmn\n";
        convertToCMN(infile);
        cout << ")\n";
    }

    return 0;
}
Beispiel #5
0
int main(int argc, char** argv) {
   HumdrumFile hfile;

   checkOptions(options, argc, argv);  // process the command-line options

   // figure out the number of input files to process
   int numinputs = options.getArgCount();

   for (int i=0; i<numinputs || i==0; i++) {
      hfile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         hfile.read(cin);
      } else {
         hfile.read(options.getArg(i+1));
      }
      // hfile.analyzeRhythm();

      Array<int> transform;
      getTransformation(hfile, transform);
      if (!determineQ) {
         printTransformation(hfile, transform);
      }

   }

   return 0;
}
Beispiel #6
0
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();

   for (int i=0; i<numinputs || i==0; i++) {
      infile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         infile.read(cin);
      } else {
         infile.read(options.getArg(i+1));
      }

      infile.analyzeSpines();
      printSpineAnalysis(infile);
   }

   return 0;
}
Beispiel #7
0
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<double> values;
   values.setSize(0);

   Array<double> midibins;
   midibins.setSize(128);
   midibins.setAll(0);
   midibins.allowGrowth(0);

   for (int i=0; i<numinputs || i==0; i++) {
      infile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         infile.read(cin);
      } else {
         infile.read(options.getArg(i+1));
      }

      generateAnalysis(infile, midibins);
   }

   printAnalysis(midibins);

   return 0;
}
Beispiel #8
0
int main(int argc, char** argv) {
   // process the command-line options
   checkOptions(options, argc, argv);

   // figure out the number of input files to process
   int numinputs = options.getArgCount();

   HumdrumFile hfile;
   for (int i=0; i<numinputs || i==0; i++) {
      hfile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         hfile.read(cin);
      } else {
         hfile.read(options.getArg(i+1));
      }

      hfile.analyzeRhythm();
      divisions = hfile.getMinTimeBase();
      if (divisions % 4 == 0) {
         divisions = divisions/4;
      } else {
         // don't know what this case may be
      }
      convertToMusicXML(hfile);

   }

   return 0;
}
Beispiel #9
0
int main(int argc, char** argv) {
   // process the command-line options
   checkOptions(options, argc, argv);
   HumdrumFile infile;
   int i;

   Array<Array<char> > idtags;
   int idtagQ = 0;
   firstinput.read(options.getArg(1));

   for (i=1; i<=options.getArgCount(); i++) {
      infile.clear();
      infile.read(options.getArg(i));
      if (i ==1) {
         idtagQ = getIdTags(idtags, infile);
      }

      if (idtagQ && i > 1) {
         printFileID(infile, i-1, options.getArgCount(), idtags);
      } else {
         printFile(infile, i-1, options.getArgCount());
      }
   }

   return 0;
}
Beispiel #10
0
void inputNewFile(void) {
	data.clear();
	linenum = 0;
	if (!streamer.read(data)) {
		finishup();
		exit(0);
	}

	data.analyzeRhythm("4");

	if (fileNumber > 1) {
		millisleep((float)(1000 * options.getDouble("pause")));
	}
	fileNumber++;
}
Beispiel #11
0
void processFile(HumdrumFile& infile, int index) {
	vector<int> lines;
	vector<int> pitches;
	vector<int> tiestates;
	vector<int> tiecorrections;
	vector<int> localindex;

	for (int i=0; i<infile.getNumLines(); i++) {
		if (infile[i].getType() == E_humrec_interpretation) {
			if (strcmp(infile[i].getExInterp(index), "**kern") != 0) {
				// spine is not **kern data, so no tie fixing necessary
				return;
			} else {
				// primary spine is **kern data
				break;
			}
		}
	}

// cout << "Spine is not kern data: " << infile[i].getExInterp(index) << endl;
// cout << "LINE IS: " << infile[i] << endl;
// cout << "INDEX = " << index << endl;
// cout << "LINE = " << i << endl;
// cout << "SPINE INFO = " << infile[i].getSpineInfo(index) << endl;

	getPitchesAndTies(infile, lines, pitches, tiestates, index, localindex);
	int corr = getTieCorrections(tiecorrections, pitches, tiestates);

	if (testQ) {
		if (corr) {
			cout << filename << ": " << corr << " incorrect ties\n";
			exit(0);
		} else {
			exit(0);
		}
	}

	if (corr) {
		stringstream datastream;
		printFileWithCorrections(datastream, infile, lines,
				tiecorrections, localindex);
		datastream << ends;
		infile.clear();
		infile.read(datastream);
	} else {
		// no corrections needed: do not alter infile
	}
}
Beispiel #12
0
int main(int argc, char* argv[]) {
   HumdrumFile infile;

   // process the command-line options
   checkOptions(options, argc, argv);

   const char* filename;
   infile.clear();
   // if no command-line arguments read data file from standard input
   int numinputs = options.getArgCount();
   if (numinputs < 1) {
      infile.read(cin);
   } else {
      filename = options.getArg(1).data();
      infile.read(filename);
   }
   processFile(infile);

}
Beispiel #13
0
int main(int argc, char* argv[]) {
   HumdrumFile    infile;
   Array<double>  timings;
   Array<double>  tempo;

   // process the command-line options
   checkOptions(options, argc, argv);

   // figure out the number of input files to process
   int numinputs = options.getArgCount();

   double totaldur = 0.0;

   for (int i=0; i<numinputs || i==0; i++) {
      infile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         infile.read(cin);
      } else {
         infile.read(options.getArg(i+1));
      }

      if (interpQ) {
         doLinearInterpolation(infile);
      } else {
         analyzeTiming(infile, timings, tempo);
         if (totalQ) {
            totaldur += timings[timings.getSize()-1];
            if (numinputs > 1) {
               printtime(options.getArg(i+1), timings[timings.getSize()-1]);
            }
         } else {
            printAnalysis(infile, timings, tempo);
         }
      }
   }
   if (totalQ) {
      printtime("", totaldur);
   }

   return 0;
}
Beispiel #14
0
int main(int argc, char** argv) {
   checkOptions(options, argc, argv); // process the command-line options

   int i;
   int numinputs = options.getArgCount();
   HumdrumFile hfile;

   for (i=0; i<numinputs || i==0; i++) {
      hfile.clear();

      // if no command-line arguments read data file from standard input
      if (numinputs < 1) {
         hfile.read(cin);
         createIndex(hfile, "");
      } else {
         processArgument(options.getArg(i+1));
      }
   }

   return 0;
}
Beispiel #15
0
int main(int argc, char* argv[]) {
	HumdrumFile infile;

	// process the command-line options
	checkOptions(options, argc, argv);

	infile.clear();
	// if no command-line arguments read data file from standard input
	int numinputs = options.getArgCount();
	if (numinputs < 1) {
		infile.read(cin);
	} else {
		filename = options.getArg(1);
		infile.read(options.getArg(1));
	}
	int i;
	for (i=0; i<infile.getMaxTracks(); i++) {
		processFile(infile, i);
	}

	cout << infile;
}