buzz forums

forums of the buzz
It is currently Fri Dec 13, 2019 10:00 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Sep 13, 2012 8:10 pm 
User avatar

Joined: Wed Nov 23, 2011 3:24 pm
Posts: 702
When my new build of PeerScale (download) is targeting the newest build of PeerChord (download), if you adjust the PeerScale's 'Peer me!' parameter the PeerChord correctly triggers notes on its target machine. But if you add a pattern for PeerScale and put some values in the 'Peer me!' column, the PeerChord doesn't trigger any notes.

Here's a template with this setup (when you load it, it will play a chord immediately so you'll have to hit stop.)

If you hit play and look at the PeerChord parameter window, you can see the Chord Type param is being changed but it seems that no note is received to go with it. I have the source for PeerChord so I built that too and confirmed that it definitely doesn't receive the 'Root Note' value.

After a bit of head scratching and poking about in the code of both 'Scale and 'Chord, I thought of changing the PeerScale pattern editor from Pattern XP to the old built-in one, which made no difference. Then I changed to the new WPF pattern editor and suddenly the PeerChord worked properly, my breakpoints were hit and notes were played (pattern data for the built-in editors wasn't saved in the template so you'll have to do that yourself, sorry :().

So this looks like a bug in Buzz, or perhaps a really weird bug in one of the peer machines that is somehow circumvented by the new pattern editor. Oskari, please could you look at this? Even if you just confirm whether it's a Buzz bug or not, so I know whether to keep looking for it.


Last edited by IXix on Fri Aug 02, 2013 2:30 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Aug 01, 2013 3:28 pm 
User avatar

Joined: Wed Nov 23, 2011 3:24 pm
Posts: 702
Still trying to figure this out. I've found that the I get the same problem trying to control IX Split from PeerScale. Pattern data only works in the new WPF editor. If PeerScale targets a synth directly, it works fine from any kind of pattern.

So it looks like it's only pt_note parameters on control machines that don't respond properly from old/PXP patterns. All three machines are MIF_CONTROL_MACHINE and MIF_NO_OUTPUT. The PeerScale->PeerMe! param is MPF_STATE and MPF_TICK_ON_EDIT.

For PeerChord, PeerScale does this in Tick()...
Code:
pCB->ControlChangeImmediate(pc.GetMachine(), GROUP_TRACK, targettrack, 1, p->chord); // Chord
pc.ControlChange_Immediate(targettrack, (octave << 4) + p->root + 1); // Note

For any other machine it just does this...
Code:
pc.ControlChange_Immediate(targettrack, nval);

CPeerCtrl::ControlChange_Immediate() looks like this...
Code:
void CPeerCtrl::ControlChange_Immediate(int track, int value)
{
   if (track == TRACK_DEFAULT)
      track = m_track;
   if (track == TRACK_DEFAULT && m_track == TRACK_DEFAULT)
      track = 0;

   if (GotParam())
   {
      if (m_group == GROUP_ATTRIBUTE)
      {
         char txt[256];
         _snprintf(txt, 256, "pCB->SetAttribute(%p,%i,%i)", m_targetmac, m_paramn, value);
         OutputDebugString(txt);

         pCB->SetAttribute(m_targetmac, m_paramn, value);
         if (s_immediatebatchmode)
            s_attributebatch.insert(m_targetmac);
         else
            pCB->AttributesChanged(m_targetmac);
      }
      else
      {
         pCB->ControlChangeImmediate(m_targetmac,
            m_group,
            track,
            GetParamNumber_Grouped(),
            value);

         if (s_immediatebatchmode)
            s_immediatebatch.insert(m_targetmac);
         else
            pCB->SendControlChanges(m_targetmac);
      }
   }
}

The problem is the same regardless of whether s_immediatebatchmode is true or false. :cry:


Top
 Profile  
 
PostPosted: Fri Aug 02, 2013 2:28 pm 
User avatar

Joined: Wed Nov 23, 2011 3:24 pm
Posts: 702
I've made a simple machine and bmx to demonstrate this problem. The machine has two note params (one global, one track) and a byte param called "Control" and can control another instance of the same machine (set via the dialog). When the Control param is adjusted, the machine sends a global and track note to the target machine. To keep it as simple as possible, I've just used Buzz callbacks to do the control changes, no PeerLib.

The test song is using PatternXP as the pattern editor so make sure the old pattern editor is active.

1. Load the bmx and open the debug console.
2. Manually adjust the "Control" param in the Sender machine param window. The debug console should show that the sender sent some notes and the receiver received them.
3. Hit play. The sender machine control param moves to reflect the values in the pattern but the debug console should show that the receiver doesn't receive the notes.

I've attached the test machine source, dlls and bmx.


Attachments:
File comment: bmx
Test Song.zip [780 Bytes]
Downloaded 146 times
File comment: VS2010 Solution
Test Machine Source.zip [35.63 KiB]
Downloaded 146 times
File comment: Test generator
Test Machine.zip [1.92 MiB]
Downloaded 149 times
Top
 Profile  
 
PostPosted: Wed Aug 07, 2013 8:24 pm 
User avatar

Joined: Wed Nov 23, 2011 3:24 pm
Posts: 702
I figured it out! You can't call pCB->ControlChangeImmediate() from Tick(). The PeerLib2 docs actually mention that fact so I guess BTD got it from Oskari at some point. I must've read it too at some point but failed to remember it when it was important.

New build of PeerScale soon! :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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