Is there a way to copy or change the type of instruments in the FMOD Studio scripting API?

Hi,

I’m trying to write a script that converts every SingleSound instance in an event into a ProgrammerSound that uses the SingleSound’s audioFIle as a placeholder. So far I can select every SingleSound in an event, but I’m a littl a little unsure how to convert, or if it’s possible.

Do I have to create a new ProgrammerInstrument and copy over all the properties of the SingleSound? Is there any kind of property cloning function? I’d to keep all the probability, automation, trigger conditions, etc. The only difference I want is for it to be a ProgrammerSound.

Thanks,
Rhys

Unfortunately, there’s no simple way to convert instrument types, or to copy all relevant properties and automations/modulations/etc. from one instrument to another via the scripting API. Your best bet is to create a script that enumerates all the settings from the existing instrument, the creates a new instrument and applies all the enumerated settings to the new instrument. Using the .dump() function should be helpful in identifying common properties and the best way to handle transferring automations/modulations.

That said, I do think this kind of functionality would be useful, so I’ve added to our internal feature/improvement tracker.