2016-02-04 16:33:42 +00:00
|
|
|
#ifndef cmXScore_h
|
|
|
|
#define cmXScore_h
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2016-02-07 04:36:53 +00:00
|
|
|
kOkXsRC = cmOkRC,
|
2016-02-04 16:33:42 +00:00
|
|
|
kXmlFailXsRC,
|
|
|
|
kLHeapFailXsRC,
|
2016-02-09 02:46:07 +00:00
|
|
|
kSyntaxErrorXsRC,
|
2016-02-12 00:23:42 +00:00
|
|
|
kCsvFailXsRC,
|
|
|
|
kUnterminatedTieXsRC,
|
2016-02-19 00:10:05 +00:00
|
|
|
kUnterminatedSlurXsRC,
|
|
|
|
kUnterminatedOctaveShiftXsrRC,
|
2016-07-20 23:16:00 +00:00
|
|
|
kPedalStateErrorXsRc,
|
2016-02-26 00:10:54 +00:00
|
|
|
kMidiFailXsRC,
|
2016-07-14 23:08:13 +00:00
|
|
|
kFileFailXsRC,
|
2016-08-31 17:38:38 +00:00
|
|
|
kSvgFailXsRC,
|
2016-09-07 21:36:15 +00:00
|
|
|
kOverlapWarnXsRC,
|
|
|
|
kZeroLengthEventXsRC
|
2016-02-07 04:36:53 +00:00
|
|
|
};
|
2016-02-04 16:33:42 +00:00
|
|
|
|
|
|
|
typedef cmRC_t cmXsRC_t;
|
|
|
|
typedef cmHandle_t cmXsH_t;
|
|
|
|
|
|
|
|
extern cmXsH_t cmXsNullHandle;
|
|
|
|
|
|
|
|
// Prepare the MusicXML file:
|
|
|
|
//
|
|
|
|
// 1) Convert XML to UTF-8:
|
2016-03-30 23:18:44 +00:00
|
|
|
// a. Change: encoding = 'UTF-16' to encoding='UTF-8'
|
2016-06-09 22:52:29 +00:00
|
|
|
|
|
|
|
|
2016-02-04 16:33:42 +00:00
|
|
|
// b. Emacs C-x <RET> f utf-8 <RET>
|
2016-03-30 23:18:44 +00:00
|
|
|
// c. Change: <?xml ... encoding = 'UTF-16' to encoding='UTF-8' ...?>
|
2016-02-04 16:33:42 +00:00
|
|
|
//
|
2017-04-15 16:27:27 +00:00
|
|
|
// 2) Replace "DoletSibelius Unknown Symbol Index " with "DoletSibelius unknownSymIdx="
|
2016-02-07 04:36:53 +00:00
|
|
|
//
|
2016-03-17 23:30:21 +00:00
|
|
|
// Steps 1) and 2) can be automated by in emacs by:
|
2016-03-16 22:34:38 +00:00
|
|
|
//
|
2016-04-20 22:53:24 +00:00
|
|
|
// M-x load-file ~/src/emacs/proc_music_xml.el
|
2016-03-16 22:34:38 +00:00
|
|
|
//
|
2016-09-15 22:28:30 +00:00
|
|
|
|
|
|
|
// Initialize an cmXScore object from a Sibelius generated MusicXML file.
|
2017-04-15 16:27:27 +00:00
|
|
|
// 'editFn' is used to add additional information to the score.
|
|
|
|
// See cmXScoreGenEditFile()
|
2016-09-15 22:28:30 +00:00
|
|
|
cmXsRC_t cmXScoreInitialize( cmCtx_t* ctx, cmXsH_t* hp, const cmChar_t* xmlFn, const cmChar_t* editFn );
|
2016-02-04 16:33:42 +00:00
|
|
|
cmXsRC_t cmXScoreFinalize( cmXsH_t* hp );
|
|
|
|
|
2016-09-15 22:28:30 +00:00
|
|
|
|
2016-03-31 23:07:48 +00:00
|
|
|
bool cmXScoreIsValid( cmXsH_t h );
|
2016-02-04 16:33:42 +00:00
|
|
|
|
2017-12-17 18:43:39 +00:00
|
|
|
cmXsRC_t cmXScoreWriteCsv( cmXsH_t h, int beginMeasNumb, const cmChar_t* csvFn );
|
2016-02-09 02:46:07 +00:00
|
|
|
|
2016-03-31 23:07:48 +00:00
|
|
|
void cmXScoreReport( cmXsH_t h, cmRpt_t* rpt, bool sortFl );
|
2016-02-04 16:33:42 +00:00
|
|
|
|
2017-04-15 16:27:27 +00:00
|
|
|
// Generate a template 'edit file'. This file can be edited by hand to included additional
|
|
|
|
// information in the score. See the 'editFn' argument to cmXScoreInitialize() for where
|
|
|
|
// this file is used.
|
2016-09-21 23:18:01 +00:00
|
|
|
cmXsRC_t cmXScoreGenEditFile( cmCtx_t* ctx, const cmChar_t* xmlFn, const cmChar_t* outFn );
|
|
|
|
|
2016-07-14 23:08:13 +00:00
|
|
|
// Generate the CSV file suitable for use by cmScore.
|
2017-04-15 16:27:27 +00:00
|
|
|
//
|
|
|
|
// If the file referenced by 'reorderFn' exists then it is used to attach additional
|
|
|
|
// score information. If it does not then a new edit file is created via an
|
|
|
|
// internal call to cmXScoreGenEditFile(). This file can then be edited
|
|
|
|
// to include the additional score file information and passed back by a later
|
|
|
|
// call to this same function.
|
2017-12-17 18:43:39 +00:00
|
|
|
// Set reportFl to true to print a report of the score following processing.
|
|
|
|
// Set begMeasNumb to the first measure the to be written to the output csv, MIDI and SVG files.
|
|
|
|
// Set begBPM to 0 to use the tempo from the score otherwise set it to the tempo at begMeasNumb.
|
|
|
|
cmXsRC_t cmXScoreTest( cmCtx_t* ctx, const cmChar_t* xmlFn, const cmChar_t* reorderFn, const cmChar_t* csvOutFn, const cmChar_t* midiOutFn, bool reportFl, int begMeasNumb, int begBPM );
|
2016-02-04 16:33:42 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|