Page 1 of 1

Correct use of flags … please help!!!

Posted: Tue Aug 30, 2016 4:05 pm
by waynerose1
Having watched the video, and read the Custom Rules GUI page aa well as every other scrap of info I can find, including this entire thread - I have to admit: I'm stuck. :cry:

https://www.youtube.com/watch?v=WLzgtJNcHsU

In the video, the demonstrator sets the flag "main", then immediately unsets "main" and sets the flag "stac". After using flag "stac", he uses flag "main" as the very last rule, which he has previously unset. This makes no sense to me (I do have previous programming experience).

The video goes on to demonstrate how different actions can be applied using flag "stac", And the two different staccato sounds in the score play as expected. However, the video never goes on to show how to return to normale or legato. It's assumed that the last rule, which as I said, uses flag main and sends a non-staccato keyswitch will do the job. But …

When I copied the code as shown in the video, but simply wanting to play a staccato sound and return to a normal sound, it didn't work. Everything came out staccato, including notes that had no articulation set in my little working score.

I should mention, I'm using keyswitches in NI Session Strings Pro.

My first question is why is there no "articulation is not" condition, similar to "technique is on" and "technique is not". It would make things a lot easier.

That aside, my understanding of set flag is that it functions like a call label in programming, i.e., the flag can be used to call and modify conditiions in a subroutine. In other words, you have to set it before you can use it. If you unset it, it's lost. Am I wrong on this point?

Edit: Turns out I apparently am wrong on this point. The earlier video discussing use of flags in Notion 4 points out that whenever a flag is set, all other flags that do not pertain to it must be unset. Live and learn. :oops:

https://www.youtube.com/watch?v=u6DU-azPR3c

My predilection would be to set all my flags at the top of my rule llist, then simply use them where needed. I'd appreciate some clarification on this.

Also, I've read that the rules are performed in order from top to bottom, so that the last rule, e.g., used to return to some original state, must be … well … last.

By the way, I tried using arco and normale in my score to return from staccato to legato, but they worked kind of hit-and-miss, depending on where they were placed.

I realize that flags are not really needed, unless a variety of different actions are required in response to the same condition. Then I can see how they would be very useful.

So, with or without flags, will someone please enlighten me as to how I might, for starters, apply an articulation of staccato, then return to arco or legato in the score. What am I missing?

I must say, as a long time Pro Tools and Sibelius user, I'm enjoying Studio One and Notion immensely - as well as the abundance of support available.

Cheers,

Wayne Rose

Re: Correct use of flags … please help!!!

Posted: Tue Aug 30, 2016 10:40 pm
by steffenblmm
hello,

in the video he does not directly unset flag 'main' and set 'stac' instead - for that he checks a condition - if the articulation is staccato.

the idea is - for each note notion has to play it goes into the script and goes through it again - from top to bottom. so, for every not one first sets the 'state' of the note to 'main' - the one checks for other states - like 'stac' with conditions (evaluating articulations or techniques or ..)
if non of those conditions return true ( you only have a normal note) it will be still in the 'main' state and play therefore play the last instuction (in this case: keyswitches for sustained sound)

hope that helps

Re: Correct use of flags … please help!!!

Posted: Wed Aug 31, 2016 1:33 am
by waynerose1
Thanks for responding, Steffen.

steffenblmm wrotein the video he does not directly unset flag 'main' and set 'stac' instead - for that he checks a condition - if the articulation is staccato.


Please take another look at the video.

The actual code he uses is:-

Conditions:
Articulation is "Staccato"
Actions:
Unset Flag "main"
Set Flag "stac"

Or am I misunderstanding what you intended?

steffenblmm wrotethe idea is - for each note notion has to play it goes into the script and goes through it again - from top to bottom. so, for every not one first sets the 'state' of the note to 'main' - the one checks for other states - like 'stac' with conditions (evaluating articulations or techniques or ..)
if non of those conditions return true ( you only have a normal note) it will be still in the 'main' state and play therefore play the last instuction (in this case: keyswitches for sustained sound)


I understand. But then why am I still getting staccato notes sounding on the following notes which are set to normal in my score?

Obviously, I don't quite get it yet. Working on it. :)

Wayne

Re: Correct use of flags … please help!!!

Posted: Wed Aug 31, 2016 1:02 pm
by kipcrawford
Always remember...the last rule "rules them all"

First rule should be Set Main

