Onset Detection
Use Onset Detection to detect the onsets of notes in the musical audio in realtime based on a certain threshold. Onset Detection is in the Audio category.
Input
Name | Data Type | Description |
---|---|---|
Audio | Audio Stream | The audio stream you want to detect the onsets for. |
Enabled | Boolean | Enable this node or not. |
Threshold | Number | The value of the spectrum magnitude difference between the current and previous audio frames. When the difference is greater than the Threshold, usually when a sound is louder, it is detected as an onset. Value range: 0 to 160. |
Output
Name | Data Type | Description |
---|---|---|
Audio | Audio Stream | The connected audio stream. Connect it to a Speaker to play or connect it to a Detection Output to play with no sound. |
Onset Value | Number | The detection result of the onset. The value of the onset energy. Value range: 0 to 1024. |
Example
This example detects the onset of notes in the audio stream. It filters the result below 600, and remaps the result to control the position of the red and green TikTok logo images.
AI Music powered by TikTok – SAMI.