Skip to content

Commit

Permalink
Finalising tuplets handling, phase 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques-menu committed Dec 11, 2024
1 parent 9f0f76c commit 6455b70
Show file tree
Hide file tree
Showing 20 changed files with 633 additions and 996 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# shell: bash FOO
# working-directory: build
# cd build; cmake --build .
cd build ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .
cd build ; uname -a ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .

# - name: Setup TeX Live
# uses: teatimeguest/setup-texlive-action@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-20.04-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build MusicFormats for Ubuntu
run:
# cd build; cmake --build .
cd build ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .
cd build ; uname -a ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .

- name: Upload libraries and executables for Ubuntu
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# shell: bash
# working-directory: build
# cd build; cmake --build .
cd build ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .
cd build ; uname -a ; cmake -S . -B . . ; ls -salR . ; make ; ls -salR .

- name: Upload libraries and executables for Ubuntu
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
# working-directory: build
# cd build; cmake --build .
# cd build ; cmake . ; ls D:/a/musicformats/musicformats/build ; make
cd build ; cmake --help ; cmake -S . -B . . ; ls . ; make ; ls .
cd build ; uname -a ; cmake --help ; cmake -S . -B . . ; ls . ; make ; ls .


- name: Upload libraries and executables for Windows
Expand Down
2 changes: 1 addition & 1 deletion MusicFormatsVersionDate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
December 09, 2024
December 11, 2024
2 changes: 1 addition & 1 deletion MusicFormatsVersionNumber.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.9.72-step-9
v0.9.72-step-10
2 changes: 1 addition & 1 deletion include/MusicFormatsVersionDate.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define MUSICFORMATS_VERSION_DATE "December 08, 2024"
#define MUSICFORMATS_VERSION_DATE "December 09, 2024"
2 changes: 1 addition & 1 deletion include/MusicFormatsVersionNumber.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define MUSICFORMATS_VERSION_NUMBER "v0.9.72-step-8"
#define MUSICFORMATS_VERSION_NUMBER "v0.9.72-step-9"
16 changes: 5 additions & 11 deletions include/passes/mxsr2msr/mxsr2msrSkeletonBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,17 +518,8 @@ class mxsr2msrPendingTupletStop : public smartable

private:

// // private methods
// // ------------------------------------------------------
//
// void displayTupletsStack (
// const std::string& context);
//
// void handleTupletsPendingOnTupletsStack (
// int inputLineNumber);
//
// void displayLastHandledTupletInVoiceMap (
// const std::string& header);
// private methods
// ------------------------------------------------------
};
typedef SMARTP<mxsr2msrPendingTupletStop> S_mxsr2msrPendingTupletStop;
EXP std::ostream& operator << (std::ostream& os, const mxsr2msrPendingTupletStop& elt);
Expand Down Expand Up @@ -1160,6 +1151,9 @@ class EXP mxsr2msrSkeletonBuilder :
// so they aref kept aside until they are handled
std::list <S_mxsrTuplet> fPendingTupletsList;

void handleChordMemberNoteIfRelevant (
int inputStartLineNumber);

void displayPendingTupletsList (
const std::string& title,
int inputStartLineNumber) const;
Expand Down
1 change: 1 addition & 0 deletions include/passes/mxsr2msr/mxsr2msrSkeletonPopulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,7 @@ class EXP mxsr2msrSkeletonPopulator :

Bool fCurrentNoteBelongsToATuplet;
Bool fATupletIsEnding;
int fEndingTupletNumber;

// a tuplet stop may occur in a chord before the latter's last note, hence:
Bool fThereIsAPendingTupletStop; // CHORD_TUP
Expand Down
66 changes: 49 additions & 17 deletions include/representations/mxsr/mxsrEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,14 @@ class EXP mxsrEventsCollection : public smartable
int getCurrentEventSequentialNumber () const
{ return fCurrentEventSequentialNumber; }

// implicit initial forward repeat
void setThereIsAnImplicitInitialForwardRepeat ()
{ fThereIsAnImplicitInitialForwardRepeat = true; }

Bool getInitialRepeatBarIsImplicit () const
{ return fThereIsAnImplicitInitialForwardRepeat; }

// staff change events
const std::map <int, S_mxsrStaffChangeEvent>&
getStaffChangeTakeOffsMap () const
{ return fStaffChangeTakeOffsMap; }
Expand All @@ -568,14 +570,25 @@ class EXP mxsrEventsCollection : public smartable
getStaffChangeEventsList () const
{ return fStaffChangeEventsList; }

