Problems with and s.newBusAllocators

I have a codebase that uses a couple of control busses. In this scenario, HPZ1( and HPZ1( are fed into 2 busses in a synth (inX and inY) and output as x+y, ( outbus ). I have to do a s.newBusAllocators to get inX and inY to have any values, but even so inY and inX have the same values.

How do I place s.newBusAllocators such that it automatically gets called when the main code gets evaluated? What would be the reason that inX and inY have the same values even though they’re set to different busses?

It would be helpful if you could post some example code? Calling s.newBusAllocators is probably a red herring for you here – this is almost surely not doing what you’re intending, this function is called automatically and should more or less never be called by user code, ever.

I placed the s.newBusAllocators to the cmdperiod so it’ll reset the bus numbering allocation. So far that works fine.

The code is a bit long but basically its this:

mouseX ----->| synth selectconnect |--------> | synth transform | ----> | synth saw |
mouseY------>|                                  |

The program structure is like

init variables
init synth

collate mappings for midi controller and mouse, and the parameters they are attached to

generate gui from collation
 arg mx,my,tx=0,ty=0,outbus,isOn=0;
 var inx,iny,sigx,sigy,res;;;
 res=sigx + sigy;,res*isOn);

x=Synth(\selectconnect, [ ......

Right now what happens is, i’ve generated a gui with a bunch of buttons, the weird thing is when I do a callback and …

As I’m typing this I realised I made a typo and set the busses wrongly, mixing the args and the vars. Alls good now. Still wondering about the bus allocation though. Maybe doing a Synth(\selectconnect, [ \varname: ~bus ] ); somehow clobbered memory.