-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: support non-traditional key signatures (#81)
* support non-traditional keys * strangely failing test * key data tests * support non-traditional keys
- Loading branch information
Showing
16 changed files
with
623 additions
and
79 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,42 @@ | ||
// MusicXML Class Library | ||
// Copyright (c) by Matthew James Briggs | ||
// Distributed under the MIT License | ||
|
||
#pragma once | ||
#include "mx/api/ApiCommon.h" | ||
#include "mx/api/PitchData.h" | ||
|
||
namespace mx | ||
{ | ||
namespace api | ||
{ | ||
|
||
// KeyComponent is only used for non-traditional key signatures. It facilitates specifying the | ||
// exact accidentals that are found in the key signature. | ||
struct KeyComponent | ||
{ | ||
// The note name that is to be altered by the key signature. | ||
Step step; | ||
|
||
// The amount that notes of this note name should be altered, in semitones. | ||
int alter; | ||
|
||
// Additional amount that notes of this note name should be altered, in cents. If alter = 1 and cents = 25.1 | ||
// then the note is altered by 1.251 semitones in total. | ||
double cents; | ||
|
||
// The accidental to display for this note name. | ||
Accidental accidental; | ||
}; | ||
|
||
|
||
MXAPI_EQUALS_BEGIN( KeyComponent ) | ||
MXAPI_EQUALS_MEMBER( step ) | ||
MXAPI_EQUALS_MEMBER( alter ) | ||
MXAPI_EQUALS_MEMBER( cents ) | ||
MXAPI_EQUALS_MEMBER( accidental ) | ||
MXAPI_EQUALS_END; | ||
|
||
MXAPI_NOT_EQUALS_AND_VECTORS( KeyComponent ); | ||
} | ||
} |
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
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
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
Oops, something went wrong.