ID:174918
 
I was wondering if its possible(and how) to store a midi thats currently playing into a variable and have it play when you call that variable. example: Im walking around and this sceen happends(could happen anywhere so the midi playing could be anything.) and durring it the midi changes. And when it ends it goes back to the original midi which could have been anything.
Cloudiroth wrote:
I was wondering if its possible(and how) to store a midi thats currently playing into a variable and have it play when you call that variable. example: Im walking around and this sceen happends(could happen anywhere so the midi playing could be anything.) and durring it the midi changes. And when it ends it goes back to the original midi which could have been anything.

In the current version of BYOND, there's no event to notify you when a sound has stopped playing, so you have two options: create a datum for each MIDI file that knows the number of ticks the music will last, or just resign yourself to letting the MIDI loop (or play once and then be silent) until a new MIDI event is triggered. The latter is your best bet if you don't have a lot of programming experience yet. I seem to remember that Spuzzum made a sound priority library at one point, many moons ago, but I don't know if it'd help here or not.