From e687cf02bb7e2ef8f4f9ea31b6e68810097c7ab9 Mon Sep 17 00:00:00 2001 From: josc146 Date: Wed, 29 Nov 2023 19:17:19 +0800 Subject: [PATCH] try to use local soundfont by default --- frontend/src/startup.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/startup.ts b/frontend/src/startup.ts index 9c85c39..10d7e0d 100644 --- a/frontend/src/startup.ts +++ b/frontend/src/startup.ts @@ -1,5 +1,5 @@ import commonStore, { MonitorData, Platform } from './stores/commonStore'; -import { GetPlatform, ListDirFiles, ReadJson } from '../wailsjs/go/backend_golang/App'; +import { FileExists, GetPlatform, ListDirFiles, ReadJson } from '../wailsjs/go/backend_golang/App'; import { Cache, checkUpdate, downloadProgramFiles, LocalConfig, refreshLocalModels, refreshModels } from './utils'; import { getStatus } from './apis'; import { EventsOn, WindowSetTitle } from '../wailsjs/runtime'; @@ -148,4 +148,10 @@ async function initMidi() { EventsOn('midiMessage', async (data: MidiMessage) => { await (await import('./pages/AudiotrackManager/AudiotrackEditor')).midiMessageHandler(data); }); + if (await FileExists('assets/sound-font/accordion/instrument.json')) { + commonStore.setCompositionParams({ + ...commonStore.compositionParams, + useLocalSoundFont: true + }); + } }