My managed control machine wants to know ticks and subticks

Post Reply
pac
Posts: 30
Joined: Fri Nov 25, 2011 10:22 am

My managed control machine wants to know ticks and subticks

Post by pac »

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

oskari
Site Admin
Posts: 285
Joined: Mon Nov 21, 2011 2:04 pm

Re: My managed control machine wants to know ticks and subti

Post by oskari »

Yeah it seems to be impossible. I'll add the void Work function.

User avatar
mantratronic
Posts: 296
Joined: Mon Nov 21, 2011 7:23 pm

Re: My managed control machine wants to know ticks and subti

Post by mantratronic »

i have this in a peer machine im working on

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;
        }
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!

Post Reply