MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / finish

Method finish

packages/alphatab/src/model/Beat.ts:923–1223  ·  view source on GitHub ↗
(settings: Settings, sharedDataBag: Map<string, unknown> | null = null)

Source from the content-addressed store, hash-verified

921 }
922
923 public finish(settings: Settings, sharedDataBag: Map<string, unknown> | null = null): void {
924 if (
925 this.getAutomation(AutomationType.Instrument) === null &&
926 this.index === 0 &&
927 this.voice.index === 0 &&
928 this.voice.bar.index === 0 &&
929 this.voice.bar.staff.index === 0
930 ) {
931 this.automations.push(
932 Automation.buildInstrumentAutomation(false, 0, this.voice.bar.staff.track.playbackInfo.program)
933 );
934 }
935
936 switch (this.graceType) {
937 case GraceType.OnBeat:
938 case GraceType.BeforeBeat:
939 const numberOfGraceBeats: number = this.graceGroup!.beats.length;
940 // set right duration for beaming/display
941 if (numberOfGraceBeats === 1) {
942 this.duration = Duration.Eighth;
943 } else if (numberOfGraceBeats === 2) {
944 this.duration = Duration.Sixteenth;
945 } else {
946 this.duration = Duration.ThirtySecond;
947 }
948 break;
949 }
950
951 if (this.brushType === BrushType.None) {
952 this.brushDuration = 0;
953 }
954
955 const tremolo = this.tremoloPicking;
956 if (tremolo !== undefined) {
957 if (tremolo.marks < TremoloPickingEffect.minMarks || tremolo.marks > TremoloPickingEffect.maxMarks) {
958 this.tremoloPicking = undefined;
959 }
960 }
961
962 const displayMode: NotationMode = !settings ? NotationMode.GuitarPro : settings.notation.notationMode;
963 let isGradual: boolean = this.text === 'grad' || this.text === 'grad.';
964 if (isGradual && displayMode === NotationMode.SongBook) {
965 this.text = '';
966 }
967 let needCopyBeatForBend: boolean = false;
968 this.minNote = null;
969 this.maxNote = null;
970 this.minStringNote = null;
971 this.maxStringNote = null;
972 let visibleNotes: number = 0;
973 let isEffectSlurBeat: boolean = false;
974 for (let i: number = 0, j: number = this.notes.length; i < j; i++) {
975 const note: Note = this.notes[i];
976 note.dynamics = this.dynamics;
977 note.finish(settings, sharedDataBag);
978 if (note.isLetRing) {
979 this.isLetRing = true;
980 }

Callers

nothing calls this directly

Calls 10

getAutomationMethod · 0.95
updateDurationsMethod · 0.95
findTieOriginMethod · 0.80
addBendPointMethod · 0.80
insertBeatMethod · 0.80
pushMethod · 0.45
spliceMethod · 0.45
cloneMethod · 0.45
addBeatMethod · 0.45

Tested by

no test coverage detected