Skip to main content
Version: 4.2.0

Onset Detection

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

NameData TypeDescription
AudioAudio StreamThe audio stream you want to detect the onsets for.
EnabledBooleanEnable this node or not.
ThresholdNumberThe 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

NameData TypeDescription
AudioAudio StreamThe connected audio stream. Connect it to a Speaker to play or connect it to a Detection Output to play with no sound.
Onset ValueNumberThe detection result of the onset. The value of the onset energy. Value range: 0 to 1024.

Example

↓ onset_detection.zip

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.

onset detection node

AI Music powered by TikTok – SAMI.