// // Programmer: Craig Stuart Sapp // Creation Date: Sun Jun 5 13:56:03 PDT 2022 // Last Modified: Sun Jun 5 14:06:06 PDT 2022 // Filename: tools/channelinfo.cpp // URL: https://github.com/craigsapp/midifile/blob/master/tools/channelinfo.cpp // Syntax: C++11 // vim: ts=3 // // Description: List channels used for notes in each track and list timbres // used in each channel. // #include "MidiFile.h" #include "Options.h" #include using namespace std; using namespace smf; void processFile(MidiFile& midifile, Options& options); void printTrackInfo(MidiFile& midifile, int track); /////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { Options options; options.process(argc, argv); MidiFile midifile; if (options.getArgCount() == 0) { midifile.read(cin); processFile(midifile, options); } else { int count = options.getArgCount(); for (int i=0; i 1) { cout << filename << "\t"; } midifile.read(filename); processFile(midifile, options); } } return 0; } /////////////////////////////////////////////////////////////////////////// ////////////////////////////// // // processFile -- // void processFile(MidiFile& midifile, Options& options) { for (int i=0; i channels(16, false); string trackName = ""; vector> patches(16); int chan; for (int i=0; i