Load midi files during runtime

I like to place a music file and its corresponding midi file in a folder structure, which should be loaded during runtime. How can I achieve that?

Are AssetBundles the way to go with custom ScriptedImporter?

do you want to load & play midi files at runtime from certain folder,
or import midi files into editor and convert them into wav’s (or other supported audio format) using custom importer ?

The first one. I like to load and play midi files during runtime in an iOS/Android game but I don’t know how to place a “.mid” file in an Asset Bundle. Or is there another way?

i’d check some plugins like,

https://github.com/n-yoda/unity-midi

if cannot add .mid file into asset bundle, i guess .bytes extension should work.
then from asset bundle could save it to device as .midi file,
or directly feed the bytes into those midi players (probably they read .mid files as binary and then parse).

1 Like

Good idea. I will try it with .bytes and see if it works.

you may wish to look around the VRchat community as they have a few solutions working with Midi

it worked in my case. thanks for this thread.

It’s good to show appreciation but please use the “Like” button in the future so you don’t end up necroposting threads.

Thanks.

1 Like