Random Rule Selection For Separate Voices

Share your favourite Noatikl tips and tricks
Loopy C
Platinum
Posts: 433
Joined: Tue Sep 11, 2007 9:32 pm
antispam_b: 2
Location: Valyermo, CA, USA
Contact:

Random Rule Selection For Separate Voices

Postby Loopy C » Wed Apr 16, 2014 1:21 am

Wow, first of all, most of the 'Tips and Tricks' here are not??? They are questions and problems :( Maybe they could be moved by a moderator?

Anyway, here is something I have been using that really is a 'trick', as it is not part of Noatikl's spec.

If you want separate voices to randomly EACH pick from a set of rules (i.e. 'Scale Rules', 'Rhythm Rules', 'Next Note Rules;, etc), set up a script that calls a non-existent name rule label...


function nt_trigger_bar(bar)

if (bar == 1)
then

noatikl_Trigger_Parameter_Set("Next Note Rules", "NN?")
end

if (bar == 1)
then

noatikl_Trigger_Parameter_Set("Rhythm Rules", "RR?")
end


end


Do this script for each 'Voice' desired and set voice rules each to '?'.

In the above 'Voice Bar' script, I call on rules named NN? and RR? which DO NOT EXIST (I have rules named NN1~12 and RR1~12, see below for NN1~12 example). This causes each voice to randomly pick from all the possibilities and use different choices for each (V1 picks NN4, V2 picks NN11, V3 picks NN7 on first run, then V1 picks NN2, V2 picks NN5, V3 picks NN12 on second run etc).

Normally, all voices set to '?' in 'Voice Rules' pick from all the possibilities but only choose the same exact rule for all voices set to ? (three voices will all pick 'NN3' in my example). Because I cut and pasted this from an existing template, it is a 'Voice Bar' script, but I imagine this can be applied across all the types of scripts.

This seems to be an 'exploit' that hopefully doesn't get closed as I have long wanted the ability to have each voice choose it's own rule from a set of rules so Tim and Pete, PLEASE DON'T FIX THIS 'LOOPHOLE' :D



Image


...

impete
Site Admin
Posts: 2290
Joined: Fri Jun 22, 2007 1:30 pm
antispam_b: 2
Location: intermorphic Towers

Re: Random Rule Selection For Separate Voices

Postby impete » Thu May 01, 2014 10:16 am

Hi Chris,

I think that should be fine - provided you follow my recommendation - which would be to use the value "?" rather than (say) "NN?"... !

Noatikl has long supported random selection by use of "?" for rules, so that should be fine.
Let me know if I ever break it by mistake. :)

An alternative approach might be to use Lua to interate through the available rules, and select a named one at random, according to whatever algorithm you might wish to adopt (for example, to change the rule every hour, or choose a rule according to time of day etc.!).

Best wishes,

Pete

Loopy C
Platinum
Posts: 433
Joined: Tue Sep 11, 2007 9:32 pm
antispam_b: 2
Location: Valyermo, CA, USA
Contact:

Re: Random Rule Selection For Separate Voices

Postby Loopy C » Fri May 02, 2014 2:02 am

Thanks for the feedback ;-)

The way I use it is to create a page of variations (as pictured) and then have each voice pick one independently of the others (as opposed to the general method of a '?' for rule which causes all voices to pick same one for that particular run, but I will follow of suggestion of '?' within the code line.

The reason I find this easier is to not have to write in all the names of variations I might have as I find the scripting of timelines and multiple items quite tedious...just want it to look at available options at any given time of a run and pick at random from them. That way, I can constantly create/combine/recombine/merge sets of values without ever touching the script again ;-)

It would be great to have this as a dedicated global function someday where any voice could pick randomly from within any current set of rules independently of other voices without the dedicated pointing to named rules being required by user in the scripting, but this current trick will keep me happy for now ;-)

Loopy C
Platinum
Posts: 433
Joined: Tue Sep 11, 2007 9:32 pm
antispam_b: 2
Location: Valyermo, CA, USA
Contact:

Re: Random Rule Selection For Separate Voices

Postby Loopy C » Wed May 07, 2014 6:29 pm

impete wrote:...I think that should be fine - provided you follow my recommendation - which would be to use the value "?" rather than (say) "NN?"... !


Actually, I tried your way using just "?" and it doesn't work (works as normal, picking same rule as other voices). Changing to "NN?" immediately got it working again (random picking from all available rules).

impete
Site Admin
Posts: 2290
Joined: Fri Jun 22, 2007 1:30 pm
antispam_b: 2
Location: intermorphic Towers

Re: Random Rule Selection For Separate Voices

Postby impete » Thu May 08, 2014 7:32 am

Hi Chris,

OK, thanks for letting me know about that. I've made a note to take a look at this, and whatever I do I'll make sure I don't break your existing approach! ;)

Best wishes,

Pete

Loopy C
Platinum
Posts: 433
Joined: Tue Sep 11, 2007 9:32 pm
antispam_b: 2
Location: Valyermo, CA, USA
Contact:

Re: Random Rule Selection For Separate Voices

Postby Loopy C » Sat May 10, 2014 6:11 pm

Thanks Pete...and just be clear I believe the key is to simply designate something that doesn't exist as a label. My use of NN in this case is just to remind me it's for the 'Next Notes' but anything would work as I actually discovered this 'trick' by making a 'typo', writing a label and observing this, in some cases, desirable behavior ;-)

Obviously, the '?' by itself is expected behavior and coincides with the behavior of using '?' in main rule choices. Using a label that doesn't exist causes engine to be confused and pick at random without referencing other voices?
Last edited by Loopy C on Tue Jun 24, 2014 7:51 pm, edited 1 time in total.

impete
Site Admin
Posts: 2290
Joined: Fri Jun 22, 2007 1:30 pm
antispam_b: 2
Location: intermorphic Towers

Re: Random Rule Selection For Separate Voices

Postby impete » Tue Jun 24, 2014 9:39 am

Hi Chris,

I've been preparing the update for Desktop Noatikl, and have just finished reviewing this for you in light of tidying-up the application.

The way it works (definitely!) is as follows:

Voice level:
If "?": use the value defined by the Piece level parameter.
else if supplied value matches a rule: use that rule.
else: use a randomly selected rule.

Piece level:
If supplied value matches a rule: use that rule.
else: use a randomly selected rule.

So, using "?" won't have the desired effect - as it has a special meaning to Noatikl, as you can see from the above I hope.

However, the approach that you're using, of "NN?" or (say) "??" (for example) will always have the effect you want! :)

I hope this clarifies things, and reassures you! ;)

Best wishes,

Pete

Loopy C
Platinum
Posts: 433
Joined: Tue Sep 11, 2007 9:32 pm
antispam_b: 2
Location: Valyermo, CA, USA
Contact:

Re: Random Rule Selection For Separate Voices

Postby Loopy C » Tue Jun 24, 2014 8:06 pm

Thanks Pete, good to know it will remain, as its a great way to experiment with lots of variations/combinations of rules with no fuss ;-)

Also, can you see this while your 'out and about' on the board, thanks in advance ;-)

viewtopic.php?f=16&t=1912


...


Return to “Tips”

Who is online

Users browsing this forum: No registered users and 1 guest