|
@@ -89,7 +89,10 @@ export class VexflowStafflineNoteCalculator implements IStafflineNoteCalculator
|
|
return graphicalNote;
|
|
return graphicalNote;
|
|
}
|
|
}
|
|
const currentPitchList: Array<Pitch> = this.staffPitchListMapping.getValue(staffIndex);
|
|
const currentPitchList: Array<Pitch> = this.staffPitchListMapping.getValue(staffIndex);
|
|
- const positionByXml: boolean = this.rules.PercussionOneLineUseXMLDisplayStep && graphicalNote.sourceNote.displayStepUnpitched !== undefined;
|
|
|
|
|
|
+ const xmlSingleStaffline: boolean = graphicalNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaff.StafflineCount === 1;
|
|
|
|
+ const positionByXml: boolean = this.rules.PercussionOneLineUseXMLDisplayStep &&
|
|
|
|
+ graphicalNote.sourceNote.displayStepUnpitched !== undefined &&
|
|
|
|
+ xmlSingleStaffline;
|
|
if (currentPitchList.length > this.rules.PercussionOneLineCutoff && !positionByXml) {
|
|
if (currentPitchList.length > this.rules.PercussionOneLineCutoff && !positionByXml) {
|
|
//Don't need to position notes. We aren't under the cutoff
|
|
//Don't need to position notes. We aren't under the cutoff
|
|
return graphicalNote;
|
|
return graphicalNote;
|
|
@@ -97,24 +100,20 @@ export class VexflowStafflineNoteCalculator implements IStafflineNoteCalculator
|
|
const vfGraphicalNote: VexFlowGraphicalNote = graphicalNote as VexFlowGraphicalNote;
|
|
const vfGraphicalNote: VexFlowGraphicalNote = graphicalNote as VexFlowGraphicalNote;
|
|
const notePitch: Pitch = graphicalNote.sourceNote.Pitch;
|
|
const notePitch: Pitch = graphicalNote.sourceNote.Pitch;
|
|
|
|
|
|
|
|
+ let displayNote: NoteEnum = this.baseLineNote;
|
|
|
|
+ let displayOctave: number = this.baseLineOctave;
|
|
|
|
+ if (this.rules.PercussionOneLineUseXMLDisplayStep
|
|
|
|
+ && graphicalNote.sourceNote.displayStepUnpitched !== undefined
|
|
|
|
+ && xmlSingleStaffline) {
|
|
|
|
+ displayNote = graphicalNote.sourceNote.displayStepUnpitched;
|
|
|
|
+ displayOctave = graphicalNote.sourceNote.displayOctaveUnpitched + this.rules.PercussionOneLineXMLDisplayStepOctaveOffset;
|
|
|
|
+ }
|
|
//If we only need to render on one line
|
|
//If we only need to render on one line
|
|
if (currentPitchList.length <= this.rules.PercussionForceVoicesOneLineCutoff) {
|
|
if (currentPitchList.length <= this.rules.PercussionForceVoicesOneLineCutoff) {
|
|
- let displayNote: NoteEnum = this.baseLineNote;
|
|
|
|
- let displayOctave: number = this.baseLineOctave;
|
|
|
|
- if (this.rules.PercussionOneLineUseXMLDisplayStep && graphicalNote.sourceNote.displayStepUnpitched !== undefined) {
|
|
|
|
- displayNote = graphicalNote.sourceNote.displayStepUnpitched;
|
|
|
|
- displayOctave = graphicalNote.sourceNote.displayOctaveUnpitched + this.rules.PercussionOneLineXMLDisplayStepOctaveOffset;
|
|
|
|
- }
|
|
|
|
vfGraphicalNote.setAccidental(new Pitch(displayNote, displayOctave, notePitch.Accidental));
|
|
vfGraphicalNote.setAccidental(new Pitch(displayNote, displayOctave, notePitch.Accidental));
|
|
} else {
|
|
} else {
|
|
const pitchIndex: number = VexflowStafflineNoteCalculator.PitchIndexOf(currentPitchList, notePitch);
|
|
const pitchIndex: number = VexflowStafflineNoteCalculator.PitchIndexOf(currentPitchList, notePitch);
|
|
if (pitchIndex > -1) {
|
|
if (pitchIndex > -1) {
|
|
- let displayNote: NoteEnum = this.baseLineNote;
|
|
|
|
- let displayOctave: number = this.baseLineOctave;
|
|
|
|
- if (this.rules.PercussionOneLineUseXMLDisplayStep && graphicalNote.sourceNote.displayStepUnpitched !== undefined) {
|
|
|
|
- displayNote = graphicalNote.sourceNote.displayStepUnpitched;
|
|
|
|
- displayOctave = graphicalNote.sourceNote.displayOctaveUnpitched + this.rules.PercussionOneLineXMLDisplayStepOctaveOffset;
|
|
|
|
- }
|
|
|
|
const half: number = Math.ceil(currentPitchList.length / 2);
|
|
const half: number = Math.ceil(currentPitchList.length / 2);
|
|
if (!this.rules.PercussionOneLineUseXMLDisplayStep) {
|
|
if (!this.rules.PercussionOneLineUseXMLDisplayStep) {
|
|
if (pitchIndex >= half) {
|
|
if (pitchIndex >= half) {
|