Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scoring up implementation as functor #3800

Draft
wants to merge 105 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
c98e2ed
Add header and source for scoringup functor and call them in doc
martha-thomae Aug 14, 2024
0464368
Test ScoringUpDoc with debug messages
martha-thomae Aug 16, 2024
d409a55
Add again the private variables for mensur
martha-thomae Aug 16, 2024
f141c9a
Test adding durquality values
martha-thomae Aug 16, 2024
2114a56
Get a vector of data_DURATION objects for a layer
martha-thomae Aug 21, 2024
97cf79d
Change to a method
martha-thomae Aug 27, 2024
7a0a61a
Clean extra lines of code
martha-thomae Aug 27, 2024
0ab0bfb
Move variable and method declaration to cpp
martha-thomae Aug 27, 2024
db58bff
Divide dursInVoiceSameMensur into subsequences
martha-thomae Aug 27, 2024
f49a9d1
Obtain xml:ids for notes and rests
martha-thomae Aug 27, 2024
ff44446
Use vectors of pairs of ids and durs
martha-thomae Aug 27, 2024
ed144a9
Correct subsequences to start and end with 'long notes'
martha-thomae Aug 27, 2024
6d7e57a
Pass seq and subse to overloaded function to determine the durquality.
martha-thomae Aug 27, 2024
8053f40
Add methods for imperfection and alteration
martha-thomae Aug 30, 2024
8892095
Add all the principles of imperfection and alteration (including thei…
martha-thomae Aug 30, 2024
c4c39ed
Start sketch of imperfection and alteration functions
martha-thomae Aug 30, 2024
75c6bb7
Add comment: missing 'rest at' conditions to forbid imperfection/alte…
martha-thomae Aug 30, 2024
b5fcc9d
Comment lines out for the program to keep working
martha-thomae Aug 30, 2024
2d2b3fa
Try to solve the issue of getting the notes/rests by ID to set the du…
martha-thomae Aug 30, 2024
593ae25
Add changes for alteration
martha-thomae Aug 30, 2024
758fa11
Trying to fix the pointers to the notes
martha-thomae Aug 31, 2024
6621587
Use maps of ids to notes/rests and fix pointer issue
martha-thomae Aug 31, 2024
64e1cfe
Add imperfection a.p.a. code
martha-thomae Sep 2, 2024
d0e1c7e
Add 'rest' condition that forbids alteration
martha-thomae Sep 2, 2024
ad2868a
Add 'short note value' condition to forbid alteration
martha-thomae Sep 2, 2024
9138d98
Finish documentating flags that forbid alteration
martha-thomae Sep 2, 2024
eab73c0
Remove comment
martha-thomae Sep 2, 2024
c789e82
Remove unnecessary comments and debug statements
martha-thomae Sep 2, 2024
7a49570
Change implementation to use references to elements
martha-thomae Sep 2, 2024
87c1aa0
Refine documentation and note values for the principles of imp and alt
martha-thomae Sep 2, 2024
bc34284
Refine comments and conditions for the principles of imp. and alt.
martha-thomae Sep 2, 2024
34d660f
get default values from mensuration
martha-thomae Sep 2, 2024
b84d383
Fix: only consider middle notes of the sequence
martha-thomae Sep 2, 2024
6fd9316
Save mensuration values
martha-thomae Sep 2, 2024
249c0d5
Add the exception case for sum = 3
martha-thomae Sep 3, 2024
035746e
Add 'dot of perfection' condition within the evaluation of imperfecti…
martha-thomae Sep 3, 2024
6182cc6
Remove the dotOfPerf flag
martha-thomae Sep 3, 2024
734a5f5
Add 'form=div' for dot of perfection
martha-thomae Sep 3, 2024
d950a87
Change formatting according to coding guidelines
martha-thomae Sep 6, 2024
94db5ea
Adjust to coding guidelines, move methods and attributes to header file
martha-thomae Sep 6, 2024
d9f4574
Add comments for meethods
martha-thomae Sep 6, 2024
e03bf0d
Comment code to try to get mensuration values from staffDef
martha-thomae Sep 6, 2024
fbc48bc
Add support for the voice starting in a small note value
martha-thomae Sep 6, 2024
f0c29ff
Add another exception for imp.app
martha-thomae Sep 6, 2024
30544fc
Add support for dots of augmentation
martha-thomae Sep 7, 2024
26d218f
Add the correct quality to the dotted notes
martha-thomae Sep 7, 2024
32e0c16
Exchange conditions to check for dots first
martha-thomae Sep 9, 2024
bf54e3f
Add progress towardsimplementation of dots of division
martha-thomae Sep 9, 2024
c5e3887
Store the array of dots positions in middleSeq
martha-thomae Sep 9, 2024
3cce967
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Sep 20, 2024
40a1ac1
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Sep 25, 2024
fccc32f
Reformat
martha-thomae Sep 25, 2024
6f91e0f
Reformat
martha-thomae Sep 25, 2024
9c053d8
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 2, 2024
722c233
Add blank lines in header file
martha-thomae Oct 2, 2024
bb92458
Add typedef for ArrayOfElementDurPairs
martha-thomae Oct 2, 2024
22e491d
Remove initialization
martha-thomae Oct 2, 2024
6834c9a
Change vectors to be read-only parameters in functions
martha-thomae Oct 2, 2024
ff5dbd6
Add 'm_' to all member variables
martha-thomae Oct 2, 2024
3a74f03
Separate functionalities for modifications
martha-thomae Oct 3, 2024
422a372
Rename variables
martha-thomae Oct 12, 2024
596f8f1
Fix pair parameter in GetNumberValue to avoid copying the sequence an…
martha-thomae Oct 12, 2024
d90b059
Reformat code
martha-thomae Oct 12, 2024
8abab6e
Regroup code into smaller functions and deal with dots of perf
martha-thomae Oct 12, 2024
6f7ce99
Rearraging code into smaller functions
martha-thomae Oct 12, 2024
d8f6917
Reformat
martha-thomae Oct 12, 2024
7616ee1
Minor changes
martha-thomae Oct 12, 2024
0d15646
Fix support for dot of division (when only on dot in sequence)
martha-thomae Oct 12, 2024
c78c42f
Add 'form = div'
martha-thomae Oct 13, 2024
0246a33
Reformat
martha-thomae Oct 13, 2024
126ee36
Move the dot of division evaluation into a function
martha-thomae Oct 13, 2024
41319ca
Add case numberOfDots > 1
martha-thomae Oct 13, 2024
2bb11a3
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 14, 2024
09d8f02
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 16, 2024
e3d9e0c
Update ImplementsEndInterface
martha-thomae Oct 17, 2024
be9553c
Make variables private
martha-thomae Oct 17, 2024
4f3a424
Reformatting
martha-thomae Oct 17, 2024
47314b5
Change to use int members
martha-thomae Oct 17, 2024
585804a
Add 'this->' for method calls
martha-thomae Oct 17, 2024
c19e554
Add a bit of documentation and reorder functions
martha-thomae Oct 19, 2024
ecdc262
Fix typo
martha-thomae Oct 19, 2024
b8a08bc
Add support for perfect and imperfect mensur in GetValueInUnit
martha-thomae Oct 19, 2024
380c405
Add support to subdivide the sequences by different bounding units (s…
martha-thomae Oct 19, 2024
afac0a8
Reformat
martha-thomae Oct 19, 2024
803c9fb
Call SubdivideIntoBoundedSequences for all four note levels depending…
martha-thomae Oct 19, 2024
4f91a6a
Add support for getting the BoundedNotes for different perfect mensur…
martha-thomae Oct 19, 2024
3837c00
Add new method to avoid repetition
martha-thomae Oct 19, 2024
ebbdcf9
Clean the method and avoid repetition
martha-thomae Oct 19, 2024
ce06d28
Add boundUnit to modification-related functions and fix GetValueInUni…
martha-thomae Oct 19, 2024
506f949
Separate calculating the value of perfect notes from encoding their q…
martha-thomae Oct 20, 2024
7cf2803
Reformatting
martha-thomae Oct 20, 2024
70b75de
Fix alteration case for multiple perfect mensurations when there is a…
martha-thomae Oct 20, 2024
4c99873
Merge pull request #1 from martha-thomae/upperMensLevels
martha-thomae Oct 20, 2024
55fc195
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 20, 2024
d845675
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 22, 2024
1da089f
Add private variable initialization in the constructor
martha-thomae Oct 22, 2024
0556863
Run code at the end of the layer rather than at the beginning of the …
martha-thomae Oct 28, 2024
19760b1
Add a flag to run the scoring up
martha-thomae Oct 28, 2024
60ac0af
Capitalize method name
martha-thomae Oct 28, 2024
07e0c97
Add support for changes in mensuration
martha-thomae Oct 28, 2024
23f839f
Remove unused variable m_notationType
martha-thomae Oct 28, 2024
4a4c37e
Change some variables from global to local and viceversa
martha-thomae Oct 28, 2024
e603295
Reformatting
martha-thomae Oct 28, 2024
ec1c2d2
Fix resetting of variables to start the next voice
martha-thomae Oct 28, 2024
a349408
Merge branch 'rism-digital:develop' into scoringup_branch
martha-thomae Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/vrv/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ class Options {

OptionBool m_ligatureAsBracket;
OptionBool m_mensuralToMeasure;
OptionBool m_mensuralScoreUp;

/**
* Additional options for passing method JSON options to the command-line
Expand Down
6 changes: 3 additions & 3 deletions include/vrv/scoringupfunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ScoringUpFunctor : public Functor {
/*
* Abstract base implementation
*/
bool ImplementsEndInterface() const override { return false; }
bool ImplementsEndInterface() const override { return true; }
martha-thomae marked this conversation as resolved.
Show resolved Hide resolved

/*
* Methods
Expand All @@ -41,7 +41,7 @@ class ScoringUpFunctor : public Functor {
* @name: Divide the notes of a voice into sequences to be processed individualy
*/
///@{
void workInMensur(const ArrayOfElementDurPairs &m_dursInVoiceSameMensur, data_DURATION noteLevel);
void WorkInMensur(const ArrayOfElementDurPairs &m_dursInVoiceSameMensur, data_DURATION noteLevel);
martha-thomae marked this conversation as resolved.
Show resolved Hide resolved
std::vector<ArrayOfElementDurPairs> SubdivideIntoBoundedSequences(
const ArrayOfElementDurPairs &dursInVoiceSameMensur, data_DURATION boundUnit);
void ProcessBoundedSequences(const std::vector<ArrayOfElementDurPairs> &listOfSequences, data_DURATION boundUnit);
Expand Down Expand Up @@ -84,7 +84,7 @@ class ScoringUpFunctor : public Functor {
* Functor interface
*/
///@{
FunctorCode VisitLayer(Layer *layer) override;
FunctorCode VisitLayerEnd(Layer *layer) override;
FunctorCode VisitLayerElement(LayerElement *layerElement) override;
///@}
///
Expand Down
1 change: 0 additions & 1 deletion src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4068,7 +4068,6 @@ bool MEIInput::ReadDoc(pugi::xml_node root)
if (success) {
m_doc->ConvertToPageBasedDoc();
m_doc->ConvertMarkupDoc(!m_doc->GetOptions()->m_preserveAnalyticalMarkup.GetValue());
m_doc->ScoringUpDoc();
}

if (success && !m_hasScoreDef) {
Expand Down
5 changes: 5 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,11 @@ Options::Options()
m_mensuralToMeasure.Init(false);
this->Register(&m_mensuralToMeasure, "mensuralToMeasure", &m_mensural);

m_mensuralScoreUp.SetInfo(
"Mensural scoring up", "Score up the mensural voices by providing a dur.quality to the notes");
m_mensuralScoreUp.Init(false);
this->Register(&m_mensuralScoreUp, "mensuralScoreUp", &m_mensural);

/********* Method JSON options to the command-line *********/

m_jsonCmdLineOptions.SetLabel("Method JSON options for the command-line", "7-methodJson");
Expand Down
17 changes: 6 additions & 11 deletions src/scoringupfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,29 @@ ScoringUpFunctor::ScoringUpFunctor() : Functor()
std::list<std::pair<Note *, Dot *>> m_listOfPerfNotesDotsPairs = {};
}

FunctorCode ScoringUpFunctor::VisitLayer(Layer *layer)
FunctorCode ScoringUpFunctor::VisitLayerEnd(Layer *layer)
{
m_currentScoreTime = 0.0;
m_currentMensur = layer->GetCurrentMensur();
/*data_MODUSMAIOR modusmaior = m_currentMensur->GetModusmaior();
data_MODUSMINOR modusminor = m_currentMensur->GetModusminor();
data_TEMPUS tempus = m_currentMensur->GetTempus();
data_PROLATIO prolatio = m_currentMensur->GetProlatio();*/
// Doesn't get it from the staffDef, right?//
if (!m_dursInVoiceSameMensur.empty()) {
if (m_prolatio == 3) {
workInMensur(m_dursInVoiceSameMensur, DURATION_semibrevis);
WorkInMensur(m_dursInVoiceSameMensur, DURATION_semibrevis);
}
if (m_tempus == 3) {
workInMensur(m_dursInVoiceSameMensur, DURATION_brevis);
WorkInMensur(m_dursInVoiceSameMensur, DURATION_brevis);
}
if (m_modusMinor == 3) {
workInMensur(m_dursInVoiceSameMensur, DURATION_longa);
WorkInMensur(m_dursInVoiceSameMensur, DURATION_longa);
}
if (m_modusMaior == 3) {
workInMensur(m_dursInVoiceSameMensur, DURATION_maxima);
WorkInMensur(m_dursInVoiceSameMensur, DURATION_maxima);
}
m_dursInVoiceSameMensur = {}; // restart for next voice (layer)
}
return FUNCTOR_CONTINUE;
}

void ScoringUpFunctor::workInMensur(const ArrayOfElementDurPairs &m_dursInVoiceSameMensur, data_DURATION noteLevel)
void ScoringUpFunctor::WorkInMensur(const ArrayOfElementDurPairs &m_dursInVoiceSameMensur, data_DURATION noteLevel)
{
m_listOfSequences = this->SubdivideIntoBoundedSequences(m_dursInVoiceSameMensur, noteLevel);
this->ProcessBoundedSequences(m_listOfSequences, noteLevel);
Expand Down
3 changes: 3 additions & 0 deletions src/toolkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,9 @@ bool Toolkit::LoadData(const std::string &data, bool resetLogBuffer)

// Convert pseudo-measures into distinct segments based on barLine elements
if (m_doc.IsMensuralMusicOnly()) {
if (m_options->m_mensuralScoreUp.GetValue()) {
m_doc.ScoringUpDoc();
}
m_doc.ConvertToCastOffMensuralDoc(true);
}

Expand Down