// chord events
const std::map <int, S_mxsrChordEvent>&
getChordsEventMap () const
{ return fChordsEventsMap; }

// tuplet events
const std::list <S_mxsrTupletEvent>&
getTupletsBeginsList () const
{ return fTupletsBeginsList; }

const std::list <S_mxsrTupletEvent>&
getTupletsEndsList () const
{ return fTupletsEndsList; }

const std::multimap <int, S_mxsrTupletEvent>&
getTupletsEventMultiMap () const
{ return fTupletsEventsMultiMap; }

// all events
const std::list <S_mxsrEvent>&
getAllEventsList () const
{ return fAllEventsList; }
Expand Down Expand Up @@ -615,17 +628,25 @@ class EXP mxsrEventsCollection : public smartable
int eventInputStartLineNumber,
int eventInputEndLineNumber);

void registerTupletEvent (
void registerTupletBeginEvent (
int noteSequentialNumber,
int noteEventStaffNumber,
int noteEventVoiceNumber,
int tupletNumber,
int eventInputStartLineNumber,
int eventInputEndLineNumber);

void registerTupletEndEvent (
int noteSequentialNumber,
int noteEventStaffNumber,
int noteEventVoiceNumber,
mxsrTupletEventKind tupletEventKind,
int tupletNumber,
int eventInputStartLineNumber,
int eventInputEndLineNumber);

void sortTheMxsrEventsLists ();

// staff changes
S_mxsrStaffChangeEvent
fetchStaffChangeTakeOffAtNoteSequentialNumber (
int noteSequentialNumber) const;
Expand All @@ -639,15 +660,13 @@ class EXP mxsrEventsCollection : public smartable
int noteSequentialNumber) const;

// tuplet events
// S_mxsrTupletEvent fetchTupletEventAtNoteSequentialNumber (
// int noteSequentialNumber) const;
void fetchTupletBeginsList (
int noteSequentialNumber,
std::list <S_mxsrTupletEvent>& collectedBeginsList);

void fetchTupletEventsRange (
int noteSequentialNumber,
std::multimap <int, S_mxsrTupletEvent>::const_iterator&
firstInRange,
std::multimap <int, S_mxsrTupletEvent>::const_iterator&
lastInRange) const;
void fetchTupletEndsList (
int noteSequentialNumber,
std::list <S_mxsrTupletEvent>& collectedEndsList);

private:

Expand All @@ -670,6 +689,12 @@ class EXP mxsrEventsCollection : public smartable
void printChordEvents (std::ostream& os) const;
void printTupletEvents (std::ostream& os) const;

void printTupletEventsList (
std::ostream& os,
const std::list <S_mxsrTupletEvent>& tupletsList,
const std::string& context,
int inputLineNumber) const;

private:

// private fields
Expand All @@ -681,27 +706,34 @@ class EXP mxsrEventsCollection : public smartable
// initial repeat bar
Bool fThereIsAnImplicitInitialForwardRepeat;

// there can be two staff changes per note,
// hence these two maps, indexed by note sequential number
// staff changes events
// there can be two staff changes per note,
// hence these two maps, indexed by note sequential number
std::map <int, S_mxsrStaffChangeEvent>
fStaffChangeTakeOffsMap,
fStaffChangeLandingsMap;

std::list <S_mxsrStaffChangeEvent>
fStaffChangeEventsList;

// there can be only one chord begin or end per note,
// hence this map, indexed by note sequential number
// chords events
// there can be only one chord begin or end per note,
// hence this map, indexed by note sequential number
std::map <int, S_mxsrChordEvent>
fChordsEventsMap;

// there can be several tuplets start and/or stop events per note,
// hence this multimap, indexed by note sequential number,
// tuplet events
// there can be several tuplets start and/or stop events per note,
// hence this multimap, indexed by note sequential number,

std::list <S_mxsrTupletEvent>
fTupletsBeginsList,
fTupletsEndsList;

std::multimap <int, S_mxsrTupletEvent>
fTupletsEventsMultiMap;

// all events list
// all events
std::list <S_mxsrEvent>
fAllEventsList;
};
Expand Down
Loading

0 comments on commit 6455b70

Please sign in to comment.