14 #define K_NO_VOICE_NUMBER -99
15 #define K_VOICE_HARMONY_VOICE_BASE_NUMBER 20
16 #define K_VOICE_FIGURED_BASS_VOICE_BASE_NUMBER 40
26 static string voiceKindAsString (
27 msrVoiceKind voiceKind);
29 enum msrVoiceRepeatPhaseKind {
30 kVoiceRepeatPhaseNone,
31 kVoiceRepeatPhaseAfterCommonPart,
32 kVoiceRepeatPhaseAfterHookedEnding,
33 kVoiceRepeatPhaseAfterHooklessEnding };
35 static string voiceRepeatPhaseKindAsString (
36 msrVoiceRepeatPhaseKind
37 afterRepeatComponentPhaseKind);
39 enum msrVoiceFinalizationStatusKind {
43 static string voiceFinalizationStatusKindAsString (
44 msrVoiceFinalizationStatusKind voiceFinalizationStatusKind);
46 enum msrVoiceCreateInitialLastSegmentKind {
47 kCreateInitialLastSegmentYes, kCreateInitialLastSegmentNo };
52 static SMARTP<msrVoice> create (
54 msrVoiceKind voiceKind,
56 msrVoiceCreateInitialLastSegmentKind
57 voiceCreateInitialLastSegmentKind,
58 S_msrStaff voiceStaffUpLink);
60 SMARTP<msrVoice> createVoiceNewbornClone (
61 S_msrStaff containingStaff);
63 SMARTP<msrVoice> createVoiceDeepCopy (
65 msrVoiceKind voiceKind,
67 S_msrStaff containingStaff);
77 msrVoiceKind voiceKind,
79 msrVoiceCreateInitialLastSegmentKind
80 voiceCreateInitialLastSegmentKind,
81 S_msrStaff voiceStaffUpLink);
91 void initializeVoice (
92 msrVoiceCreateInitialLastSegmentKind
93 voiceCreateInitialLastSegmentKind);
102 S_msrStaff getVoiceStaffUpLink ()
const
103 {
return fVoiceStaffUpLink; }
107 void setVoiceKind (msrVoiceKind voiceKind)
108 { fVoiceKind = voiceKind; }
110 msrVoiceKind getVoiceKind ()
const
111 {
return fVoiceKind; }
115 void setVoiceNumber (
int voiceNumber)
116 { fVoiceNumber = voiceNumber; }
118 int getVoiceNumber ()
const
119 {
return fVoiceNumber; }
121 void setRegularVoiceStaffSequentialNumber (
122 int regularVoiceStaffSequentialNumber);
124 int getRegularVoiceStaffSequentialNumber ()
const
125 {
return fRegularVoiceStaffSequentialNumber; }
129 void setVoiceNameFromNumber (
133 string getVoiceName ()
const
134 {
return fVoiceName; }
138 S_msrVoice getHarmonyVoiceForRegularVoiceForwardLink ()
const
139 {
return fHarmonyVoiceForRegularVoiceForwardLink; }
141 S_msrVoice getRegularVoiceForHarmonyVoiceBackwardLink ()
const
142 {
return fRegularVoiceForHarmonyVoiceBackwardLink; }
146 S_msrVoice getFiguredBassVoiceForRegularVoiceForwardLink ()
const
147 {
return fFiguredBassVoiceForRegularVoiceForwardLink; }
149 S_msrVoice getRegularVoiceForFiguredBassVoiceBackwardLink ()
const
150 {
return fRegularVoiceForFiguredBassVoiceBackwardLink; }
154 const map<string, S_msrStanza>&
155 getVoiceStanzasMap ()
const
156 {
return fVoiceStanzasMap; }
160 void setVoiceLastSegmentInVoiceClone (
161 S_msrSegment segment);
163 void appendSegmentToVoiceClone (
164 S_msrSegment segment);
166 S_msrSegment getVoiceLastSegment ()
const
167 {
return fVoiceLastSegment; }
171 S_msrNote getVoiceLastAppendedNote ()
const
172 {
return fVoiceLastAppendedNote; }
176 rational getVoiceShortestNoteDuration ()
const
177 {
return fVoiceShortestNoteDuration; }
179 rational getVoiceShortestNoteTupletFactor ()
const
180 {
return fVoiceShortestNoteTupletFactor; }
184 int getVoiceActualNotesCounter ()
const
185 {
return fVoiceActualNotesCounter; }
187 int getVoiceRestsCounter ()
const
188 {
return fVoiceRestsCounter; }
190 int getVoiceSkipsCounter ()
const
191 {
return fVoiceSkipsCounter; }
193 int getVoiceActualHarmoniesCounter ()
const
194 {
return fVoiceActualHarmoniesCounter; }
196 int getVoiceActualFiguredBassesCounter ()
const
197 {
return fVoiceActualFiguredBassesCounter; }
201 void setMusicHasBeenInsertedInVoice ()
202 { fMusicHasBeenInsertedInVoice =
true; }
204 bool getMusicHasBeenInsertedInVoice ()
const
205 {
return fMusicHasBeenInsertedInVoice; }
209 void setWholeNotesSinceLastRegularMeasureEnd (
213 rational getWholeNotesSinceLastRegularMeasureEnd ()
const
214 {
return fWholeNotesSinceLastRegularMeasureEnd; }
218 void setCurrentVoiceRepeatPhaseKind (
220 msrVoiceRepeatPhaseKind
221 afterRepeatComponentPhaseKind);
223 msrVoiceRepeatPhaseKind
224 getCurrentVoiceRepeatPhaseKind ()
const
225 {
return fCurrentVoiceRepeatPhaseKind; }
230 void setVoiceContainsRestMeasures (
231 int inputLineNumber);
233 bool getVoiceContainsRestMeasures ()
const
234 {
return fVoiceContainsRestMeasures; }
238 void setVoiceContainsMeasuresRepeats (
239 int inputLineNumber);
241 bool getVoiceContainsMeasuresRepeats ()
const
242 {
return fVoiceContainsMeasuresRepeats; }
245 const list<S_msrMeasure>&
246 getVoiceMeasuresFlatList ()
const
247 {
return fVoiceMeasuresFlatList; }
256 S_msrPart fetchVoicePartUpLink ()
const;
260 void changeVoiceIdentity (
265 S_msrMeasure createMeasureAndAppendItToVoice (
267 string measureNumber,
268 msrMeasure::msrMeasureImplicitKind
269 measureImplicitKind);
271 void setNextMeasureNumberInVoice (
273 string nextMeasureNumber);
277 void appendPaddingNoteToVoice (
283 void padUpToPositionInMeasureInVoice (
285 rational wholeNotesPositionInMeasure);
287 void backupByWholeNotesStepLengthInVoice (
289 rational backupTargetMeasureElementPositionInMeasure);
293 void appendClefToVoice (S_msrClef clef);
295 void appendKeyToVoice (S_msrKey key);
297 void appendTimeToVoice (S_msrTime time);
298 void appendTimeToVoiceClone (S_msrTime time);
302 S_msrNote fetchVoiceFirstNonGraceNote ()
const;
304 void registerShortestNoteIfRelevant (S_msrNote note);
306 void registerNoteAsVoiceLastAppendedNote (S_msrNote note);
310 S_msrVoice createHarmonyVoiceForRegularVoice (
312 string currentMeasureNumber);
316 S_msrVoice createFiguredBassVoiceForRegularVoice (
318 string currentMeasureNumber);
322 void appendTransposeToVoice (
323 S_msrTranspose transpose);
327 void appendPartNameDisplayToVoice (
328 S_msrPartNameDisplay partNameDisplay);
332 void appendPartAbbreviationDisplayToVoice (
333 S_msrPartAbbreviationDisplay partAbbreviationDisplay);
337 void appendStaffDetailsToVoice (
338 S_msrStaffDetails staffDetails);
342 void appendTempoToVoice (S_msrTempo tempo);
346 void appendRehearsalToVoice (
347 S_msrRehearsal rehearsal);
351 void appendOctaveShiftToVoice (
352 S_msrOctaveShift octaveShift);
356 void appendScordaturaToVoice (
357 S_msrScordatura scordatura);
361 void appendAccordionRegistrationToVoice (
362 S_msrAccordionRegistration
363 accordionRegistration);
367 void appendHarpPedalsTuningToVoice (
368 S_msrHarpPedalsTuning
373 void appendVoiceStaffChangeToVoice (
374 S_msrVoiceStaffChange voiceStaffChange);
378 void appendNoteToVoice (S_msrNote note);
379 void appendNoteToVoiceClone (S_msrNote note);
383 void appendDoubleTremoloToVoice (
384 S_msrDoubleTremolo doubleTremolo);
388 void appendChordToVoice (S_msrChord chord);
392 void appendTupletToVoice (S_msrTuplet tuplet);
396 void appendHarmonyToVoice (
397 S_msrHarmony harmony);
399 void appendHarmonyToVoiceClone (
400 S_msrHarmony harmony);
404 void appendFiguredBassToVoice (
405 S_msrFiguredBass figuredBass);
407 void appendFiguredBassToVoiceClone (
408 S_msrFiguredBass figuredBass);
412 void appendFrameToVoice (
415 void appendFrameToVoiceClone (
420 void addGraceNotesGroupBeforeAheadOfVoiceIfNeeded (
421 S_msrGraceNotesGroup graceNotesGroup);
436 void appendSyllableToVoice (
440 S_msrSyllable syllable);
444 void appendBarCheckToVoice (
445 S_msrBarCheck barCheck);
449 void appendBarNumberCheckToVoice (
450 S_msrBarNumberCheck barNumberCheck);
454 void appendLineBreakToVoice (S_msrLineBreak lineBreak);
455 void appendPageBreakToVoice (S_msrPageBreak pageBreak);
459 void prependBarlineToVoice (S_msrBarline barline);
460 void appendBarlineToVoice (S_msrBarline barline);
464 void appendSegnoToVoice (S_msrSegno segno);
468 void appendCodaToVoice (S_msrCoda coda);
472 void appendEyeGlassesToVoice (
473 S_msrEyeGlasses eyeGlasses);
477 void appendPedalToVoice (S_msrPedal pedal);
481 void appendDampToVoice (S_msrDamp damp);
485 void appendDampAllToVoice (S_msrDampAll dampAll);
489 void prependOtherElementToVoice (
490 S_msrMeasureElement elem);
491 void appendOtherElementToVoice (
492 S_msrMeasureElement elem);
498 S_msrMeasure fetchVoiceLastMeasure (
499 int inputLineNumber)
const;
503 S_msrMeasureElement fetchVoiceLastElement (
504 int inputLineNumber)
const;
508 void removeNoteFromVoice (
512 void removeElementFromVoice (
514 S_msrElement element);
516 S_msrMeasure removeLastMeasureFromVoice (
517 int inputLineNumber);
521 void createNewLastSegmentForVoice (
525 void createNewLastSegmentFromItsFirstMeasureForVoice (
527 S_msrMeasure firstMeasure,
532 void handleRepeatEndInVoice (
534 string measureNumber,
537 void handleRepeatEndingStartInVoice (
538 int inputLineNumber);
540 void handleRepeatEndingEndInVoice (
542 string repeatEndingNumber,
543 msrRepeatEnding::msrRepeatEndingKind
546 void handleRepeatCommonPartStartInVoiceClone (
547 int inputLineNumber);
549 void handleRepeatCommonPartEndInVoiceClone (
550 int inputLineNumber);
552 void handleRepeatEndingStartInVoiceClone (
554 msrRepeatEnding::msrRepeatEndingKind
556 string repeatEndingNumber);
558 void handleRepeatEndingEndInVoiceClone (
560 string repeatEndingNumber,
561 msrRepeatEnding::msrRepeatEndingKind
564 void handleSegmentCloneEndInVoiceClone (
566 S_msrSegment segmentClone);
575 void handleRepeatStartInVoice (
576 int inputLineNumber);
578 void handleRepeatStartInVoiceClone (
582 void handleRepeatEndInVoiceClone (
583 int inputLineNumber);
585 void appendRepeatCloneToVoiceClone (
587 S_msrRepeat repeatCLone);
589 void appendRepeatEndingCloneToVoice (
590 S_msrRepeatEnding repeatEndingClone);
594 void appendRestMeasuresToVoiceElementsList (
595 S_msrRestMeasures restMeasures);
597 void createRestMeasuresInVoice (
599 int restMeasuresNumber);
601 void appendRestMeasuresToVoice (
603 S_msrRestMeasures restMeasures);
605 void appendPendingRestMeasuresToVoice (
606 int inputLineNumber);
608 void handleRestMeasuresStartInVoiceClone (
610 S_msrRestMeasures restMeasures);
612 void handleRestMeasuresEndInVoiceClone (
613 int inputLineNumber);
615 void handleRestMeasuresContentsStartInVoiceClone (
616 int inputLineNumber);
618 void handleRestMeasuresContentsEndInVoiceClone (
619 int inputLineNumber);
621 void appendRestMeasuresCloneToVoiceClone (
623 S_msrRestMeasures restMeasuresClone);
627 void appendMeasuresRepeatToVoiceElementsList (
628 S_msrMeasuresRepeat beatsRepeat);
630 void appendMeasuresRepeatReplicaToVoice (
631 int inputLineNumber);
633 void createMeasuresRepeatFromItsFirstMeasuresInVoice (
635 int beatsRepeatMeasuresNumber,
636 int beatsRepeatSlashesNumber);
638 void appendMeasuresRepeatToVoice (
640 S_msrMeasuresRepeat beatsRepeat);
642 void appendPendingMeasuresRepeatToVoice (
643 int inputLineNumber);
645 void createMeasuresRepeatAndAppendItToVoiceClone (
647 int beatsRepeatMeasuresNumber,
648 int beatsRepeatSlashesNumber);
650 void handleMeasuresRepeatStartInVoiceClone (
652 S_msrMeasuresRepeat beatsRepeat);
654 void handleMeasuresRepeatEndInVoiceClone (
655 int inputLineNumber);
657 void handleMeasuresRepeatPatternStartInVoiceClone (
658 int inputLineNumber);
660 void handleMeasuresRepeatPatternEndInVoiceClone (
661 int inputLineNumber);
663 void handleMeasuresRepeatReplicasStartInVoiceClone (
664 int inputLineNumber);
666 void handleMeasuresRepeatReplicasEndInVoiceClone (
667 int inputLineNumber);
669 void appendMeasuresRepeatCloneToVoiceClone (
671 S_msrMeasuresRepeat beatsRepeatClone);
675 S_msrStanza addStanzaToVoiceByItsNumber (
677 string stanzaNumber);
679 void addStanzaToVoiceWithoutCatchUp (
682 void addStanzaToVoice (
685 S_msrStanza createStanzaInVoiceIfNotYetDone (
690 S_msrStanza fetchStanzaInVoice (
699 void finalizeCurrentMeasureInVoice (
700 int inputLineNumber);
703 int inputLineNumber);
705 void collectVoiceMeasuresIntoFlatList (
706 int inputLineNumber);
715 void appendVoiceLastSegmentToInitialVoiceElements (
719 void moveVoiceLastSegmentToInitialVoiceElementsIfRelevant (
725 void appendHarmonyToHarmonyVoice (
726 S_msrHarmony harmony);
730 void appendFiguredBassToFiguredBassVoice (
731 S_msrFiguredBass figuredBass);
735 S_msrRepeat createARepeatAndStackIt (
739 S_msrRepeat createARepeatCloneAndStackIt (
744 void popRepeatFromRepeatDescrsStack (
749 void pushRepeatOntoRepeatDescrsStack (
754 void appendRepeatToInitialVoiceElements (
759 void appendRepeatCloneToInitialVoiceElements (
761 S_msrRepeat repeatCLone,
764 void handleVoiceLevelRepeatStartInVoice (
765 int inputLineNumber);
767 void handleNestedRepeatStartInVoice (
768 int inputLineNumber);
770 void handleVoiceLevelRepeatEndWithoutStartInVoice (
772 string measureNumber,
775 void handleVoiceLevelContainingRepeatEndWithoutStartInVoice (
777 string measureNumber,
780 void handleVoiceLevelRepeatEndWithStartInVoice (
782 string measureNumber,
785 void handleVoiceLevelRepeatEndingStartWithoutExplicitStartInVoice (
787 S_msrRepeat currentRepeat);
789 void handleVoiceLevelRepeatEndingStartWithExplicitStartInVoice (
790 int inputLineNumber);
792 void nestContentsIntoNewRepeatInVoice (
793 int inputLineNumber);
795 void handleNestedRepeatEndingStartInVoice (
796 int inputLineNumber);
798 void handleNestedRepeatEndInVoice (
800 string measureNumber,
803 void moveVoiceInitialElementsToRepeatCommonPart (
805 S_msrRepeatCommonPart repeatCommonPart,
808 void moveVoiceLastSegmentToRepeatCommonPart (
810 S_msrRepeatCommonPart repeatCommonPart,
813 void moveAllVoiceContentsToRepeatCommonPart (
815 S_msrRepeatCommonPart repeatCommonPart,
818 void moveVoiceLastSegmentToRepeatEnding (
820 S_msrRepeatEnding repeatEnding,
823 void handleHookedRepeatEndingEndInVoice (
825 string repeatEndingNumber);
827 void handleHooklessRepeatEndingEndInVoice (
829 string repeatEndingNumber);
831 void handleHookedRepeatEndingEndInVoiceClone (
833 string repeatEndingNumber);
835 void handleHooklessRepeatEndingEndInVoiceClone (
837 string repeatEndingNumber);
841 void appendRestMeasuresToInitialVoiceElements (
843 S_msrRestMeasures restMeasures,
848 void appendMeasuresRepeatToInitialVoiceElements (
850 S_msrMeasuresRepeat measuresRepeat,
855 void appendBeatsRepeatToInitialVoiceElements (
857 S_msrBeatsRepeat beatsRepeat,
865 virtual void acceptIn (basevisitor* v);
866 virtual void acceptOut (basevisitor* v);
868 virtual void browseData (basevisitor* v);
875 string voiceKindAsString ()
const;
877 string voiceNumberAsString ()
const;
879 string regularVoiceStaffSequentialNumberAsString ()
const;
881 string asShortString ()
const;
882 string asString ()
const;
888 void displayVoiceRepeatsStackRestMeasuresMeasuresRepeatAndVoice (
892 virtual void print (ostream& os)
const;
901 S_msrStaff fVoiceStaffUpLink;
904 S_msrVoice fHarmonyVoiceForRegularVoiceForwardLink;
905 S_msrVoice fRegularVoiceForHarmonyVoiceBackwardLink;
907 S_msrVoice fFiguredBassVoiceForRegularVoiceForwardLink;
908 S_msrVoice fRegularVoiceForFiguredBassVoiceBackwardLink;
912 msrVoiceKind fVoiceKind;
923 int fRegularVoiceStaffSequentialNumber;
932 static int gVoicesCounter;
934 int fVoiceActualNotesCounter;
935 int fVoiceRestsCounter;
936 int fVoiceSkipsCounter;
937 int fVoiceActualHarmoniesCounter;
938 int fVoiceActualFiguredBassesCounter;
942 bool fMusicHasBeenInsertedInVoice;
946 rational fWholeNotesSinceLastRegularMeasureEnd;
949 msrVoiceRepeatPhaseKind
950 fCurrentVoiceRepeatPhaseKind;
954 list<S_msrVoiceElement>
955 fInitialVoiceElementsList;
959 map<string, S_msrStanza>
970 S_msrSegment fVoiceLastSegment;
973 S_msrSegment fVoiceFirstSegment;
978 S_msrMeasure fVoiceFirstMeasure;
984 list<S_msrMeasure> fVoiceMeasuresFlatList;
989 S_msrNote fVoiceLastAppendedNote;
990 rational fVoiceShortestNoteDuration;
995 rational fVoiceShorftestNoteDuration;
996 rational fVoiceShortestNoteTupletFactor;
1007 void setVoiceCurrentClef (S_msrClef clef);
1009 S_msrClef getVoiceCurrentClef ()
const
1010 {
return fVoiceCurrentClef; }
1012 S_msrClef getVoiceFirstClef ()
const
1013 {
return fVoiceFirstClef; }
1015 void setVoiceCurrentKey (S_msrKey key);
1017 S_msrKey getVoiceCurrentKey ()
const
1018 {
return fVoiceCurrentKey; }
1020 void setVoiceCurrentTime (S_msrTime time);
1022 S_msrTime getVoiceCurrentTime ()
const
1023 {
return fVoiceCurrentTime; }
1027 const string getVoiceCurrentMeasureNumber ()
const
1028 {
return fVoiceCurrentMeasureNumber; }
1030 void incrementVoiceCurrentMeasurePuristNumber (
1031 int inputLineNumber,
1034 void setVoiceCurrentMeasurePuristNumber (
1035 int measurePuristNumber)
1036 { fVoiceCurrentMeasureNumber = measurePuristNumber; }
1038 const int getVoiceCurrentMeasurePuristNumber ()
const
1039 {
return fVoiceCurrentMeasurePuristNumber; }
1041 void setVoiceFirstMeasure (
1042 S_msrMeasure measure)
1043 { fVoiceFirstMeasure = measure; }
1045 const S_msrMeasure getVoiceFirstMeasure ()
const
1046 {
return fVoiceFirstMeasure; }
1048 void appendMeasureCloneToVoiceClone (
1049 int inputLineNumber,
1050 S_msrMeasure measureClone);
1057 void displayVoiceRepeatsStackSummary (
1058 int inputLineNumber,
1061 void displayVoiceRepeatsStack (
1062 int inputLineNumber,
1065 void displayVoiceRepeatsStackAndVoice (
1066 int inputLineNumber,
1069 void displayVoiceRestMeasures (
1070 int inputLineNumber,
1073 void displayVoiceRestMeasuresAndVoice (
1074 int inputLineNumber,
1077 void displayVoiceMeasuresRepeat (
1078 int inputLineNumber,
1081 void displayVoiceMeasuresRepeatAndVoice (
1082 int inputLineNumber,
1093 S_msrClef fVoiceCurrentClef;
1095 S_msrKey fVoiceCurrentKey;
1097 S_msrTime fVoiceCurrentTime;
1100 S_msrClef fVoiceFirstClef;
1104 string fVoiceCurrentMeasureNumber;
1106 int fVoiceCurrentMeasurePuristNumber;
1113 S_msrMeasure fVoiceCurrentMeasure;
1116 list<S_msrRepeatDescr>
1117 fVoicePendingRepeatDescrsStack;
1124 S_msrRestMeasures fVoicePendingRestMeasures;
1129 S_msrRestMeasures fVoiceRestMeasuresWaitingForItsNextMeasureNumber;
1130 int fVoiceRemainingRestMeasures;
1132 bool fVoiceContainsRestMeasures;
1139 S_msrMeasuresRepeat fVoicePendingMeasuresRepeat;
1141 bool fVoiceContainsMeasuresRepeats;
1145 bool fVoiceHasBeenFinalized;
1147EXP ostream& operator<< (ostream& os,
const S_msrVoice& elt);
Definition: msrVoices_MUT_DEP.h:8
Rational number representation.
Definition: rational.h:25