-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,793 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Tue Sep 12 20:14:20 PDT 2023 | ||
// Last Modified: Tue Sep 12 20:14:22 PDT 2023 | ||
// Filename: meter.cpp | ||
// URL: https://github.com/craigsapp/humlib/blob/master/cli/meter.cpp | ||
// Syntax: C++11 | ||
// vim: ts=3 noexpandtab nowrap | ||
// | ||
// Description: Meter/beat extraction tool. | ||
// | ||
|
||
#include "humlib.h" | ||
|
||
STREAM_INTERFACE(Tool_meter) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Sep 2 16:14:22 CEST 2023 | ||
// Last Modified: Mon Sep 4 11:39:35 CEST 2023 | ||
// Filename: pline.cpp | ||
// URL: https://github.com/craigsapp/humlib/blob/master/cli/pline.cpp | ||
// Syntax: C++11 | ||
// vim: ts=3 noexpandtab nowrap | ||
// | ||
// Description: Processing tool for poetic lines. | ||
// | ||
|
||
#include "humlib.h" | ||
|
||
STREAM_INTERFACE(Tool_pline) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Sep 2 16:14:22 CEST 2023 | ||
// Last Modified: Sat Sep 2 16:14:24 CEST 2023 | ||
// Filename: textdur.cpp | ||
// URL: https://github.com/craigsapp/humlib/blob/master/cli/textdur.cpp | ||
// Syntax: C++11 | ||
// vim: ts=3 noexpandtab nowrap | ||
// | ||
// Description: Calculate durations of **text/**sylbe syllables (including melismas). | ||
// | ||
|
||
#include "humlib.h" | ||
|
||
STREAM_INTERFACE(Tool_textdur) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sun Sep 10 00:29:24 PDT 2023 | ||
// Last Modified: Thu Sep 14 03:33:20 PDT 2023 | ||
// Filename: tool-meter.h | ||
// URL: https://github.com/craigsapp/humlib/blob/master/include/tool-meter.h | ||
// Syntax: C++11; humlib | ||
// vim: ts=3 noexpandtab | ||
// | ||
// Description: Meter/beat data extraction tool. | ||
// | ||
|
||
#ifndef _TOOL_METER_H | ||
#define _TOOL_METER_H | ||
|
||
#include "HumTool.h" | ||
#include "HumdrumFile.h" | ||
|
||
namespace hum { | ||
|
||
// START_MERGE | ||
|
||
class Tool_meter : public HumTool { | ||
|
||
public: | ||
Tool_meter (void); | ||
~Tool_meter () {}; | ||
|
||
bool run (HumdrumFileSet& infiles); | ||
bool run (HumdrumFile& infile); | ||
bool run (const string& indata, std::ostream& out); | ||
bool run (HumdrumFile& infile, std::ostream& out); | ||
|
||
|
||
protected: | ||
void initialize (void); | ||
void processFile (HumdrumFile& infile); | ||
void getMeterData (HumdrumFile& infile); | ||
void processLine (HumdrumLine& line, | ||
std::vector<HumNum>& curNum, | ||
std::vector<HumNum>& curDen, | ||
std::vector<HumNum>& curBeat, | ||
std::vector<HumNum>& curBarTime); | ||
void printMeterData (HumdrumFile& infile); | ||
void printHumdrumLine (HumdrumLine& line, bool printLabels); | ||
int printKernAndAnalysisSpine(HumdrumLine& line, int index, bool printLabels, bool forceInterpretation = false); | ||
HumNum getHumNum (HTp token, const std::string& parameter); | ||
std::string getHumNumString(HumNum input); | ||
bool searchForLabels (HumdrumLine& line); | ||
void printLabelLine (HumdrumLine& line); | ||
|
||
private: | ||
bool m_commaQ = false; | ||
bool m_denominatorQ = false; | ||
bool m_floatQ = false; | ||
bool m_joinQ = false; | ||
bool m_tsigQ = false; | ||
bool m_nobeatQ = false; | ||
bool m_nolabelQ = false; | ||
bool m_numeratorQ = false; | ||
bool m_restQ = false; | ||
bool m_zeroQ = false; | ||
|
||
}; | ||
|
||
// END_MERGE | ||
|
||
} // end namespace hum | ||
|
||
#endif /* _TOOL_METER_H */ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Sep 2 11:58:11 CEST 2023 | ||
// Last Modified: Mon Sep 4 10:23:13 CEST 2023 | ||
// Filename: tool-pline.h | ||
// URL: https://github.com/craigsapp/humlib/blob/master/include/tool-pline.h | ||
// Syntax: C++11; humlib | ||
// vim: ts=3 noexpandtab | ||
// | ||
// Description: Poetic line processing tool. | ||
// | ||
|
||
#ifndef _TOOL_PLINE_H | ||
#define _TOOL_PLINE_H | ||
|
||
#include "HumTool.h" | ||
#include "HumdrumFile.h" | ||
|
||
namespace hum { | ||
|
||
// START_MERGE | ||
|
||
class Tool_pline : public HumTool { | ||
public: | ||
Tool_pline (void); | ||
~Tool_pline () {}; | ||
|
||
bool run (HumdrumFileSet& infiles); | ||
bool run (HumdrumFile& infile); | ||
bool run (const string& indata, ostream& out); | ||
bool run (HumdrumFile& infile, ostream& out); | ||
|
||
|
||
protected: | ||
void initialize (void); | ||
void processFile (HumdrumFile& infile); | ||
void getPlineInterpretations(HumdrumFile& infile, vector<HTp>& tokens); | ||
void plineToColor (HumdrumFile& infile, vector<HTp>& tokens); | ||
void markRests (HumdrumFile& infile); | ||
void markSpineRests (HTp spineStop); | ||
void fillLineInfo (HumdrumFile& infile, std::vector<std::vector<int>>& lineInfo); | ||
|
||
private: | ||
bool m_colorQ = false; // used with -c option | ||
// bool m_overlapQ = false; // used with -o option | ||
|
||
std::vector<std::string> m_colors; | ||
std::vector<HTp> m_ptokens; | ||
std::vector<std::vector<int>> m_lineInfo; | ||
|
||
|
||
}; | ||
|
||
// END_MERGE | ||
|
||
} // end namespace hum | ||
|
||
#endif /* _TOOL_PLINE_H */ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Sat Sep 2 11:58:11 CEST 2023 | ||
// Last Modified: Sat Sep 2 11:58:15 CEST 2023 | ||
// Filename: tool-textdur.h | ||
// URL: https://github.com/craigsapp/humlib/blob/master/include/tool-textdur.h | ||
// Syntax: C++11; humlib | ||
// vim: ts=3 noexpandtab | ||
// | ||
// Description: Calculate duration of text (lyrics). Either as **text or **sylba | ||
// | ||
|
||
#ifndef _TOOL_TEXTDUR_H | ||
#define _TOOL_TEXTDUR_H | ||
|
||
#include "HumTool.h" | ||
#include "HumdrumFile.h" | ||
|
||
namespace hum { | ||
|
||
// START_MERGE | ||
|
||
class Tool_textdur : public HumTool { | ||
public: | ||
Tool_textdur (void); | ||
~Tool_textdur () {}; | ||
|
||
bool run (HumdrumFileSet& infiles); | ||
bool run (HumdrumFile& infile); | ||
bool run (const string& indata, ostream& out); | ||
bool run (HumdrumFile& infile, ostream& out); | ||
|
||
|
||
protected: | ||
void initialize (void); | ||
void processFile (HumdrumFile& infile); | ||
void printMelismas (HumdrumFile& infile); | ||
void printDurations (HumdrumFile& infile); | ||
void getTextSpineStarts(HumdrumFile& infile, vector<HTp>& starts); | ||
void processTextSpine (vector<HTp>& starts, int index); | ||
int getMelisma (HTp tok1, HTp tok2); | ||
HumNum getDuration (HTp tok1, HTp tok2); | ||
HTp getTandemKernToken(HTp token); | ||
void printInterleaved (HumdrumFile& infile); | ||
void printInterleavedLine(HumdrumLine& line, vector<bool>& textTrack); | ||
void printTokenAnalysis(HTp token); | ||
void printAnalysis (void); | ||
void printDurationAverage(void); | ||
void printMelismaAverage(void); | ||
void printHtmlContent (void); | ||
void printMelismaHtmlHistogram(void); | ||
void printMelismaHtmlHistogram(int index, int maxVal); | ||
void printDurationHtmlHistogram(void); | ||
void fillInstrumentNameInfo(void); | ||
std::string getColumnName (HTp token); | ||
|
||
private: | ||
std::vector<HTp> m_textStarts; | ||
std::vector<int> m_track2column; | ||
std::vector<string> m_columnName; | ||
|
||
std::vector<std::vector<HTp>> m_syllables; // List of syllables in **text/**sylba | ||
std::vector<std::vector<HumNum>> m_durations; // List of durations excluding trailing rests | ||
std::vector<std::vector<int>> m_melismas; // List of note counts for syllable | ||
|
||
bool m_analysisQ = false; // used with -a option | ||
bool m_melismaQ = false; // used with -m option | ||
bool m_durationQ = true; // used with -m, -d option | ||
bool m_interleaveQ = false; // used with -i option | ||
HumNum m_RhythmFactor = 1; // uwed with -1, -2, -8, and later -f # | ||
|
||
}; | ||
|
||
// END_MERGE | ||
|
||
} // end namespace hum | ||
|
||
#endif /* _TOOL_TEXTDUR_H */ | ||
|
||
|
||
|
Oops, something went wrong.