Sound2Light (S2L) |
Previous Next |
Functionality▪As described above, sound data refers mainly to frequency-based data. First of all, the function GetSoundLevel retrieves the volume of the audio channels (left and right). The float value returned ranges from 0.0 to 1.0, the lowest and highest level possible, respectively. ▪Moreover, other available data are the frequency values. They are stored in the arrays SOUND_DATA_LEFT and SOUND_DATA_RIGHT, which are both of the data type float. There are up to 511 values and each describes the volume of a »well-defined frequency. ▪The length-operator of the »arrays tells how much valid data they contain. A check may be necessary and then just take the values that are actually provided to have a proper effect. ▪In contrast to other dynamic arrays, in MADRIX Script those arrays will not grow because their size is fixed. Trying to get an invalid element, always results in 0.
ExampleThe following example for the MAS Script Effect analyses the left and the right audio channel. Lines will be drawn onto the matrix to indicate the average frequency. const color LEFT_CHANNEL = {255, 0, 0, 128}; |
MADRIX Version: 5.7 | Script Version: 3.23 |
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100% |
Previous
Next
|
Enable automatic translation | Activer la traduction automatique | |