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

Method exportAudio

packages/alphatab/src/synth/AlphaSynth.ts:722–759  ·  view source on GitHub ↗

* Creates a new audio exporter, initialized with the given data. * @param options The export options to use. * The track volume and transposition pitches must lists must be filled with midi channels. * @param midi The midi file to use. * @param syncPoints The sync points to use

(
        options: AudioExportOptions,
        midi: MidiFile,
        syncPoints: BackingTrackSyncPoint[],
        mainTranspositionPitches: Map<number, number>
    )

Source from the content-addressed store, hash-verified

720 * @param transpositionPitches The initial transposition pitches to apply.
721 */
722 public exportAudio(
723 options: AudioExportOptions,
724 midi: MidiFile,
725 syncPoints: BackingTrackSyncPoint[],
726 mainTranspositionPitches: Map<number, number>
727 ): IAlphaSynthAudioExporter {
728 const exporter = new AlphaSynthAudioExporter(options);
729
730 exporter.loadMidiFile(midi);
731 if (options.useSyncPoints) {
732 exporter.updateSyncPoints(syncPoints);
733 }
734 exporter.applyTranspositionPitches(mainTranspositionPitches);
735
736 for (const [channel, semitones] of options.trackTranspositionPitches) {
737 exporter.setChannelTranspositionPitch(channel, semitones);
738 }
739
740 for (const [channel, volume] of options.trackVolume) {
741 exporter.channelSetMixVolume(channel, volume);
742 }
743
744 if (options.soundFonts) {
745 for (const f of options.soundFonts!) {
746 exporter.loadSoundFont(f);
747 }
748 } else {
749 exporter.loadPresets((this.synthesizer as TinySoundFont).presets);
750 }
751
752 if (options.playbackRange) {
753 exporter.limitExport(options.playbackRange);
754 }
755
756 exporter.setup();
757
758 return exporter;
759 }
760}
761
762/**

Callers 3

testAudioExportFunction · 0.95
exportAudioFunction · 0.45

Calls 9

loadMidiFileMethod · 0.95
updateSyncPointsMethod · 0.95
channelSetMixVolumeMethod · 0.95
loadSoundFontMethod · 0.95
loadPresetsMethod · 0.95
limitExportMethod · 0.95
setupMethod · 0.95

Tested by 1

testAudioExportFunction · 0.76