Defining Rules

< Previous | Contents | Manuals Home | Boris FX | Next >

Defining Rules

You can define your own Synthia rules. Naturally, you do that by using the rules for defining rules. By far, the most important rules (see rules about define) for users to define new rules are

define a qphrase means a sentence

define a qphrase means "a compoundsentence "

For example, to set up SynthEyes for half-speed playback, you can say half speed. Perhaps you’d like to be able to say half time as well?

define half time means half speed

This creates a new rule with a right-hand side of "half time," ie

<a menucmd> :: half time ($EXmeans) => half speed.

The left-hand side nonterminal is determined automatically, as the nonterminal of

half speed, namely a menucmd . The auxiliary value shows what half time means.

Exercise: define half time as click half speed instead. What is the left-

hand nonterminal now?

Note that we did not define a rule such as define time means speed, which would not produce the same effect (depending on the other rules, it might do something... wrong). The new rule, like the old one, produces a non-terminal. Since there’s no nonterminal in half speed, a time means speed rule would have nothing to act upon (match), if you will. And while you want time to mean speed in half time, you don't want time to mean speed in what time is it? (We could blindly replace time with speed everywhere using an input substitution, but don't!)

It's a good idea to use quotes liberally. Consider the following (almost-real) definition:

define "start peeling" means go to the features room and click the "peel" button.

This definition uses the first define rule above, ... means a sentence, not the compound sentence version. Consequently, it defines start peeling to go to the features room. Then, immediately after defining the rule, it clicks the peel button! That's not what we wanted, ie the real definition

define "start peeling" means "go to the features room and click the "peel" button".

which produces the rule

<a sentence> :: start peeling ($EXmeans) => go to the features room and click the "peel" button.

Exercise: make the sentence help me open Synthia's pdf manual.

Here's a fun question: What does

define "wazzup" means the selected tracker's position

mean? It's the position of the selected tracker when you enter wazzup, right?

But how about this rule?:

define "wazzup" means make the selected tracker's position tracker 1's position.

We might want this rule to do one of two different things: set the selected tracker's position to be tracker 1's position either right now or when wazzup runs. Normally, Synthia will always interpret this to be the second case, everything is evaluated when it runs.

But, if the very purpose of the rule is to save and later regurgitate the current

value, you want to say this:

define "putback" means make the selected tracker's position the current value of tracker 1's position.

The phrase the current value of ... tells Synthia to go check right now, so that you can create that rule.

Exercise: create a rule that restores the current value of the scene's multiple export settings, so that you can create and switch among different sets.

Exercise: For much extra credit, where else might you want to use a variation on current value in the putback rule above? (It takes an additional technical rule.)

©2024 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.