~pbatch/gestvm

51848f5ff731647276d0aebf38e659e5a6c0be6c — Paul Batchelor 1 year, 2 months ago e902ca5
improved organization in behaviors section
1 files changed, 36 insertions(+), 9 deletions(-)

M gestvm.org
M gestvm.org => gestvm.org +36 -9
@@ 1374,15 1374,21 @@ SKFLT a;
#+BEGIN_SRC c
gvm->a = 0;
#+END_SRC
** Some Behaviors
Some behaviors include linear, step, and glissando.
** Behaviors
The manner in which Gesture travels from one point to
another is known as a "behavior". A behavior refers to
an interpolation method. It is a function that takes in
a value between 0 and 1, and returns a value between 0
and 1. The default input value is expected to be a linear
ramp.
*** Linear
Linear behavior applies linear interpolation to the signal.
Since the input value is already a ramp, no additional
operation is needed and this value is returned.

#+NAME: static_funcdefs
#+BEGIN_SRC c
static SKFLT b_linear(gestvm *gvm, SKFLT a);
static SKFLT b_step(gestvm *gvm, SKFLT a);
static SKFLT b_gliss_medium(gestvm *gvm, SKFLT a);
static SKFLT b_gliss(gestvm *gvm, SKFLT a);
#+END_SRC

#+NAME: funcs


@@ 1391,12 1397,37 @@ static SKFLT b_linear(gestvm *gvm, SKFLT a)
{
    return a;
}
#+END_SRC
*** Step
Returns only the 'a' value (0).

#+NAME: static_funcdefs
#+BEGIN_SRC c
static SKFLT b_step(gestvm *gvm, SKFLT a);
#+END_SRC

#+NAME: funcs
#+BEGIN_SRC c
static SKFLT b_step(gestvm *gvm, SKFLT a)
{
    return 0;
}
#+END_SRC
*** Glissando
Glissando splits the ramp signal into two parts, and
applies cubic scaling to the second half.

Regular glissando sets the division at 25%, while medium
glissando sets it at 75%.

#+NAME: static_funcdefs
#+BEGIN_SRC c
static SKFLT b_gliss_medium(gestvm *gvm, SKFLT a);
static SKFLT b_gliss(gestvm *gvm, SKFLT a);
#+END_SRC

#+NAME: funcs
#+BEGIN_SRC c
static SKFLT b_gliss_medium(gestvm *gvm, SKFLT a)
{
    if (a < 0.75) {


@@ 1424,10 1455,6 @@ static SKFLT b_gliss(gestvm *gvm, SKFLT a)
    return a;
}
#+END_SRC

Some behaviors, such as exponential with variable slope,
will require arguments. More thought required here. Maybe
aux values that get tied to cur/nxt?
** Main Function
#+NAME: static_funcdefs
#+BEGIN_SRC c