Last Rule should be "play main"

Here is a copy of the rules I use for one of my violins. Every aspect such as Staccato or Pizzicato, etc has a "SET" and "PLAY" set of rules. In this case I am using key switches. You'll notice that the main on the bottom returns the rule to main i.e. Normale, Legato or whatever the main sound is suppose to be. The top rule "sets" main on what it will be when other flags are not called. Every rule needs a SET for whatever flag you name and a PLAY to activate the flag. You'll see a pattern here for all my articulations BUT...SET MAIN is always in the beginning and PLAY MAIN is at the end....if you want to play Staccato all other flags except Staccato will be unset. So...if you have a Normale called after the Staccato then stac flag will be unset and main flag set.

</setup>

<rule remark="main" enabled="true">

<if midi-channel="1"/>

<set-flag name="main"/>


</rule>

<rule remark="Set Staccato" enabled="true">

<if articulation="staccato"/>

<unset-flag name="main"/>

<unset-flag name="pizz"/>

<unset-flag name="mezz"/>

<set-flag name="stac"/>

</rule>


<rule remark="play staccato" enabled="true">

<if flag="stac"/>

<key-switch midi-pitch="38" velocity="80" type="note-on-prefix"/>

</rule>


<rule remark="set pizzicato" enabled="true">

<if technique="pizz"/>

<unset-flag name="main"/>

<unset-flag name="stac"/>

<unset-flag name="mezz"/>

<set-flag name="pizz"/>

</rule>

<rule remark="play pizz" enabled="true">

<if flag="pizz"/>

<key-switch midi-pitch="40" velocity="80" type="note-on-prefix"/>

</rule>

<rule remark="Trill" enabled="true">

<trill pitches="1" time="0.08" delay="0.03"/>

</rule>

<rule remark="Set Mezzo-Staccato" enabled="true">

<if articulation="mezzo-staccato"/>

<unset-flag name="Main"/>

<unset-flag name="stac"/>

<unset-flag name="pizz"/>

<set-flag name="mezt"/>

</rule>

<rule remark="Play Mezzo-Staccato" enabled="true">

<if flag="mezt"/>

<duration-change amount="0.25"/>

<velocity-change bump="20"/>

</rule>

<rule remark="Set Staccatissimo" enabled="true">

<if articulation="staccatissimo"/>

<unset-flag name="main"/>

<unset-flag name="stac"/>

<unset-flag name="pizz"/>

<unset-flag name="mezt"/>

<set-flag name="sacc"/>

</rule>

<rule remark="Play Staccatissimo" enabled="true">

<if flag="sacc"/>

<duration-change amount="0.1"/>

<velocity-change bump="20"/>

<volume-change amount="0.5"/>

</rule>

<rule remark="play main" enabled="true">

<if flag="main"/>

<key-switch midi-pitch="36" velocity="80" type="note-on-prefix"/>

Re: Correct use of flags … please help!!!

Posted: Wed Aug 31, 2016 4:17 pm
by waynerose1
Thanks for posting this, Kip. Excellent! Very clear. Just what I, and many others it seems, have been looking for. :thumbup:

Prior to reading your response, I downloaded the Warp IV Screaming Trumpet prules from the Share Custom Rules Thread, and managed to get my little script working.

For now, I'm working with Session Strings Pro in Kontakt 5, which has its own internal articulations (techniques), so I don't believe the timing subtlies such as those you use in your trill rule are possible. By the way, is the bit of code in that rule complete?

The duration and velocity tweaks in mezzo-staccato and elsewhere might be, however. I'll have to give that a try.

I did notice what looks like a typo in your flags. You unset mezz, but set and don't unset mezt? I've done a decent amount of coding in my days, and two sets of eyes are always better than one. :)

That said, I really like your concept of separate code segments for Set and Play. Even more useful when variious different Play actions are needed. Put all your Set rules up top, and use your Play rules further down as needed. Great! This will be my template going forward.

I think I'll also make a habit of opening up my rules files in an external editor and adding some rem'd out (!) notes, to explain to myself (and others) what's going on in the code.

This is really great, man. Can't thank you enough. 8-)

Wayne

Re: Correct use of flags … please help!!!

Posted: Wed Aug 31, 2016 11:04 pm
by kipcrawford
Those set of rules are not complete....it's an old copy.

