Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
craigsapp committed Aug 18, 2024
1 parent 593dfeb commit 2a90850
Show file tree
Hide file tree
Showing 4 changed files with 456 additions and 125 deletions.
10 changes: 9 additions & 1 deletion include/tool-tandeminfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Tool_tandeminfo : public HumTool {
public:
HTp token = NULL;
std::string description;
int count = 0;
};

Tool_tandeminfo (void);
Expand All @@ -48,6 +49,7 @@ class Tool_tandeminfo : public HumTool {
void printEntries (HumdrumFile& infile);
void printEntriesHtml (HumdrumFile& infile);
void printEntriesText (HumdrumFile& infile);
void doCountAnalysis (void);

std::string getDescription (HTp token);
std::string checkForKeySignature (const std::string& tok);
Expand Down Expand Up @@ -94,13 +96,19 @@ class Tool_tandeminfo : public HumTool {
bool m_descriptionQ = false; // used with -m option (print description of interpretation)
bool m_locationQ = false; // used with -l option (print location of interpretation in file)
bool m_zeroQ = false; // used with -z option (location address by 0-index)
bool m_tableQ = false; // used with -t option (display results as inline HTML table)
bool m_tableQ = false; // used with -t option (display results as HTML table)
bool m_closeQ = false; // used with --close option (HTML details closed by default)
bool m_sortQ = false; // used with -s (sort entries alphabetically by tandem interpretation)
bool m_headerOnlyQ = false; // used with -h option (process only header interpretations)
bool m_bodyOnlyQ = false; // used with -H option (process only body interpretations)
bool m_countQ = false; // used with -c option (only show unique list with counts);
bool m_sortByCountQ = false; // used with -c and -n options (sort from low to high count)
bool m_sortByReverseCountQ = false; // used with -c and -N options (sort from high to low count)

std::string m_unknown = "unknown";

std::vector<Tool_tandeminfo::Entry> m_entries;
std::map<std::string, int> m_count;
};

// END_MERGE
Expand Down
30 changes: 16 additions & 14 deletions src/HumInstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ void HumInstrument::setHumdrum(const string& Hname) {
void HumInstrument::initialize(void) {
m_data.reserve(500);

// List has to be sorted by first parameter. Maybe put in map.
afi("accor", GM_ACCORDION, "accordion");
afi("alto", GM_RECORDER, "alto");
afi("anvil", GM_TINKLE_BELL, "anvil");
afi("hbell", GM_TINKLE_BELL, "handbell");
afi("archl", GM_ACOUSTIC_GUITAR_NYLON, "archlute");
afi("armon", GM_HARMONICA, "harmonica");
afi("arpa", GM_ORCHESTRAL_HARP, "harp");
Expand All @@ -218,16 +218,15 @@ void HumInstrument::initialize(void) {
afi("banjo", GM_BANJO, "banjo");
afi("bansu", GM_FLUTE, "bansuri");
afi("barit", GM_CHOIR_AAHS, "baritone");
afi("mbari", GM_CHOIR_AAHS, "high baritone");
afi("baset", GM_CLARINET, "bassett horn");
afi("bass", GM_CHOIR_AAHS, "bass");
afi("bdrum", GM_TAIKO_DRUM, "bass drum");
afi("bongo", GM_TAIKO_DRUM, "bongo");
afi("bguit", GM_ELECTRIC_BASS_FINGER, "electric bass guitar");
afi("biwa", GM_FLUTE, "biwa");
afi("bongo", GM_TAIKO_DRUM, "bongo");
afi("brush", GM_BREATH_NOISE, "brush");
afi("bscan", GM_CHOIR_AAHS, "basso cantante");
afi("bspro", GM_CHOIR_AAHS, "basso profondo");
afi("brush", GM_BREATH_NOISE, "brush");
afi("bugle", GM_TRUMPET, "bugle");
afi("calam", GM_OBOE, "chalumeau");
afi("calpe", GM_LEAD_CALLIOPE, "calliope");
Expand All @@ -243,8 +242,8 @@ void HumInstrument::initialize(void) {
afi("cemba", GM_HARPSICHORD, "harpsichord");
afi("cetra", GM_VIOLIN, "cittern");
afi("chain", GM_TINKLE_BELL, "chains");
afi("chime", GM_TUBULAR_BELLS, "chimes");
afi("chcym", GM_REVERSE_CYMBAL, "China cymbal");
afi("chime", GM_TUBULAR_BELLS, "chimes");
afi("chlma", GM_BASSOON, "alto shawm");
afi("chlms", GM_BASSOON, "soprano shawm");
afi("chlmt", GM_BASSOON, "tenor shawm");
Expand Down Expand Up @@ -275,8 +274,8 @@ void HumInstrument::initialize(void) {
afi("fag_c", GM_BASSOON, "contrabassoon");
afi("fagot", GM_BASSOON, "bassoon");
afi("false", GM_RECORDER, "falsetto");
afi("feme", GM_CHOIR_AAHS, "female voice");
afi("fdrum", GM_TAIKO_DRUM, "frame drum");
afi("feme", GM_CHOIR_AAHS, "female voice");
afi("fife", GM_BLOWN_BOTTLE, "fife");
afi("fingc", GM_REVERSE_CYMBAL, "finger cymbal");
afi("flt", GM_FLUTE, "flute");
Expand All @@ -289,14 +288,15 @@ void HumInstrument::initialize(void) {
afi("fltdt", GM_RECORDER, "tenor recorder");
afi("flugh", GM_FRENCH_HORN, "flugelhorn");
afi("forte", GM_HONKYTONK_PIANO, "fortepiano");
afi("glock", GM_GLOCKENSPIEL, "glockenspiel");
afi("gen", GM_ACOUSTIC_GRAND_PIANO, "generic instrument");
afi("genT", GM_ACOUSTIC_GRAND_PIANO, "generic treble instrument");
afi("genB", GM_ACOUSTIC_GRAND_PIANO, "generic bass instrument");
afi("genT", GM_ACOUSTIC_GRAND_PIANO, "generic treble instrument");
afi("glock", GM_GLOCKENSPIEL, "glockenspiel");
afi("gong", GM_REVERSE_CYMBAL, "gong");
afi("guitr", GM_ACOUSTIC_GUITAR_NYLON, "guitar");
afi("hammd", GM_DRAWBAR_ORGAN, "Hammond electronic organ");
afi("hbell", GM_TINKLE_BELL, "handbell");
afi("hbell", GM_TINKLE_BELL, "handbell");
afi("heck", GM_BASSOON, "heckelphone");
afi("heltn", GM_CHOIR_AAHS, "Heldentenor");
afi("hichi", GM_OBOE, "hichiriki");
Expand All @@ -310,25 +310,27 @@ void HumInstrument::initialize(void) {
afi("krumb", GM_TRUMPET, "bass crumhorn");
afi("krums", GM_TRUMPET, "soprano crumhorn");
afi("krumt", GM_TRUMPET, "tenor crumhorn");
afi("liuto", GM_ACOUSTIC_GUITAR_NYLON, "lute");
afi("lion", GM_AGOGO, "lion's roar");
afi("liuto", GM_ACOUSTIC_GUITAR_NYLON, "lute");
afi("lyrsp", GM_FLUTE, "lyric soprano");
afi("lyrtn", GM_FRENCH_HORN, "lyric tenor");
afi("male", GM_CHOIR_AAHS, "male voice");
afi("mando", GM_ACOUSTIC_GUITAR_NYLON, "mandolin");
afi("marac", GM_AGOGO, "maracas");
afi("marim", GM_MARIMBA, "marimba");
afi("mbari", GM_CHOIR_AAHS, "high baritone");
afi("mezzo", GM_CHOIR_AAHS, "mezzo soprano");
afi("nfant", GM_CHOIR_AAHS, "child's voice");
afi("nokan", GM_SHAKUHACHI, "nokan");
afi("oboeD", GM_ENGLISH_HORN, "oboe d'amore");
afi("oboe", GM_OBOE, "oboe");
afi("oboeD", GM_ENGLISH_HORN, "oboe d'amore");
afi("ocari", GM_OCARINA, "ocarina");
afi("ondes", GM_PAD_SWEEP, "ondes Martenot");
afi("ophic", GM_TUBA, "ophicleide");
afi("organ", GM_CHURCH_ORGAN, "pipe organ");
afi("panpi", GM_PAN_FLUTE, "panpipe");
afi("oud", GM_ACOUSTIC_GUITAR_NYLON, "oud");
afi("paila", GM_AGOGO, "timbales");
afi("panpi", GM_PAN_FLUTE, "panpipe");
afi("pbell", GM_TUBULAR_BELLS, "bell plate");
afi("pguit", GM_ACOUSTIC_GUITAR_NYLON, "Portuguese guitar");
afi("physh", GM_REED_ORGAN, "physharmonica");
Expand Down Expand Up @@ -370,11 +372,11 @@ void HumInstrument::initialize(void) {
afi("spshc", GM_REVERSE_CYMBAL, "splash cymbal");
afi("steel", GM_STEEL_DRUMS, "steel-drum");
afi("stim", GM_SEASHORE, "Sprechstimme");
afi("stimS", GM_SEASHORE, "Sprechstimme, soprano");
afi("stimA", GM_SEASHORE, "Sprechstimme, alto");
afi("stimB", GM_SEASHORE, "Sprechstimme, bass");
afi("stimC", GM_SEASHORE, "Sprechstimme, contralto");
afi("stimR", GM_SEASHORE, "Sprechstimme, baritone");
afi("stimB", GM_SEASHORE, "Sprechstimme, bass");
afi("stimS", GM_SEASHORE, "Sprechstimme, soprano");
afi("strdr", GM_AGOGO, "string drum");
afi("sxhA", GM_ALTO_SAX, "alto saxhorn");
afi("sxhB", GM_BARITONE_SAX, "bass saxhorn");
Expand Down Expand Up @@ -402,7 +404,6 @@ void HumInstrument::initialize(void) {
afi("tubaC", GM_TUBA, "contrabass tuba");
afi("tubaT", GM_TUBA, "tenor tuba");
afi("tubaU", GM_TUBA, "subcontra tuba");
afi("oud", GM_ACOUSTIC_GUITAR_NYLON, "oud");
afi("ukule", GM_ACOUSTIC_GUITAR_NYLON, "ukulele");
afi("vibra", GM_VIBRAPHONE, "vibraphone");
afi("vina", GM_SITAR, "vina");
Expand All @@ -418,6 +419,7 @@ void HumInstrument::initialize(void) {
afi("xylo", GM_XYLOPHONE, "xylophone");
afi("zithr", GM_CLAVI, "zither");
afi("zurna", GM_ACOUSTIC_GUITAR_NYLON, "zurna");

}


Expand Down
1 change: 1 addition & 0 deletions src/tool-rphrase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ void Tool_rphrase::printEmbeddedVoiceInfo(vector<Tool_rphrase::VoiceInfo>& voice
m_humdrum_text << "!! }" << endl;

m_humdrum_text << "!!@CONTENT:\n";

if (m_compositeQ) {
m_humdrum_text << "!!<style> .PREHTML .composite ul .rest { color: #ccc; } </style>" << endl;
m_humdrum_text << "!!<style> .PREHTML .composite ul .measure { color: #ccc; } </style>" << endl;
Expand Down
Loading

0 comments on commit 2a90850

Please sign in to comment.