Sine Controller
Description
Outputs a sine-wave in each dimension.
Syntax and Default Values
The sine controller can be created using the following Mlys (Max), mlys.lua, or Lisp syntax:
In Modalys for Max, this object is named mlys.sine:
[mlys.sine @name MySine @frequency 440 @phase 30]
[mlys.sine @name MySine @frequency 200 300] //multidimensional => dimension = 2
• The period is 0 (updated every sample).
• The maximal dimension is 64.
• frequency and phase be changed dynamically viaMySine@freq {value} {time}
andMySine@phase {value} {time}
messsages.
• If there are inlets, you can connect 1 or 2 controllers of the same dimension that will be used for frequency or phase.
local sine = create_controller{ kind="sine", name="MySine",
frequency=440}
--or:
local myfreqs = create_controller{kind="dynamic",name="MyFreqs",
value={55,110,220}}
local myphases = create_controller{kind="dynamic",name="MyPhases",
value={0,30,45}}
local sine = create_controller{kind="sine",name="MySine",
frequency=myfreqs,phase=myphases}
• The controller's dimension is based on frequency's.
• The frequency and phase parameters can be either controllers, or numerical values, in latter case some dynamic controllers are created automatically (controllable viaMySine@freq {value} {time}
andMySine@phase {value} {time}
messsages.)
• The phase parameter must have the same dimension as frequency, and if not provided, it is set to zero(s) by default.
(make-controller 'sine
dimension
frequency
phase)
The dimension and phase parameters are mandatory in Lisp.
Parameters
The sine controller takes 3 arguments:
- dimension: dimension of the output controller
- frequency: controller defining the frequency of the sine wave.
- phase: controller defining the initial phase of the sine wave (in degrees).
The frequency controller determines frequency (or frequencies) of the output sine-wave(s). The dimension of this controller must equal the dimension of the sine-wave controller whose frequency it determines.
Naturally, a cosine may be made by providing a phase of 90 degrees.
The sine controller is updated every synthesis sample period.
Discussion
A basic sine controller (at 440 Hz, for example) may be created like this:
(setq my-sine (make-controller 'sine 1 (const 440) 0))
(setq my-sine (make-controller 'sine 3 (const 1 2 5) 0))
Sine controllers can also be used to make synthesis, that can be used to resonate objects, as shown in Example 5.
★