Page 1 of 1

rule execution and precedence

PostPosted: Thu Jun 27, 2013 7:25 am
by derAbgang
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?

Re: rule execution and precedence

PostPosted: Thu Jun 27, 2013 1:28 pm
by matt_2013
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

Re: rule execution and precedence

PostPosted: Thu Jun 27, 2013 2:00 pm
by derAbgang
Exactly what I figured out a few moments ago and although a bit cumbersome, certainly does clean up the retriggers

thanks for the reply.