buzz forums

forums of the buzz
It is currently Tue Jul 16, 2019 9:05 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Feb 17, 2014 12:20 pm 

Joined: Fri Nov 25, 2011 10:22 am
Posts: 28
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


Top
 Profile  
 
PostPosted: Mon Feb 17, 2014 12:38 pm 
Site Admin

Joined: Mon Nov 21, 2011 2:04 pm
Posts: 277
Yeah it seems to be impossible. I'll add the void Work function.


Top
 Profile  
 
PostPosted: Mon Feb 17, 2014 5:44 pm 
User avatar

Joined: Mon Nov 21, 2011 7:23 pm
Posts: 294
i have this in a peer machine im working on

Code:
      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!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group