Attention:

Welcome to the old forum. While it is no longer updated, there is a wealth of information here that you may search and learn from.

To partake in the current forum discussion, please visit https://forums.presonus.com

rule execution and precedence

rule execution and precedence

Postby derAbgang » Thu Jun 27, 2013 7:25 am

I have rules defined in this order:

Code: Select all
    <rule name="default">
      <!-- if this flag remains set. pitch=24 will trigger -->
      <set-flag name="default" />
    </rule>

    <rule name="qleg">
      <if midi-channel="1"/>
      <if technique="qleg" />
      <if condition="under-slur" />
      <unset-flag name="default" />
      <key-switch type="note-on-prefix" midi-pitch="25" velocity="1" />
    </rule>

    <rule name="staccatissimo">
      <if midi-channel="1"/>
      <if articulation="staccatissimo" />
      <velocity-change bump="10" />
      <unset-flag name="default" />
      <key-switch type="note-on-prefix" midi-pitch="32" velocity="1" />
    </rule>

    <rule name="ks-default">
      <if midi-channel="1"/>
      <if flag="default" />
      <key-switch type="note-on-prefix" midi-pitch="24" velocity="1" />
    </rule>


With a note that is under a slur (last note of a phrase) and has a staccato articulation, it appears both key-switches (midi-pitch="25" and midi-pitch="32") are being triggered: 25 first and then 32. I can see this clearly using MIDI-OX

I assumed that only 1 rule would actually "fire" and the precedence is in file order (last defined having higher precedence than first). Basically, I would expect only midi-pitch="32" to be triggered.

This is an important assumption as without it, any key-switch event that matches gets sent to the VST leading to a pretty cluttered MIDI event stream.

Any thoughts?
derAbgang
 
Posts: 32
Joined: Wed Feb 23, 2011 4:09 am

Re: rule execution and precedence

Postby matt_2013 » Thu Jun 27, 2013 1:28 pm

You could simply add "<if flag="default" />" to the beginning of both your "qleg" and "staccatissimo" rules. Then only the key-switch to 25 would triggered since "qleg" unsets the "default" so that "staccatissimo" will no longer trigger.

I hope this helps.

Matthias
matt_2013
 
Posts: 10
Joined: Thu Jan 03, 2013 3:05 pm

Re: rule execution and precedence

Postby derAbgang » Thu Jun 27, 2013 2:00 pm

Exactly what I figured out a few moments ago and although a bit cumbersome, certainly does clean up the retriggers

thanks for the reply.
derAbgang
 
Posts: 32
Joined: Wed Feb 23, 2011 4:09 am


Return to Custom Rules Discussion

Who is online

Users browsing this forum: No registered users and 1 guest


cron