Song analyzer, timecoded sequence creation. Actions/ Triggers execution based on segmenter/rhythm difference. This work mainly for mp3 audio file. Should work on any OS where Chataigne / Sonic Annotator are running.
Segmenter : divides a single channel of music up into structurally consistent segments.
It returns a numeric value (the segment type) for each moment at which a new segment starts.
Rhythm difference : Calculates rhythmic features of a signal, including onsets and tempo.
* Difference: The difference between the onset curve and its moving average.
Used as the input for peak-picking.
Main goal is to create automatic sequence with actions/triggers execution : could be any protocol/software already integrated into Chataigne, even external by using HTTP module for example.
It's based on these two Vamp plugins:
QM Segmenter.
see demo : https://youtu.be/vkKx9QjBUSk
BBC Rhythm Difference.
see demo : https://youtu.be/6Crcvwpx4_0
The Sonic Annotator extraction tool is necessary and is the main process that will be run. SCAnalyzer take json datas from it, interpret them and create requested triggers/mapping.
This module is deeply integrated with WLED and LedFX, so if you use the corresponding modules, it can automaticaly create actions for them. Websocket , UDP and HTTP protocols are used, depend of the necessity and required response time.
It will also take care of the Spleeter module to generate mapping for only vocal part of the song.
See: https://youtu.be/TxMugj49Dz4
WLEDAudioSync replay file feature is part of the process. You can even use more than one WLEDAudioSync module if you need to send on same time to WLED fw based on ESP8266 and WLED fw based on ESP32.
See : https://youtu.be/Fy8NGl8-Jyc
'Create Show' command will generate all actions/triggers/mapping with few clicks.
Links :
Chataigne : https://benjamin.kuperberg.fr/chataigne/fr
Vamp Plugins : https://vamp-plugins.org/index.html ---> Pack : https://vamp-plugins.org/pack.html
Sonic Annotator : https://vamp-plugins.org/sonic-annotator/ --> binaries : https://code.soundsoftware.ac.uk/projects/sonic-annotator/files
Youtube Chanel : https://youtube.com/@NGEvents?feature=shared
Manual (any OS) :
Install Chataigne (v 1.9.16 min.) & copy this repository into :
<Chataigne>/modules/SCAnalyzer
You need also this utility module to have full features: https://github.com/zak-45/SCAnalyzer_util
copy to <Chataigne>/modules/SCAnalyzer_util
Install Sonic Annotator and the corresponding vamp plugins (see related links and documentation).
For Win users :
use the SCAnalyzer.exe from releases
(https://github.com/zak-45/SCAnalyzer-Chataigne-Module/releases/)
you can install : Chataigne , SCAnalyzer module, vamp plugins and Sonic annotator in easy way
Go to Modules, right click, custom / SCAnalyzer
You should see these modules loaded and on Inspector, all related params.
On Inspector / Parameters
Audio Params
Global Delay : delay in ms to execute all triggers/consequences & mapping/outputs.
mainly used to sync actions (lights) with audio
in case of delay during playback(e.g use of BT wireless speaker).
Sonic Params
Run Sonic Visualizer : click to execute Sonic Visualizer app (optional)
// Sonic Visualiser : to be adapted by OS
sonicVisu = "C:/Program Files/Sonic Visualiser/Sonic Visualiser.exe";
Sonic Annotator info : click to go web documentation
Sonic Annotator location : choose where sonic annotator app can be found (mandatory)
output folder : folder to store the json datas
transform file : file to use when want custom params for segmenter vamp plugin
Rhythm transform file : file to use when want custom params for rhythm vamp plugin
Group Params
Link to group number : select group number to choose during automatic mapping creation.
the one selected need to exist in custom variables.
Scgroup xx (1 .. 12) : enter a group name to create an entry in custom variables.
----- Info on group feature ---------
each group will have :
Variables container with one to many IP address (others should work, name need to be IPxxx).
Calculated params container with variables used/calculated by script and read only.
in case of WLED module presence,
a Default WLED params container with default values that can be set.
These values will be used during automatic WLED actions generation.
Mapping Params
Reset mapping Max value : check to create during mapping a zero point before and after the max value.
Caution, extra time needed and to use for test only.
Split : actions will be split (in modulo of index) through all IP address
set in the selected group.
Sequential : actions will be split (in sequential order & loop) through all IP address
set in the selected group.
see : https://youtu.be/tL3g7ofz_Ts
----- Visual representation for Reset mapping Max value ------
default (without Reset mapping Max value) :
Reset mapping Max value checked :
-------- Example for Split & Sequential -------
During sequence playback, index value will be incremented each time during mapping output
(from 1 ... n)
Suppose we have 3 IP addresses in the group :
IP : 192.168.1.1
IP1: 192.168.1.2
IP2: 192.168.1.3
Split case :for index value 1 the mapping output will be set to IP
for index value 2 the mapping output will be set to IP1
for index value 3 the mapping output will be set to IP2
for index value 4 the mapping output will be set to IP1
for index value 5 the mapping output will be set to IP
for index value 6 the mapping output will be set to IP2
for index value 7 the mapping output will be set to IP
for index value 8 the mapping output will be set to IP1
for index value 9 the mapping output will be set to IP2
for index value 10 the mapping output will be set to IP1
....
Sequential case : more simple
this will go from IP, IP1, IP2, IP, IP1, IP2 ....