filling in slots Halion vs Sonic

Hi,

I finally made a test instrument (aimed also at H Sonic users) that takes an program and fills up the 16 slots in Halion 6 5the A slots)

Little code to make it work:

program = this.program.instance:getProgram(1)

t=1
repeat
– clear slot t of the Slot Rack before assigning
this.program.instance:getSlot(t):setProgram(nil)
this.program.instance:getSlot(t):setProgram(program)
t=t+1
until t>16

Point is that after creating the Instrument with the library creator tool (yes we DO have to save/convert H Sonic layer sounds into programs to get this working :wink:) and the instrument registered in the library manager, all works fine in Halion!! Program shows up, macropage OK, sounds open up into the 16 slots. In H Sonic however, the instrument shows up, macropage OK, but sounds are opened up only in the first slot!?

Does someone know what I’m missing? Is it the fact that Halion has the A,B,C and D slots and Sonic not?

Someone a clue?

Thanks
L.

As for the code, couldn’t this work too:

program = this.program.instance:getProgram(1)

	for i = 2, 16 do
		this.program.instance:getSlot(i):setProgram(program)
	end

With a for loop you don’t need to manually iterate. Having the setProgram(nil) in each loop might be unnecessary function calls. Unless the other slots are filled, but I’m not sure.

I did see that the setProgram() function is part of the Halion script controller thread, so it should be in the UI script. Strictly speaking it should have given you an error on running this in the script module.

I know the manual example mixes UI and module script too, but this might be why Sonic doesn’t complete the slot loads.

If I find anything else I’ll let you know.

Yes Aposmus you’re completely right, Will try out if this will work on Halion Sonic too. Thanks