fix: AI-generated tracks save synth_engine + pass to applyAITrackInstrument

- Build synth_engine object with type, plugin_id, soundfont_bank,
  soundfont_program, soundfont_id
- Save to targetTrack.synth_engine so schedulePianoRollMidi reads it
- Pass synthEngine as 3rd arg to applyAITrackInstrument (was missing)
- Remove redundant separate loadSoundFont call (applyAITrackInstrument
  chains to selectInstrument which already calls loadSoundFont)
This commit is contained in:
2026-07-26 21:55:47 +07:00
parent 3b6f1ad05a
commit 0f5f494173
2 changed files with 11 additions and 5 deletions
+10 -4
View File
@@ -13873,11 +13873,17 @@ const App = () => {
if (aiTrack.soundfont_bank !== undefined && aiTrack.soundfont_program !== undefined) {
targetTrack.soundfont_bank = aiTrack.soundfont_bank;
targetTrack.soundfont_program = aiTrack.soundfont_program;
targetTrack.soundfont_id = aiTrack.soundfont_id || '';
const sfEngine = {
type: 'soundfont',
plugin_id: aiTrack.soundfont_id ? 'sf_' + aiTrack.soundfont_id : null,
soundfont_bank: aiTrack.soundfont_bank,
soundfont_program: aiTrack.soundfont_program,
soundfont_id: aiTrack.soundfont_id || ''
};
targetTrack.synth_engine = sfEngine;
if (window.SonicSF && window.SonicSF.applyAITrackInstrument) {
window.SonicSF.applyAITrackInstrument(aiTrack.soundfont_bank, aiTrack.soundfont_program);
}
if (window.SonicSF && window.SonicSF.loadSoundFont && aiTrack.soundfont_id) {
window.SonicSF.loadSoundFont(aiTrack.soundfont_id);
window.SonicSF.applyAITrackInstrument(aiTrack.soundfont_bank, aiTrack.soundfont_program, sfEngine);
}
}
});
File diff suppressed because one or more lines are too long