42 lines
773 B
ReStructuredText
42 lines
773 B
ReStructuredText
|
=======
|
||
|
Signals
|
||
|
=======
|
||
|
|
||
|
Signal Types
|
||
|
------------
|
||
|
|
||
|
MuzGen use different kind of signals for sound design.
|
||
|
|
||
|
|
||
|
Constant
|
||
|
^^^^^^^^
|
||
|
|
||
|
The simplest signal is the **constant signal**. It
|
||
|
returns the same frame everytime. It is used mostly as argument of
|
||
|
commands. In MuzScript, every numbers are constant signals.
|
||
|
|
||
|
.. code-block::
|
||
|
|
||
|
# constant signal
|
||
|
142
|
||
|
|
||
|
|
||
|
Sine
|
||
|
^^^^
|
||
|
|
||
|
The sine wave signal is the fundamental signal in sound theory.
|
||
|
It takes two arguments: a frequency and an amplitude.
|
||
|
Mathematically we can define our sine using the following formula:
|
||
|
|
||
|
.. math::
|
||
|
|
||
|
amplitude * sin(2 * pi * frequency / samplerate * time)
|
||
|
|
||
|
|
||
|
To generate a sine, we can use the ``sine`` command.
|
||
|
|
||
|
.. code-block::
|
||
|
|
||
|
# sine signal with a frequency of 440 and an amplitude of 1
|
||
|
[sine 440 1]
|