Closed Wohlstand closed 9 months ago
This would be great to have, as an experiment I've tried using ADLMIDI to play the XMI music in our System Shock source port but with all the tracks playing at once it's just a cacophony!
WIP here: https://github.com/Interrupt/systemshock/tree/adlmidi
This is an API proposal to control which of the tracks can be played by the sequencer. It has benefit of not being tied to XMI particularly, so it can work with the rest of formats.
enum ADLMIDI_TrackOptions
{
ADL_TrackOption_On,
ADL_TrackOption_Off,
ADL_TrackOption_Solo,
};
/*Count tracks of current data in sequencer*/
int adl_getTrackCount(struct ADL_MIDIPlayer *device);
/*Set track options in sequencer*/
int adl_setTrackOptions(struct ADL_MIDIPlayer *device, int trackNumber, unsigned trackOptions);
On System Shock side:
adl_setTrackOptions(adlDevice, themeID, ADL_TrackOption_Solo)
@Interrupt you may want to try an update considering @Wohlstand has worked hard to implement a support of XMI loop events.
I made some experiments in your adlmidi-xmi
branch (before a Music AI commit), and I was able to hear some properly looped music that wasn't before.
I noted some things not supported yet, which I don't know if needed or not.
thmintro
, introthm
)@jpcima thanks for the ping! The 119 callback trigger is definitely needed by System Shock, it uses it to have the game run the Music AI to mute / unmute tracks at loops points.
I forgot to tell, that I already implemented this a while ago. It's possible to play XMI tracks as separated songs and switch between these tracks on the fly.
Because current converter does merge of all songs inside same XMI file, result becoming too cluncky. As example, music from "System Shock" game is widely uses multi-song XMI files.
XMI2MIDI: https://github.com/Wohlstand/libADLMIDI/blob/master/src/cvt_xmi2mid.hpp
adl_open[FileData]Track()
which will have one extra field - a track number). By default, open first XMI track.