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

Method setup

packages/alphatab/src/synth/AlphaSynth.ts:880–897  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

878 private _generatedAudioEndTime: number = 0;
879
880 public setup() {
881 this._synth.setupMetronomeChannel(this._sequencer.metronomeChannel, this._synth.metronomeVolume);
882
883 const syncPoints = this._sequencer.currentSyncPoints;
884 const alphaTabEndTime = this._sequencer.currentEndTime;
885
886 if (syncPoints.length === 0) {
887 this._generatedAudioEndTime = alphaTabEndTime;
888 } else {
889 const lastSyncPoint = syncPoints[syncPoints.length - 1];
890 let endTime = lastSyncPoint.syncTime;
891 const remainingTicks = this._sequencer.currentEndTick - lastSyncPoint.synthTick;
892 if (remainingTicks > 0) {
893 endTime += MidiUtils.ticksToMillis(remainingTicks, lastSyncPoint.syncBpm);
894 }
895 this._generatedAudioEndTime = endTime;
896 }
897 }
898
899 public render(milliseconds: number): AudioExportChunk | undefined {
900 if (this._sequencer.isFinished) {

Callers 1

exportAudioMethod · 0.95

Calls 2

ticksToMillisMethod · 0.80
setupMetronomeChannelMethod · 0.65

Tested by

no test coverage detected