- Code in documents can be run on .
- You can also directly modify the code, and experience fabulous
In timbre.js, programming is performed by combining the T-Object generated by
T() function. T-object type is specified by a string as the first argument of the T-function. Below is a simple example of generating a sine wave. Sound is heard? Next, re-run after changing to
sin. You will hear different type of sound (sawtooth wave).
The second argument specifies properties in the form of a dictionary. In the following example we set to play 880(Hz) the property of the sin-oscillator frequency.
set() is if you will specify properties later. In fact, the dictionary of the second argument is internally calling this method. The following example is almost the same as in the previous example.
Subsequent arguments are input objects. Most T-object is added to the value of input objects in front of its own processing. For example, an envelope object outputs the values that multiplied by values of input objects. In the following example,
The basic processing flow of the T-object
- Adds the values of the input object
- The calculation of attribute values
- Processing its own object
- And outputs the result
- The output value is the value/attribute of another T-object