In the c# API, you make a control machine by not giving it any Work function. But i need to handle ticks and subticks ! If my machine wants to do anything without patterns (ie controlling other machines according to the song time), as far as i can tell there is no way of doing this in the current API.
I tried subscribing to Song.PlayPosition and got some strange results : it gets fired multiple times per tick in a seemingly random way (and anyways it doesn't have subticks.) So it would be useful to have an event or a special version of Work() for control machines (maybe void Work() ?)
Peace
My managed control machine wants to know ticks and subticks
Re: My managed control machine wants to know ticks and subti
Yeah it seems to be impossible. I'll add the void Work function.
- mantratronic
- Posts: 296
- Joined: Mon Nov 21, 2011 7:23 pm
Re: My managed control machine wants to know ticks and subti
i have this in a peer machine im working on
host is the IBuzzMachineHost host from the constructor
gets called without input and updates ok. not done the testing to say it works perfect, but maybe it'll help?
edit: just checked and it needs to be connected to master, would be nice to have the void work() instead!
Code: Select all
public bool Work(Sample[] output, int n, WorkModes mode)
{
if ((host.SubTickInfo.CurrentSubTick == 0) || (subTickCount > (host.SubTickInfo.SubTicksPerTick / updatesPerTick)))
{
for (int i = 0; i < Peers.Count; i++)
{
Peer p = Peers[i];
if ((p != null) && p.OnOff)//&& (tracks[i].peerOnOff))
{
p.Update();
}
}
subTickCount = 0;
}
if (host.SubTickInfo.PosInSubTick == 0)
subTickCount++;
return true;
}
gets called without input and updates ok. not done the testing to say it works perfect, but maybe it'll help?
edit: just checked and it needs to be connected to master, would be nice to have the void work() instead!