Hi Philip,
Let's say that you want to control the frequency of an oscillator using the
signal delivered by the amplitude follower. You can write:
import("stdfaust.lib");
process = an.amp_follower(0.1) : *(440) : +(440) : os.osc;
The amplitude follower delivers an amplitude signal between 0 and 1. This
signal is then mapped between 440 and 880 Hz to control the frequency of
the oscillator.
This example can be refined to use the amplitude follower also to control
the level of the oscillator:
import("stdfaust.lib");
process = an.amp_follower(0.1) <: (*(440) : +(440) : os.osc), _ : *;
In order to understand these examples, please note that Faust expressions
can combine different types of notations:
- core notation: 2,3:foo,
- applicative notation: foo(2,3),
- partial application notation: 3:foo(2).
- as well as infix notation: 10*(2+3).
The expression an.amp_follower(0.1) is an example of partial application
notation. The amplitude follower has two inputs: the first one is the
release time and the second one is the signal to analyze. This is
equivalent to:
0.1, _ : an.amp_follower
Using only core notation the first example could be rewritten as:
import("stdfaust.lib");
process = 0.1, _ : an.amp_follower, 440 : *, 440 : + : os.osc;
While using only infix and applicative notation, it could be rewritten as:
import("stdfaust.lib");
process(x) = os.osc(440 + 440*an.amp_follower(0.1,x));
How do you choose between core, infix and partial application notations? It
is largely a matter of taste. Personnaly, I like to combine core notation
(for the overall structure) with partial application notation (for the
slowly varying "parameters") as in the first two examples, and infix
notation for mathematical expressions.
Cheers
Yann
-------------------------
Yann Orlarey
Directeur scientifique
www.grame.fr
2017-07-17 16:30 GMT+02:00 Yassin Philip <[email protected]>:
> An amplitude follower is just a detection/analysis tool, right?
> So you pass a signal through it, and it "follows the amplitude" of said
> signal, correct?
>
> How do I retrieve the information gathered by this amplitude follower to
> use it elsewhere? I think once I get this logic, I'll really be on my way.
>
> Phil
>
> --
> Yassin Philip New album NOW
> http://yassinphilip.bitbucket.io
>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Faudiostream-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/faudiostream-users