Trill
Mezzo-staccato
, etc are basic settings. Used these handmade rules because I needed these for my violin at the time. I also use Kontakt, most of the instruments I have do not have key switches for trill of mezzo-staccato...so I make my own. if you have a instrument with many built in techniques with key switches, the same "rules" apply when creating custom rules for those instruments.

That said, I really like your concept of separate code segments for Set and Play. Even more useful when variious different Play actions are needed. Put all your Set rules up top, and use your Play rules further down as needed. Great! This will be my template going forward.


Sure, you can do it that way. I group mine together, but that is my own preference. Just remember...Set Main on top, Play Main on bottom everything else in between.

Re: Correct use of flags … please help!!!

Posted: Thu Sep 01, 2016 12:38 pm
by kipcrawford
The below rule set here is a small one and fairly straight forward. The only difference is for others is the key switch call outs. Also, there is a Trill rule that uses no flags. The trill rule requires no Set and Play Flag rules. It stands alone.


<rule remark="main" enabled="true">

<if midi-channel="1"/>

<set-flag name="main"/>


</rule>

<rule remark="Set Staccato" enabled="true">

<if articulation="staccato"/>

<unset-flag name="main"/>

<unset-flag name="pizz"/>

<set-flag name="stac"/>

</rule>

<rule remark="play Staccato" enabled="true">

<if flag="stac"/>

<key-switch midi-pitch="40" velocity="80" type="note-on-prefix"/>

</rule>


<rule remark="Set Pizzicato" enabled="true">

<if technique="pizz"/>

<unset-flag name="main"/>

<unset-flag name="stac"/>

<set-flag name="pizz"/>

</rule>

<rule remark="play pizzicato" enabled="true">

<if flag="pizz"/>

<key-switch midi-pitch="38" velocity="80" type="note-on-prefix"/>


</rule>

<rule remark="Trill" enabled="true">
"This particular rule is considered an exception. It uses no flags. It is a (true/false) statement. Therefore, you could in essence place this rule before the Set Main Rule at the beginning. Also, you can also preset the varibles within the trill function to whatever speed/delay you want"

<trill pitches="1" time="0.08" delay="0.1"/>

</rule>

<rule remark="main" enabled="true">

<if flag="main"/>

<key-switch midi-pitch="36" velocity="80" type="note-on-prefix"/>

</rule>

Re: Correct use of flags … please help!!!

Posted: Thu Sep 01, 2016 2:27 pm
by johnnewberry
Staccato is an articulation and does not need to have a flag set .
You'll only need to unset the main flag when an articulation like staccato occurs.

Setting a flag is to "keep" the setting locked until it is unset. And then by using set "main" flag allows the "main" rules to run at the bottom of the prules document and activate its action or instructions.

Conditions and technique that play for more than one note or in a phrase like Pizzicato, Con Sordino or Harmon Mute as examples use flags in order to hold the setting until unset.

Flags can also be used in other ways, like testing if an condition or technique etc. is or isn't present at the moment.

,Newberry

:arrow:

Re: Correct use of flags … please help!!!

Posted: Fri Sep 02, 2016 12:03 am
by waynerose1
Thanks for clarifying,, Kip. Will keep your suggestions in mind.

I'm about to post what I've written for K5 and Session Strings Pro in Share Custom Rules, if you'd like to have a look. :)

Thanks also for your comments, John.

I'm coming from having used Sibelius Sound Sets for a number of years. I (and others) always had a problem getting back to normal or arco after a pizz. passage. Sib seemed to have a problem playing nicely with EWQLSO.

Set/unset main and the use of flags in Notion is an elegant way of getting around such issues.

johnnewberry wroteStaccato is an articulation and does not need to have a flag set .
You'll only need to unset the main flag when an articulation like staccato occurs.

I'm a Notion newbie. Are you saying I should not use a flag for articulations, but should unset main nonetheless?

johnnewberry wroteConditions and technique that play for more than one note or in a phrase like Pizzicato, Con Sordino or Harmon Mute as examples use flags in order to hold the setting until unset.

So I should use a flag for long staccato passages, but not necessarily for incidental staccato within phrases. Is that what you're saying?

johnnewberry wroteFlags can also be used in other ways, like testing if an condition or technique etc. is or isn't present at the moment.

Interesting. There doesn't seem to be any written documentation describing such techniques.

Must say, I'm enjoying this end of things. Notion has its weak areas, but its ease of use is the best I've encountered for a notation package.

Wayne 8-)