Hello!
I’m having some troubles with assigning the sounds to multisound instrument via js scrpipt;
In my script I create the event, add tracks to it and want to add sounds from the asset bin.
When I use this method for just a single sound instrument:
var sample = track.addSound(wEvent.timeline, 'SingleSound', 0, 10);
sample.audioFile = studio.project.workspace.masterAssetFolder.getAsset("sound.wav");
all looks good, event is playable and doesn’t have any errors;
However, when I try to propagate sounds to multi sound instrument - I just can’t find right answers for how to do it
Can’t find anything precise in the api reference. From some tutorials I got the idea that you need to create Multi instrument on the timeline first, and then add single sounds, than make the multi sound “owner” of single sounds, something like this:
var multiInstrument = track.addSound(wEvent.timeline, 'MultiSound', 0, 10);
var sample = track.addSound(wEvent.timeline, 'SingleSound', 0, 10);
sample.audioFile = studio.project.workspace.masterAssetFolder.getAsset("sound.wav");
sample.owner = multiInstrument;
Yet, this approach creates something super wierd - you get the multi instrument that has this single sound in itself, but also single sound is on the timeline on top of multi instrument. Also, fmod can’t play that event at all, the playhead just stays forever in place.
So what should be a proper way to add sounds to multi instrument via script?
Thanks in advance!
Marcin