// // Programmer: Craig Stuart Sapp // Creation Date: Thu Dec 2 12:45:43 PST 1999 // Last Modified: Thu Dec 2 13:53:31 PST 1999 // Filename: midimixup.cpp // Syntax: C++ // // Description: Reads a standard MIDI file, adjusts the timing of // the events in a random manner, then writes the file // back out to a standard MIDI file. // #include "MidiFile.h" #include "Options.h" #ifndef OLDCPP #include #else #include #endif // function declarations: void adjustTime(int deviation, int& aTime); void checkOptions(Options& opts); void example(void); void usage(const char* command); // Global variables: smf::MidiFile midifile; // performance interface // command-line variables int maxdev = 10; // maximum unit deviation /////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { Options options(argc, argv); checkOptions(options); smf::MidiFile midifile; midifile.read(options.getArg(1).data()); // note: when a MIDI file is read in by the read() function, // the delta timings are converted to absolute timings. // The next piece of code will add random timing shifts // to all events in the file according to the -m command line // option. int track, event; for (track=0; track