|====================================| | ArtiSPECTRUM Protocol Version 1.00 | | Written by: Michel van Osenbruggen | | CopyRight 2026 ArtiLED B.V. | |====================================| Latest change : 15-10-2026 =============== | Description | =============== The ArtiLED ArtiSPECTRUM protocol sends the analysed sound of one audio channel (one side of a stereo input) as UDP packets, one packet per analysis frame. One side = one channel. No answer is returned. ======================= | Protocol Definition | ======================= Protocol : UDP broadcast Port : 50300 + Channel (Channel 1-99 -> 50301-50399) Destination : data/spectrum_send "network" = broadcast address of the sender's own primary network, never 255.255.255.255 (default) "local" = 127.255.255.255 (loopback broadcast, this box only) "off" = nothing is sent Source port : Any (random, one socket per input) Senders : Touch (artiled_spectrum.py, one service per input) Receivers : Touch (screen/vizstream.php), see ArtiPORTS Packet size : 21 + 2 x bands bytes (85, 149 or 277), never fragmented =========================== | Magic Packet Definition | =========================== Magic Packet : 2zjD7hpU ========================== | Data Format Definition | ========================== Byte order : Big endian 0-7 magic : "2zjD7hpU" 8 version uint8 : 1 9 flags uint8 : bit 0 = silent, bit 1 = clipping 10-13 sequence uint32 : Frame number since the service started, wraps 14-15 rate uint16 : Frames/s x 10 (500, 1000) 16-17 level uint16 : 0-65535 18-19 peak uint16 : 0-65535 20 bands uint8 : 32, 64, 128 21- band1 - bandN uint16 x N : 0-65535 ===================== | Value Definition | ===================== level : RMS of the frame's new samples, 10000 = 0 dB = a full-scale sine at 2 Vrms (dB = 20 x log10(level / 10000)) peak : Largest sample of the frame's new samples, same scale as level band1 - bandN : sqrt(energy of the band's FFT bins), 10000 = a 0 dB sine inside the band silent : level < 10 (-60 dB) on both sides clipping : A sample of the frame >= 14800 input counts from the input's centre ======================== | Analyzer Definition | ======================== Sampling : 48000 Hz, 16 bit, stereo FFT : 4096 samples, Hann window, centre removed (slow running average) Bin width : 11.71875 Hz Band edges : 20 x 1000^(N / bands) Hz, N = 0 - bands (log 20 Hz - 20 kHz) Band centre : 20 x 1000^((N - 0.5) / bands) Hz, N = 1 - bands Narrow band : Less than 3 bins -> the 3 bins around its centre Reference : data/spectrum_N_reference (100-32767, default 19900) = input counts RMS of 0 dB ===================== | Rate Definition | ===================== Frame rate : data/spectrum_rate 50 or 100 (default 100) frames/s per channel Frame : 48000 / rate new samples (960 or 480) Silence : Silent for 60 s -> 1 frame per 1.0 s ======================= | Channel Definition | ======================= Left : data/spectrum_N_left_channel (1-99, default 2 x N - 1) Right : data/spectrum_N_right_channel (1-99, default 2 x N) Bands : data/spectrum_bands 32, 64, 128 (default 64) Input N : USB audio input N (USB port order), or data/spectrum_N_device (USB path) ===================== | Receive Definition | ===================== Validation : magic, version 1, bands >= 8, length = 21 + 2 x bands Source : Touch accepts 127.0.0.1 and its own address only Shared ports : Several receivers on one box share a port with SO_REUSEADDR ===================== | Cross References | ===================== ArtiPORTS : 50301-50399 UDP-B ArtiSPECTRUM Channel 1-99 ArtiWAVE : Same input, same sequence ArtiAUDIO : The Audio Processor's 8-band protocol (50101-50199) ArtiTouchAPI : Visualizer (screen/vizstream.php)