Trouble using multiple programmer instruments and loading in new sounds

Hey! I’m having trouble getting multiple programmer instruments to work in the same event. I was hoping to access the property “parameter.name” in the event’s callback(to differentiate between programmer instruments) but have only had success doing this with the first programmer instrument in the event. For context, both programmer instruments are stored in separate audio tracks.

I was also hoping to find a way to load a new sound into a programmer instrument at runtime, after already having played/loaded the initial sound. As far as I can tell the CREATE_PROGRAMMER_SOUND callback is the only chance you have to actually load a sound into a programmer instrument, and was hoping there might be some type of workaround. If the CREATE_PROGRAMMER_SOUND callback occurs every time the beginning of a programmer instrument is reached this would also be very useful information, as the event is also an indefinite loop.

The idea here is to seamlessly transition between songs, and I’ve so far concluded that creating multiple events to accomplish this will always lead to some small, but noticeable degree of latency. This is all being done in the latest version of FMOD with unity’s FMOD integration API.

*The sound array is loaded in from the instance’s user data, containing multiple pieces of information: an array of FMOD.sound objects, a corresponding array of FMOD.studio.SOUND_INFO objects, and an object used to store timeline information such as the current beat, bar, and ms timeline position. I was hoping to use the setUserData() function to effectively pass in newly loaded sounds as needed.

case FMOD.Studio.EVENT_CALLBACK_TYPE.CREATE_PROGRAMMER_SOUND:
{

                    var parameter = (FMOD.Studio.PROGRAMMER_SOUND_PROPERTIES)Marshal.PtrToStructure(parameterPtr, typeof(FMOD.Studio.PROGRAMMER_SOUND_PROPERTIES));

                    if((string)parameter.name == "PI")
                    {
                    //this branch has been executed each time without fail
                        parameter.sound = sounds[0].handle;
                        parameter.subsoundIndex = soundInfo[0].subsoundindex;
                        Marshal.StructureToPtr(parameter, parameterPtr, false);
                    } 
                    else if((string)parameter.name == "PI2")
                    {
                    //code here never seems to be executed
                        parameter.sound = sounds[1].handle;
                        parameter.subsoundIndex = soundInfo[1].subsoundindex;
                        Marshal.StructureToPtr(parameter, parameterPtr, false);
                    }

                    
                                                         
                }