diff --git a/bin/LoopbackCapture.cs b/bin/LoopbackCapture.cs index cbe0dac..53506ea 100644 --- a/bin/LoopbackCapture.cs +++ b/bin/LoopbackCapture.cs @@ -1,6 +1,12 @@ +// Exit codes: 0 = clean exit / parent ended; 2 = no render endpoint; +// 3 = instance already running; 4 = WASAPI initialization failed; +// 5 = unhandled exception / persistent capture error; +// 6 = lease expired (Godot is not responding). using System; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; +using System.IO; using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; @@ -9,14 +15,423 @@ using System.Threading; namespace LoopbackCapture { + // Independent analysis branch: never writes to RMS/onset/BPM detector state. + sealed class RuleGenreAnalyzer + { + // TUNING TABLE: initial heuristics, NOT calibrated probabilities. Adjust here. + const int FftSize = 2048, ShortHops = 400, RhythmHops = 1600; + const int DynamicsSamples = 160, DynamicsHopCount = 10, MinDynamicsSamples = 40; + const int MinBars = 4, MinPeaks = 4; + const double FeatureAlpha = 0.05, Temperature = 0.20, ConfidenceThreshold = 0.30; + const double BandMinHz = 100, BandMaxHz = 8000, HighHz = 2000; + const double LowMinHz = 40, LowMaxHz = 120, MidMinHz = 200, MidMaxHz = 5000; + const double CentroidMinHz = 500, CentroidMaxHz = 4000; + const double FlatnessMin = 0.02, FlatnessMax = 0.50; + const double HighRatioMin = 0.05, HighRatioMax = 0.60, LowRatioMin = 0.05, LowRatioMax = 0.50; + const double DensityMax = 8, DynamicsMinDb = 6, DynamicsMaxDb = 24; + const double LatinMinBpm = 85, LatinMaxBpm = 105, ElectronicMinBpm = 115, ElectronicMaxBpm = 135; + const double HipHopMinBpm = 80, HipHopMaxBpm = 95, TempoShoulderBpm = 15; + // Il dembow e' una firma discreta, non un contributo lineare: sopra soglia sposta + // la decisione, sotto soglia non tocca nulla. Richiede anche affinita' di tempo + // >= 0.5, altrimenti una sincope qualsiasi a 130 BPM verrebbe promossa a latin. + // La soglia lavora sul dembow NORMALIZZATO (vedi DembowBaseline). + const double DembowGate = 0.40, DembowBonus = 0.35; + // Un istogramma uniforme correla gia' 7/16 con un template che ha 7 caselle attive + // su 16. Senza togliere questo pavimento, qualsiasi ritmo piatto (rock con piatti + // ovunque) ottiene ~0.44 e passa per un dembow debole. + const double DembowBaseline = 7.0 / 16.0; + // Il rilevatore puo' agganciare la cella 3+3+2 e riportare 4/3 del battito. + // Si prova anche l'ipotesi 3/4 e si tiene quella che spiega meglio il pattern. + const double FoldMargin = 0.05, MinFoldBpm = 50; + static readonly double[] FoldFactors = { 1.0, 0.75, 1.25 }; + const double RegularityCenter = 0.50, RegularityWidth = 0.50; + const double PeakSigma = 1, PowerEpsilon = 1e-20, RmsFloor = 1e-6, ActiveRms = 1e-5; + const int PublishMs = 1000, StaleMs = 1000; + // Columns: dembow, fourFloor, tempo affinity, low, flatness, high, density, + // centroid, regularity, medium regularity, dynamics. Negative = inhibitory. + // Each row has total absolute weight 1; Bias implements rewarded complements. + // Scores include Bias, then stable softmax(score / Temperature). + static readonly string[] Labels = { "latin", "electronic", "hiphop", "rock", "classical" }; + // Pesi derivati dalla distanza di Fisher misurata su dati reali etichettati + // (tests\rock2.csv, classic.csv, hiphop.csv). Le feature sono quasi ortogonali: + // flatness/highRatio separano classical da {rock, hiphop} ma NON rock da hiphop (d'~0.03); + // regularity/regMid/dynamics separano rock da hiphop ma non rock da classical. + // density non discrimina nessuna delle tre coppie (d' 0.14-0.45): peso azzerato. + // I Bias NON sono scelti a mano: sono il valore che porta ogni classe a 0 sulla media + // globale delle feature (bias_c = -w_c . mean). Senza questa compensazione una classe + // diventa il "vincitore per default" e ogni ritaratura sposta il problema su un'altra. + static readonly double[] Bias = { -0.273, -0.119, -0.197, 0.018, 0.191 }; + static readonly double[,] Weights = { + { 0.50, 0, 0.25, 0.25, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0.35, 0.25, 0.15, 0, 0, 0, 0, 0.25, 0, 0 }, + { 0, 0, 0, 0.15, 0, 0, 0, 0, 0.20, 0.35, 0.30 }, + { 0, 0, 0, 0, 0.25, 0.15, 0, 0, -0.20, -0.25, -0.15 }, + { 0, 0, 0, 0, -0.40, -0.45, 0, 0, 0, 0, 0.15 } + }; + static readonly int[] DembowTemplate = { 1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0 }; + readonly int rate, hop; + readonly double[] samples = new double[FftSize], hann = new double[FftSize]; + readonly double[] real = new double[FftSize], imag = new double[FftSize]; + readonly double[] cos = new double[FftSize / 2], sin = new double[FftSize / 2]; + readonly int[] reverse = new int[FftSize]; + readonly double[] previousPower = new double[FftSize / 2 + 1]; + readonly double[] shortOnset = new double[ShortHops], rhythm = new double[RhythmHops]; + readonly double[] envelope = new double[ShortHops], folded = new double[16]; + readonly double[] dynamics = new double[DynamicsSamples], sortedDynamics = new double[DynamicsSamples]; + readonly double[] features = new double[11], probabilities = new double[5]; + int write, filled, hopFrames, shortHead, shortCount, rhythmHead, rhythmCount; + int dynamicsHead, dynamicsCount, dynamicsHops, dynamicsFrames; + double dynamicsSum, recentRms, centroid, flatness, highRatio, lowRatio; + double dembow, fourFloor, density, regularity, dynamicRange; + bool spectrumReady, dynamicReady; + long lastDataMs = -1, lastPublishMs; + StreamWriter dump; + public double DembowPhase { get; private set; } + // Tempo effettivamente usato per il folding: puo' essere i 3/4 di quello rilevato + // se il pattern dimostra che il detector ha agganciato la cella 3+3+2. + public double EffectiveBpm { get; private set; } + + public RuleGenreAnalyzer(int sampleRate, int hopSize, string dumpPath) + { + rate = sampleRate; hop = hopSize; + for (int i = 0; i < FftSize; i++) + { + hann[i] = 0.5 - 0.5 * Math.Cos(2 * Math.PI * i / (FftSize - 1)); + int x = i, r = 0; + for (int b = 0; b < 11; b++) { r = (r << 1) | (x & 1); x >>= 1; } + reverse[i] = r; + } + for (int i = 0; i < cos.Length; i++) + { + cos[i] = Math.Cos(-2 * Math.PI * i / FftSize); + sin[i] = Math.Sin(-2 * Math.PI * i / FftSize); + } + if (!string.IsNullOrEmpty(dumpPath)) + { + try + { + dump = new StreamWriter(dumpPath, false, Encoding.UTF8); + dump.WriteLine("ms,bpm,dembow,fourfloor,density,flatness,centroid,regularity,highRatio,lowRatio,label,conf,f0_latin_dembow,f1_fourfloor,f2_tempo_latin,f3_low,f4_flat,f5_high,f6_density,f7_centroid,f8_reg,f9_regmid,f10_dyn,s_latin,s_electronic,s_hiphop,s_rock,s_classical"); + dump.Flush(); + } + catch (Exception ex) { DisableDump(ex); } + } + } + + void DisableDump(Exception ex) + { + Console.Error.WriteLine("Feature dump disabled: " + ex.Message); + if (dump != null) { try { dump.Dispose(); } catch { } dump = null; } + } + + public void MarkData(long now) { lastDataMs = now; } + + // Il folding ritmico dipende dal tempo: se il BPM cambia (nuovo brano), la storia + // gia' registrata e' su una griglia che non corrisponde piu'. Va scartata, altrimenti + // per fino a 16 s si pubblica un dembow/fourFloor casuale. + public void ResetRhythm() + { + rhythmHead = 0; + rhythmCount = 0; + Array.Clear(rhythm, 0, rhythm.Length); + dembow = 0; + fourFloor = 0; + DembowPhase = 0; + } + + // Errore di ottava del rilevatore: 85 BPM puo' uscire 170, 195 puo' uscire 97.5. + // Riporta il tempo in [70,145) prima di applicare sia i template di tempo sia il + // folding ritmico. Senza questa normalizzazione nessuna regola di tempo entra in + // gioco (LatinMin 85, HipHopMin 80) e vince sempre la classe senza termine ritmico. + public static double CanonicalTempo(double bpm) + { + if (bpm <= 0) return 0; + while (bpm >= 145.0) bpm /= 2.0; + while (bpm < 70.0) bpm *= 2.0; + return bpm; + } + + public void AddSample(float value) + { + double v = float.IsNaN(value) || float.IsInfinity(value) ? 0 : value; + samples[write] = v; write = (write + 1) % FftSize; + if (filled < FftSize) filled++; + dynamicsSum += v * v; dynamicsFrames++; + if (++hopFrames < hop) return; + hopFrames = 0; + double flux = filled == FftSize ? Spectrum() : 0; + shortOnset[shortHead] = flux; shortHead = (shortHead + 1) % ShortHops; + shortCount = Math.Min(shortCount + 1, ShortHops); + rhythm[rhythmHead] = flux; rhythmHead = (rhythmHead + 1) % RhythmHops; + rhythmCount = Math.Min(rhythmCount + 1, RhythmHops); + if (++dynamicsHops >= DynamicsHopCount) + { + recentRms = Math.Sqrt(dynamicsSum / Math.Max(1, dynamicsFrames)); + dynamics[dynamicsHead] = 20 * Math.Log10(Math.Max(RmsFloor, recentRms)); + dynamicsHead = (dynamicsHead + 1) % DynamicsSamples; + dynamicsCount = Math.Min(dynamicsCount + 1, DynamicsSamples); + dynamicsSum = 0; dynamicsFrames = 0; dynamicsHops = 0; + } + } + + // Real input, radix-2 complex workspace; only nonnegative frequency bins used. + // All FFT/window/twiddle/history arrays are preallocated and reused per hop. + double Spectrum() + { + for (int i = 0; i < FftSize; i++) + { + real[reverse[i]] = samples[(write + i) % FftSize] * hann[i]; + imag[reverse[i]] = 0; + } + for (int size = 2; size <= FftSize; size <<= 1) + { + int half = size / 2, stride = FftSize / size; + for (int start = 0; start < FftSize; start += size) + for (int j = 0; j < half; j++) + { + int a = start + j, b = a + half, t = j * stride; + double tr = cos[t] * real[b] - sin[t] * imag[b]; + double ti = sin[t] * real[b] + cos[t] * imag[b]; + real[b] = real[a] - tr; imag[b] = imag[a] - ti; + real[a] += tr; imag[a] += ti; + } + } + double total = 0, band = 0, weighted = 0, logs = 0, high = 0, low = 0, flux = 0; + int bins = 0; + for (int k = 0; k <= FftSize / 2; k++) + { + double hz = k * (double)rate / FftSize; + double p = (real[k] * real[k] + imag[k] * imag[k]) / (FftSize * (double)FftSize); + // One-sided power: DC/Nyquist occur once, other bins twice. + if (k > 0 && k < FftSize / 2) p *= 2; + total += p; + if (hz >= BandMinHz && hz <= BandMaxHz) + { band += p; weighted += hz * p; logs += Math.Log(Math.Max(PowerEpsilon, p)); bins++; } + if (hz > HighHz) high += p; + if (hz >= LowMinHz && hz <= LowMaxHz) low += p; + if (hz >= MidMinHz && hz <= MidMaxHz && spectrumReady) + flux += Math.Max(0, p - previousPower[k]); + previousPower[k] = p; + } + double smoothing = spectrumReady ? FeatureAlpha : 1; + centroid += smoothing * ((band > PowerEpsilon ? weighted / band : 0) - centroid); + flatness += smoothing * ((band > PowerEpsilon && bins > 0 ? Clamp(Math.Exp(logs / bins) / (band / bins)) : 0) - flatness); + highRatio += smoothing * ((total > PowerEpsilon ? high / total : 0) - highRatio); + lowRatio += smoothing * ((total > PowerEpsilon ? low / total : 0) - lowRatio); + spectrumReady = true; + return flux; + } + + static double Clamp(double x) { return Math.Max(0, Math.Min(1, x)); } + static double Normalize(double x, double min, double max) { return Clamp((x - min) / (max - min)); } + static double Tempo(double bpm, double min, double max) + { return bpm <= 0 ? 0 : Clamp(1 - Math.Max(min - bpm, Math.Max(0, bpm - max)) / TempoShoulderBpm); } + + void RhythmFeatures(double bpm) + { + double maximum = PowerEpsilon; + for (int i = 0; i < shortCount; i++) + { + envelope[i] = shortOnset[(shortHead - shortCount + i + ShortHops) % ShortHops]; + maximum = Math.Max(maximum, envelope[i]); + } + double mean = 0, variance = 0; + for (int i = 0; i < shortCount; i++) { envelope[i] /= maximum; mean += envelope[i]; } + mean /= Math.Max(1, shortCount); + for (int i = 0; i < shortCount; i++) variance += (envelope[i] - mean) * (envelope[i] - mean); + double threshold = mean + PeakSigma * Math.Sqrt(variance / Math.Max(1, shortCount)); + int peaks = 0, lastPeak = -1, intervals = 0; + double sum = 0, squares = 0; + for (int i = 1; i < shortCount - 1; i++) + if (envelope[i] > threshold && envelope[i] > envelope[i - 1] && envelope[i] >= envelope[i + 1]) + { + peaks++; + if (lastPeak >= 0) { double d = i - lastPeak; sum += d; squares += d * d; intervals++; } + lastPeak = i; + } + // Available duration during warm-up; exactly 4 s once the 400-slot ring is full. + density = peaks / Math.Max(0.01, shortCount / 100.0); + regularity = peaks < MinPeaks ? 0 : 1 - Clamp(Math.Sqrt(Math.Max(0, squares / intervals - Math.Pow(sum / intervals, 2))) / (sum / intervals)); + dembow = 0; fourFloor = 0; DembowPhase = 0; + EffectiveBpm = 0; + if (bpm <= 0) return; + + // Il pattern 3+3+2 crea periodicita' spurie a 4/3 e a 5/4 del battito: il + // detector puo' agganciare una cella invece del battito (95 BPM letti 127 o 76). + // Non lo si decide a priori: vince l'ipotesi che correla meglio col template. + double bestD = 0, bestF = 0, bestP = 0, bestT = 0; + bool found = false; + for (int h = 0; h < FoldFactors.Length; h++) + { + double d, f, p; + if (!Fold(bpm * FoldFactors[h], out d, out f, out p)) continue; + if (!found || d > bestD + FoldMargin) + { + bestD = d; bestF = f; bestP = p; bestT = bpm * FoldFactors[h]; + found = true; + } + } + if (found) { dembow = bestD; fourFloor = bestF; DembowPhase = bestP; EffectiveBpm = bestT; } + } + + bool Fold(double bpm, out double dembowScore, out double fourFloorScore, out double phaseScore) + { + dembowScore = 0; fourFloorScore = 0; phaseScore = 0; + if (bpm < MinFoldBpm) return false; + double hopPerBeat = 60 / bpm * 100, barHops = hopPerBeat * 4; + int bars = (int)Math.Floor(rhythmCount / barHops); + if (bars < MinBars) return false; + int count = (int)Math.Floor(bars * barHops); + Array.Clear(folded, 0, folded.Length); + double maximum = PowerEpsilon; + for (int i = 0; i < count; i++) maximum = Math.Max(maximum, rhythm[(rhythmHead - count + i + RhythmHops) % RhythmHops]); + for (int i = 0; i < count; i++) + folded[((int)Math.Floor(i / hopPerBeat * 4)) % 16] += rhythm[(rhythmHead - count + i + RhythmHops) % RhythmHops] / maximum / bars; + double sum = 0; + for (int i = 0; i < 16; i++) sum += folded[i]; + if (sum <= PowerEpsilon) return false; + for (int i = 0; i < 16; i++) folded[i] /= sum; + for (int phase = 0; phase < 16; phase++) + { + double correlation = 0; + for (int i = 0; i < 16; i++) correlation += folded[(i + phase) % 16] * DembowTemplate[i]; + // Unit-sum folded envelope, binary template: theoretical maximum dot = 1. + if (correlation > dembowScore) { dembowScore = Clamp(correlation); phaseScore = phase / 16.0; } + double mass = 0, weakest = 1; + for (int q = 0; q < 4; q++) + { double v = folded[(phase + 4 * q) % 16]; mass += v; weakest = Math.Min(weakest, v); } + // quarterMass * (weakest / meanQuarter): penalizes missing quarters. + // Uniform 16 bins => .25; four equal quarter hits => 1; missing hit => 0. + double floor = mass > 0 ? mass * Clamp(weakest / (mass / 4)) : 0; + fourFloorScore = Math.Max(fourFloorScore, Clamp(floor)); + } + // Rimuove il pavimento del 7/16: 0 = nessuna informazione ritmica, 1 = dembow pieno. + dembowScore = Clamp((dembowScore - DembowBaseline) / (1 - DembowBaseline)); + return true; + } + + double Percentile(double fraction) + { + double index = (dynamicsCount - 1) * fraction; + int lo = (int)index, hi = Math.Min(lo + 1, dynamicsCount - 1); + return sortedDynamics[lo] + (sortedDynamics[hi] - sortedDynamics[lo]) * (index - lo); + } + + public void Publish(long now, double bpm, UdpClient udp, IPEndPoint destination) + { + if (now - lastPublishMs < PublishMs) return; + lastPublishMs = now; + bool fresh = lastDataMs >= 0 && now - lastDataMs <= StaleMs; + RhythmFeatures(bpm); + // Il termine di tempo usa il BPM che ha vinto il confronto di folding, + // non quello grezzo del rilevatore. + double tempo = EffectiveBpm > 0 ? EffectiveBpm : bpm; + dynamicReady = dynamicsCount >= MinDynamicsSamples; + dynamicRange = 0; + if (dynamicReady) + { + Array.Copy(dynamics, sortedDynamics, dynamicsCount); + Array.Sort(sortedDynamics, 0, dynamicsCount); + dynamicRange = Percentile(0.90) - Percentile(0.10); + } + features[0] = dembow; features[1] = fourFloor; + features[3] = Normalize(lowRatio, LowRatioMin, LowRatioMax); + features[4] = Normalize(flatness, FlatnessMin, FlatnessMax); + features[5] = Normalize(highRatio, HighRatioMin, HighRatioMax); + features[6] = Normalize(density, 0, DensityMax); + features[7] = Normalize(centroid, CentroidMinHz, CentroidMaxHz); + features[8] = regularity; + features[9] = Clamp(1 - Math.Abs(regularity - RegularityCenter) / RegularityWidth); + features[10] = dynamicReady ? Normalize(dynamicRange, DynamicsMinDb, DynamicsMaxDb) : 0; + double maxScore = double.NegativeInfinity; + double[] rawScores = new double[Labels.Length]; + for (int c = 0; c < Labels.Length; c++) + { + features[2] = c == 0 ? Tempo(tempo, LatinMinBpm, LatinMaxBpm) : c == 1 ? Tempo(tempo, ElectronicMinBpm, ElectronicMaxBpm) : c == 2 ? Tempo(tempo, HipHopMinBpm, HipHopMaxBpm) : 0; + double score = Bias[c]; + for (int j = 0; j < features.Length; j++) score += features[j] * Weights[c, j]; + // Dembow come soglia, non come peso: un pattern 3+3+2 riconosciuto vale + // piu' di un contributo lineare, ma solo se il tempo e' compatibile. + if (c == 0 && dembow >= DembowGate && Tempo(tempo, LatinMinBpm, LatinMaxBpm) >= 0.5) + score += DembowBonus; + probabilities[c] = score; + rawScores[c] = score; + maxScore = Math.Max(maxScore, score); + } + double total = 0; + bool active = fresh && recentRms >= ActiveRms && shortCount >= ShortHops; + for (int c = 0; c < Labels.Length; c++) + { probabilities[c] = active ? Math.Exp((probabilities[c] - maxScore) / Temperature) : 1; total += probabilities[c]; } + for (int c = 0; c < Labels.Length; c++) + probabilities[c] /= total; + int best = 0; + for (int c = 1; c < Labels.Length; c++) if (probabilities[c] > probabilities[best]) best = c; + string label = probabilities[best] < ConfidenceThreshold ? "unknown" : Labels[best]; + StringBuilder packet = new StringBuilder(); + packet.AppendFormat(CultureInfo.InvariantCulture, "GENR:1;{0};{1:F3}", label, probabilities[best]); + for (int c = 0; c < Labels.Length; c++) packet.AppendFormat(CultureInfo.InvariantCulture, ";{0}={1:F3}", Labels[c], probabilities[c]); + try { byte[] bytes = Encoding.UTF8.GetBytes(packet.ToString()); udp.Send(bytes, bytes.Length, destination); } catch { } + if (dump != null) + { + try + { + StringBuilder row = new StringBuilder(); + row.AppendFormat(CultureInfo.InvariantCulture, + "{0},{1:F3},{2:F3},{3:F3},{4:F3},{5:F6},{6:F3},{7:F3},{8:F6},{9:F6},{10},{11:F3}", + now, tempo, fresh ? dembow : 0, fresh ? fourFloor : 0, fresh ? density : 0, + fresh ? flatness : 0, fresh ? centroid : 0, fresh ? regularity : 0, + fresh ? highRatio : 0, fresh ? lowRatio : 0, label, probabilities[best]); + // Valori normalizzati visti dal classificatore + punteggi grezzi per classe: + // servono a capire QUALE termine fa perdere una classe, non solo che perde. + for (int j = 0; j < features.Length; j++) row.AppendFormat(CultureInfo.InvariantCulture, ",{0:F3}", features[j]); + for (int c = 0; c < Labels.Length; c++) row.AppendFormat(CultureInfo.InvariantCulture, ",{0:F3}", rawScores[c]); + dump.WriteLine(row.ToString()); + dump.Flush(); // Once a second, never on the per-frame path. + } + catch (Exception ex) { DisableDump(ex); } + } + } + } + class Program { const int SIO_UDP_CONNRESET = -1744830452; static int selectedTargetPid = 0; // 0 = Tutto il sistema + static Mutex instanceMutex; + static ManualResetEvent cmdReady = new ManualResetEvent(false); + static long leaseDeadlineMs; static void Main(string[] args) { + try + { + Run(args); + } + catch (Exception ex) + { + Console.Error.WriteLine(ex); + Environment.Exit(5); + } + } + + static void Run(string[] args) + { + Stopwatch lifecycleClock = Stopwatch.StartNew(); + int leaseMs = 0; + string dumpPath = null; + foreach (string arg in args) + { + if (arg.StartsWith("--dump-features=", StringComparison.Ordinal)) + dumpPath = arg.Substring(16); + if (arg.StartsWith("--lease-ms=", StringComparison.Ordinal)) + { + int parsedLease; + if (int.TryParse(arg.Substring(11), out parsedLease) && parsedLease > 0) + leaseMs = parsedLease; + } + } + Interlocked.Exchange(ref leaseDeadlineMs, lifecycleClock.ElapsedMilliseconds + leaseMs); int port = 4242; int cmdPort = 4243; if (args.Length > 0) @@ -25,6 +440,35 @@ namespace LoopbackCapture cmdPort = port + 1; } + int parentPid = 0; + if (args.Length > 1) int.TryParse(args[1], out parentPid); + if (parentPid > 0) + { + Thread parentWatchdog = new Thread(() => + { + try + { + using (Process parent = Process.GetProcessById(parentPid)) + { + parent.WaitForExit(); + } + } + catch { } + Environment.Exit(0); + }); + parentWatchdog.IsBackground = true; + parentWatchdog.Start(); + } + + bool createdNew; + instanceMutex = new Mutex(false, "Local\\LoopbackCapture_" + port, out createdNew); + if (!createdNew) + { + Console.Error.WriteLine("LoopbackCapture: istanza gia attiva sulla porta " + port); + Environment.Exit(3); + } + GC.KeepAlive(instanceMutex); + UdpClient udpSend = null; try { @@ -44,6 +488,7 @@ namespace LoopbackCapture try { udpCmd = new UdpClient(cmdPort); + cmdReady.Set(); IPEndPoint sender = new IPEndPoint(IPAddress.Any, 0); while (true) { @@ -57,6 +502,11 @@ namespace LoopbackCapture selectedTargetPid = pid; } } + else if (cmd.StartsWith("PING:", StringComparison.Ordinal)) + { + Interlocked.Exchange(ref leaseDeadlineMs, lifecycleClock.ElapsedMilliseconds + leaseMs); + } + // Unknown commands are deliberately ignored. } } catch { } @@ -64,29 +514,42 @@ namespace LoopbackCapture cmdListenerThread.IsBackground = true; cmdListenerThread.Start(); + // Thread.Start alone does not guarantee that the command socket is bound. + if (!cmdReady.WaitOne(2000)) + Console.Error.WriteLine("LoopbackCapture: command socket not ready after 2000 ms; continuing."); + + // Announce after command readiness (or its bounded diagnostic timeout). + try + { + byte[] hello = Encoding.UTF8.GetBytes("HELLO:2"); + udpSend.Send(hello, hello.Length, remoteEp); + } + catch { } + IMMDeviceEnumerator enumerator = (IMMDeviceEnumerator)new MMDeviceEnumeratorComObject(); IMMDevice device = null; int hr = enumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia, out device); if (hr != 0 || device == null) { hr = enumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eConsole, out device); - if (hr != 0 || device == null) return; + if (hr != 0 || device == null) Environment.Exit(2); } Guid iidMgr = typeof(IAudioSessionManager2).GUID; object oMgr; - device.Activate(ref iidMgr, 1, IntPtr.Zero, out oMgr); + hr = device.Activate(ref iidMgr, 1, IntPtr.Zero, out oMgr); + if (hr != 0 || oMgr == null) Environment.Exit(4); IAudioSessionManager2 sessionManager = (IAudioSessionManager2)oMgr; Guid iidAudioClient = typeof(IAudioClient).GUID; object oAudioClient; hr = device.Activate(ref iidAudioClient, 1, IntPtr.Zero, out oAudioClient); - if (hr != 0 || oAudioClient == null) return; + if (hr != 0 || oAudioClient == null) Environment.Exit(4); IAudioClient audioClient = (IAudioClient)oAudioClient; IntPtr pMixFormat; hr = audioClient.GetMixFormat(out pMixFormat); - if (hr != 0 || pMixFormat == IntPtr.Zero) return; + if (hr != 0 || pMixFormat == IntPtr.Zero) Environment.Exit(4); WAVEFORMATEX wf = (WAVEFORMATEX)Marshal.PtrToStructure(pMixFormat, typeof(WAVEFORMATEX)); int channels = wf.nChannels; @@ -112,15 +575,16 @@ namespace LoopbackCapture Guid emptySession = Guid.Empty; hr = audioClient.Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_LOOPBACK, 10000000, 0, pMixFormat, ref emptySession); - if (hr != 0) return; + if (hr != 0) Environment.Exit(4); Guid iidCaptureClient = typeof(IAudioCaptureClient).GUID; object oCaptureClient; hr = audioClient.GetService(ref iidCaptureClient, out oCaptureClient); - if (hr != 0 || oCaptureClient == null) return; + if (hr != 0 || oCaptureClient == null) Environment.Exit(4); IAudioCaptureClient captureClient = (IAudioCaptureClient)oCaptureClient; - audioClient.Start(); + hr = audioClient.Start(); + if (hr != 0) Environment.Exit(4); // Filtro Passa-Basso sui Sub-Bassi (cassa e basse frequenze: 120 Hz) float cutoffFreq = 120.0f; @@ -134,6 +598,7 @@ namespace LoopbackCapture // Buffer circolare onset flux temporizzato ai campioni audio reali (100 Hz = ogni 10ms esatti) int hopSize = sampleRate / 100; if (hopSize < 1) hopSize = 480; + RuleGenreAnalyzer genreAnalyzer = new RuleGenreAnalyzer(sampleRate, hopSize, dumpPath); const int BUFFER_HOPS = 400; // 4.0 secondi di finestra temporale float[] onsetBuffer = new float[BUFFER_HOPS]; int onsetHead = 0; @@ -146,15 +611,50 @@ namespace LoopbackCapture float prevHopTotalRms = 0; float detectedBpm = 0.0f; + double foldedBpm = 0.0; // tempo canonico con cui e' stato costruito lo storico ritmico int candidateBpm = 0; int candidateStreak = 0; int bpmEvalCounter = 0; long lastAppListBroadcast = 0; int myPid = Process.GetCurrentProcess().Id; + long lastHeartbeat = -250; + long heartbeatCounter = 0; + long captureErrorSince = -1; while (true) { + if (leaseMs > 0 && lifecycleClock.ElapsedMilliseconds > Interlocked.Read(ref leaseDeadlineMs)) + { + // Prefer clean parent termination even if its watchdog has not run yet. + if (parentPid > 0) + { + try + { + using (Process parent = Process.GetProcessById(parentPid)) + { + if (parent.HasExited) Environment.Exit(0); + } + } + catch { Environment.Exit(0); } + } + // A PING may have renewed the lease while checking the parent. + if (lifecycleClock.ElapsedMilliseconds > Interlocked.Read(ref leaseDeadlineMs)) + { + Console.Error.WriteLine("LoopbackCapture: lease expired (Godot is not responding)."); + Environment.Exit(6); + } + } + if (lifecycleClock.ElapsedMilliseconds - lastHeartbeat >= 250) + { + lastHeartbeat = lifecycleClock.ElapsedMilliseconds; + try + { + byte[] heartbeat = Encoding.UTF8.GetBytes(string.Format("HB:{0};0", heartbeatCounter++)); + udpSend.Send(heartbeat, heartbeat.Length, remoteEp); + } + catch { } + } // 1. Lettura campioni PCM WASAPI dal loopback di sistema uint packetLength = 0; hr = captureClient.GetNextPacketSize(out packetLength); @@ -168,6 +668,7 @@ namespace LoopbackCapture hr = captureClient.GetBuffer(out pData, out numFramesRead, out flags, out devPos, out qpcPos); if (hr != 0) break; + if (numFramesRead > 0) genreAnalyzer.MarkData(lifecycleClock.ElapsedMilliseconds); if ((flags & 1) == 0 && numFramesRead > 0) { @@ -200,6 +701,7 @@ namespace LoopbackCapture monoSample /= channels; } + genreAnalyzer.AddSample((flags & 2) != 0 ? 0f : monoSample); totalSumSq += (monoSample * monoSample); // Filtro IIR passa-basso a doppio polo per estrarre la cassa @@ -243,6 +745,7 @@ namespace LoopbackCapture } else { + for (uint f = 0; f < numFramesRead; f++) genreAnalyzer.AddSample(0f); currentTotalRms *= 0.7f; } @@ -250,6 +753,18 @@ namespace LoopbackCapture hr = captureClient.GetNextPacketSize(out packetLength); } + // A full second of consecutive failed capture iterations is persistent. + if (hr != 0) + { + if (captureErrorSince < 0) captureErrorSince = lifecycleClock.ElapsedMilliseconds; + if (lifecycleClock.ElapsedMilliseconds - captureErrorSince >= 1000) + { + Console.Error.WriteLine("Persistent WASAPI capture error: " + hr); + Environment.Exit(5); + } + } + else captureErrorSince = -1; + // 2. Volume mirato se selezionata una specifica applicazione (es. Spotify/Chrome) float displayRms = currentTotalRms; if (selectedTargetPid > 0 && sessionManager != null) @@ -427,6 +942,22 @@ namespace LoopbackCapture } } + // Il folding ritmico e' valido solo sullo stesso brano. Il ring contiene envelope + // di onset indipendenti dal tempo: il problema non e' il BPM in se', ma mediare + // battute di brani diversi. Serve quindi un salto DISCRETO di tempo, non la deriva + // dell'inseguimento morbido (0.94/0.06), che altrimenti azzererebbe lo storico + // a ogni gradino e dembow resterebbe sempre a zero. + // Il confronto usa il tempo canonico: un flip di ottava del rilevatore (170 -> 171) + // non deve azzerare nulla, mentre un cambio reale di brano si'. + double canonicalBpm = RuleGenreAnalyzer.CanonicalTempo(detectedBpm); + if (detectedBpm > 50.0f && Math.Abs(canonicalBpm - foldedBpm) > 10.0) + { + genreAnalyzer.ResetRhythm(); + } + foldedBpm = canonicalBpm; + + genreAnalyzer.Publish(lifecycleClock.ElapsedMilliseconds, canonicalBpm, udpSend, remoteEp); + // 4. Invio lista applicazioni attive (FILTRANDO se stesso e Godot!) long nowTicks = DateTime.UtcNow.Ticks; if ((nowTicks - lastAppListBroadcast) >= (TimeSpan.TicksPerMillisecond * 1500) && sessionManager != null) diff --git a/bin/LoopbackCapture.exe b/bin/LoopbackCapture.exe index 3c98635..c93c1f4 100644 Binary files a/bin/LoopbackCapture.exe and b/bin/LoopbackCapture.exe differ diff --git a/bin/build.ps1 b/bin/build.ps1 new file mode 100644 index 0000000..4e1797c --- /dev/null +++ b/bin/build.ps1 @@ -0,0 +1,10 @@ +$csc = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe" +if (-not (Test-Path $csc)) { + $csc = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" +} +if (-not (Test-Path $csc)) { + Write-Error "Compilatore .NET Framework csc.exe non trovato (Framework64 / Framework)." + exit 1 +} +& $csc /nologo /unsafe /optimize+ /target:exe /out:bin\LoopbackCapture.exe bin\LoopbackCapture.cs +exit $LASTEXITCODE diff --git a/project.godot b/project.godot index 6012f36..215cba8 100644 --- a/project.godot +++ b/project.godot @@ -17,6 +17,7 @@ config/icon="res://icon.svg" [audio] +buses/default_bus_layout="uid://de2evqqag5qan" driver/enable_input=true [display] diff --git a/scenes/Main.tscn b/scenes/Main.tscn index be5de87..bd55ac3 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -1,8 +1,8 @@ -[gd_scene load_steps=5 format=3] +[gd_scene format=3 uid="uid://dsx8ygbmfsyj8"] -[ext_resource type="Script" path="res://scripts/SystemAudioAnalyzer.gd" id="1_audio_analyzer"] -[ext_resource type="Script" path="res://scripts/CompanionController.gd" id="2_companion"] -[ext_resource type="Texture2D" path="res://icon.svg" id="3_icon"] +[ext_resource type="Script" uid="uid://c76vsjv0asi61" path="res://scripts/SystemAudioAnalyzer.gd" id="1_audio_analyzer"] +[ext_resource type="Script" uid="uid://b8bfvlbipx8j8" path="res://scripts/CompanionController.gd" id="2_companion"] +[ext_resource type="Texture2D" uid="uid://c2yvovlrnbclm" path="res://icon.svg" id="3_icon"] [sub_resource type="SpriteFrames" id="SpriteFrames_1"] animations = [{ @@ -11,14 +11,6 @@ animations = [{ "texture": ExtResource("3_icon") }], "loop": true, -"name": &"idle", -"speed": 5.0 -}, { -"frames": [{ -"duration": 1.0, -"texture": ExtResource("3_icon") -}], -"loop": true, "name": &"dance", "speed": 10.0 }, { @@ -27,16 +19,24 @@ animations = [{ "texture": ExtResource("3_icon") }], "loop": true, +"name": &"idle", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("3_icon") +}], +"loop": true, "name": &"sleep", "speed": 2.0 }] -[node name="Main" type="Node2D"] +[node name="Main" type="Node2D" unique_id=36355540] -[node name="SystemAudioAnalyzer" type="Node" parent="."] +[node name="SystemAudioAnalyzer" type="Node" parent="." unique_id=1763523839] script = ExtResource("1_audio_analyzer") -[node name="Companion" type="Node2D" parent="." node_paths=PackedStringArray("audio_analyzer", "sprite", "debug_label", "volume_bar", "app_selector")] +[node name="Companion" type="Node2D" parent="." unique_id=444784374 node_paths=PackedStringArray("audio_analyzer", "sprite", "debug_label", "volume_bar", "app_selector")] position = Vector2(200, 280) script = ExtResource("2_companion") audio_analyzer = NodePath("../SystemAudioAnalyzer") @@ -45,14 +45,14 @@ debug_label = NodePath("../UI/MarginContainer/VBoxContainer/DebugLabel") volume_bar = NodePath("../UI/MarginContainer/VBoxContainer/VolumeBar") app_selector = NodePath("../UI/MarginContainer/VBoxContainer/AppSelector") -[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Companion"] +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Companion" unique_id=1873221699] scale = Vector2(1.2, 1.2) sprite_frames = SubResource("SpriteFrames_1") animation = &"idle" -[node name="UI" type="CanvasLayer" parent="."] +[node name="UI" type="CanvasLayer" parent="." unique_id=2055130498] -[node name="MarginContainer" type="MarginContainer" parent="UI"] +[node name="MarginContainer" type="MarginContainer" parent="UI" unique_id=700137692] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 @@ -63,29 +63,29 @@ theme_override_constants/margin_top = 16 theme_override_constants/margin_right = 16 theme_override_constants/margin_bottom = 16 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="UI/MarginContainer" unique_id=969047865] layout_mode = 2 size_flags_vertical = 0 theme_override_constants/separation = 6 -[node name="TitleLabel" type="Label" parent="UI/MarginContainer/VBoxContainer"] +[node name="TitleLabel" type="Label" parent="UI/MarginContainer/VBoxContainer" unique_id=2017771158] layout_mode = 2 theme_override_colors/font_color = Color(0.9, 0.9, 0.9, 1) theme_override_font_sizes/font_size = 13 text = "Desktop Companion" horizontal_alignment = 1 -[node name="AppSelector" type="OptionButton" parent="UI/MarginContainer/VBoxContainer"] +[node name="AppSelector" type="OptionButton" parent="UI/MarginContainer/VBoxContainer" unique_id=1135696676] layout_mode = 2 tooltip_text = "Seleziona l'applicazione da ascoltare (Spotify, Chrome, ecc.)" -[node name="VolumeBar" type="ProgressBar" parent="UI/MarginContainer/VBoxContainer"] +[node name="VolumeBar" type="ProgressBar" parent="UI/MarginContainer/VBoxContainer" unique_id=426369941] custom_minimum_size = Vector2(0, 8) layout_mode = 2 max_value = 1.0 show_percentage = false -[node name="DebugLabel" type="Label" parent="UI/MarginContainer/VBoxContainer"] +[node name="DebugLabel" type="Label" parent="UI/MarginContainer/VBoxContainer" unique_id=826112804] layout_mode = 2 theme_override_colors/font_color = Color(0.65, 0.9, 0.75, 1) theme_override_font_sizes/font_size = 12 diff --git a/scripts/CompanionController.gd b/scripts/CompanionController.gd index 970aab8..99039d6 100644 --- a/scripts/CompanionController.gd +++ b/scripts/CompanionController.gd @@ -27,6 +27,8 @@ enum State { var current_state: State = State.IDLE var _silence_timer: float = 0.0 var _current_rms: float = 0.0 +var _current_genre: String = "" +var _current_genre_conf: float = 0.0 # BPM dinamico: parte da 0 finché la canzone non viene agganciata var _current_bpm: float = 0.0 @@ -48,6 +50,7 @@ func _ready() -> void: audio_analyzer.volume_updated.connect(_on_volume_updated) audio_analyzer.bpm_updated.connect(_on_bpm_updated) audio_analyzer.applications_updated.connect(_on_applications_updated) + audio_analyzer.genre_updated.connect(_on_genre_updated) if app_selector: app_selector.item_selected.connect(_on_app_selected) @@ -56,18 +59,22 @@ func _ready() -> void: _set_state(State.IDLE) +func _on_genre_updated(genre: String, confidence: float, _probs: Dictionary) -> void: + _current_genre = genre + _current_genre_conf = confidence + func _on_applications_updated(apps: Array[Dictionary]) -> void: if not app_selector: return # Evita di ricreare la lista se gli elementi sono identici (previene glitch della UI) - var is_same = (apps.size() == _known_apps.size()) - if is_same: + var issame = (apps.size() == _known_apps.size()) + if issame: for i in range(apps.size()): if apps[i]["pid"] != _known_apps[i]["pid"] or apps[i]["name"] != _known_apps[i]["name"]: - is_same = false + issame = false break - if is_same: + if issame: return _known_apps = apps @@ -207,8 +214,12 @@ func _update_debug_ui() -> void: if _current_bpm > 50.0: bpm_str = "%d BPM" % round(_current_bpm) - debug_label.text = "Stato: %s | Volume: %.2f | %s" % [ + var genre_str: String = "Genere: --" + if not _current_genre.is_empty() and _current_genre != "unknown": + genre_str = "%s (%d%%)" % [_current_genre, roundi(_current_genre_conf * 100.0)] + debug_label.text = "Stato: %s | Volume: %.2f | %s | %s" % [ State.keys()[current_state], _current_rms, - bpm_str + bpm_str, + genre_str ] diff --git a/scripts/SystemAudioAnalyzer.gd b/scripts/SystemAudioAnalyzer.gd index 64121dc..4ed3ee3 100644 --- a/scripts/SystemAudioAnalyzer.gd +++ b/scripts/SystemAudioAnalyzer.gd @@ -7,9 +7,18 @@ signal volume_updated(rms_value: float) signal bpm_updated(bpm: float) ## Emette la lista delle applicazioni audio attive (es. Spotify, Chrome, Discord) signal applications_updated(apps: Array[Dictionary]) +signal genre_updated(genre: String, confidence: float, probs: Dictionary) @export var udp_port: int = 4242 @export var cmd_port: int = 4243 +@export var heartbeat_timeout_ms: int = 1500 +@export var lease_enabled: bool = true +@export var genre_enabled: bool = true + +const LEASE_MS: int = 10000 +const GENRE_LABELS = ["latin", "electronic", "hiphop", "rock", "classical"] +const GENRE_ALPHA: float = 0.25 +const GENRE_MIN_CONFIDENCE: float = 0.30 @export_group("Gain & Sensitivity") @export var system_audio_gain: float = 3.8 @@ -21,8 +30,23 @@ var _loopback_pid: int = -1 var _loopback_rms: float = 0.0 var _last_bpm: float = 0.0 var _watchdog_timer: float = 0.0 +var _last_heartbeat_msec: int = 0 +var _bridge_protocol: int = 0 +var _restart_delay: float = 1.0 +var _next_restart_at: int = 0 +var _selected_pid: int = 0 +var _restore_selection_at: int = -1 +var _healthy_since: int = -1 +var _last_health_packet: int = -1 +var _restart_attempt: bool = false +var _bridge_enabled: bool = false +var _last_ping_msec: int = 0 +var _genre_probs: Dictionary = {} +var _genre_argmax: String = "" +var _genre_last_emit_msec: int = -5000 func _ready() -> void: + process_mode = Node.PROCESS_MODE_ALWAYS _init_native_wasapi_loopback() func _init_native_wasapi_loopback() -> void: @@ -35,27 +59,97 @@ func _init_native_wasapi_loopback() -> void: _udp_send.set_dest_address("127.0.0.1", cmd_port) if err == OK: - var exe_path = ProjectSettings.globalize_path("res://bin/LoopbackCapture.exe") - if FileAccess.file_exists("res://bin/LoopbackCapture.exe"): - _loopback_pid = OS.create_process(exe_path, [str(udp_port)], false) + _bridge_enabled = true + _spawn_bridge() + +func _spawn_bridge() -> void: + var now: int = Time.get_ticks_msec() + if now < _next_restart_at: + return + # Discard queued packets from the preceding session without closing the socket. + while _udp_peer.get_available_packet_count() > 0: + _udp_peer.get_packet() + _bridge_protocol = 0 + _genre_probs.clear() + _genre_argmax = "" + _genre_last_emit_msec = -5000 + _last_heartbeat_msec = now + _healthy_since = -1 + _last_health_packet = -1 + var exe_path = ProjectSettings.globalize_path("res://bin/LoopbackCapture.exe") + if FileAccess.file_exists("res://bin/LoopbackCapture.exe"): + var args: PackedStringArray = [str(udp_port), str(OS.get_process_id())] + if lease_enabled and not OS.is_debug_build(): + args.append("--lease-ms=%d" % LEASE_MS) + _loopback_pid = OS.create_process(exe_path, args, false) + else: + _loopback_pid = -1 + if _loopback_pid <= 0: + _schedule_restart("avvio fallito") + else: + _restore_selection_at = now + 300 + _send_ping() + +func _send_ping() -> void: + if _udp_send and _loopback_pid > 0 and OS.is_process_running(_loopback_pid): + _last_ping_msec = Time.get_ticks_msec() + _udp_send.put_packet(("PING:%d" % _last_ping_msec).to_utf8_buffer()) + +func _schedule_restart(reason: String, exit_code: int = -1) -> void: + if _restart_attempt: + _restart_delay = minf(_restart_delay * 2.0, 30.0) + if exit_code == 3: + print("[SystemAudioAnalyzer] istanza gia attiva, attendo") + _restart_delay = 30.0 + # Limite noto: un'istanza vecchia senza heartbeat non viene terminata. + print("[SystemAudioAnalyzer] Riavvio: %s; attesa %.1f s" % [reason, _restart_delay]) + _next_restart_at = Time.get_ticks_msec() + int(_restart_delay * 1000.0) + _restart_attempt = true + _loopback_pid = -1 + _restore_selection_at = -1 + _healthy_since = -1 + +func _record_health_packet(now: int) -> void: + if _loopback_pid <= 0: + return + if _last_health_packet < 0 or now - _last_health_packet > heartbeat_timeout_ms: + _healthy_since = now + _last_health_packet = now + if now - _healthy_since >= 10000: + _restart_delay = 1.0 + _restart_attempt = false + +func _check_bridge_lifecycle() -> void: + if not _bridge_enabled: + return + var now: int = Time.get_ticks_msec() + if _loopback_pid <= 0: + if now >= _next_restart_at: + _spawn_bridge() + return + if not OS.is_process_running(_loopback_pid): + _schedule_restart("processo terminato", OS.get_process_exit_code(_loopback_pid)) + elif _bridge_protocol > 0: + # Finche' non arriva il primo HB l'exe puo' essere ancora in inizializzazione + # WASAPI: concedi una finestra piu' ampia per evitare falsi timeout a freddo. + var timeout: int = heartbeat_timeout_ms + if _last_health_packet < 0: + timeout = maxi(heartbeat_timeout_ms, 5000) + if now - _last_heartbeat_msec > timeout: + OS.kill(_loopback_pid) + _schedule_restart("timeout heartbeat") ## Invia al bridge la richiesta di ascoltare SOLO l'applicazione con il PID specificato (0 = Tutto) func select_application_pid(pid: int) -> void: + _selected_pid = pid if _udp_send: var msg = "PID:%d" % pid _udp_send.put_packet(msg.to_utf8_buffer()) print("[SystemAudioAnalyzer] Applicazione audio selezionata PID: ", pid) func _process(delta: float) -> void: - # Watchdog: se LoopbackCapture non è in esecuzione, riavvialo automaticamente - _watchdog_timer += delta - if _watchdog_timer >= 2.0: - _watchdog_timer = 0.0 - if _loopback_pid <= 0 or not OS.is_process_running(_loopback_pid): - var exe_path = ProjectSettings.globalize_path("res://bin/LoopbackCapture.exe") - if FileAccess.file_exists("res://bin/LoopbackCapture.exe"): - _loopback_pid = OS.create_process(exe_path, [str(udp_port)], false) - + if Time.get_ticks_msec() - _last_ping_msec >= 2000: + _send_ping() # Lettura esclusiva dell'Audio di Sistema o dell'Applicazione selezionata (Zero Microfono) if _udp_peer: var packet_received: bool = false @@ -67,9 +161,35 @@ func _process(delta: float) -> void: var text: String = packet.get_string_from_utf8() _parse_applications_list(text) continue + if packet.size() >= 3 and packet[0] == 72 and packet[1] == 66 and packet[2] == 58: + _last_heartbeat_msec = Time.get_ticks_msec() + _record_health_packet(_last_heartbeat_msec) + continue + if packet.size() >= 6 and packet[0] == 72 and packet[1] == 69 and packet[2] == 76 and packet[3] == 76 and packet[4] == 79 and packet[5] == 58: + if _bridge_protocol == 0 and _loopback_pid > 0: + _bridge_protocol = packet.get_string_from_utf8().substr(6).to_int() + _last_heartbeat_msec = Time.get_ticks_msec() + _healthy_since = -1 + _last_health_packet = -1 + select_application_pid(_selected_pid) + # Retain the 300ms resend for legacy bridges without command readiness. + continue - # Pacchetto audio standard: 8 byte (4 byte RMS + 4 byte BPM) - if packet.size() >= 4: + if packet.size() >= 5 and packet[0] == 71 and packet[1] == 69 and packet[2] == 78 and packet[3] == 82 and packet[4] == 58: + if genre_enabled: + _parse_genre(packet.get_string_from_utf8()) + continue + + # Convenzione: le future estensioni testuali non devono MAI essere lunghe + # esattamente 8 byte (messaggio completo, non solo prefisso). + # HELLO:/HB:/APPS:/GENR: sono riconosciuti sopra; PING: e i futuri STATUS:/SILENT: + # devono rispettare la convenzione o essere gestiti prima del ramo binario. + # Nessuna euristica sui byte: anche 0x41 e' legittimo in un float little-endian. + # Pacchetto audio standard: 8 byte (4 byte RMS + 4 byte BPM). + if packet.size() == 8: + # No HELLO means legacy mode: process liveness only, no HB timeout. + if _bridge_protocol == 0: + _record_health_packet(Time.get_ticks_msec()) _loopback_rms = packet.decode_float(0) packet_received = true @@ -82,6 +202,16 @@ func _process(delta: float) -> void: if not packet_received: _loopback_rms = move_toward(_loopback_rms, 0.0, delta * 3.0) + # Read queued heartbeats before checking the watchdog to avoid false timeouts. + _watchdog_timer += delta + if _watchdog_timer >= 0.5: + _watchdog_timer = 0.0 + _check_bridge_lifecycle() + if _restore_selection_at >= 0 and Time.get_ticks_msec() >= _restore_selection_at: + _restore_selection_at = -1 + if _loopback_pid > 0 and OS.is_process_running(_loopback_pid): + select_application_pid(_selected_pid) + # Calcolo Volume Percepito (Curva Loudness) var processed_rms: float = 0.0 if _loopback_rms > system_noise_floor: @@ -89,6 +219,47 @@ func _process(delta: float) -> void: volume_updated.emit(processed_rms) +func _parse_genre(raw_text: String) -> void: + var fields: PackedStringArray = raw_text.substr(5).split(";") + if fields.size() < 8: + return + # Version, raw label and raw confidence precede the five probabilities. + # The displayed label/confidence are recomputed from the smoothed distribution. + var incoming: Dictionary = {} + var total: float = 0.0 + for i in range(3, fields.size()): + var pair: PackedStringArray = fields[i].split("=") + if pair.size() != 2 or not GENRE_LABELS.has(pair[0]): + continue + if incoming.has(pair[0]) or not pair[1].is_valid_float(): + return + var probability: float = pair[1].to_float() + if not is_finite(probability) or probability < 0.0 or probability > 1.0: + return + incoming[pair[0]] = probability + total += probability + if incoming.size() != GENRE_LABELS.size() or total <= 0.0: + return + var first: bool = _genre_probs.is_empty() + var best: String = "" + var confidence: float = -1.0 + for genre in GENRE_LABELS: + var probability: float = float(incoming[genre]) / total + if first: + _genre_probs[genre] = probability + else: + _genre_probs[genre] = lerpf(float(_genre_probs[genre]), probability, GENRE_ALPHA) + if float(_genre_probs[genre]) > confidence: + confidence = float(_genre_probs[genre]) + best = genre + var label: String = best if confidence >= GENRE_MIN_CONFIDENCE else "unknown" + var now: int = Time.get_ticks_msec() + if best != _genre_argmax or now - _genre_last_emit_msec >= 5000: + _genre_argmax = best + _genre_last_emit_msec = now + print("[SystemAudioAnalyzer] Genere: %s (%.0f%%)" % [label, confidence * 100.0]) + genre_updated.emit(label, confidence, _genre_probs.duplicate()) + func _parse_applications_list(raw_text: String) -> void: var payload = raw_text.substr(5) var tokens = payload.split(";") @@ -97,8 +268,8 @@ func _parse_applications_list(raw_text: String) -> void: var parts = token.split(":") if parts.size() >= 2: var pid = int(parts[0]) - var name = parts[1] - apps.append({"pid": pid, "name": name}) + var curr_name = parts[1] + apps.append({"pid": pid, "name": curr_name}) if not apps.is_empty(): applications_updated.emit(apps) diff --git a/tests/classic.bpm.translation b/tests/classic.bpm.translation new file mode 100644 index 0000000..3d25cc2 Binary files /dev/null and b/tests/classic.bpm.translation differ diff --git a/tests/classic.centroid.translation b/tests/classic.centroid.translation new file mode 100644 index 0000000..c18d937 Binary files /dev/null and b/tests/classic.centroid.translation differ diff --git a/tests/classic.conf.translation b/tests/classic.conf.translation new file mode 100644 index 0000000..9be95c6 Binary files /dev/null and b/tests/classic.conf.translation differ diff --git a/tests/classic.csv b/tests/classic.csv new file mode 100644 index 0000000..708f0f0 --- /dev/null +++ b/tests/classic.csv @@ -0,0 +1,121 @@ +ms,bpm,dembow,fourfloor,density,flatness,centroid,regularity,highRatio,lowRatio,label,conf,f0_latin_dembow,f1_fourfloor,f2_tempo_latin,f3_low,f4_flat,f5_high,f6_density,f7_centroid,f8_reg,f9_regmid,f10_dyn,s_latin,s_electronic,s_hiphop,s_rock,s_classical +1004,0.000,0.000,0.000,3.125,0.061322,333.778,0.000,0.080008,0.000081,unknown,0.200,0.000,0.000,0.000,0.000,0.086,0.055,0.391,0.000,0.000,0.000,0.000,0.000,0.000,0.258,0.146,0.386 +2015,0.000,0.000,0.000,1.523,0.000345,1.877,0.000,0.000450,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.190,0.000,0.000,0.000,0.000,0.000,0.000,0.312,0.057,0.452 +3019,0.000,0.000,0.000,1.347,0.000002,0.011,0.536,0.000003,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.168,0.000,0.536,0.927,0.000,0.000,0.134,0.455,0.051,0.404 +4033,0.000,0.000,0.000,1.256,0.000000,0.000,0.496,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.157,0.000,0.496,0.991,0.000,0.000,0.124,0.467,0.047,0.411 +5035,0.000,0.000,0.000,0.750,0.039351,523.073,0.000,0.421286,0.172807,unknown,0.200,0.000,0.000,0.000,0.273,0.040,0.675,0.094,0.007,0.000,0.000,0.000,0.068,0.041,0.217,0.238,0.274 +6049,98.030,0.000,0.000,4.500,0.024149,877.338,0.712,0.144162,0.304831,classical,0.430,0.000,0.000,0.000,0.566,0.009,0.171,0.563,0.108,0.712,0.577,1.000,0.392,0.263,0.474,0.248,0.587 +7049,98.034,0.000,0.000,3.000,0.013014,648.946,0.375,0.110104,0.059829,classical,0.650,0.000,0.000,0.000,0.022,0.000,0.109,0.375,0.043,0.375,0.750,1.000,0.255,0.097,0.444,0.156,0.686 +8063,97.784,0.000,0.000,5.750,0.022374,949.100,0.000,0.175541,0.021308,classical,0.618,0.000,0.000,0.000,0.000,0.005,0.228,0.719,0.128,0.000,0.000,1.000,0.250,0.000,0.231,0.317,0.602 +9067,97.868,0.000,0.000,7.250,0.022594,686.227,0.000,0.121620,0.131801,classical,0.567,0.000,0.000,0.000,0.182,0.005,0.130,0.906,0.053,0.000,0.000,1.000,0.295,0.027,0.253,0.325,0.584 +10080,97.917,0.000,0.000,10.000,0.016427,740.431,0.447,0.142132,0.339054,classical,0.321,0.000,0.000,0.000,0.642,0.000,0.168,1.000,0.069,0.447,0.893,1.000,0.411,0.208,0.451,0.367,0.505 +11093,97.917,0.000,0.000,7.750,0.008827,561.398,0.000,0.088407,0.055460,classical,0.602,0.000,0.000,0.000,0.012,0.000,0.070,0.969,0.018,0.000,0.000,1.000,0.253,0.002,0.222,0.316,0.587 +12096,97.931,0.000,0.000,3.500,0.010444,697.350,0.408,0.115244,0.261812,classical,0.523,0.000,0.000,0.000,0.471,0.000,0.119,0.438,0.056,0.408,0.816,1.000,0.368,0.173,0.530,0.181,0.664 +13109,97.920,0.000,0.000,5.250,0.011000,703.071,0.000,0.133925,0.153050,classical,0.635,0.000,0.000,0.000,0.229,0.000,0.153,0.656,0.058,0.000,0.000,1.000,0.307,0.034,0.307,0.257,0.640 +14110,122.422,0.000,0.190,8.250,0.009172,496.655,0.000,0.057272,0.358066,classical,0.507,0.000,0.190,0.000,0.685,0.000,0.013,1.000,0.000,0.000,0.000,1.000,0.171,0.419,0.284,0.304,0.596 +15123,122.686,0.000,0.223,13.250,0.006278,499.749,0.000,0.060614,0.067184,classical,0.598,0.000,0.223,0.000,0.038,0.000,0.019,1.000,0.000,0.000,0.000,1.000,0.010,0.334,0.153,0.306,0.594 +16125,98.568,0.000,0.230,10.750,0.023982,855.449,0.000,0.142623,0.100499,classical,0.509,0.000,0.230,0.000,0.112,0.008,0.168,1.000,0.102,0.000,0.000,1.000,0.278,0.097,0.207,0.377,0.549 +17138,98.857,0.000,0.218,11.250,0.014475,620.684,0.000,0.089700,0.104751,classical,0.562,0.000,0.218,0.000,0.122,0.000,0.072,1.000,0.034,0.000,0.000,1.000,0.280,0.095,0.231,0.330,0.578 +18150,99.053,0.000,0.222,10.250,0.013542,714.236,0.000,0.134646,0.125733,classical,0.514,0.000,0.222,0.000,0.168,0.000,0.154,1.000,0.061,0.000,0.000,1.000,0.292,0.103,0.218,0.361,0.554 +19153,99.044,0.000,0.237,8.250,0.006275,461.911,0.000,0.053247,0.103583,classical,0.593,0.000,0.237,0.000,0.119,0.000,0.006,1.000,0.000,0.000,0.000,1.000,0.280,0.101,0.245,0.302,0.598 +20165,99.044,0.000,0.246,8.750,0.007984,531.868,0.000,0.042467,0.104763,classical,0.480,0.000,0.246,0.000,0.122,0.000,0.000,1.000,0.009,0.000,0.000,0.738,0.280,0.104,0.247,0.302,0.508 +21167,99.039,0.000,0.239,9.500,0.006585,543.170,0.000,0.050090,0.154835,classical,0.334,0.000,0.239,0.000,0.233,0.000,0.000,1.000,0.012,0.000,0.000,0.433,0.308,0.119,0.270,0.303,0.402 +22172,99.039,0.000,0.237,8.500,0.008795,577.304,0.000,0.051923,0.122636,unknown,0.287,0.000,0.237,0.000,0.161,0.000,0.003,1.000,0.022,0.000,0.000,0.283,0.290,0.107,0.254,0.307,0.348 +23184,99.039,0.000,0.217,7.500,0.015380,786.163,0.000,0.113428,0.038068,rock,0.307,0.000,0.217,0.000,0.000,0.000,0.115,0.938,0.082,0.000,0.000,0.179,0.250,0.076,0.207,0.336,0.294 +24244,98.947,0.000,0.232,8.000,0.007492,652.794,0.000,0.087718,0.005156,rock,0.312,0.000,0.232,0.000,0.000,0.000,0.069,1.000,0.044,0.000,0.000,0.103,0.250,0.081,0.207,0.331,0.266 +25256,98.786,0.000,0.245,8.750,0.013626,762.278,0.000,0.124556,0.037949,rock,0.360,0.000,0.245,0.000,0.000,0.000,0.136,1.000,0.075,0.000,0.000,0.052,0.250,0.086,0.191,0.359,0.228 +26259,98.542,0.000,0.231,9.500,0.006000,1297.760,0.000,0.331577,0.022301,rock,0.606,0.000,0.231,0.000,0.000,0.000,0.512,1.000,0.228,0.000,0.000,0.031,0.250,0.081,0.098,0.511,0.107 +27270,98.374,0.000,0.244,8.500,0.007808,751.478,0.000,0.131256,0.055057,rock,0.364,0.000,0.244,0.000,0.011,0.000,0.148,1.000,0.072,0.000,0.000,0.039,0.253,0.087,0.193,0.362,0.219 +28283,98.346,0.000,0.251,10.000,0.014947,1337.281,0.000,0.275495,0.135953,rock,0.514,0.000,0.251,0.000,0.191,0.000,0.410,1.000,0.239,0.000,0.000,0.054,0.298,0.117,0.163,0.483,0.146 +29283,98.370,0.000,0.248,8.500,0.016143,2521.022,0.000,0.620861,0.066173,rock,0.854,0.000,0.248,0.000,0.036,0.000,1.000,1.000,0.577,0.000,0.000,0.071,0.259,0.092,-0.015,0.744,-0.025 +30283,98.277,0.000,0.239,6.500,0.012478,724.830,0.000,0.114668,0.071013,unknown,0.251,0.000,0.239,0.000,0.047,0.000,0.118,0.813,0.064,0.000,0.000,0.096,0.262,0.091,0.246,0.295,0.295 +31293,98.191,0.000,0.244,6.250,0.004110,339.673,0.000,0.038890,0.013710,classical,0.319,0.000,0.244,0.000,0.000,0.000,0.000,0.781,0.000,0.000,0.000,0.122,0.250,0.086,0.272,0.234,0.347 +32294,98.140,0.000,0.271,7.250,0.007121,546.270,0.000,0.088478,0.064826,unknown,0.255,0.000,0.271,0.000,0.033,0.000,0.070,0.906,0.013,0.000,0.000,0.131,0.258,0.100,0.237,0.296,0.298 +33306,98.091,0.000,0.242,9.500,0.007229,499.780,0.000,0.072822,0.079403,unknown,0.273,0.000,0.242,0.000,0.065,0.000,0.041,1.000,0.000,0.000,0.000,0.131,0.266,0.095,0.232,0.312,0.283 +34321,98.063,0.000,0.261,9.500,0.012931,746.717,0.000,0.111006,0.122510,rock,0.308,0.000,0.261,0.000,0.161,0.000,0.111,1.000,0.070,0.000,0.000,0.134,0.290,0.116,0.234,0.351,0.264 +35335,98.043,0.000,0.251,10.000,0.005499,636.391,0.000,0.108008,0.063769,rock,0.317,0.000,0.251,0.000,0.031,0.000,0.105,1.000,0.039,0.000,0.000,0.144,0.258,0.092,0.209,0.341,0.269 +36336,98.030,0.000,0.237,8.750,0.006635,768.991,0.000,0.122391,0.289401,unknown,0.291,0.000,0.237,0.000,0.532,0.000,0.132,1.000,0.077,0.000,0.000,0.144,0.383,0.163,0.303,0.359,0.261 +37348,97.910,0.000,0.242,7.000,0.007505,1397.054,0.000,0.327693,0.165552,rock,0.485,0.000,0.242,0.000,0.257,0.000,0.505,0.875,0.256,0.000,0.000,0.144,0.314,0.123,0.181,0.478,0.180 +38353,97.951,0.000,0.216,8.000,0.005131,608.813,0.000,0.135939,0.069241,rock,0.341,0.000,0.216,0.000,0.043,0.000,0.156,1.000,0.031,0.000,0.000,0.134,0.261,0.082,0.200,0.355,0.250 +39353,97.862,0.000,0.228,8.250,0.012774,1044.094,0.000,0.241191,0.019678,rock,0.485,0.000,0.228,0.000,0.000,0.000,0.348,1.000,0.155,0.000,0.000,0.149,0.250,0.080,0.144,0.443,0.198 +40368,97.890,0.000,0.245,9.500,0.371500,5132.645,0.082,0.968539,0.002507,unknown,0.200,0.000,0.245,0.000,0.000,0.732,1.000,1.000,1.000,0.082,0.163,0.221,0.250,0.106,0.005,0.960,0.019 +41369,97.791,0.000,0.235,9.500,0.881606,5061.612,0.378,0.990216,0.001809,unknown,0.200,0.000,0.235,0.000,0.000,1.000,1.000,1.000,1.000,0.378,0.755,1.000,0.250,0.177,0.095,1.000,0.262 +42383,97.919,0.000,0.222,5.750,0.019691,253.064,0.580,0.027891,0.592308,unknown,0.200,0.000,0.222,0.000,1.000,0.000,0.000,0.719,0.000,0.580,0.840,1.000,0.500,0.373,0.613,0.216,0.612 +43392,97.956,0.000,0.227,1.750,0.079951,630.531,0.387,0.072890,0.494349,unknown,0.200,0.000,0.227,0.000,0.987,0.125,0.042,0.219,0.037,0.387,0.773,1.000,0.497,0.324,0.690,0.106,0.744 +44407,97.972,0.000,0.236,4.000,0.027850,724.776,0.000,0.031961,0.191943,classical,0.694,0.000,0.236,0.000,0.315,0.016,0.000,0.500,0.064,0.000,0.000,1.000,0.329,0.130,0.393,0.169,0.725 +45408,97.980,0.000,0.225,6.000,0.050824,861.395,0.000,0.061264,0.058481,classical,0.674,0.000,0.225,0.000,0.019,0.064,0.020,0.750,0.103,0.000,0.000,1.000,0.255,0.082,0.279,0.267,0.656 +46409,98.096,0.000,0.206,7.250,0.056042,820.527,0.000,0.066464,0.084772,classical,0.610,0.000,0.206,0.000,0.077,0.075,0.030,0.906,0.092,0.000,0.000,1.000,0.269,0.084,0.256,0.315,0.614 +47422,98.221,0.000,0.187,6.750,0.036285,582.518,0.000,0.043044,0.193740,classical,0.608,0.000,0.187,0.000,0.319,0.034,0.000,0.844,0.024,0.000,0.000,1.000,0.330,0.113,0.324,0.264,0.639 +48437,98.308,0.000,0.178,5.750,0.019782,917.314,0.000,0.025185,0.030469,classical,0.697,0.000,0.178,0.000,0.000,0.000,0.000,0.719,0.119,0.000,0.000,1.000,0.250,0.062,0.284,0.245,0.670 +49452,98.359,0.000,0.209,6.000,0.018166,1146.549,0.000,0.264151,0.007861,classical,0.516,0.000,0.209,0.000,0.000,0.000,0.389,0.750,0.185,0.000,0.000,1.000,0.250,0.073,0.180,0.388,0.546 +50465,98.367,0.105,0.162,7.500,0.036312,733.273,0.000,0.111132,0.308805,classical,0.461,0.105,0.162,0.000,0.575,0.034,0.111,0.938,0.067,0.000,0.000,1.000,0.446,0.143,0.312,0.336,0.582 +51479,73.646,0.167,0.014,7.000,0.041625,1236.936,0.000,0.302169,0.043854,classical,0.447,0.167,0.014,0.000,0.000,0.045,0.458,0.875,0.211,0.000,0.000,1.000,0.144,0.005,0.093,0.459,0.494 +52490,73.530,0.187,0.008,1.750,0.031035,702.669,0.611,0.080966,0.053999,classical,0.706,0.187,0.008,0.000,0.009,0.023,0.056,0.219,0.058,0.611,0.777,1.000,0.154,0.157,0.439,0.100,0.717 +53493,98.028,0.070,0.058,3.750,0.042029,765.451,0.437,0.111460,0.052959,classical,0.604,0.070,0.058,0.000,0.007,0.046,0.112,0.469,0.076,0.437,0.874,1.000,0.287,0.130,0.430,0.200,0.656 +54494,98.019,0.000,0.171,5.250,0.040401,812.126,0.314,0.116077,0.030856,classical,0.590,0.000,0.171,0.000,0.000,0.043,0.120,0.656,0.089,0.314,0.628,1.000,0.250,0.138,0.363,0.262,0.619 +55508,97.879,0.000,0.192,7.750,0.041553,815.356,0.341,0.128955,0.037727,classical,0.465,0.000,0.192,0.000,0.000,0.045,0.144,0.969,0.090,0.341,0.682,1.000,0.250,0.153,0.303,0.363,0.531 +56520,97.762,0.000,0.196,7.250,0.036986,721.973,0.325,0.101986,0.030788,classical,0.516,0.000,0.196,0.000,0.000,0.035,0.095,0.906,0.063,0.325,0.650,1.000,0.250,0.150,0.324,0.321,0.563 +57532,97.681,0.000,0.212,7.000,0.006120,441.902,0.404,0.017280,0.178052,classical,0.484,0.000,0.212,0.000,0.285,0.000,0.000,0.875,0.000,0.404,0.809,1.000,0.321,0.218,0.435,0.263,0.591 +58541,97.625,0.000,0.188,7.000,0.043900,904.930,0.000,0.158110,0.052161,classical,0.560,0.000,0.188,0.000,0.005,0.050,0.197,0.875,0.116,0.000,0.000,1.000,0.251,0.066,0.209,0.358,0.572 +59541,97.559,0.000,0.185,5.000,0.060172,1113.703,0.000,0.200810,0.027586,classical,0.615,0.000,0.185,0.000,0.000,0.084,0.274,0.625,0.175,0.000,0.000,1.000,0.250,0.065,0.239,0.326,0.611 +60553,97.879,0.000,0.251,7.500,0.040733,913.016,0.000,0.156284,0.033432,classical,0.533,0.000,0.251,0.000,0.000,0.043,0.193,0.938,0.118,0.000,0.000,1.000,0.250,0.088,0.195,0.375,0.558 +61566,98.382,0.000,0.217,7.250,0.037884,780.987,0.108,0.137164,0.039326,classical,0.545,0.000,0.217,0.000,0.000,0.037,0.158,0.906,0.080,0.108,0.217,1.000,0.250,0.103,0.239,0.345,0.565 +62578,98.622,0.000,0.255,7.250,0.038590,795.831,0.105,0.118986,0.047799,classical,0.558,0.000,0.255,0.000,0.000,0.039,0.125,0.906,0.085,0.105,0.210,1.000,0.250,0.116,0.245,0.336,0.575 +63580,98.872,0.000,0.217,7.500,0.046989,1322.181,0.161,0.274019,0.010562,classical,0.373,0.000,0.217,0.000,0.000,0.056,0.407,0.938,0.235,0.161,0.321,1.000,0.250,0.116,0.183,0.471,0.477 +64584,99.067,0.000,0.208,6.500,0.043714,839.682,0.000,0.117523,0.067015,classical,0.616,0.000,0.208,0.000,0.038,0.049,0.123,0.813,0.097,0.000,0.000,1.000,0.259,0.079,0.237,0.312,0.610 +65598,99.106,0.000,0.226,8.000,0.044190,780.945,0.000,0.098368,0.061774,classical,0.561,0.000,0.226,0.000,0.026,0.050,0.088,1.000,0.080,0.000,0.000,1.000,0.257,0.083,0.206,0.354,0.574 +66611,99.078,0.000,0.215,8.250,0.048174,854.232,0.000,0.124958,0.093759,classical,0.524,0.000,0.215,0.000,0.097,0.059,0.136,1.000,0.101,0.000,0.000,1.000,0.274,0.090,0.208,0.375,0.559 +67623,99.061,0.000,0.218,9.250,0.029645,627.516,0.124,0.072281,0.040430,classical,0.314,0.000,0.218,0.000,0.000,0.020,0.041,1.000,0.036,0.124,0.247,0.408,0.250,0.107,0.250,0.324,0.368 +68635,99.057,0.000,0.230,6.000,0.053197,1083.410,0.029,0.167699,0.056714,rock,0.306,0.000,0.230,0.000,0.015,0.069,0.214,0.750,0.167,0.029,0.057,0.116,0.254,0.090,0.231,0.341,0.286 +69646,98.883,0.000,0.212,6.750,0.049802,914.430,0.021,0.148538,0.030747,rock,0.322,0.000,0.212,0.000,0.000,0.062,0.179,0.844,0.118,0.021,0.043,0.113,0.250,0.080,0.217,0.346,0.273 +70646,98.880,0.000,0.230,7.750,0.070950,1742.675,0.166,0.422216,0.029789,rock,0.700,0.000,0.230,0.000,0.000,0.106,0.677,0.969,0.355,0.166,0.332,0.113,0.250,0.122,0.111,0.598,0.078 +71659,98.917,0.000,0.221,5.750,0.064900,1038.989,0.091,0.149649,0.073738,unknown,0.268,0.000,0.221,0.000,0.053,0.094,0.181,0.719,0.154,0.091,0.182,0.102,0.263,0.108,0.273,0.323,0.293 +72671,98.943,0.000,0.213,8.500,0.046567,970.091,0.000,0.132740,0.009896,rock,0.395,0.000,0.213,0.000,0.000,0.055,0.150,1.000,0.134,0.000,0.000,0.067,0.250,0.075,0.186,0.387,0.228 +73671,98.961,0.000,0.236,6.750,0.070808,1342.344,0.000,0.239446,0.043884,rock,0.469,0.000,0.236,0.000,0.000,0.106,0.344,0.844,0.241,0.000,0.000,0.000,0.250,0.083,0.169,0.433,0.186 +74672,98.974,0.000,0.206,8.250,0.082026,1268.893,0.246,0.239283,0.051134,rock,0.517,0.000,0.206,0.000,0.003,0.129,0.344,1.000,0.220,0.246,0.492,0.000,0.251,0.134,0.212,0.478,0.122 +75683,99.089,0.000,0.224,7.500,0.070693,1051.333,0.210,0.163545,0.052211,rock,0.392,0.000,0.224,0.000,0.005,0.106,0.206,0.938,0.158,0.210,0.421,0.000,0.251,0.132,0.248,0.398,0.183 +76696,99.020,0.000,0.240,6.500,0.067145,885.090,0.226,0.133951,0.067109,unknown,0.283,0.000,0.240,0.000,0.038,0.098,0.153,0.813,0.110,0.226,0.452,0.000,0.260,0.146,0.298,0.332,0.228 +77696,99.014,0.000,0.215,4.000,0.065444,873.480,0.000,0.140001,0.056694,unknown,0.290,0.000,0.215,0.000,0.015,0.095,0.164,0.500,0.107,0.000,0.000,0.000,0.254,0.078,0.285,0.240,0.326 +78696,99.010,0.000,0.242,3.750,0.077847,1456.184,0.000,0.290221,0.039008,rock,0.342,0.000,0.242,0.000,0.000,0.121,0.437,0.469,0.273,0.000,0.000,0.000,0.250,0.085,0.220,0.358,0.252 +79697,99.006,0.000,0.221,3.500,0.076802,1836.423,0.000,0.391417,0.021519,rock,0.458,0.000,0.221,0.000,0.000,0.118,0.621,0.438,0.382,0.000,0.000,0.000,0.250,0.077,0.181,0.431,0.204 +80710,99.004,0.000,0.229,3.250,0.082999,1490.978,0.000,0.283795,0.020664,rock,0.311,0.000,0.229,0.000,0.000,0.131,0.425,0.406,0.283,0.000,0.000,0.000,0.250,0.080,0.236,0.340,0.271 +81724,98.693,0.000,0.235,3.250,0.067662,1107.044,0.000,0.200096,0.023994,unknown,0.277,0.000,0.235,0.000,0.000,0.099,0.273,0.406,0.173,0.000,0.000,0.000,0.250,0.082,0.276,0.262,0.317 +82724,98.556,0.000,0.244,4.250,0.072169,968.190,0.000,0.183290,0.030618,unknown,0.254,0.000,0.244,0.000,0.000,0.109,0.242,0.531,0.134,0.000,0.000,0.000,0.250,0.085,0.259,0.282,0.294 +83737,98.457,0.000,0.242,6.750,0.079156,1376.102,0.000,0.255929,0.026187,rock,0.490,0.000,0.242,0.000,0.000,0.123,0.374,0.844,0.250,0.000,0.000,0.000,0.250,0.085,0.165,0.447,0.177 +84751,98.422,0.000,0.230,5.250,0.067359,1774.435,0.000,0.375321,0.013163,rock,0.543,0.000,0.230,0.000,0.000,0.099,0.591,0.656,0.364,0.000,0.000,0.000,0.250,0.081,0.148,0.480,0.158 +85764,98.435,0.000,0.239,6.000,0.081163,1406.010,0.000,0.254591,0.014967,rock,0.444,0.000,0.239,0.000,0.000,0.127,0.372,0.750,0.259,0.000,0.000,0.000,0.250,0.084,0.184,0.420,0.201 +86778,98.391,0.000,0.229,6.250,0.066903,1099.889,0.000,0.194961,0.053704,rock,0.369,0.000,0.229,0.000,0.008,0.098,0.264,0.781,0.171,0.000,0.000,0.000,0.252,0.081,0.207,0.371,0.226 +87792,98.270,0.000,0.229,5.500,0.086023,1113.192,0.000,0.209291,0.053777,rock,0.344,0.000,0.229,0.000,0.008,0.138,0.290,0.688,0.175,0.000,0.000,0.000,0.252,0.081,0.220,0.358,0.241 +88806,98.186,0.000,0.251,7.250,0.056165,779.682,0.047,0.121704,0.074862,rock,0.317,0.000,0.251,0.000,0.055,0.075,0.130,0.906,0.080,0.047,0.094,0.000,0.264,0.108,0.240,0.342,0.230 +89809,98.091,0.000,0.222,5.000,0.067502,826.405,0.265,0.131410,0.073777,hiphop,0.302,0.000,0.222,0.000,0.053,0.099,0.148,0.625,0.093,0.265,0.530,0.024,0.263,0.152,0.357,0.270,0.281 +90823,98.068,0.003,0.230,4.750,0.028568,759.858,0.000,0.081706,0.073314,classical,0.315,0.003,0.230,0.000,0.052,0.018,0.058,0.594,0.074,0.000,0.000,0.062,0.264,0.088,0.306,0.217,0.356 +91834,98.142,0.030,0.223,7.500,0.030628,716.241,0.000,0.104891,0.071259,rock,0.300,0.030,0.223,0.000,0.047,0.022,0.100,0.938,0.062,0.000,0.000,0.056,0.277,0.085,0.222,0.330,0.255 +92846,98.297,0.000,0.241,6.500,0.041704,822.473,0.000,0.119826,0.072315,unknown,0.273,0.000,0.241,0.000,0.050,0.045,0.127,0.813,0.092,0.000,0.000,0.051,0.262,0.092,0.244,0.312,0.277 +93860,98.368,0.007,0.242,6.500,0.043870,810.094,0.000,0.134532,0.044193,unknown,0.291,0.007,0.242,0.000,0.000,0.050,0.154,0.813,0.089,0.000,0.000,0.053,0.253,0.085,0.226,0.319,0.269 +94873,98.409,0.000,0.269,8.000,0.049984,866.452,0.000,0.123156,0.015955,rock,0.376,0.000,0.269,0.000,0.000,0.062,0.133,1.000,0.105,0.000,0.000,0.051,0.250,0.094,0.194,0.375,0.228 +95886,98.437,0.000,0.252,9.000,0.052941,973.247,0.374,0.180377,0.044510,rock,0.395,0.000,0.252,0.000,0.000,0.069,0.237,1.000,0.135,0.374,0.748,0.038,0.250,0.182,0.280,0.415,0.155 +96892,98.457,0.000,0.268,9.000,0.036364,917.881,0.223,0.147049,0.031483,rock,0.373,0.000,0.268,0.000,0.000,0.034,0.176,1.000,0.119,0.223,0.447,0.050,0.250,0.150,0.250,0.388,0.192 +97905,98.339,0.000,0.248,7.750,0.049250,829.444,0.271,0.137068,0.023268,rock,0.340,0.000,0.248,0.000,0.000,0.061,0.158,0.969,0.094,0.271,0.542,0.053,0.250,0.155,0.276,0.371,0.202 +98905,98.234,0.000,0.247,7.000,0.117592,1851.130,0.315,0.382080,0.004831,rock,0.635,0.000,0.247,0.000,0.000,0.203,0.604,0.875,0.386,0.315,0.631,0.046,0.250,0.165,0.197,0.571,0.085 +99905,98.161,0.000,0.246,4.500,0.063859,1805.919,0.000,0.448536,0.012620,rock,0.561,0.000,0.246,0.000,0.000,0.091,0.725,0.563,0.373,0.000,0.000,0.053,0.250,0.086,0.135,0.493,0.161 +100907,98.111,0.000,0.206,4.000,0.043859,2445.386,0.000,0.559094,0.017351,rock,0.676,0.000,0.206,0.000,0.000,0.050,0.926,0.500,0.556,0.000,0.000,0.086,0.250,0.072,0.098,0.574,0.127 +101920,98.102,0.000,0.226,4.750,0.048489,1951.290,0.000,0.379895,0.000308,rock,0.514,0.000,0.226,0.000,0.000,0.059,0.600,0.594,0.415,0.000,0.000,0.086,0.250,0.079,0.161,0.471,0.202 +102921,98.148,0.000,0.208,4.250,0.039109,1515.642,0.000,0.286703,0.000072,rock,0.350,0.000,0.208,0.000,0.000,0.040,0.430,0.531,0.290,0.000,0.000,0.082,0.250,0.073,0.215,0.367,0.267 +103923,98.148,0.000,0.222,4.750,0.041030,1654.072,0.230,0.290009,0.000099,rock,0.370,0.000,0.222,0.000,0.000,0.044,0.436,0.594,0.330,0.230,0.460,0.092,0.250,0.135,0.270,0.398,0.230 +104934,78.354,0.000,0.000,3.500,0.019290,1737.739,0.336,0.309386,0.000019,rock,0.332,0.000,0.000,0.000,0.000,0.000,0.472,0.438,0.354,0.336,0.672,0.085,0.139,0.084,0.334,0.361,0.245 +105946,77.962,0.000,0.000,3.000,0.046700,2426.534,0.121,0.584411,0.000056,rock,0.686,0.000,0.000,0.000,0.000,0.056,0.972,0.375,0.550,0.121,0.241,0.071,0.133,0.030,0.155,0.550,0.128 +106961,77.819,0.000,0.000,3.000,0.033641,1456.426,0.000,0.358588,0.000083,rock,0.375,0.000,0.000,0.000,0.000,0.028,0.561,0.375,0.273,0.000,0.000,0.088,0.130,0.000,0.220,0.353,0.269 +107961,77.692,0.000,0.000,2.750,0.036084,1130.360,0.000,0.197410,0.000041,classical,0.382,0.000,0.000,0.000,0.000,0.034,0.268,0.344,0.180,0.000,0.000,0.119,0.128,0.000,0.299,0.234,0.375 +108975,77.692,0.000,0.000,4.000,0.031522,1286.931,0.065,0.299218,0.000022,rock,0.355,0.000,0.000,0.000,0.000,0.024,0.453,0.500,0.225,0.065,0.129,0.119,0.128,0.016,0.241,0.346,0.274 +109986,75.894,0.000,0.000,4.750,0.046605,1857.822,0.000,0.417767,0.000030,rock,0.607,0.000,0.000,0.000,0.000,0.055,0.669,0.594,0.388,0.000,0.000,0.129,0.098,0.000,0.137,0.484,0.196 +110994,75.750,0.000,0.000,3.000,0.026657,2881.627,0.000,0.515009,0.000041,rock,0.669,0.000,0.000,0.000,0.000,0.014,0.845,0.375,0.680,0.000,0.000,0.139,0.096,0.000,0.135,0.538,0.201 +112005,75.533,0.000,0.000,1.750,0.026818,2235.027,0.000,0.512930,0.000131,rock,0.524,0.000,0.000,0.000,0.000,0.014,0.842,0.219,0.496,0.000,0.000,0.164,0.092,0.000,0.166,0.444,0.250 +113018,75.170,0.000,0.000,1.500,0.031214,1294.026,0.000,0.191054,0.000775,classical,0.473,0.000,0.000,0.000,0.000,0.023,0.256,0.188,0.227,0.000,0.000,0.182,0.086,0.000,0.316,0.193,0.440 +114018,74.962,0.000,0.000,1.750,0.025372,974.089,0.000,0.109181,0.000113,classical,0.547,0.000,0.000,0.000,0.000,0.011,0.108,0.219,0.135,0.000,0.000,0.250,0.083,0.000,0.346,0.133,0.500 +115032,93.629,0.008,0.124,3.500,0.019817,770.121,0.000,0.058018,0.000038,classical,0.465,0.008,0.124,0.000,0.000,0.000,0.015,0.438,0.077,0.000,0.000,0.279,0.254,0.043,0.358,0.155,0.484 +116045,94.164,0.009,0.178,5.000,0.030624,864.348,0.000,0.097070,0.000088,classical,0.389,0.009,0.178,0.000,0.000,0.022,0.086,0.625,0.104,0.000,0.000,0.290,0.254,0.062,0.302,0.243,0.420 +117059,94.677,0.000,0.204,6.000,0.038831,671.875,0.000,0.091924,0.017081,classical,0.375,0.000,0.204,0.000,0.000,0.039,0.076,0.750,0.049,0.000,0.000,0.336,0.250,0.071,0.281,0.266,0.407 +118061,75.849,0.000,0.198,6.750,0.033419,703.828,0.000,0.075623,0.013355,classical,0.403,0.000,0.198,0.000,0.000,0.028,0.047,0.844,0.058,0.000,0.000,0.336,0.097,0.069,0.242,0.286,0.393 +119071,75.837,0.000,0.185,7.250,0.033306,577.178,0.000,0.069195,0.051841,classical,0.389,0.000,0.185,0.000,0.004,0.028,0.035,0.906,0.022,0.000,0.000,0.336,0.098,0.065,0.233,0.292,0.381 +120086,75.798,0.000,0.208,5.250,0.050438,770.684,0.000,0.116150,0.031022,classical,0.436,0.000,0.208,0.000,0.000,0.063,0.120,0.656,0.077,0.000,0.000,0.337,0.097,0.073,0.261,0.262,0.418 +121093,75.861,0.000,0.201,5.000,0.067920,1160.512,0.000,0.177743,0.061046,classical,0.382,0.000,0.201,0.000,0.025,0.100,0.232,0.625,0.189,0.000,0.000,0.337,0.104,0.074,0.244,0.319,0.392 diff --git a/tests/classic.csv.import b/tests/classic.csv.import new file mode 100644 index 0000000..0747db9 --- /dev/null +++ b/tests/classic.csv.import @@ -0,0 +1,19 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://cjhbh0w1lnyvu" + +[deps] + +files=["res://tests/classic.bpm.translation", "res://tests/classic.dembow.translation", "res://tests/classic.fourfloor.translation", "res://tests/classic.density.translation", "res://tests/classic.flatness.translation", "res://tests/classic.centroid.translation", "res://tests/classic.regularity.translation", "res://tests/classic.highRatio.translation", "res://tests/classic.lowRatio.translation", "res://tests/classic.label.translation", "res://tests/classic.conf.translation", "res://tests/classic.f0.translation", "res://tests/classic.f1.translation", "res://tests/classic.f2.translation", "res://tests/classic.f3.translation", "res://tests/classic.f4.translation", "res://tests/classic.f5.translation", "res://tests/classic.f6.translation", "res://tests/classic.f7.translation", "res://tests/classic.f8.translation", "res://tests/classic.f9.translation", "res://tests/classic.f10.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation"] + +source_file="res://tests/classic.csv" +dest_files=["res://tests/classic.bpm.translation", "res://tests/classic.dembow.translation", "res://tests/classic.fourfloor.translation", "res://tests/classic.density.translation", "res://tests/classic.flatness.translation", "res://tests/classic.centroid.translation", "res://tests/classic.regularity.translation", "res://tests/classic.highRatio.translation", "res://tests/classic.lowRatio.translation", "res://tests/classic.label.translation", "res://tests/classic.conf.translation", "res://tests/classic.f0.translation", "res://tests/classic.f1.translation", "res://tests/classic.f2.translation", "res://tests/classic.f3.translation", "res://tests/classic.f4.translation", "res://tests/classic.f5.translation", "res://tests/classic.f6.translation", "res://tests/classic.f7.translation", "res://tests/classic.f8.translation", "res://tests/classic.f9.translation", "res://tests/classic.f10.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation", "res://tests/classic.s.translation"] + +[params] + +compress=1 +delimiter=0 +unescape_keys=false +unescape_translations=true diff --git a/tests/classic.dembow.translation b/tests/classic.dembow.translation new file mode 100644 index 0000000..0dace67 Binary files /dev/null and b/tests/classic.dembow.translation differ diff --git a/tests/classic.density.translation b/tests/classic.density.translation new file mode 100644 index 0000000..6a390cd Binary files /dev/null and b/tests/classic.density.translation differ diff --git a/tests/classic.f0.translation b/tests/classic.f0.translation new file mode 100644 index 0000000..a51d3ff Binary files /dev/null and b/tests/classic.f0.translation differ diff --git a/tests/classic.f1.translation b/tests/classic.f1.translation new file mode 100644 index 0000000..4970706 Binary files /dev/null and b/tests/classic.f1.translation differ diff --git a/tests/classic.f10.translation b/tests/classic.f10.translation new file mode 100644 index 0000000..27288c0 Binary files /dev/null and b/tests/classic.f10.translation differ diff --git a/tests/classic.f2.translation b/tests/classic.f2.translation new file mode 100644 index 0000000..f4600e7 Binary files /dev/null and b/tests/classic.f2.translation differ diff --git a/tests/classic.f3.translation b/tests/classic.f3.translation new file mode 100644 index 0000000..cfc134f Binary files /dev/null and b/tests/classic.f3.translation differ diff --git a/tests/classic.f4.translation b/tests/classic.f4.translation new file mode 100644 index 0000000..21bc14b Binary files /dev/null and b/tests/classic.f4.translation differ diff --git a/tests/classic.f5.translation b/tests/classic.f5.translation new file mode 100644 index 0000000..4200a1a Binary files /dev/null and b/tests/classic.f5.translation differ diff --git a/tests/classic.f6.translation b/tests/classic.f6.translation new file mode 100644 index 0000000..7c12325 Binary files /dev/null and b/tests/classic.f6.translation differ diff --git a/tests/classic.f7.translation b/tests/classic.f7.translation new file mode 100644 index 0000000..a995ad4 Binary files /dev/null and b/tests/classic.f7.translation differ diff --git a/tests/classic.f8.translation b/tests/classic.f8.translation new file mode 100644 index 0000000..291a304 Binary files /dev/null and b/tests/classic.f8.translation differ diff --git a/tests/classic.f9.translation b/tests/classic.f9.translation new file mode 100644 index 0000000..94cc3f6 Binary files /dev/null and b/tests/classic.f9.translation differ diff --git a/tests/classic.flatness.translation b/tests/classic.flatness.translation new file mode 100644 index 0000000..f9d11a3 Binary files /dev/null and b/tests/classic.flatness.translation differ diff --git a/tests/classic.fourfloor.translation b/tests/classic.fourfloor.translation new file mode 100644 index 0000000..aff9492 Binary files /dev/null and b/tests/classic.fourfloor.translation differ diff --git a/tests/classic.highRatio.translation b/tests/classic.highRatio.translation new file mode 100644 index 0000000..d521d4d Binary files /dev/null and b/tests/classic.highRatio.translation differ diff --git a/tests/classic.label.translation b/tests/classic.label.translation new file mode 100644 index 0000000..6b75b1d Binary files /dev/null and b/tests/classic.label.translation differ diff --git a/tests/classic.lowRatio.translation b/tests/classic.lowRatio.translation new file mode 100644 index 0000000..01ba34a Binary files /dev/null and b/tests/classic.lowRatio.translation differ diff --git a/tests/classic.regularity.translation b/tests/classic.regularity.translation new file mode 100644 index 0000000..d54ab2f Binary files /dev/null and b/tests/classic.regularity.translation differ diff --git a/tests/classic.s.translation b/tests/classic.s.translation new file mode 100644 index 0000000..267b8bb Binary files /dev/null and b/tests/classic.s.translation differ diff --git a/tests/hiphop.bpm.translation b/tests/hiphop.bpm.translation new file mode 100644 index 0000000..8e0300a Binary files /dev/null and b/tests/hiphop.bpm.translation differ diff --git a/tests/hiphop.centroid.translation b/tests/hiphop.centroid.translation new file mode 100644 index 0000000..6a892e1 Binary files /dev/null and b/tests/hiphop.centroid.translation differ diff --git a/tests/hiphop.conf.translation b/tests/hiphop.conf.translation new file mode 100644 index 0000000..f2fc80f Binary files /dev/null and b/tests/hiphop.conf.translation differ diff --git a/tests/hiphop.csv b/tests/hiphop.csv new file mode 100644 index 0000000..d01846c --- /dev/null +++ b/tests/hiphop.csv @@ -0,0 +1,121 @@ +ms,bpm,dembow,fourfloor,density,flatness,centroid,regularity,highRatio,lowRatio,label,conf,f0_latin_dembow,f1_fourfloor,f2_tempo_latin,f3_low,f4_flat,f5_high,f6_density,f7_centroid,f8_reg,f9_regmid,f10_dyn,s_latin,s_electronic,s_hiphop,s_rock,s_classical +1002,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +2002,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +3010,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +4010,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +5022,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +6026,0.000,0.000,0.000,0.250,0.086251,560.918,0.000,0.147086,0.076215,unknown,0.200,0.000,0.000,0.000,0.058,0.138,0.177,0.031,0.017,0.000,0.000,0.000,0.015,0.009,0.311,0.087,0.439 +7037,87.000,0.000,0.000,1.500,0.086424,826.565,0.000,0.216763,0.083466,classical,0.726,0.000,0.000,0.000,0.074,0.138,0.303,0.188,0.093,0.000,0.000,1.000,0.269,0.011,0.352,0.191,0.712 +8050,142.800,0.000,0.000,2.500,0.046664,1139.075,0.098,0.225174,0.092552,classical,0.731,0.000,0.000,0.000,0.095,0.056,0.318,0.313,0.183,0.098,0.195,1.000,0.024,0.159,0.256,0.243,0.667 +9059,124.941,0.000,0.000,4.000,0.036306,811.527,0.005,0.162772,0.113095,classical,0.705,0.000,0.000,0.000,0.140,0.034,0.205,0.500,0.089,0.005,0.010,1.000,0.035,0.272,0.228,0.239,0.663 +10074,124.941,0.000,0.000,5.750,0.055898,905.908,0.000,0.161694,0.096084,classical,0.633,0.000,0.000,0.000,0.102,0.075,0.203,0.719,0.116,0.000,0.000,1.000,0.026,0.265,0.176,0.317,0.609 +11087,91.857,0.000,0.000,7.000,0.078341,785.666,0.000,0.198931,0.077835,classical,0.518,0.000,0.000,0.000,0.062,0.122,0.271,0.875,0.082,0.000,0.000,1.000,0.265,0.009,0.220,0.382,0.550 +12099,91.281,0.000,0.000,6.500,0.034910,521.074,0.000,0.079071,0.140190,classical,0.622,0.000,0.000,0.000,0.200,0.031,0.053,0.813,0.006,0.000,0.000,1.000,0.300,0.030,0.314,0.266,0.631 +13112,90.831,0.000,0.000,6.750,0.137589,2070.016,0.000,0.475527,0.033395,rock,0.635,0.000,0.000,0.000,0.000,0.245,0.774,0.844,0.449,0.000,0.000,1.000,0.250,0.000,0.088,0.634,0.407 +14112,90.573,0.000,0.000,7.000,0.036490,768.895,0.003,0.135799,0.083741,classical,0.575,0.000,0.000,0.000,0.075,0.034,0.156,0.875,0.077,0.003,0.005,1.000,0.269,0.012,0.252,0.334,0.584 +15117,90.395,0.000,0.000,6.750,0.081315,1024.093,0.155,0.260680,0.047665,classical,0.439,0.000,0.000,0.000,0.000,0.128,0.383,0.844,0.150,0.155,0.309,1.000,0.250,0.039,0.232,0.425,0.509 +16128,90.273,0.000,0.000,6.250,0.078749,799.882,0.130,0.140181,0.066458,classical,0.574,0.000,0.000,0.000,0.037,0.122,0.164,0.781,0.086,0.130,0.260,1.000,0.259,0.038,0.299,0.323,0.593 +17139,90.188,0.000,0.000,6.250,0.036523,1093.933,0.203,0.174571,0.043717,classical,0.532,0.000,0.000,0.000,0.000,0.034,0.226,0.781,0.170,0.203,0.406,1.000,0.250,0.051,0.298,0.350,0.566 +18152,90.122,0.000,0.000,6.000,0.088942,2474.495,0.153,0.437981,0.068980,rock,0.553,0.000,0.000,0.000,0.042,0.144,0.705,0.750,0.564,0.153,0.306,1.000,0.261,0.045,0.178,0.599,0.436 +19152,112.605,0.084,0.316,6.000,0.118739,1509.232,0.115,0.343182,0.041436,classical,0.356,0.084,0.316,0.000,0.000,0.206,0.533,0.750,0.288,0.115,0.229,1.000,0.165,0.349,0.089,0.488,0.491 +20152,112.573,0.030,0.343,5.750,0.063853,651.245,0.267,0.107691,0.069464,classical,0.553,0.030,0.343,0.000,0.043,0.091,0.105,0.719,0.043,0.267,0.534,1.000,0.149,0.403,0.264,0.272,0.612 +21166,90.038,0.227,0.175,5.750,0.044052,666.620,0.257,0.118663,0.097063,classical,0.467,0.227,0.175,0.000,0.105,0.050,0.125,0.719,0.048,0.257,0.514,0.854,0.390,0.141,0.339,0.272,0.556 +22170,90.026,0.175,0.166,4.750,0.087412,1387.867,0.000,0.267084,0.066480,classical,0.364,0.175,0.166,0.000,0.037,0.140,0.395,0.594,0.254,0.000,0.000,0.622,0.347,0.064,0.214,0.381,0.451 +23185,90.018,0.183,0.171,5.750,0.160948,2393.636,0.000,0.528348,0.014746,rock,0.698,0.183,0.171,0.000,0.000,0.294,0.870,0.719,0.541,0.000,0.000,0.507,0.342,0.060,0.061,0.656,0.237 +24196,90.012,0.247,0.160,5.000,0.107401,1121.302,0.000,0.189027,0.015950,classical,0.321,0.247,0.160,0.000,0.000,0.182,0.253,0.625,0.178,0.000,0.000,0.397,0.374,0.056,0.225,0.335,0.407 +25198,90.009,0.243,0.168,5.250,0.066720,1048.731,0.000,0.279676,0.038075,unknown,0.298,0.243,0.168,0.000,0.000,0.097,0.418,0.656,0.157,0.000,0.000,0.347,0.372,0.059,0.178,0.376,0.332 +26199,90.006,0.238,0.162,6.000,0.080503,1135.790,0.165,0.259606,0.051088,rock,0.329,0.238,0.162,0.000,0.002,0.126,0.381,0.750,0.182,0.165,0.329,0.329,0.369,0.098,0.219,0.404,0.297 +27208,90.004,0.246,0.181,5.750,0.068150,1304.660,0.134,0.259840,0.008606,rock,0.330,0.246,0.181,0.000,0.000,0.100,0.382,0.719,0.230,0.134,0.267,0.269,0.373,0.097,0.214,0.403,0.287 +28220,90.003,0.263,0.186,6.500,0.148410,1370.261,0.092,0.303956,0.063247,rock,0.440,0.263,0.186,0.000,0.029,0.268,0.462,0.813,0.249,0.092,0.184,0.289,0.389,0.093,0.166,0.485,0.250 +29220,90.002,0.242,0.182,7.000,0.059710,1625.211,0.107,0.345556,0.056480,rock,0.506,0.242,0.182,0.000,0.014,0.083,0.537,0.875,0.321,0.107,0.215,0.280,0.375,0.093,0.139,0.516,0.207 +30233,90.001,0.244,0.205,6.500,0.078367,1083.009,0.087,0.252912,0.039936,rock,0.354,0.244,0.205,0.000,0.000,0.122,0.369,0.813,0.167,0.087,0.174,0.277,0.372,0.094,0.185,0.414,0.274 +31247,90.001,0.242,0.205,6.250,0.062236,1210.876,0.130,0.319751,0.013474,rock,0.403,0.242,0.205,0.000,0.000,0.088,0.490,0.781,0.203,0.130,0.260,0.266,0.371,0.104,0.174,0.445,0.238 +32262,90.001,0.196,0.198,6.000,0.112402,1092.307,0.000,0.246196,0.027627,rock,0.348,0.196,0.198,0.000,0.000,0.193,0.357,0.750,0.169,0.000,0.000,0.266,0.348,0.069,0.181,0.403,0.299 +33276,90.000,0.080,0.231,5.750,0.051936,768.889,0.000,0.138694,0.065030,classical,0.307,0.080,0.231,0.000,0.033,0.067,0.161,0.719,0.077,0.000,0.000,0.267,0.299,0.086,0.261,0.293,0.365 +34276,90.000,0.089,0.229,6.000,0.052100,1056.451,0.012,0.218992,0.048787,rock,0.316,0.089,0.229,0.000,0.000,0.067,0.307,0.750,0.159,0.012,0.024,0.267,0.294,0.083,0.214,0.367,0.312 +35291,90.000,0.015,0.231,5.250,0.071053,1582.568,0.000,0.339740,0.007659,rock,0.457,0.015,0.231,0.000,0.000,0.106,0.527,0.656,0.309,0.000,0.000,0.216,0.257,0.081,0.185,0.448,0.253 +36291,90.000,0.015,0.243,5.500,0.092907,873.626,0.136,0.191986,0.052013,unknown,0.268,0.015,0.243,0.000,0.004,0.152,0.258,0.688,0.107,0.136,0.273,0.218,0.259,0.120,0.288,0.333,0.313 +37302,90.000,0.076,0.247,5.250,0.060784,871.486,0.158,0.180343,0.081134,unknown,0.239,0.076,0.247,0.000,0.069,0.085,0.237,0.656,0.106,0.158,0.316,0.209,0.305,0.136,0.309,0.307,0.322 +38305,90.000,0.145,0.255,5.750,0.082604,1616.441,0.118,0.349673,0.030504,rock,0.470,0.145,0.255,0.000,0.000,0.130,0.545,0.719,0.319,0.118,0.236,0.209,0.322,0.119,0.184,0.478,0.218 +39316,90.000,0.177,0.208,6.500,0.075003,1115.349,0.040,0.320306,0.029676,rock,0.442,0.177,0.208,0.000,0.000,0.115,0.491,0.813,0.176,0.040,0.081,0.218,0.338,0.083,0.150,0.452,0.222 +40327,90.000,0.179,0.222,7.000,0.104162,1094.797,0.000,0.234622,0.032478,rock,0.403,0.179,0.222,0.000,0.000,0.175,0.336,0.875,0.170,0.000,0.000,0.218,0.340,0.078,0.164,0.432,0.257 +41340,90.000,0.183,0.236,7.500,0.047194,750.805,0.000,0.147654,0.067428,unknown,0.299,0.183,0.236,0.000,0.039,0.057,0.178,0.938,0.072,0.000,0.000,0.218,0.351,0.088,0.198,0.361,0.289 +42394,90.000,0.163,0.246,6.250,0.032578,663.779,0.000,0.105775,0.085914,unknown,0.277,0.163,0.246,0.000,0.080,0.026,0.101,0.781,0.047,0.000,0.000,0.218,0.352,0.098,0.260,0.280,0.351 +43399,90.000,0.186,0.257,6.750,0.038921,972.423,0.000,0.148528,0.076217,unknown,0.283,0.186,0.257,0.000,0.058,0.039,0.179,0.844,0.135,0.000,0.000,0.227,0.358,0.099,0.220,0.347,0.315 +44411,90.000,0.183,0.256,6.500,0.050480,784.569,0.000,0.142954,0.041675,unknown,0.272,0.183,0.256,0.000,0.000,0.064,0.169,0.813,0.081,0.000,0.000,0.232,0.341,0.090,0.218,0.324,0.327 +45414,90.000,0.183,0.258,6.000,0.034949,771.744,0.000,0.117416,0.029045,unknown,0.287,0.183,0.258,0.000,0.000,0.031,0.123,0.750,0.078,0.000,0.000,0.223,0.342,0.090,0.242,0.286,0.354 +46428,90.000,0.149,0.278,7.250,0.053878,1994.402,0.066,0.419458,0.064035,rock,0.639,0.149,0.278,0.000,0.031,0.071,0.672,0.906,0.427,0.066,0.132,0.231,0.332,0.119,0.105,0.591,0.146 +47442,90.000,0.119,0.283,6.500,0.024823,639.701,0.072,0.095007,0.097550,unknown,0.263,0.119,0.283,0.000,0.106,0.010,0.082,0.813,0.040,0.072,0.144,0.227,0.336,0.133,0.292,0.280,0.344 +48457,90.000,0.031,0.284,7.250,0.042839,707.558,0.000,0.093894,0.020580,unknown,0.270,0.031,0.284,0.000,0.000,0.048,0.080,0.906,0.059,0.000,0.000,0.215,0.266,0.099,0.244,0.318,0.325 +49459,90.000,0.034,0.293,7.750,0.055947,614.639,0.033,0.105050,0.101988,unknown,0.275,0.034,0.293,0.000,0.116,0.075,0.100,0.969,0.033,0.033,0.067,0.215,0.296,0.128,0.259,0.340,0.300 +50469,90.000,0.124,0.288,6.500,0.092223,1292.170,0.118,0.254842,0.024931,rock,0.403,0.124,0.288,0.000,0.000,0.150,0.372,0.813,0.226,0.118,0.236,0.215,0.312,0.130,0.211,0.435,0.249 +51475,90.000,0.169,0.283,6.250,0.039382,902.038,0.063,0.164093,0.080277,unknown,0.274,0.169,0.283,0.000,0.067,0.040,0.207,0.781,0.115,0.063,0.126,0.214,0.351,0.125,0.249,0.331,0.311 +52480,90.000,0.187,0.278,5.750,0.048634,679.905,0.029,0.179927,0.020714,unknown,0.276,0.187,0.278,0.000,0.000,0.060,0.236,0.719,0.051,0.029,0.059,0.230,0.343,0.105,0.228,0.308,0.327 +53494,90.000,0.214,0.219,5.000,0.026368,497.402,0.008,0.049891,0.268027,latin,0.350,0.214,0.219,0.000,0.485,0.013,0.000,0.625,0.000,0.008,0.015,0.242,0.478,0.151,0.392,0.189,0.428 +54495,90.000,0.240,0.234,5.250,0.355085,4971.243,0.000,0.972897,0.003241,unknown,0.200,0.240,0.234,0.000,0.000,0.698,1.000,0.656,1.000,0.000,0.000,0.436,0.370,0.082,0.033,0.852,0.189 +55495,90.000,0.254,0.185,3.750,0.891175,4956.843,0.000,0.991328,0.001058,unknown,0.200,0.254,0.185,0.000,0.000,1.000,1.000,0.469,1.000,0.000,0.000,1.000,0.377,0.065,0.068,0.841,0.433 +56495,90.000,0.246,0.200,2.250,0.014342,881.677,0.317,0.161377,0.335484,classical,0.477,0.246,0.200,0.000,0.634,0.000,0.203,0.281,0.109,0.317,0.634,1.000,0.531,0.244,0.528,0.172,0.687 +57496,90.000,0.236,0.203,1.750,0.010253,897.765,0.392,0.199804,0.288459,classical,0.477,0.236,0.203,0.000,0.530,0.000,0.272,0.219,0.114,0.392,0.784,1.000,0.500,0.249,0.526,0.176,0.674 +58498,89.880,0.183,0.262,2.000,0.007452,877.596,0.647,0.134804,0.258972,classical,0.485,0.183,0.262,0.000,0.464,0.000,0.154,0.250,0.108,0.647,0.707,1.000,0.458,0.323,0.533,0.148,0.677 +59509,89.661,0.116,0.299,2.750,0.010564,886.225,0.711,0.180620,0.452588,classical,0.346,0.116,0.299,0.000,0.895,0.000,0.237,0.344,0.110,0.711,0.579,1.000,0.532,0.416,0.570,0.202,0.622 +60511,89.297,0.112,0.217,2.750,0.004825,494.570,0.535,0.087567,0.291906,classical,0.476,0.112,0.217,0.000,0.538,0.000,0.068,0.344,0.000,0.535,0.931,1.000,0.441,0.290,0.594,0.124,0.690 +61522,89.459,0.040,0.260,2.000,0.004926,319.790,0.418,0.039609,0.623463,classical,0.422,0.040,0.260,0.000,1.000,0.000,0.000,0.250,0.000,0.418,0.835,1.000,0.520,0.345,0.719,0.075,0.746 +62536,89.890,0.209,0.142,2.500,0.010554,686.662,0.000,0.070503,0.248275,classical,0.665,0.209,0.142,0.000,0.441,0.000,0.037,0.313,0.053,0.000,0.000,1.000,0.464,0.116,0.435,0.118,0.761 +63550,88.993,0.191,0.148,2.500,0.010554,865.529,0.000,0.186921,0.243003,classical,0.611,0.191,0.148,0.000,0.429,0.000,0.249,0.313,0.104,0.000,0.000,1.000,0.453,0.116,0.382,0.195,0.697 +64563,66.745,0.283,0.163,2.250,0.008958,838.919,0.407,0.151594,0.576061,classical,0.514,0.283,0.163,0.000,1.000,0.000,0.185,0.281,0.097,0.407,0.814,1.000,0.392,0.309,0.539,0.164,0.684 +65563,88.993,0.230,0.023,2.250,0.008132,539.182,0.654,0.067326,0.418054,classical,0.428,0.230,0.023,0.000,0.818,0.000,0.032,0.281,0.011,0.654,0.693,1.000,0.570,0.294,0.619,0.097,0.705 +66578,89.114,0.416,0.114,2.500,0.002126,269.557,0.037,0.005494,0.508816,latin,0.752,0.416,0.114,0.000,1.000,0.000,0.000,0.313,0.000,0.037,0.073,1.000,1.058,0.199,0.536,0.094,0.768 +67579,88.987,0.403,0.124,0.750,0.037053,1083.532,0.000,0.250323,0.192157,latin,0.641,0.403,0.124,0.000,0.316,0.036,0.364,0.094,0.167,0.000,0.000,1.000,0.880,0.091,0.343,0.184,0.717 +68579,66.786,0.182,0.037,3.750,0.158575,1694.094,0.233,0.378551,0.087020,classical,0.484,0.182,0.037,0.000,0.082,0.289,0.597,0.469,0.341,0.233,0.467,1.000,0.111,0.084,0.178,0.448,0.530 +69594,89.048,0.079,0.194,5.000,0.052670,1136.522,0.320,0.224601,0.128643,classical,0.468,0.079,0.194,0.000,0.175,0.068,0.317,0.625,0.182,0.320,0.639,1.000,0.333,0.174,0.365,0.338,0.567 +70604,84.573,0.000,0.000,5.750,0.091598,2025.956,0.220,0.463284,0.056762,rock,0.597,0.000,0.000,0.000,0.015,0.149,0.751,0.719,0.436,0.220,0.441,0.653,0.247,0.057,0.187,0.572,0.301 +71616,84.861,0.000,0.000,6.500,0.258383,2482.451,0.350,0.594467,0.020903,rock,0.822,0.000,0.000,0.000,0.000,0.497,0.990,0.813,0.566,0.350,0.699,0.620,0.248,0.087,0.145,0.757,0.182 +72616,85.059,0.000,0.000,6.250,0.040247,1555.264,0.331,0.322927,0.108261,rock,0.390,0.000,0.000,0.000,0.129,0.042,0.496,0.781,0.302,0.331,0.662,0.660,0.282,0.102,0.295,0.465,0.354 +73627,85.214,0.000,0.000,6.000,0.068996,1672.022,0.299,0.359707,0.121879,rock,0.429,0.000,0.000,0.000,0.160,0.102,0.563,0.750,0.335,0.299,0.599,0.669,0.290,0.099,0.281,0.493,0.348 +74640,85.303,0.000,0.000,6.000,0.171735,4192.992,0.374,0.796374,0.012945,rock,0.853,0.000,0.000,0.000,0.000,0.316,1.000,0.750,1.000,0.374,0.749,0.736,0.250,0.094,0.162,0.822,0.233 +75654,85.364,0.000,0.000,6.500,0.219857,2084.408,0.286,0.487862,0.056566,rock,0.695,0.000,0.000,0.000,0.015,0.416,0.796,0.813,0.453,0.286,0.572,0.756,0.254,0.074,0.177,0.658,0.294 +76666,85.412,0.000,0.000,7.500,0.045889,811.453,0.279,0.186554,0.155977,classical,0.322,0.000,0.000,0.000,0.236,0.054,0.248,0.938,0.089,0.279,0.558,0.774,0.309,0.105,0.331,0.386,0.434 +77668,85.439,0.000,0.000,7.000,0.072411,1339.155,0.213,0.297866,0.091805,rock,0.407,0.000,0.000,0.000,0.093,0.109,0.451,0.875,0.240,0.213,0.425,0.743,0.273,0.067,0.245,0.474,0.385 +78669,85.458,0.000,0.000,7.000,0.235403,2311.080,0.242,0.601919,0.015793,rock,0.827,0.000,0.000,0.000,0.000,0.449,1.000,0.875,0.517,0.242,0.485,0.724,0.250,0.061,0.098,0.759,0.210 +79677,106.839,0.000,0.241,7.250,0.036385,896.446,0.213,0.159580,0.097214,classical,0.362,0.000,0.241,0.000,0.105,0.034,0.199,0.906,0.113,0.213,0.425,0.727,0.246,0.267,0.225,0.365,0.447 +80680,106.851,0.000,0.252,6.750,0.086049,1221.720,0.248,0.270072,0.105650,rock,0.348,0.000,0.252,0.000,0.124,0.138,0.400,0.844,0.206,0.248,0.496,0.705,0.250,0.283,0.201,0.445,0.391 +81694,85.487,0.050,0.276,6.250,0.107666,1465.835,0.310,0.323963,0.069658,rock,0.408,0.050,0.276,0.000,0.044,0.183,0.498,0.781,0.276,0.310,0.621,0.630,0.286,0.181,0.264,0.480,0.345 +82708,85.491,0.075,0.259,6.000,0.282903,2313.212,0.342,0.588605,0.022931,rock,0.798,0.075,0.259,0.000,0.000,0.548,0.979,0.750,0.518,0.342,0.684,0.091,0.287,0.176,0.147,0.730,0.016 +83720,85.494,0.107,0.194,5.750,0.060711,996.766,0.421,0.260427,0.104371,unknown,0.293,0.107,0.194,0.000,0.121,0.085,0.383,0.719,0.142,0.421,0.842,0.048,0.334,0.191,0.345,0.379,0.180 +84734,85.496,0.010,0.252,5.750,0.081430,1130.765,0.404,0.242481,0.116993,unknown,0.299,0.010,0.252,0.000,0.149,0.128,0.350,0.719,0.180,0.404,0.808,0.040,0.292,0.212,0.368,0.385,0.189 +85736,85.497,0.001,0.262,6.000,0.104890,1674.076,0.285,0.367044,0.022116,rock,0.537,0.001,0.262,0.000,0.000,0.177,0.576,0.750,0.335,0.285,0.571,0.039,0.251,0.163,0.241,0.508,0.125 +86748,85.498,0.065,0.249,6.000,0.127971,1388.222,0.308,0.313455,0.067722,rock,0.447,0.065,0.249,0.000,0.039,0.225,0.479,0.750,0.254,0.308,0.617,0.045,0.293,0.170,0.271,0.466,0.154 +87748,85.499,0.098,0.198,5.750,0.199636,2203.710,0.000,0.448678,0.105528,rock,0.668,0.098,0.198,0.000,0.123,0.374,0.725,0.719,0.487,0.000,0.000,0.043,0.330,0.088,0.135,0.611,0.118 +88760,85.499,0.000,0.232,6.000,0.191134,2126.845,0.144,0.482774,0.035643,rock,0.724,0.000,0.232,0.000,0.000,0.357,0.787,0.750,0.465,0.144,0.289,0.070,0.250,0.117,0.147,0.631,0.086 +89775,85.499,0.000,0.250,5.500,0.368682,2808.173,0.296,0.650021,0.043425,rock,0.846,0.000,0.250,0.000,0.000,0.726,1.000,0.688,0.659,0.296,0.592,0.072,0.250,0.162,0.151,0.780,0.024 +90789,85.500,0.044,0.260,4.750,0.087283,1126.620,0.177,0.244945,0.159798,unknown,0.256,0.044,0.260,0.000,0.244,0.140,0.354,0.594,0.179,0.177,0.353,0.101,0.333,0.172,0.338,0.350,0.263 +91799,85.500,0.091,0.196,4.500,0.137459,1768.459,0.213,0.357446,0.163504,rock,0.397,0.091,0.196,0.000,0.252,0.245,0.559,0.563,0.362,0.213,0.426,0.096,0.359,0.160,0.298,0.464,0.204 +92800,85.500,0.042,0.230,4.750,0.245006,2084.467,0.217,0.483802,0.088430,rock,0.639,0.042,0.230,0.000,0.085,0.469,0.789,0.594,0.453,0.217,0.433,0.125,0.292,0.148,0.210,0.598,0.137 +93814,85.500,0.000,0.252,5.000,0.224574,1982.211,0.243,0.440522,0.082381,rock,0.603,0.000,0.252,0.000,0.072,0.426,0.710,0.625,0.423,0.243,0.487,0.131,0.268,0.160,0.235,0.570,0.152 +94828,85.500,0.000,0.234,4.750,0.087749,1100.931,0.307,0.183258,0.144928,hiphop,0.316,0.000,0.234,0.000,0.211,0.141,0.242,0.594,0.172,0.307,0.615,0.147,0.303,0.190,0.405,0.315,0.300 +95843,85.500,0.028,0.211,4.500,0.139474,1496.115,0.371,0.325178,0.053935,rock,0.374,0.028,0.211,0.000,0.009,0.249,0.500,0.563,0.285,0.371,0.741,0.157,0.266,0.168,0.321,0.427,0.227 +96853,85.500,0.100,0.247,4.250,0.346220,2531.902,0.350,0.584420,0.058238,rock,0.743,0.100,0.247,0.000,0.018,0.680,0.972,0.531,0.581,0.350,0.700,0.177,0.305,0.177,0.195,0.698,0.103 +97855,85.500,0.050,0.257,3.750,0.096754,1111.219,0.289,0.199661,0.107282,unknown,0.297,0.050,0.257,0.000,0.127,0.160,0.272,0.469,0.175,0.289,0.579,0.196,0.307,0.181,0.393,0.290,0.341 +98866,85.500,0.000,0.231,4.000,0.195522,1955.958,0.221,0.395785,0.127016,rock,0.460,0.000,0.231,0.000,0.171,0.366,0.629,0.500,0.416,0.221,0.441,0.196,0.293,0.162,0.293,0.497,0.233 +99880,85.500,0.012,0.208,4.500,0.227363,2014.409,0.179,0.466769,0.056001,rock,0.616,0.012,0.208,0.000,0.013,0.432,0.758,0.563,0.433,0.179,0.358,0.192,0.259,0.120,0.203,0.569,0.181 +100892,85.500,0.132,0.280,4.750,0.311658,2401.856,0.219,0.553393,0.050032,rock,0.732,0.132,0.280,0.000,0.000,0.608,0.915,0.594,0.543,0.219,0.438,0.195,0.316,0.153,0.148,0.680,0.123 +101893,85.500,0.088,0.263,3.750,0.096951,1050.321,0.146,0.223453,0.155625,unknown,0.246,0.088,0.263,0.000,0.235,0.160,0.315,0.469,0.157,0.146,0.292,0.195,0.352,0.164,0.355,0.299,0.342 +102895,85.500,0.022,0.216,4.500,0.157944,1925.809,0.120,0.417563,0.094481,rock,0.523,0.022,0.216,0.000,0.099,0.287,0.668,0.563,0.407,0.120,0.241,0.189,0.285,0.121,0.223,0.514,0.213 +103896,85.500,0.025,0.203,4.500,0.309709,2471.817,0.252,0.582709,0.033337,rock,0.765,0.025,0.203,0.000,0.000,0.604,0.969,0.563,0.563,0.252,0.504,0.187,0.262,0.134,0.167,0.691,0.109 +104908,85.500,0.131,0.289,4.750,0.109995,1399.277,0.239,0.286444,0.086962,rock,0.317,0.131,0.289,0.000,0.082,0.187,0.430,0.594,0.257,0.239,0.479,0.193,0.336,0.173,0.292,0.399,0.266 +105920,85.500,0.084,0.268,5.250,0.122539,1304.351,0.231,0.228313,0.115698,unknown,0.290,0.084,0.268,0.000,0.146,0.214,0.324,0.656,0.230,0.231,0.462,0.189,0.329,0.173,0.324,0.384,0.282 +106925,85.500,0.028,0.223,5.250,0.206759,1899.189,0.177,0.420148,0.025836,rock,0.600,0.028,0.223,0.000,0.000,0.389,0.673,0.656,0.400,0.177,0.354,0.189,0.264,0.122,0.199,0.557,0.182 +107925,85.500,0.025,0.211,5.000,0.343124,2520.147,0.264,0.577431,0.040423,rock,0.793,0.025,0.211,0.000,0.000,0.673,0.959,0.625,0.577,0.264,0.528,0.184,0.262,0.140,0.161,0.720,0.094 +108925,85.500,0.127,0.278,5.250,0.067721,747.949,0.249,0.131038,0.164077,unknown,0.275,0.127,0.278,0.000,0.254,0.099,0.147,0.656,0.071,0.249,0.499,0.184,0.377,0.198,0.388,0.274,0.331 +109935,85.500,0.068,0.244,5.500,0.136528,2034.409,0.035,0.500907,0.086315,rock,0.662,0.068,0.244,0.000,0.081,0.243,0.820,0.688,0.438,0.035,0.070,0.180,0.304,0.106,0.124,0.598,0.142 +110935,85.500,0.000,0.192,5.500,0.256322,3063.191,0.000,0.664238,0.013081,rock,0.853,0.000,0.192,0.000,0.000,0.492,1.000,0.688,0.732,0.000,0.000,0.175,0.250,0.067,0.062,0.763,0.089 +111949,85.500,0.036,0.207,5.750,0.086206,1330.180,0.000,0.292571,0.114048,rock,0.403,0.036,0.207,0.000,0.142,0.138,0.441,0.719,0.237,0.000,0.000,0.164,0.304,0.094,0.219,0.428,0.245 +112964,85.500,0.106,0.230,6.000,0.064633,1664.132,0.140,0.344261,0.081714,rock,0.476,0.106,0.230,0.000,0.070,0.093,0.535,0.750,0.333,0.140,0.280,0.155,0.321,0.126,0.206,0.483,0.192 +113978,85.500,0.057,0.225,6.250,0.111311,1722.007,0.160,0.447730,0.019046,rock,0.635,0.057,0.225,0.000,0.000,0.190,0.723,0.781,0.349,0.160,0.321,0.138,0.279,0.119,0.152,0.567,0.120 +114991,85.500,0.001,0.214,7.500,0.370619,3380.706,0.040,0.761781,0.021921,rock,0.925,0.001,0.214,0.000,0.000,0.730,1.000,0.938,0.823,0.040,0.080,0.144,0.251,0.085,0.024,0.897,0.012 +116003,85.500,0.012,0.208,6.500,0.086243,1097.496,0.179,0.245502,0.221125,rock,0.327,0.012,0.208,0.000,0.380,0.138,0.355,0.813,0.171,0.179,0.358,0.140,0.351,0.174,0.327,0.414,0.221 +117004,85.500,0.077,0.253,7.250,0.063856,1663.415,0.190,0.406219,0.104746,rock,0.598,0.077,0.253,0.000,0.122,0.091,0.648,0.906,0.332,0.190,0.379,0.135,0.319,0.154,0.176,0.563,0.107 +118019,85.500,0.076,0.244,6.750,0.176151,2571.964,0.122,0.535134,0.019323,rock,0.801,0.076,0.244,0.000,0.000,0.325,0.882,0.844,0.592,0.122,0.244,0.115,0.288,0.116,0.086,0.715,0.053 +119022,85.500,0.032,0.199,6.000,0.237047,2745.068,0.037,0.579984,0.072794,rock,0.831,0.032,0.199,0.000,0.051,0.452,0.964,0.750,0.641,0.037,0.074,0.103,0.279,0.086,0.075,0.742,0.056 +120027,85.500,0.005,0.216,6.750,0.042490,1573.564,0.087,0.384397,0.121774,rock,0.558,0.005,0.216,0.000,0.159,0.047,0.608,0.844,0.307,0.087,0.174,0.096,0.292,0.121,0.187,0.519,0.132 +121027,85.500,0.064,0.237,5.250,0.073838,1621.846,0.061,0.389908,0.038250,rock,0.511,0.064,0.237,0.000,0.000,0.112,0.618,0.656,0.321,0.061,0.121,0.091,0.282,0.098,0.173,0.479,0.176 diff --git a/tests/hiphop.csv.import b/tests/hiphop.csv.import new file mode 100644 index 0000000..1434969 --- /dev/null +++ b/tests/hiphop.csv.import @@ -0,0 +1,19 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://c4and8k1dqsa2" + +[deps] + +files=["res://tests/hiphop.bpm.translation", "res://tests/hiphop.dembow.translation", "res://tests/hiphop.fourfloor.translation", "res://tests/hiphop.density.translation", "res://tests/hiphop.flatness.translation", "res://tests/hiphop.centroid.translation", "res://tests/hiphop.regularity.translation", "res://tests/hiphop.highRatio.translation", "res://tests/hiphop.lowRatio.translation", "res://tests/hiphop.label.translation", "res://tests/hiphop.conf.translation", "res://tests/hiphop.f0.translation", "res://tests/hiphop.f1.translation", "res://tests/hiphop.f2.translation", "res://tests/hiphop.f3.translation", "res://tests/hiphop.f4.translation", "res://tests/hiphop.f5.translation", "res://tests/hiphop.f6.translation", "res://tests/hiphop.f7.translation", "res://tests/hiphop.f8.translation", "res://tests/hiphop.f9.translation", "res://tests/hiphop.f10.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation"] + +source_file="res://tests/hiphop.csv" +dest_files=["res://tests/hiphop.bpm.translation", "res://tests/hiphop.dembow.translation", "res://tests/hiphop.fourfloor.translation", "res://tests/hiphop.density.translation", "res://tests/hiphop.flatness.translation", "res://tests/hiphop.centroid.translation", "res://tests/hiphop.regularity.translation", "res://tests/hiphop.highRatio.translation", "res://tests/hiphop.lowRatio.translation", "res://tests/hiphop.label.translation", "res://tests/hiphop.conf.translation", "res://tests/hiphop.f0.translation", "res://tests/hiphop.f1.translation", "res://tests/hiphop.f2.translation", "res://tests/hiphop.f3.translation", "res://tests/hiphop.f4.translation", "res://tests/hiphop.f5.translation", "res://tests/hiphop.f6.translation", "res://tests/hiphop.f7.translation", "res://tests/hiphop.f8.translation", "res://tests/hiphop.f9.translation", "res://tests/hiphop.f10.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation", "res://tests/hiphop.s.translation"] + +[params] + +compress=1 +delimiter=0 +unescape_keys=false +unescape_translations=true diff --git a/tests/hiphop.dembow.translation b/tests/hiphop.dembow.translation new file mode 100644 index 0000000..abcc845 Binary files /dev/null and b/tests/hiphop.dembow.translation differ diff --git a/tests/hiphop.density.translation b/tests/hiphop.density.translation new file mode 100644 index 0000000..f1c1faa Binary files /dev/null and b/tests/hiphop.density.translation differ diff --git a/tests/hiphop.f0.translation b/tests/hiphop.f0.translation new file mode 100644 index 0000000..96b6f37 Binary files /dev/null and b/tests/hiphop.f0.translation differ diff --git a/tests/hiphop.f1.translation b/tests/hiphop.f1.translation new file mode 100644 index 0000000..e4cf884 Binary files /dev/null and b/tests/hiphop.f1.translation differ diff --git a/tests/hiphop.f10.translation b/tests/hiphop.f10.translation new file mode 100644 index 0000000..36b8f5c Binary files /dev/null and b/tests/hiphop.f10.translation differ diff --git a/tests/hiphop.f2.translation b/tests/hiphop.f2.translation new file mode 100644 index 0000000..e591af1 Binary files /dev/null and b/tests/hiphop.f2.translation differ diff --git a/tests/hiphop.f3.translation b/tests/hiphop.f3.translation new file mode 100644 index 0000000..4516282 Binary files /dev/null and b/tests/hiphop.f3.translation differ diff --git a/tests/hiphop.f4.translation b/tests/hiphop.f4.translation new file mode 100644 index 0000000..22c7c7e Binary files /dev/null and b/tests/hiphop.f4.translation differ diff --git a/tests/hiphop.f5.translation b/tests/hiphop.f5.translation new file mode 100644 index 0000000..176a4ce Binary files /dev/null and b/tests/hiphop.f5.translation differ diff --git a/tests/hiphop.f6.translation b/tests/hiphop.f6.translation new file mode 100644 index 0000000..1707f33 Binary files /dev/null and b/tests/hiphop.f6.translation differ diff --git a/tests/hiphop.f7.translation b/tests/hiphop.f7.translation new file mode 100644 index 0000000..5ffe5a4 Binary files /dev/null and b/tests/hiphop.f7.translation differ diff --git a/tests/hiphop.f8.translation b/tests/hiphop.f8.translation new file mode 100644 index 0000000..7e1dd69 Binary files /dev/null and b/tests/hiphop.f8.translation differ diff --git a/tests/hiphop.f9.translation b/tests/hiphop.f9.translation new file mode 100644 index 0000000..5b7e8e8 Binary files /dev/null and b/tests/hiphop.f9.translation differ diff --git a/tests/hiphop.flatness.translation b/tests/hiphop.flatness.translation new file mode 100644 index 0000000..ec54cc1 Binary files /dev/null and b/tests/hiphop.flatness.translation differ diff --git a/tests/hiphop.fourfloor.translation b/tests/hiphop.fourfloor.translation new file mode 100644 index 0000000..0215e35 Binary files /dev/null and b/tests/hiphop.fourfloor.translation differ diff --git a/tests/hiphop.highRatio.translation b/tests/hiphop.highRatio.translation new file mode 100644 index 0000000..c6f3ffd Binary files /dev/null and b/tests/hiphop.highRatio.translation differ diff --git a/tests/hiphop.label.translation b/tests/hiphop.label.translation new file mode 100644 index 0000000..e0f3efe Binary files /dev/null and b/tests/hiphop.label.translation differ diff --git a/tests/hiphop.lowRatio.translation b/tests/hiphop.lowRatio.translation new file mode 100644 index 0000000..476ff89 Binary files /dev/null and b/tests/hiphop.lowRatio.translation differ diff --git a/tests/hiphop.regularity.translation b/tests/hiphop.regularity.translation new file mode 100644 index 0000000..8efc176 Binary files /dev/null and b/tests/hiphop.regularity.translation differ diff --git a/tests/hiphop.s.translation b/tests/hiphop.s.translation new file mode 100644 index 0000000..64dd151 Binary files /dev/null and b/tests/hiphop.s.translation differ diff --git a/tests/rock.bpm.translation b/tests/rock.bpm.translation new file mode 100644 index 0000000..6b71d6b Binary files /dev/null and b/tests/rock.bpm.translation differ diff --git a/tests/rock.centroid.translation b/tests/rock.centroid.translation new file mode 100644 index 0000000..96ba3b1 Binary files /dev/null and b/tests/rock.centroid.translation differ diff --git a/tests/rock.conf.translation b/tests/rock.conf.translation new file mode 100644 index 0000000..ebf6870 Binary files /dev/null and b/tests/rock.conf.translation differ diff --git a/tests/rock.csv b/tests/rock.csv new file mode 100644 index 0000000..b01e3c7 --- /dev/null +++ b/tests/rock.csv @@ -0,0 +1,121 @@ +ms,bpm,dembow,fourfloor,density,flatness,centroid,regularity,highRatio,lowRatio,label,conf,f0_latin_dembow,f1_fourfloor,f2_tempo_latin,f3_low,f4_flat,f5_high,f6_density,f7_centroid,f8_reg,f9_regmid,f10_dyn,s_latin,s_electronic,s_hiphop,s_rock,s_classical +1008,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.450,0.000,0.500 +2011,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.450,0.000,0.500 +3023,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.450,0.000,0.500 +4023,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.450,0.000,0.500 +5036,0.000,0.000,0.000,0.250,0.094046,976.232,0.000,0.231524,0.005892,hiphop,0.446,0.000,0.000,0.000,0.000,0.154,0.330,0.031,0.136,0.000,0.000,0.000,0.000,0.000,0.444,0.166,0.393 +6050,76.175,0.000,0.000,4.000,0.008093,433.805,0.230,0.046573,0.049788,classical,0.587,0.000,0.000,0.000,0.000,0.000,0.000,0.500,0.000,0.230,0.460,1.000,0.103,0.057,0.582,0.150,0.702 +7065,76.586,0.000,0.000,5.000,0.009455,478.560,0.315,0.055351,0.087579,classical,0.510,0.000,0.000,0.000,0.084,0.000,0.010,0.625,0.000,0.315,0.631,1.000,0.131,0.091,0.598,0.190,0.659 +8066,76.841,0.000,0.000,5.750,0.051953,721.064,0.104,0.180571,0.042061,classical,0.470,0.000,0.000,0.000,0.000,0.067,0.237,0.719,0.063,0.104,0.208,1.000,0.114,0.026,0.524,0.313,0.589 +9075,76.983,0.000,0.000,6.750,0.020593,486.786,0.182,0.063254,0.041035,classical,0.518,0.000,0.000,0.000,0.000,0.001,0.024,0.844,0.000,0.182,0.365,1.000,0.116,0.046,0.517,0.261,0.614 +10079,76.678,0.000,0.000,7.500,0.010048,466.446,0.226,0.050118,0.103846,classical,0.475,0.000,0.000,0.000,0.120,0.000,0.000,0.938,0.000,0.226,0.451,1.000,0.141,0.074,0.526,0.281,0.593 +11093,76.577,0.000,0.000,6.250,0.023767,364.739,0.251,0.045458,0.052718,classical,0.524,0.000,0.000,0.000,0.006,0.008,0.000,0.781,0.000,0.251,0.503,1.000,0.111,0.064,0.538,0.236,0.630 +12094,76.568,0.000,0.000,7.500,0.017094,443.146,0.263,0.052218,0.037068,classical,0.488,0.000,0.000,0.000,0.000,0.000,0.004,0.938,0.000,0.263,0.525,1.000,0.109,0.066,0.508,0.282,0.588 +13105,76.568,0.000,0.000,7.500,0.008741,444.808,0.306,0.043587,0.050113,classical,0.476,0.000,0.000,0.000,0.000,0.000,0.000,0.938,0.000,0.306,0.612,1.000,0.110,0.077,0.517,0.281,0.585 +14105,76.723,0.000,0.000,5.000,0.028499,426.141,0.380,0.053840,0.062242,classical,0.499,0.000,0.000,0.000,0.027,0.018,0.007,0.625,0.000,0.380,0.760,1.000,0.119,0.099,0.602,0.192,0.654 +15117,77.064,0.000,0.000,6.000,0.029838,395.265,0.430,0.052129,0.026707,classical,0.464,0.000,0.000,0.000,0.000,0.020,0.004,0.750,0.000,0.430,0.860,1.000,0.118,0.107,0.587,0.229,0.618 +16119,77.378,0.000,0.000,6.500,0.029253,456.931,0.392,0.052401,0.120020,classical,0.426,0.000,0.000,0.000,0.156,0.019,0.004,0.813,0.000,0.392,0.784,1.000,0.162,0.121,0.603,0.248,0.606 +17132,77.697,0.000,0.000,6.000,0.027637,410.862,0.236,0.058635,0.089095,classical,0.492,0.000,0.000,0.000,0.087,0.016,0.016,0.750,0.000,0.236,0.472,1.000,0.150,0.072,0.576,0.232,0.634 +18133,77.946,0.414,0.191,8.500,0.029296,387.653,0.130,0.079750,0.025304,latin,0.504,0.414,0.191,0.000,0.000,0.019,0.054,1.000,0.000,0.130,0.259,1.000,0.689,0.099,0.388,0.319,0.571 +19137,78.008,0.441,0.214,6.750,0.032505,520.236,0.040,0.091394,0.029875,latin,0.496,0.441,0.214,0.000,0.000,0.026,0.075,0.844,0.006,0.040,0.079,1.000,0.704,0.085,0.396,0.281,0.613 +20143,78.348,0.422,0.248,5.750,0.026268,428.708,0.102,0.061869,0.063764,latin,0.645,0.422,0.248,0.000,0.031,0.013,0.022,0.719,0.000,0.102,0.203,0.000,0.708,0.117,0.450,0.224,0.304 +21143,78.753,0.439,0.220,5.000,0.042038,518.843,0.108,0.116878,0.037963,latin,0.647,0.439,0.220,0.000,0.000,0.046,0.122,0.625,0.005,0.108,0.215,0.000,0.715,0.104,0.466,0.232,0.297 +22156,78.985,0.421,0.261,6.000,0.026327,462.984,0.216,0.074294,0.023539,latin,0.636,0.421,0.261,0.000,0.000,0.013,0.044,0.750,0.000,0.216,0.433,0.000,0.710,0.146,0.471,0.240,0.278 +23157,79.399,0.409,0.278,5.750,0.049932,544.830,0.082,0.111606,0.023998,latin,0.642,0.409,0.278,0.000,0.000,0.062,0.112,0.719,0.013,0.082,0.163,0.000,0.711,0.118,0.460,0.262,0.279 +24160,79.895,0.424,0.291,5.500,0.057309,639.217,0.233,0.152209,0.045577,latin,0.632,0.424,0.291,0.000,0.000,0.078,0.186,0.688,0.040,0.233,0.467,0.000,0.727,0.160,0.501,0.284,0.249 +25170,80.227,0.422,0.278,5.000,0.044019,704.903,0.237,0.129789,0.046326,latin,0.628,0.422,0.278,0.000,0.000,0.050,0.145,0.625,0.059,0.237,0.475,0.000,0.732,0.157,0.517,0.253,0.276 +26184,80.179,0.419,0.299,4.250,0.048589,554.867,0.066,0.105016,0.023010,latin,0.634,0.419,0.299,0.000,0.000,0.060,0.100,0.531,0.016,0.066,0.131,0.000,0.729,0.121,0.502,0.202,0.331 +27185,80.123,0.409,0.313,4.250,0.027278,398.318,0.247,0.099237,0.020442,latin,0.600,0.409,0.313,0.000,0.000,0.015,0.090,0.531,0.000,0.247,0.495,0.000,0.723,0.171,0.541,0.189,0.316 +28195,80.085,0.421,0.262,5.000,0.017612,945.590,0.045,0.117278,0.007156,latin,0.648,0.421,0.262,0.000,0.000,0.000,0.122,0.625,0.127,0.045,0.090,0.000,0.729,0.103,0.479,0.256,0.303 +29208,79.922,0.426,0.326,4.500,0.010635,821.048,0.000,0.055691,0.005576,latin,0.521,0.426,0.326,0.000,0.000,0.000,0.010,0.563,0.092,0.000,0.000,0.683,0.728,0.114,0.480,0.195,0.595 +30220,79.830,0.427,0.345,4.250,0.015413,956.619,0.298,0.116512,0.007342,latin,0.498,0.427,0.345,0.000,0.000,0.000,0.121,0.531,0.130,0.298,0.595,0.766,0.727,0.195,0.544,0.228,0.569 +31233,79.830,0.410,0.277,5.000,0.015732,993.791,0.257,0.105126,0.016777,latin,0.496,0.410,0.277,0.000,0.000,0.000,0.100,0.625,0.141,0.257,0.513,0.815,0.719,0.161,0.521,0.253,0.573 +32236,79.791,0.439,0.348,5.500,0.006023,621.475,0.346,0.036727,0.006834,latin,0.510,0.439,0.348,0.000,0.000,0.000,0.000,0.688,0.035,0.346,0.691,0.825,0.733,0.208,0.518,0.215,0.582 +33250,79.791,0.415,0.346,5.500,0.021187,986.815,0.366,0.113636,0.006049,latin,0.504,0.415,0.346,0.000,0.000,0.002,0.116,0.688,0.139,0.366,0.731,0.822,0.721,0.213,0.528,0.276,0.544 +34250,130.533,0.000,0.000,5.500,0.013906,870.985,0.354,0.068016,0.011131,classical,0.504,0.000,0.000,0.000,0.000,0.000,0.033,0.688,0.106,0.354,0.708,0.806,0.000,0.338,0.383,0.243,0.565 +35262,126.624,0.000,0.000,5.500,0.018676,962.252,0.365,0.114346,0.010923,classical,0.461,0.000,0.000,0.000,0.000,0.000,0.117,0.688,0.132,0.365,0.729,0.807,0.000,0.341,0.385,0.274,0.539 +36277,126.053,0.000,0.000,5.750,0.012112,745.910,0.389,0.073439,0.005924,classical,0.482,0.000,0.000,0.000,0.000,0.000,0.043,0.719,0.070,0.389,0.778,0.807,0.000,0.347,0.384,0.246,0.551 +37288,126.059,0.000,0.000,4.750,0.005260,373.269,0.042,0.028033,0.110150,classical,0.623,0.000,0.000,0.000,0.134,0.000,0.000,0.594,0.000,0.042,0.085,0.801,0.033,0.281,0.366,0.178,0.628 +38292,126.059,0.000,0.000,5.000,0.001487,239.651,0.112,0.004474,0.043842,classical,0.612,0.000,0.000,0.000,0.000,0.000,0.000,0.625,0.000,0.112,0.224,0.786,0.000,0.278,0.347,0.188,0.608 +39305,125.777,0.000,0.000,6.500,0.165769,3207.211,0.219,0.758497,0.005550,rock,0.781,0.000,0.000,0.000,0.000,0.304,1.000,0.813,0.773,0.219,0.438,0.744,0.000,0.305,0.331,0.783,0.235 +40318,125.536,0.000,0.000,6.000,0.130908,2735.401,0.000,0.651613,0.001003,rock,0.741,0.000,0.000,0.000,0.000,0.231,1.000,0.750,0.639,0.000,0.000,0.720,0.000,0.250,0.300,0.719,0.265 +41332,125.510,0.000,0.000,4.500,0.071348,688.952,0.000,0.155078,0.174660,classical,0.494,0.000,0.000,0.000,0.277,0.107,0.191,0.563,0.054,0.000,0.000,0.722,0.069,0.292,0.393,0.256,0.555 +42394,125.593,0.457,0.175,5.250,0.066057,790.164,0.000,0.142718,0.181015,classical,0.454,0.457,0.175,0.000,0.291,0.096,0.169,0.656,0.083,0.000,0.000,0.739,0.301,0.355,0.263,0.283,0.544 +43408,125.736,0.418,0.212,5.750,0.106239,1396.723,0.000,0.386003,0.038819,rock,0.394,0.418,0.212,0.000,0.000,0.180,0.611,0.719,0.256,0.000,0.000,0.732,0.209,0.324,0.202,0.490,0.393 +44408,125.818,0.423,0.234,5.250,0.185251,1931.635,0.000,0.458400,0.068225,rock,0.494,0.423,0.234,0.000,0.040,0.344,0.743,0.656,0.409,0.000,0.000,0.752,0.222,0.338,0.221,0.574,0.376 +45419,125.866,0.412,0.237,5.000,0.024875,353.227,0.000,0.079982,0.259196,classical,0.483,0.412,0.237,0.000,0.465,0.010,0.055,0.625,0.000,0.000,0.000,0.741,0.322,0.403,0.315,0.205,0.587 +46434,125.694,0.415,0.190,3.750,0.056889,704.117,0.031,0.203879,0.168042,classical,0.462,0.415,0.190,0.000,0.262,0.077,0.280,0.469,0.058,0.031,0.061,0.728,0.273,0.363,0.311,0.251,0.551 +47435,125.606,0.433,0.201,3.500,0.128077,1303.925,0.198,0.431714,0.141359,unknown,0.261,0.433,0.201,0.000,0.203,0.225,0.694,0.438,0.230,0.198,0.396,0.711,0.267,0.400,0.334,0.431,0.411 +48435,125.606,0.440,0.182,3.250,0.191149,2292.775,0.135,0.577652,0.052598,rock,0.509,0.440,0.182,0.000,0.006,0.357,0.959,0.406,0.512,0.135,0.270,0.708,0.221,0.348,0.287,0.591,0.345 +49449,91.067,0.000,0.000,3.500,0.113475,1076.186,0.197,0.276186,0.066815,hiphop,0.550,0.000,0.000,0.000,0.037,0.195,0.411,0.438,0.165,0.197,0.393,0.717,0.259,0.055,0.659,0.325,0.499 +50462,91.047,0.000,0.000,3.000,0.105050,980.264,0.221,0.353846,0.110005,hiphop,0.617,0.000,0.000,0.000,0.133,0.177,0.552,0.375,0.137,0.221,0.442,0.639,0.283,0.075,0.696,0.339,0.442 +51462,91.124,0.000,0.000,3.750,0.061178,558.306,0.199,0.164432,0.185876,hiphop,0.661,0.000,0.000,0.000,0.302,0.086,0.208,0.469,0.017,0.199,0.398,0.318,0.325,0.095,0.706,0.220,0.412 +52477,91.397,0.000,0.000,6.000,0.032196,427.806,0.000,0.064404,0.145567,hiphop,0.556,0.000,0.000,0.000,0.212,0.025,0.026,0.750,0.000,0.000,0.000,0.193,0.303,0.032,0.592,0.237,0.372 +53479,91.606,0.000,0.000,6.250,0.070789,771.820,0.000,0.204365,0.044705,hiphop,0.515,0.000,0.000,0.000,0.000,0.106,0.281,0.781,0.078,0.000,0.000,0.148,0.250,0.000,0.544,0.354,0.272 +54492,91.716,0.000,0.000,6.000,0.082047,766.813,0.000,0.187879,0.138169,hiphop,0.554,0.000,0.000,0.000,0.196,0.129,0.251,0.750,0.076,0.000,0.000,0.152,0.299,0.029,0.589,0.339,0.290 +55506,91.779,0.000,0.000,6.000,0.049271,538.882,0.000,0.169050,0.214957,hiphop,0.592,0.000,0.000,0.000,0.367,0.061,0.216,0.750,0.011,0.000,0.000,0.110,0.342,0.055,0.623,0.302,0.286 +56508,91.773,0.000,0.000,3.250,0.064706,742.845,0.146,0.228969,0.191774,hiphop,0.700,0.000,0.000,0.000,0.315,0.093,0.325,0.406,0.069,0.146,0.293,0.074,0.329,0.084,0.711,0.251,0.312 +57521,91.870,0.000,0.000,3.250,0.126462,1329.969,0.244,0.421329,0.177271,hiphop,0.683,0.000,0.000,0.000,0.283,0.222,0.675,0.406,0.237,0.244,0.487,0.065,0.321,0.103,0.724,0.417,0.194 +58521,92.014,0.000,0.000,3.250,0.129875,1352.415,0.170,0.406212,0.181718,hiphop,0.670,0.000,0.000,0.000,0.293,0.229,0.648,0.406,0.244,0.170,0.340,0.059,0.323,0.086,0.711,0.411,0.208 +59525,92.014,0.455,0.167,3.750,0.021912,320.832,0.221,0.056104,0.091851,latin,0.725,0.455,0.167,0.000,0.093,0.004,0.011,0.469,0.000,0.221,0.441,0.061,0.851,0.127,0.555,0.145,0.379 +60539,92.043,0.467,0.175,3.500,0.109835,1114.583,0.222,0.328673,0.080641,latin,0.722,0.467,0.175,0.000,0.068,0.187,0.507,0.438,0.176,0.222,0.443,0.082,0.851,0.127,0.554,0.355,0.245 +61539,92.043,0.475,0.187,4.250,0.083968,840.255,0.014,0.220953,0.123491,latin,0.776,0.475,0.187,0.000,0.163,0.133,0.311,0.531,0.097,0.014,0.029,0.075,0.878,0.094,0.510,0.297,0.299 +62551,92.043,0.411,0.214,5.250,0.025032,300.249,0.000,0.063453,0.178208,latin,0.766,0.411,0.214,0.000,0.285,0.010,0.024,0.656,0.000,0.000,0.000,0.104,0.877,0.118,0.523,0.206,0.365 +63552,92.043,0.415,0.235,5.750,0.153008,1620.231,0.000,0.430732,0.028202,latin,0.666,0.415,0.235,0.000,0.000,0.277,0.692,0.719,0.320,0.000,0.000,0.106,0.808,0.082,0.452,0.545,0.150 +64567,92.034,0.417,0.240,5.000,0.092256,2150.228,0.000,0.491711,0.035355,latin,0.646,0.417,0.240,0.000,0.000,0.151,0.803,0.625,0.471,0.000,0.000,0.088,0.808,0.084,0.471,0.569,0.134 +65579,92.034,0.429,0.239,4.000,0.051186,688.181,0.000,0.172806,0.128278,latin,0.748,0.429,0.239,0.000,0.174,0.065,0.223,0.500,0.054,0.000,0.000,0.093,0.858,0.110,0.528,0.240,0.341 +66583,92.026,0.408,0.253,3.500,0.093807,1052.048,0.000,0.287388,0.047338,latin,0.699,0.408,0.253,0.000,0.000,0.154,0.432,0.438,0.158,0.000,0.000,0.119,0.804,0.089,0.510,0.323,0.303 +67595,92.053,0.424,0.238,3.250,0.071538,870.765,0.000,0.298586,0.130528,latin,0.732,0.424,0.238,0.000,0.179,0.107,0.452,0.406,0.106,0.000,0.000,0.155,0.857,0.110,0.549,0.300,0.317 +68596,92.172,0.414,0.224,3.500,0.109576,1078.562,0.000,0.318007,0.110992,latin,0.720,0.414,0.224,0.000,0.136,0.187,0.487,0.438,0.165,0.000,0.000,0.114,0.841,0.099,0.536,0.347,0.284 +69598,92.274,0.430,0.242,4.000,0.166998,1469.998,0.000,0.325857,0.062074,latin,0.702,0.430,0.242,0.000,0.027,0.306,0.502,0.500,0.277,0.000,0.000,0.183,0.822,0.089,0.498,0.416,0.289 +70599,92.334,0.441,0.261,4.250,0.081292,1185.890,0.000,0.346279,0.037591,latin,0.713,0.441,0.261,0.000,0.000,0.128,0.539,0.531,0.196,0.000,0.000,0.271,0.820,0.091,0.484,0.389,0.301 +71600,92.443,0.461,0.228,4.750,0.114499,1412.133,0.000,0.538661,0.067141,latin,0.694,0.461,0.228,0.000,0.038,0.197,0.888,0.594,0.261,0.000,0.000,0.267,0.840,0.085,0.474,0.539,0.178 +72604,92.443,0.464,0.223,5.250,0.143367,1605.981,0.405,0.496839,0.067280,latin,0.652,0.464,0.223,0.000,0.038,0.257,0.812,0.656,0.316,0.405,0.809,0.268,0.841,0.185,0.541,0.558,0.146 +73615,132.577,0.000,0.000,5.250,0.095108,1982.327,0.367,0.537711,0.046665,rock,0.554,0.000,0.000,0.000,0.000,0.156,0.887,0.656,0.424,0.367,0.734,0.275,0.000,0.342,0.392,0.592,0.129 +74618,131.467,0.000,0.000,6.000,0.065170,753.794,0.178,0.494681,0.121706,rock,0.456,0.000,0.000,0.000,0.159,0.094,0.809,0.750,0.073,0.178,0.355,0.285,0.040,0.318,0.367,0.500,0.152 +75627,130.819,0.000,0.000,5.500,0.114370,1517.080,0.000,0.615343,0.071525,rock,0.645,0.000,0.000,0.000,0.048,0.197,1.000,0.688,0.291,0.000,0.000,0.275,0.012,0.257,0.322,0.608,0.124 +76630,130.565,0.000,0.000,5.250,0.131392,1357.621,0.000,0.582835,0.065831,rock,0.611,0.000,0.000,0.000,0.035,0.232,0.969,0.656,0.245,0.000,0.000,0.285,0.009,0.255,0.326,0.584,0.145 +77633,130.390,0.000,0.000,6.000,0.218606,2568.119,0.000,0.658998,0.042389,rock,0.785,0.000,0.000,0.000,0.000,0.414,1.000,0.750,0.591,0.000,0.000,0.297,0.000,0.250,0.300,0.735,0.116 +78647,130.253,0.000,0.000,6.750,0.170274,1732.278,0.000,0.422632,0.014780,rock,0.636,0.000,0.000,0.000,0.000,0.313,0.678,0.844,0.352,0.000,0.000,0.262,0.000,0.250,0.281,0.591,0.178 +79648,130.210,0.000,0.000,6.250,0.192025,1930.509,0.161,0.537934,0.045368,rock,0.686,0.000,0.000,0.000,0.000,0.358,0.887,0.781,0.409,0.161,0.322,0.275,0.000,0.290,0.326,0.656,0.119 +80653,130.210,0.000,0.000,6.500,0.200480,1847.947,0.154,0.453841,0.032911,rock,0.638,0.000,0.000,0.000,0.000,0.376,0.734,0.813,0.385,0.154,0.307,0.288,0.000,0.288,0.318,0.617,0.162 +81664,88.500,0.000,0.000,6.000,0.184270,1853.712,0.257,0.506398,0.039933,rock,0.452,0.000,0.000,0.000,0.000,0.342,0.830,0.750,0.387,0.257,0.513,0.301,0.250,0.064,0.601,0.622,0.143 +82664,87.621,0.000,0.000,6.000,0.179525,1355.751,0.316,0.334919,0.046793,hiphop,0.525,0.000,0.000,0.000,0.000,0.332,0.518,0.750,0.245,0.316,0.631,0.229,0.250,0.079,0.613,0.491,0.206 +83664,87.002,0.000,0.000,7.000,0.160297,1610.782,0.099,0.419044,0.028644,rock,0.462,0.000,0.000,0.000,0.000,0.292,0.671,0.875,0.317,0.099,0.198,0.206,0.250,0.025,0.545,0.587,0.142 +84668,86.381,0.000,0.000,7.250,0.193232,2766.687,0.057,0.591461,0.060899,rock,0.711,0.000,0.000,0.000,0.024,0.361,0.984,0.906,0.648,0.057,0.115,0.162,0.256,0.018,0.535,0.783,0.029 +85681,85.953,0.000,0.000,6.500,0.203476,2815.997,0.030,0.678773,0.048672,rock,0.690,0.000,0.000,0.000,0.000,0.382,1.000,0.813,0.662,0.030,0.059,0.073,0.250,0.007,0.543,0.767,0.019 +86695,85.791,0.000,0.000,6.250,0.222513,2306.189,0.000,0.583331,0.075013,rock,0.622,0.000,0.000,0.000,0.056,0.422,0.970,0.781,0.516,0.000,0.000,0.061,0.264,0.008,0.555,0.718,0.035 +87707,85.791,0.000,0.000,5.500,0.188004,3341.320,0.148,0.686576,0.046362,rock,0.642,0.000,0.000,0.000,0.000,0.350,1.000,0.688,0.812,0.148,0.297,0.049,0.250,0.037,0.592,0.762,0.030 +88707,85.546,0.000,0.000,5.750,0.087285,1031.477,0.092,0.241802,0.060577,hiphop,0.557,0.000,0.000,0.000,0.024,0.140,0.349,0.719,0.152,0.092,0.185,0.036,0.256,0.027,0.579,0.379,0.219 +89713,85.377,0.000,0.000,6.750,0.117213,1916.847,0.098,0.467769,0.029026,rock,0.496,0.000,0.000,0.000,0.000,0.203,0.760,0.844,0.405,0.098,0.196,0.038,0.250,0.024,0.551,0.613,0.065 +90713,85.090,0.000,0.000,6.250,0.163169,2271.625,0.191,0.549806,0.055712,rock,0.548,0.000,0.000,0.000,0.013,0.298,0.909,0.781,0.506,0.191,0.382,0.032,0.253,0.050,0.585,0.678,0.024 +91715,85.017,0.000,0.000,7.250,0.137876,1700.342,0.299,0.434323,0.044369,rock,0.458,0.000,0.000,0.000,0.000,0.246,0.699,0.906,0.343,0.299,0.598,0.031,0.250,0.075,0.579,0.604,0.045 +92715,85.125,0.419,0.229,6.250,0.237641,2310.998,0.182,0.491060,0.059263,latin,0.577,0.419,0.229,0.000,0.021,0.453,0.802,0.781,0.517,0.182,0.364,0.036,0.815,0.129,0.480,0.672,0.058 +93718,85.456,0.442,0.214,4.750,0.108976,1015.908,0.407,0.254686,0.035746,latin,0.692,0.442,0.214,0.000,0.000,0.185,0.372,0.594,0.147,0.407,0.813,0.030,0.821,0.177,0.552,0.354,0.210 +94721,85.935,0.466,0.226,5.500,0.221305,2468.684,0.162,0.612412,0.051491,latin,0.571,0.466,0.226,0.000,0.003,0.419,1.000,0.688,0.562,0.162,0.325,0.027,0.834,0.120,0.479,0.710,0.021 +95734,86.309,0.429,0.230,6.250,0.083549,837.414,0.049,0.380836,0.142307,latin,0.751,0.429,0.230,0.000,0.205,0.132,0.602,0.781,0.096,0.049,0.097,0.026,0.866,0.123,0.487,0.459,0.128 +96746,86.354,0.438,0.224,6.750,0.090336,806.055,0.000,0.393931,0.128333,latin,0.753,0.438,0.224,0.000,0.174,0.147,0.625,0.844,0.087,0.000,0.000,0.024,0.862,0.104,0.457,0.485,0.110 +97758,86.244,0.416,0.244,6.500,0.084559,1156.193,0.000,0.348852,0.063809,latin,0.717,0.416,0.244,0.000,0.031,0.134,0.543,0.813,0.187,0.000,0.000,0.029,0.816,0.090,0.440,0.474,0.144 +98761,86.169,0.432,0.246,6.500,0.100929,1164.137,0.000,0.444010,0.113135,latin,0.720,0.432,0.246,0.000,0.140,0.169,0.716,0.813,0.190,0.000,0.000,0.026,0.851,0.107,0.458,0.531,0.091 +99761,86.109,0.446,0.252,6.750,0.111208,1242.862,0.000,0.482892,0.089203,latin,0.700,0.446,0.252,0.000,0.087,0.190,0.787,0.844,0.212,0.000,0.000,0.027,0.845,0.101,0.437,0.571,0.062 +100761,86.192,0.455,0.235,6.500,0.117794,1284.496,0.000,0.490760,0.051142,latin,0.688,0.455,0.235,0.000,0.003,0.204,0.801,0.813,0.224,0.000,0.000,0.006,0.828,0.083,0.424,0.571,0.059 +101766,86.442,0.430,0.221,6.250,0.236305,2246.263,0.000,0.651758,0.047472,latin,0.544,0.430,0.221,0.000,0.000,0.451,1.000,0.781,0.499,0.000,0.000,0.040,0.815,0.077,0.436,0.727,0.019 +102772,86.615,0.435,0.235,6.000,0.187874,1803.267,0.000,0.600042,0.087782,latin,0.616,0.435,0.235,0.000,0.084,0.350,1.000,0.750,0.372,0.000,0.000,0.041,0.839,0.095,0.458,0.671,0.027 +103775,86.412,0.423,0.250,5.750,0.092944,840.528,0.000,0.449998,0.122387,latin,0.733,0.423,0.250,0.000,0.161,0.152,0.727,0.719,0.097,0.000,0.000,0.040,0.852,0.112,0.483,0.481,0.116 +104789,86.193,0.484,0.254,6.500,0.093791,1261.335,0.000,0.364319,0.039076,latin,0.743,0.484,0.254,0.000,0.000,0.154,0.571,0.813,0.218,0.000,0.000,0.041,0.842,0.089,0.416,0.493,0.140 +105805,86.133,0.466,0.224,6.250,0.140927,1378.191,0.000,0.534531,0.077961,latin,0.686,0.466,0.224,0.000,0.062,0.252,0.881,0.781,0.251,0.000,0.000,0.035,0.849,0.088,0.440,0.599,0.053 +106819,86.402,0.463,0.244,6.500,0.129961,1419.177,0.000,0.657494,0.039263,latin,0.641,0.463,0.244,0.000,0.000,0.229,1.000,0.813,0.263,0.000,0.000,0.044,0.831,0.085,0.422,0.644,0.012 +107834,86.612,0.468,0.230,6.750,0.171030,1364.572,0.000,0.542583,0.067580,latin,0.664,0.468,0.230,0.000,0.039,0.315,0.896,0.844,0.247,0.000,0.000,0.050,0.844,0.086,0.422,0.631,0.038 +108835,86.733,0.417,0.241,6.000,0.136535,1463.151,0.000,0.461706,0.023112,latin,0.667,0.417,0.241,0.000,0.000,0.243,0.749,0.750,0.275,0.000,0.000,0.050,0.809,0.085,0.446,0.555,0.105 +109847,86.791,0.423,0.231,7.000,0.075165,902.331,0.000,0.338014,0.075288,latin,0.734,0.423,0.231,0.000,0.056,0.115,0.524,0.875,0.115,0.000,0.000,0.057,0.825,0.089,0.431,0.466,0.144 +110862,86.996,0.406,0.228,6.750,0.135660,1443.922,0.000,0.477148,0.069930,latin,0.654,0.406,0.228,0.000,0.044,0.241,0.777,0.844,0.270,0.000,0.000,0.057,0.814,0.086,0.439,0.590,0.076 +111865,86.996,0.428,0.227,6.250,0.104046,1034.021,0.000,0.420254,0.105818,latin,0.726,0.428,0.227,0.000,0.124,0.175,0.673,0.781,0.153,0.000,0.000,0.086,0.845,0.098,0.462,0.501,0.133 +112868,86.997,0.438,0.236,5.000,0.115936,1732.900,0.025,0.530688,0.071532,latin,0.670,0.438,0.236,0.000,0.048,0.200,0.874,0.625,0.352,0.025,0.050,0.069,0.831,0.096,0.480,0.568,0.103 +113870,86.829,0.422,0.242,4.000,0.096391,963.548,0.000,0.498007,0.113551,latin,0.717,0.422,0.242,0.000,0.141,0.159,0.815,0.500,0.132,0.000,0.000,0.079,0.846,0.106,0.523,0.451,0.158 +114871,86.608,0.426,0.174,5.000,0.097410,1035.041,0.000,0.407248,0.070110,latin,0.720,0.426,0.174,0.000,0.045,0.161,0.650,0.625,0.153,0.000,0.000,0.084,0.824,0.067,0.477,0.445,0.178 +115885,86.705,0.449,0.179,4.750,0.143565,1687.760,0.000,0.507596,0.046201,latin,0.677,0.449,0.179,0.000,0.000,0.257,0.832,0.594,0.339,0.000,0.000,0.076,0.825,0.063,0.469,0.551,0.128 +116890,86.796,0.465,0.215,5.750,0.104514,1168.172,0.000,0.437340,0.067505,latin,0.729,0.465,0.215,0.000,0.039,0.176,0.704,0.719,0.191,0.000,0.000,0.080,0.842,0.081,0.448,0.501,0.137 +117903,86.859,0.447,0.202,6.000,0.110759,1344.406,0.000,0.467353,0.049423,latin,0.694,0.447,0.202,0.000,0.000,0.189,0.759,0.750,0.241,0.000,0.000,0.066,0.823,0.071,0.438,0.541,0.108 +118915,86.849,0.440,0.217,5.750,0.135861,1231.415,0.000,0.573437,0.056052,latin,0.662,0.440,0.217,0.000,0.013,0.241,0.952,0.719,0.209,0.000,0.000,0.064,0.823,0.078,0.449,0.590,0.057 +119928,86.586,0.428,0.197,6.750,0.098921,1503.748,0.108,0.519246,0.046644,latin,0.641,0.428,0.197,0.000,0.000,0.164,0.853,0.844,0.287,0.108,0.215,0.052,0.814,0.096,0.446,0.605,0.040 +120930,86.404,0.484,0.204,5.750,0.105406,988.541,0.212,0.538570,0.108256,latin,0.719,0.484,0.204,0.000,0.129,0.178,0.888,0.719,0.140,0.212,0.425,0.057,0.874,0.144,0.504,0.544,0.053 diff --git a/tests/rock.csv.import b/tests/rock.csv.import new file mode 100644 index 0000000..dafab21 --- /dev/null +++ b/tests/rock.csv.import @@ -0,0 +1,19 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://cw56huda4jabp" + +[deps] + +files=["res://tests/rock.bpm.translation", "res://tests/rock.dembow.translation", "res://tests/rock.fourfloor.translation", "res://tests/rock.density.translation", "res://tests/rock.flatness.translation", "res://tests/rock.centroid.translation", "res://tests/rock.regularity.translation", "res://tests/rock.highRatio.translation", "res://tests/rock.lowRatio.translation", "res://tests/rock.label.translation", "res://tests/rock.conf.translation", "res://tests/rock.f0.translation", "res://tests/rock.f1.translation", "res://tests/rock.f2.translation", "res://tests/rock.f3.translation", "res://tests/rock.f4.translation", "res://tests/rock.f5.translation", "res://tests/rock.f6.translation", "res://tests/rock.f7.translation", "res://tests/rock.f8.translation", "res://tests/rock.f9.translation", "res://tests/rock.f10.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation"] + +source_file="res://tests/rock.csv" +dest_files=["res://tests/rock.bpm.translation", "res://tests/rock.dembow.translation", "res://tests/rock.fourfloor.translation", "res://tests/rock.density.translation", "res://tests/rock.flatness.translation", "res://tests/rock.centroid.translation", "res://tests/rock.regularity.translation", "res://tests/rock.highRatio.translation", "res://tests/rock.lowRatio.translation", "res://tests/rock.label.translation", "res://tests/rock.conf.translation", "res://tests/rock.f0.translation", "res://tests/rock.f1.translation", "res://tests/rock.f2.translation", "res://tests/rock.f3.translation", "res://tests/rock.f4.translation", "res://tests/rock.f5.translation", "res://tests/rock.f6.translation", "res://tests/rock.f7.translation", "res://tests/rock.f8.translation", "res://tests/rock.f9.translation", "res://tests/rock.f10.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation", "res://tests/rock.s.translation"] + +[params] + +compress=1 +delimiter=0 +unescape_keys=false +unescape_translations=true diff --git a/tests/rock.dembow.translation b/tests/rock.dembow.translation new file mode 100644 index 0000000..1a0f01d Binary files /dev/null and b/tests/rock.dembow.translation differ diff --git a/tests/rock.density.translation b/tests/rock.density.translation new file mode 100644 index 0000000..7160ba8 Binary files /dev/null and b/tests/rock.density.translation differ diff --git a/tests/rock.f0.translation b/tests/rock.f0.translation new file mode 100644 index 0000000..8a8350c Binary files /dev/null and b/tests/rock.f0.translation differ diff --git a/tests/rock.f1.translation b/tests/rock.f1.translation new file mode 100644 index 0000000..e5b6ff2 Binary files /dev/null and b/tests/rock.f1.translation differ diff --git a/tests/rock.f10.translation b/tests/rock.f10.translation new file mode 100644 index 0000000..7754cfa Binary files /dev/null and b/tests/rock.f10.translation differ diff --git a/tests/rock.f2.translation b/tests/rock.f2.translation new file mode 100644 index 0000000..067fbf1 Binary files /dev/null and b/tests/rock.f2.translation differ diff --git a/tests/rock.f3.translation b/tests/rock.f3.translation new file mode 100644 index 0000000..9f45cac Binary files /dev/null and b/tests/rock.f3.translation differ diff --git a/tests/rock.f4.translation b/tests/rock.f4.translation new file mode 100644 index 0000000..4141543 Binary files /dev/null and b/tests/rock.f4.translation differ diff --git a/tests/rock.f5.translation b/tests/rock.f5.translation new file mode 100644 index 0000000..c827b57 Binary files /dev/null and b/tests/rock.f5.translation differ diff --git a/tests/rock.f6.translation b/tests/rock.f6.translation new file mode 100644 index 0000000..e02a981 Binary files /dev/null and b/tests/rock.f6.translation differ diff --git a/tests/rock.f7.translation b/tests/rock.f7.translation new file mode 100644 index 0000000..e61d8ea Binary files /dev/null and b/tests/rock.f7.translation differ diff --git a/tests/rock.f8.translation b/tests/rock.f8.translation new file mode 100644 index 0000000..796ceb5 Binary files /dev/null and b/tests/rock.f8.translation differ diff --git a/tests/rock.f9.translation b/tests/rock.f9.translation new file mode 100644 index 0000000..13d1bfd Binary files /dev/null and b/tests/rock.f9.translation differ diff --git a/tests/rock.flatness.translation b/tests/rock.flatness.translation new file mode 100644 index 0000000..c715aae Binary files /dev/null and b/tests/rock.flatness.translation differ diff --git a/tests/rock.fourfloor.translation b/tests/rock.fourfloor.translation new file mode 100644 index 0000000..2b68a9c Binary files /dev/null and b/tests/rock.fourfloor.translation differ diff --git a/tests/rock.highRatio.translation b/tests/rock.highRatio.translation new file mode 100644 index 0000000..7ba916c Binary files /dev/null and b/tests/rock.highRatio.translation differ diff --git a/tests/rock.label.translation b/tests/rock.label.translation new file mode 100644 index 0000000..8c3901e Binary files /dev/null and b/tests/rock.label.translation differ diff --git a/tests/rock.lowRatio.translation b/tests/rock.lowRatio.translation new file mode 100644 index 0000000..c5ba867 Binary files /dev/null and b/tests/rock.lowRatio.translation differ diff --git a/tests/rock.regularity.translation b/tests/rock.regularity.translation new file mode 100644 index 0000000..00c7d18 Binary files /dev/null and b/tests/rock.regularity.translation differ diff --git a/tests/rock.s.translation b/tests/rock.s.translation new file mode 100644 index 0000000..b407481 Binary files /dev/null and b/tests/rock.s.translation differ diff --git a/tests/rock2.bpm.translation b/tests/rock2.bpm.translation new file mode 100644 index 0000000..87dfc15 Binary files /dev/null and b/tests/rock2.bpm.translation differ diff --git a/tests/rock2.centroid.translation b/tests/rock2.centroid.translation new file mode 100644 index 0000000..33f3d4e Binary files /dev/null and b/tests/rock2.centroid.translation differ diff --git a/tests/rock2.conf.translation b/tests/rock2.conf.translation new file mode 100644 index 0000000..c5d6326 Binary files /dev/null and b/tests/rock2.conf.translation differ diff --git a/tests/rock2.csv b/tests/rock2.csv new file mode 100644 index 0000000..54fda51 --- /dev/null +++ b/tests/rock2.csv @@ -0,0 +1,120 @@ +ms,bpm,dembow,fourfloor,density,flatness,centroid,regularity,highRatio,lowRatio,label,conf,f0_latin_dembow,f1_fourfloor,f2_tempo_latin,f3_low,f4_flat,f5_high,f6_density,f7_centroid,f8_reg,f9_regmid,f10_dyn,s_latin,s_electronic,s_hiphop,s_rock,s_classical +1001,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +2015,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +3029,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +4042,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +5043,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +6057,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +7069,0.000,0.000,0.000,0.000,0.000000,0.000,0.000,0.000000,0.000000,unknown,0.200,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.350,0.000,0.500 +8076,102.000,0.000,0.000,1.750,0.156256,1632.365,0.750,0.371409,0.052544,classical,0.473,0.000,0.000,0.000,0.006,0.284,0.584,0.219,0.324,0.750,0.500,1.000,0.251,0.222,0.290,0.364,0.545 +9087,102.000,0.000,0.000,3.500,0.201653,1677.462,0.000,0.485919,0.080667,rock,0.398,0.000,0.000,0.000,0.068,0.378,0.793,0.438,0.336,0.000,0.000,1.000,0.267,0.044,0.131,0.510,0.503 +10102,102.000,0.000,0.000,5.250,0.232756,2743.705,0.000,0.667323,0.032812,rock,0.746,0.000,0.000,0.000,0.000,0.443,1.000,0.656,0.641,0.000,0.000,1.000,0.250,0.033,0.022,0.724,0.386 +11102,102.000,0.000,0.000,5.500,0.135749,1168.287,0.000,0.283968,0.105701,classical,0.496,0.000,0.000,0.000,0.124,0.241,0.425,0.688,0.191,0.000,0.000,1.000,0.281,0.052,0.184,0.418,0.551 +12114,102.000,0.000,0.000,5.000,0.180048,1702.826,0.049,0.449438,0.043572,rock,0.468,0.000,0.000,0.000,0.000,0.333,0.726,0.625,0.344,0.049,0.098,1.000,0.250,0.046,0.111,0.541,0.471 +13128,102.000,0.000,0.000,5.750,0.132384,1586.090,0.029,0.345756,0.034940,classical,0.408,0.000,0.000,0.000,0.000,0.234,0.538,0.719,0.310,0.029,0.058,1.000,0.250,0.041,0.134,0.490,0.506 +14128,102.000,0.000,0.000,7.000,0.187569,2081.940,0.000,0.553365,0.015067,rock,0.743,0.000,0.000,0.000,0.000,0.349,0.915,0.875,0.452,0.000,0.000,1.000,0.250,0.033,0.000,0.702,0.357 +15128,102.000,0.000,0.000,7.000,0.120595,1492.410,0.000,0.342378,0.038347,rock,0.449,0.000,0.000,0.000,0.000,0.210,0.532,0.875,0.284,0.000,0.000,1.000,0.250,0.033,0.095,0.524,0.472 +16138,89.021,0.000,0.000,6.500,0.198685,2366.251,0.105,0.597931,0.017965,rock,0.772,0.000,0.000,0.000,0.000,0.372,0.996,0.813,0.533,0.105,0.210,1.000,0.250,0.026,0.070,0.732,0.338 +17144,88.084,0.000,0.000,7.000,0.171208,1873.130,0.239,0.501703,0.037874,rock,0.670,0.000,0.000,0.000,0.000,0.315,0.821,0.875,0.392,0.239,0.478,1.000,0.250,0.060,0.141,0.654,0.361 +18145,87.704,0.000,0.000,7.500,0.073627,785.297,0.172,0.188300,0.031305,classical,0.470,0.000,0.000,0.000,0.000,0.112,0.251,0.938,0.082,0.172,0.344,1.000,0.250,0.043,0.251,0.394,0.523 +19148,87.682,0.000,0.000,7.750,0.183957,2285.769,0.093,0.485451,0.077555,rock,0.730,0.000,0.000,0.000,0.061,0.342,0.792,0.969,0.510,0.093,0.186,1.000,0.265,0.032,0.098,0.707,0.361 +20160,87.752,0.000,0.000,6.250,0.136662,1384.180,0.000,0.464750,0.136839,rock,0.504,0.000,0.000,0.000,0.193,0.243,0.754,0.781,0.253,0.000,0.000,1.000,0.298,0.029,0.144,0.560,0.428 +21171,87.839,0.000,0.000,6.250,0.073565,790.928,0.000,0.307476,0.134484,classical,0.445,0.000,0.000,0.000,0.188,0.112,0.468,0.781,0.083,0.000,0.000,1.000,0.297,0.028,0.214,0.412,0.514 +22185,87.814,0.000,0.000,5.500,0.089330,1015.663,0.000,0.339204,0.066156,rock,0.377,0.000,0.000,0.000,0.036,0.144,0.526,0.688,0.147,0.000,0.000,0.575,0.259,0.005,0.188,0.422,0.372 +23198,87.367,0.000,0.000,6.250,0.137109,1505.532,0.000,0.417782,0.049285,rock,0.637,0.000,0.000,0.000,0.000,0.244,0.669,0.781,0.287,0.000,0.000,0.170,0.250,0.000,0.127,0.543,0.163 +24212,86.886,0.000,0.000,5.750,0.135035,1360.099,0.000,0.583685,0.062557,rock,0.739,0.000,0.000,0.000,0.028,0.240,0.970,0.719,0.246,0.000,0.000,0.016,0.257,0.004,0.069,0.604,0.035 +25223,108.538,0.000,0.221,6.000,0.130584,1212.783,0.000,0.566394,0.041952,rock,0.716,0.000,0.221,0.000,0.000,0.230,0.939,0.750,0.204,0.000,0.000,0.000,0.191,0.220,-0.025,0.592,0.031 +26237,108.604,0.000,0.229,6.000,0.163683,1684.176,0.000,0.585374,0.028213,rock,0.769,0.000,0.229,0.000,0.000,0.299,0.973,0.750,0.338,0.000,0.000,0.000,0.190,0.224,-0.034,0.647,0.020 +27250,86.914,0.072,0.236,4.750,0.214620,2411.306,0.000,0.648224,0.054981,rock,0.775,0.072,0.236,0.000,0.011,0.405,1.000,0.594,0.546,0.000,0.000,0.000,0.289,0.084,0.073,0.675,0.052 +28250,86.914,0.080,0.228,4.750,0.102405,998.021,0.000,0.565064,0.055326,rock,0.605,0.080,0.228,0.000,0.012,0.172,0.936,0.594,0.142,0.000,0.000,0.000,0.293,0.082,0.088,0.520,0.071 +29252,86.631,0.024,0.205,4.500,0.110174,1180.914,0.000,0.515243,0.092731,rock,0.563,0.024,0.205,0.000,0.095,0.188,0.846,0.563,0.195,0.000,0.000,0.000,0.286,0.086,0.141,0.499,0.106 +30253,86.435,0.023,0.208,4.250,0.361365,4917.811,0.000,0.968122,0.005811,unknown,0.200,0.023,0.208,0.000,0.000,0.711,1.000,0.531,1.000,0.000,0.000,0.002,0.262,0.073,0.090,0.816,0.068 +31254,86.319,0.053,0.251,4.250,0.030043,473.102,0.000,0.122652,0.093525,unknown,0.274,0.053,0.251,0.000,0.097,0.021,0.132,0.531,0.000,0.000,0.000,0.011,0.301,0.102,0.322,0.202,0.331 +32264,86.282,0.016,0.214,5.500,0.028002,401.321,0.000,0.123295,0.061081,unknown,0.256,0.016,0.214,0.000,0.025,0.017,0.133,0.688,0.000,0.000,0.000,0.022,0.264,0.078,0.282,0.249,0.296 +33264,86.282,0.045,0.198,6.500,0.015308,316.285,0.000,0.100756,0.056819,unknown,0.235,0.045,0.198,0.000,0.015,0.000,0.092,0.813,0.000,0.000,0.000,0.021,0.276,0.072,0.261,0.271,0.277 +34270,97.513,0.000,0.000,5.750,0.039840,490.209,0.000,0.166125,0.060109,unknown,0.262,0.000,0.000,0.000,0.022,0.041,0.211,0.719,0.000,0.000,0.000,0.021,0.256,0.003,0.241,0.285,0.264 +35277,102.802,0.000,0.000,6.000,0.093457,921.980,0.000,0.194082,0.035459,rock,0.360,0.000,0.000,0.000,0.000,0.153,0.262,0.750,0.121,0.000,0.000,0.022,0.250,0.047,0.182,0.357,0.242 +36291,103.484,0.000,0.000,6.500,0.070387,714.444,0.042,0.170516,0.038627,rock,0.340,0.000,0.000,0.000,0.000,0.105,0.219,0.813,0.061,0.042,0.083,0.017,0.250,0.068,0.189,0.341,0.233 +37293,104.236,0.000,0.000,5.500,0.074959,662.629,0.096,0.175849,0.015664,unknown,0.280,0.000,0.000,0.000,0.000,0.114,0.229,0.688,0.046,0.096,0.192,0.022,0.250,0.095,0.223,0.304,0.258 +38307,104.783,0.000,0.000,5.000,0.072053,653.021,0.197,0.171308,0.009113,unknown,0.241,0.000,0.000,0.000,0.000,0.108,0.221,0.625,0.044,0.197,0.394,0.005,0.250,0.129,0.264,0.281,0.260 +39321,104.540,0.000,0.000,6.250,0.100870,851.415,0.014,0.229552,0.046805,rock,0.403,0.000,0.000,0.000,0.000,0.168,0.326,0.781,0.100,0.014,0.027,0.024,0.250,0.079,0.153,0.383,0.214 +40332,104.373,0.000,0.000,6.500,0.090356,835.420,0.133,0.201153,0.015891,rock,0.378,0.000,0.000,0.000,0.000,0.147,0.275,0.813,0.096,0.133,0.265,0.000,0.250,0.106,0.196,0.372,0.201 +41346,104.680,0.000,0.000,6.250,0.054402,607.067,0.000,0.150414,0.028979,unknown,0.298,0.000,0.000,0.000,0.000,0.072,0.183,0.781,0.031,0.000,0.000,0.003,0.250,0.078,0.184,0.308,0.251 +42360,131.029,0.000,0.250,6.750,0.071083,791.597,0.055,0.211660,0.059267,rock,0.366,0.000,0.250,0.000,0.021,0.106,0.294,0.844,0.083,0.055,0.110,0.000,0.005,0.354,0.128,0.378,0.195 +43361,131.098,0.000,0.244,6.000,0.081072,749.900,0.037,0.210389,0.046186,rock,0.331,0.000,0.244,0.000,0.000,0.127,0.292,0.750,0.071,0.037,0.073,0.000,0.000,0.344,0.138,0.349,0.221 +44375,105.189,0.000,0.326,4.750,0.117124,1004.744,0.106,0.205667,0.034655,unknown,0.282,0.000,0.326,0.000,0.000,0.202,0.283,0.594,0.144,0.106,0.211,0.000,0.247,0.227,0.224,0.329,0.256 +45388,105.123,0.000,0.333,5.250,0.081871,720.331,0.019,0.202384,0.034558,unknown,0.282,0.000,0.333,0.000,0.000,0.129,0.277,0.656,0.063,0.019,0.038,0.000,0.248,0.207,0.188,0.315,0.251 +46388,105.085,0.000,0.343,5.250,0.068689,667.818,0.000,0.206624,0.015770,unknown,0.278,0.000,0.343,0.000,0.000,0.101,0.285,0.656,0.048,0.000,0.000,0.000,0.249,0.205,0.180,0.310,0.251 +47388,105.058,0.000,0.328,6.250,0.091741,813.283,0.000,0.275119,0.010794,rock,0.415,0.000,0.328,0.000,0.000,0.149,0.409,0.781,0.090,0.000,0.000,0.000,0.249,0.199,0.124,0.402,0.182 +48401,105.304,0.000,0.330,5.750,0.065183,644.049,0.000,0.159492,0.055452,unknown,0.263,0.000,0.330,0.000,0.012,0.094,0.199,0.719,0.041,0.000,0.000,0.000,0.248,0.206,0.190,0.300,0.261 +49401,105.520,0.000,0.292,6.500,0.071255,637.082,0.000,0.143286,0.018067,unknown,0.296,0.000,0.292,0.000,0.000,0.107,0.170,0.813,0.039,0.000,0.000,0.000,0.241,0.194,0.175,0.320,0.246 +50416,105.669,0.000,0.260,7.750,0.070291,976.806,0.026,0.260996,0.034539,rock,0.505,0.000,0.260,0.000,0.000,0.105,0.384,0.969,0.136,0.026,0.053,0.000,0.239,0.192,0.097,0.455,0.140 +51422,105.906,0.000,0.282,7.250,0.054960,590.258,0.000,0.163929,0.023026,rock,0.348,0.000,0.282,0.000,0.000,0.073,0.207,0.906,0.026,0.000,0.000,0.000,0.235,0.197,0.144,0.351,0.211 +52427,105.806,0.000,0.288,6.750,0.090196,951.896,0.000,0.286537,0.027252,rock,0.474,0.000,0.288,0.000,0.000,0.146,0.430,0.844,0.129,0.000,0.000,0.000,0.237,0.198,0.102,0.436,0.160 +53432,105.523,0.000,0.273,6.750,0.091724,825.664,0.160,0.188069,0.074056,rock,0.345,0.000,0.273,0.000,0.053,0.149,0.251,0.844,0.093,0.160,0.319,0.000,0.255,0.235,0.207,0.374,0.198 +54435,105.361,0.000,0.268,6.500,0.097813,927.670,0.163,0.242751,0.035234,rock,0.400,0.000,0.268,0.000,0.000,0.162,0.350,0.813,0.122,0.163,0.326,0.000,0.244,0.224,0.180,0.404,0.175 +55448,105.189,0.000,0.263,8.000,0.082887,692.404,0.214,0.124326,0.026398,rock,0.349,0.000,0.263,0.000,0.000,0.131,0.135,1.000,0.055,0.214,0.428,0.000,0.247,0.232,0.212,0.374,0.188 +56460,105.189,0.000,0.253,7.750,0.053829,557.177,0.182,0.099521,0.009115,unknown,0.299,0.000,0.253,0.000,0.000,0.070,0.090,0.969,0.016,0.182,0.364,0.000,0.247,0.221,0.220,0.332,0.213 +57461,104.649,0.000,0.322,9.250,0.051756,662.883,0.000,0.114801,0.014882,rock,0.347,0.000,0.322,0.000,0.000,0.066,0.118,1.000,0.047,0.000,0.000,0.000,0.250,0.190,0.156,0.357,0.215 +58465,104.490,0.000,0.324,8.250,0.131957,1063.410,0.000,0.294766,0.063523,rock,0.572,0.000,0.324,0.000,0.030,0.233,0.445,1.000,0.161,0.000,0.000,0.000,0.258,0.193,0.081,0.509,0.116 +59467,104.520,0.000,0.308,8.500,0.145620,1627.907,0.000,0.339367,0.032862,rock,0.669,0.000,0.308,0.000,0.000,0.262,0.526,1.000,0.322,0.000,0.000,0.000,0.250,0.183,0.055,0.578,0.092 +60472,104.520,0.000,0.327,8.500,0.101216,932.916,0.187,0.175229,0.025608,rock,0.420,0.000,0.327,0.000,0.000,0.169,0.228,1.000,0.124,0.187,0.374,0.000,0.250,0.237,0.186,0.425,0.163 +61486,104.382,0.000,0.300,6.750,0.050695,612.856,0.205,0.112215,0.131651,unknown,0.229,0.000,0.300,0.000,0.181,0.064,0.113,0.844,0.032,0.205,0.410,0.000,0.295,0.257,0.288,0.305,0.235 +62491,104.263,0.000,0.317,7.000,0.358852,4903.823,0.292,0.941385,0.006999,unknown,0.200,0.000,0.317,0.000,0.000,0.706,1.000,0.875,1.000,0.292,0.585,0.000,0.250,0.255,0.051,0.918,-0.048 +63494,104.351,0.000,0.309,5.500,0.052632,1489.820,0.398,0.257979,0.014074,classical,0.422,0.000,0.309,0.000,0.000,0.068,0.378,0.688,0.283,0.398,0.796,1.000,0.250,0.280,0.275,0.401,0.525 +64504,104.351,0.002,0.298,6.500,0.142195,1353.483,0.000,0.427266,0.055397,rock,0.487,0.002,0.298,0.000,0.012,0.255,0.686,0.813,0.244,0.000,0.000,1.000,0.254,0.179,0.056,0.549,0.441 +65516,104.351,0.000,0.272,3.250,0.094785,1011.766,0.000,0.262917,0.195204,classical,0.588,0.000,0.272,0.000,0.323,0.156,0.387,0.406,0.146,0.000,0.000,1.000,0.331,0.216,0.274,0.298,0.632 +66527,103.783,0.000,0.299,4.000,0.072916,773.498,0.000,0.234073,0.112783,classical,0.616,0.000,0.299,0.000,0.140,0.110,0.335,0.500,0.078,0.000,0.000,1.000,0.285,0.189,0.236,0.286,0.625 +67527,102.920,0.000,0.283,3.750,0.135621,1713.565,0.000,0.480307,0.024620,rock,0.384,0.000,0.283,0.000,0.000,0.241,0.782,0.469,0.347,0.000,0.000,1.000,0.250,0.148,0.108,0.498,0.498 +68541,102.374,0.000,0.245,3.000,0.116818,1330.094,0.000,0.455167,0.063176,classical,0.477,0.000,0.245,0.000,0.029,0.202,0.737,0.375,0.237,0.000,0.000,1.000,0.257,0.130,0.148,0.423,0.535 +69544,102.214,0.000,0.267,5.000,0.059203,626.564,0.000,0.189443,0.111645,classical,0.615,0.000,0.267,0.000,0.137,0.082,0.254,0.625,0.036,0.000,0.000,1.000,0.284,0.151,0.241,0.285,0.618 +70544,102.214,0.000,0.263,5.000,0.179106,1832.671,0.000,0.363740,0.053764,classical,0.408,0.000,0.263,0.000,0.008,0.331,0.570,0.625,0.381,0.000,0.000,1.000,0.252,0.130,0.136,0.504,0.523 +71555,102.190,0.000,0.228,6.500,0.102342,1444.068,0.113,0.300647,0.121749,classical,0.379,0.000,0.228,0.000,0.159,0.172,0.456,0.813,0.270,0.113,0.225,1.000,0.290,0.168,0.191,0.474,0.499 +72556,102.190,0.000,0.251,5.500,0.168337,1952.929,0.000,0.573533,0.031959,rock,0.645,0.000,0.251,0.000,0.000,0.309,0.952,0.688,0.415,0.000,0.000,1.000,0.250,0.124,0.027,0.642,0.393 +73571,81.937,0.000,0.000,5.000,0.036443,563.016,0.000,0.149791,0.034156,classical,0.684,0.000,0.000,0.000,0.000,0.034,0.181,0.625,0.018,0.000,0.000,1.000,0.199,0.000,0.280,0.252,0.639 +74572,81.937,0.000,0.000,4.500,0.152020,1553.863,0.000,0.392877,0.035107,classical,0.448,0.000,0.000,0.000,0.000,0.275,0.623,0.563,0.301,0.000,0.000,1.000,0.199,0.000,0.182,0.472,0.522 +75577,81.937,0.000,0.000,4.250,0.120569,1811.827,0.000,0.652682,0.021882,rock,0.582,0.000,0.000,0.000,0.000,0.210,1.000,0.531,0.375,0.000,0.000,1.000,0.199,0.000,0.094,0.585,0.417 +76584,81.937,0.000,0.000,4.500,0.074148,743.685,0.000,0.297265,0.194732,classical,0.541,0.000,0.000,0.000,0.322,0.113,0.450,0.563,0.070,0.000,0.000,1.000,0.279,0.048,0.289,0.338,0.575 +77585,81.937,0.000,0.000,4.750,0.114675,1303.328,0.000,0.368486,0.017205,classical,0.426,0.000,0.000,0.000,0.000,0.197,0.579,0.594,0.230,0.000,0.000,0.876,0.199,0.000,0.186,0.439,0.484 +78599,81.937,0.000,0.000,3.750,0.119255,1238.339,0.000,0.344586,0.056858,rock,0.381,0.000,0.000,0.000,0.015,0.207,0.536,0.469,0.211,0.000,0.000,0.197,0.203,0.002,0.225,0.385,0.291 +79609,81.937,0.000,0.000,4.000,0.159176,1882.935,0.000,0.439851,0.097378,rock,0.560,0.000,0.000,0.000,0.105,0.290,0.709,0.500,0.395,0.000,0.000,0.168,0.225,0.016,0.194,0.505,0.221 +80622,81.937,0.000,0.000,5.250,0.082413,839.171,0.000,0.150936,0.040921,classical,0.321,0.000,0.000,0.000,0.000,0.130,0.184,0.656,0.097,0.000,0.000,0.191,0.199,0.000,0.273,0.296,0.348 +81634,82.310,0.000,0.000,6.250,0.136440,1760.190,0.026,0.363549,0.119094,rock,0.601,0.000,0.000,0.000,0.154,0.243,0.570,0.781,0.360,0.026,0.053,0.114,0.244,0.030,0.190,0.532,0.171 +82637,103.155,0.000,0.192,5.250,0.120275,1541.117,0.177,0.339672,0.131680,rock,0.440,0.000,0.192,0.000,0.182,0.209,0.527,0.656,0.297,0.177,0.355,0.114,0.295,0.191,0.222,0.461,0.200 +83638,103.314,0.000,0.194,4.750,0.085572,901.642,0.000,0.161475,0.138245,unknown,0.259,0.000,0.194,0.000,0.196,0.137,0.203,0.594,0.115,0.000,0.000,0.100,0.299,0.153,0.264,0.288,0.326 +84650,82.603,0.000,0.201,5.750,0.093714,1120.968,0.000,0.211097,0.165506,rock,0.320,0.000,0.201,0.000,0.257,0.154,0.293,0.719,0.177,0.000,0.000,0.095,0.274,0.109,0.284,0.371,0.266 +85651,82.496,0.000,0.229,4.750,0.072050,924.403,0.000,0.178488,0.125998,unknown,0.254,0.000,0.229,0.000,0.169,0.108,0.234,0.594,0.121,0.000,0.000,0.095,0.250,0.105,0.307,0.295,0.315 +86655,82.387,0.000,0.178,4.250,0.099123,1141.862,0.000,0.212739,0.221748,unknown,0.261,0.000,0.178,0.000,0.382,0.165,0.296,0.531,0.183,0.000,0.000,0.095,0.302,0.120,0.346,0.319,0.312 +87665,82.322,0.019,0.186,1.250,0.099470,1547.827,0.246,0.297516,0.087449,hiphop,0.328,0.019,0.186,0.000,0.083,0.166,0.450,0.156,0.299,0.246,0.491,0.091,0.236,0.139,0.394,0.282,0.333 +88678,82.251,0.016,0.231,1.250,0.095816,984.636,0.000,0.175296,0.112529,classical,0.367,0.016,0.231,0.000,0.139,0.158,0.228,0.156,0.138,0.000,0.000,0.090,0.247,0.102,0.387,0.174,0.424 +89681,82.222,0.080,0.195,1.250,0.091228,799.502,0.000,0.150782,0.085064,classical,0.387,0.080,0.195,0.000,0.078,0.148,0.183,0.156,0.086,0.000,0.000,0.080,0.263,0.080,0.377,0.145,0.434 +90681,81.901,0.123,0.172,1.000,0.121518,1427.089,0.000,0.322188,0.035379,unknown,0.286,0.123,0.172,0.000,0.000,0.211,0.495,0.125,0.265,0.000,0.000,0.038,0.260,0.060,0.283,0.284,0.334 +91695,81.813,0.070,0.172,5.750,0.084369,887.631,0.014,0.166389,0.128231,unknown,0.278,0.070,0.172,0.000,0.174,0.134,0.212,0.719,0.111,0.014,0.028,0.019,0.275,0.090,0.282,0.327,0.262 +92710,81.716,0.086,0.179,6.250,0.155270,1893.378,0.030,0.450220,0.075396,rock,0.701,0.086,0.179,0.000,0.056,0.282,0.728,0.781,0.398,0.030,0.060,0.000,0.252,0.079,0.119,0.594,0.083 +93756,81.707,0.082,0.178,6.750,0.111175,1235.930,0.000,0.272393,0.140959,rock,0.472,0.082,0.178,0.000,0.202,0.190,0.404,0.844,0.210,0.000,0.000,0.000,0.287,0.093,0.208,0.455,0.168 +94759,81.810,0.000,0.217,7.250,0.115065,1603.118,0.000,0.423942,0.114473,rock,0.695,0.000,0.217,0.000,0.143,0.198,0.680,0.906,0.315,0.000,0.000,0.000,0.233,0.098,0.127,0.584,0.069 +95770,81.792,0.061,0.194,5.000,0.111571,1349.278,0.034,0.275873,0.092656,rock,0.393,0.061,0.194,0.000,0.095,0.191,0.411,0.625,0.243,0.034,0.069,0.000,0.251,0.091,0.242,0.400,0.217 +96782,81.864,0.000,0.222,5.250,0.168612,1915.874,0.036,0.438116,0.061644,rock,0.658,0.000,0.222,0.000,0.026,0.310,0.706,0.656,0.405,0.036,0.073,0.000,0.204,0.091,0.158,0.556,0.121 +97784,81.972,0.044,0.210,5.750,0.136899,1385.979,0.108,0.282921,0.139212,rock,0.431,0.044,0.210,0.000,0.198,0.244,0.423,0.719,0.253,0.108,0.216,0.000,0.271,0.130,0.266,0.442,0.182 +98786,61.479,0.072,0.225,5.250,0.123275,1034.867,0.151,0.234489,0.142001,rock,0.399,0.072,0.225,0.000,0.204,0.215,0.335,0.656,0.153,0.151,0.302,0.000,0.087,0.147,0.210,0.368,0.220 +99800,81.945,0.050,0.199,6.000,0.114670,1054.016,0.023,0.211069,0.047302,rock,0.388,0.050,0.199,0.000,0.000,0.197,0.293,0.750,0.158,0.023,0.045,0.000,0.224,0.075,0.226,0.382,0.222 +100814,82.010,0.000,0.231,6.000,0.059923,692.345,0.000,0.107511,0.116559,unknown,0.258,0.000,0.231,0.000,0.148,0.083,0.105,0.750,0.055,0.000,0.000,0.000,0.237,0.103,0.303,0.283,0.281 +101826,82.182,0.000,0.214,6.250,0.022093,310.018,0.000,0.037311,0.050413,unknown,0.280,0.000,0.214,0.000,0.001,0.004,0.000,0.781,0.000,0.000,0.000,0.000,0.203,0.075,0.294,0.235,0.305 +102841,82.281,0.000,0.233,5.250,0.288516,2840.617,0.000,0.677153,0.012285,rock,0.859,0.000,0.233,0.000,0.000,0.559,1.000,0.656,0.669,0.000,0.000,0.000,0.205,0.082,0.069,0.748,0.036 +103855,82.349,0.000,0.219,4.500,0.172444,2483.410,0.045,0.593286,0.067857,rock,0.776,0.000,0.219,0.000,0.040,0.318,0.988,0.563,0.567,0.045,0.090,0.000,0.216,0.094,0.112,0.654,0.059 +104867,82.396,0.000,0.211,4.500,0.076306,972.856,0.000,0.247006,0.065850,rock,0.309,0.000,0.211,0.000,0.035,0.117,0.358,0.563,0.135,0.000,0.000,0.000,0.215,0.079,0.255,0.328,0.252 +105877,82.402,0.000,0.235,6.000,0.172406,1861.206,0.000,0.522046,0.077175,rock,0.753,0.000,0.235,0.000,0.060,0.318,0.858,0.750,0.389,0.000,0.000,0.000,0.222,0.091,0.098,0.627,0.055 +106887,82.402,0.000,0.221,5.250,0.103262,961.552,0.000,0.215522,0.117017,rock,0.313,0.000,0.221,0.000,0.149,0.173,0.301,0.656,0.132,0.000,0.000,0.000,0.244,0.100,0.273,0.346,0.246 +107901,82.402,0.000,0.220,5.000,0.254436,2617.210,0.000,0.588305,0.028676,rock,0.828,0.000,0.220,0.000,0.000,0.488,0.979,0.625,0.605,0.000,0.000,0.000,0.207,0.077,0.080,0.706,0.050 +108915,82.472,0.000,0.216,5.750,0.070745,788.437,0.000,0.257905,0.140319,rock,0.348,0.000,0.216,0.000,0.201,0.106,0.378,0.719,0.082,0.000,0.000,0.000,0.258,0.106,0.252,0.365,0.207 +109918,82.472,0.000,0.251,5.500,0.096672,1363.381,0.000,0.320246,0.077386,rock,0.476,0.000,0.251,0.000,0.061,0.160,0.491,0.688,0.247,0.000,0.000,0.000,0.223,0.097,0.202,0.439,0.181 +110931,82.472,0.000,0.207,4.000,0.184187,2248.664,0.139,0.643953,0.041023,rock,0.743,0.000,0.207,0.000,0.000,0.342,1.000,0.500,0.500,0.139,0.278,0.000,0.208,0.107,0.142,0.626,0.061 +111944,82.472,0.000,0.261,4.750,0.170157,1556.865,0.000,0.348190,0.123277,rock,0.481,0.000,0.261,0.000,0.163,0.313,0.542,0.594,0.302,0.000,0.000,0.000,0.249,0.116,0.228,0.463,0.189 +112957,82.384,0.000,0.253,4.500,0.167672,1567.493,0.029,0.358911,0.076029,rock,0.493,0.000,0.253,0.000,0.058,0.308,0.562,0.563,0.305,0.029,0.059,0.000,0.221,0.105,0.217,0.460,0.188 +113961,81.955,0.000,0.254,4.500,0.204600,2032.568,0.000,0.415048,0.095682,rock,0.602,0.000,0.254,0.000,0.102,0.385,0.664,0.563,0.438,0.000,0.000,0.000,0.225,0.104,0.192,0.535,0.160 +114963,81.659,0.000,0.218,6.500,0.165629,1985.705,0.019,0.411795,0.068376,rock,0.709,0.000,0.218,0.000,0.041,0.303,0.658,0.813,0.424,0.019,0.038,0.000,0.205,0.087,0.137,0.593,0.098 +115978,81.514,0.000,0.226,6.000,0.156446,1764.552,0.000,0.364208,0.142785,rock,0.589,0.000,0.226,0.000,0.206,0.284,0.571,0.750,0.361,0.000,0.000,0.000,0.243,0.110,0.198,0.529,0.141 +116978,81.514,0.000,0.212,7.000,0.066384,675.592,0.000,0.149840,0.098715,rock,0.333,0.000,0.212,0.000,0.108,0.097,0.182,0.875,0.050,0.000,0.000,0.000,0.219,0.090,0.251,0.344,0.227 +117978,81.514,0.000,0.223,6.250,0.133564,1931.548,0.000,0.412183,0.177319,rock,0.638,0.000,0.223,0.000,0.283,0.237,0.659,0.781,0.409,0.000,0.000,0.000,0.263,0.120,0.186,0.570,0.107 +118980,81.514,0.000,0.200,7.500,0.059368,689.348,0.000,0.129954,0.401913,unknown,0.276,0.000,0.200,0.000,0.782,0.082,0.145,0.938,0.054,0.000,0.000,0.018,0.387,0.187,0.383,0.351,0.228 +119994,89.000,0.000,0.218,7.500,0.096764,983.913,0.222,0.269455,0.146696,rock,0.431,0.000,0.218,0.000,0.215,0.160,0.399,0.938,0.138,0.222,0.443,0.141,0.304,0.164,0.272,0.460,0.173 diff --git a/tests/rock2.csv.import b/tests/rock2.csv.import new file mode 100644 index 0000000..6163dce --- /dev/null +++ b/tests/rock2.csv.import @@ -0,0 +1,19 @@ +[remap] + +importer="csv_translation" +type="Translation" +uid="uid://fcfafqq3p3rj" + +[deps] + +files=["res://tests/rock2.bpm.translation", "res://tests/rock2.dembow.translation", "res://tests/rock2.fourfloor.translation", "res://tests/rock2.density.translation", "res://tests/rock2.flatness.translation", "res://tests/rock2.centroid.translation", "res://tests/rock2.regularity.translation", "res://tests/rock2.highRatio.translation", "res://tests/rock2.lowRatio.translation", "res://tests/rock2.label.translation", "res://tests/rock2.conf.translation", "res://tests/rock2.f0.translation", "res://tests/rock2.f1.translation", "res://tests/rock2.f2.translation", "res://tests/rock2.f3.translation", "res://tests/rock2.f4.translation", "res://tests/rock2.f5.translation", "res://tests/rock2.f6.translation", "res://tests/rock2.f7.translation", "res://tests/rock2.f8.translation", "res://tests/rock2.f9.translation", "res://tests/rock2.f10.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation"] + +source_file="res://tests/rock2.csv" +dest_files=["res://tests/rock2.bpm.translation", "res://tests/rock2.dembow.translation", "res://tests/rock2.fourfloor.translation", "res://tests/rock2.density.translation", "res://tests/rock2.flatness.translation", "res://tests/rock2.centroid.translation", "res://tests/rock2.regularity.translation", "res://tests/rock2.highRatio.translation", "res://tests/rock2.lowRatio.translation", "res://tests/rock2.label.translation", "res://tests/rock2.conf.translation", "res://tests/rock2.f0.translation", "res://tests/rock2.f1.translation", "res://tests/rock2.f2.translation", "res://tests/rock2.f3.translation", "res://tests/rock2.f4.translation", "res://tests/rock2.f5.translation", "res://tests/rock2.f6.translation", "res://tests/rock2.f7.translation", "res://tests/rock2.f8.translation", "res://tests/rock2.f9.translation", "res://tests/rock2.f10.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation", "res://tests/rock2.s.translation"] + +[params] + +compress=1 +delimiter=0 +unescape_keys=false +unescape_translations=true diff --git a/tests/rock2.dembow.translation b/tests/rock2.dembow.translation new file mode 100644 index 0000000..420f303 Binary files /dev/null and b/tests/rock2.dembow.translation differ diff --git a/tests/rock2.density.translation b/tests/rock2.density.translation new file mode 100644 index 0000000..5dfb346 Binary files /dev/null and b/tests/rock2.density.translation differ diff --git a/tests/rock2.f0.translation b/tests/rock2.f0.translation new file mode 100644 index 0000000..37732e0 Binary files /dev/null and b/tests/rock2.f0.translation differ diff --git a/tests/rock2.f1.translation b/tests/rock2.f1.translation new file mode 100644 index 0000000..e84fdda Binary files /dev/null and b/tests/rock2.f1.translation differ diff --git a/tests/rock2.f10.translation b/tests/rock2.f10.translation new file mode 100644 index 0000000..2a75ecc Binary files /dev/null and b/tests/rock2.f10.translation differ diff --git a/tests/rock2.f2.translation b/tests/rock2.f2.translation new file mode 100644 index 0000000..0753253 Binary files /dev/null and b/tests/rock2.f2.translation differ diff --git a/tests/rock2.f3.translation b/tests/rock2.f3.translation new file mode 100644 index 0000000..405d529 Binary files /dev/null and b/tests/rock2.f3.translation differ diff --git a/tests/rock2.f4.translation b/tests/rock2.f4.translation new file mode 100644 index 0000000..2a464db Binary files /dev/null and b/tests/rock2.f4.translation differ diff --git a/tests/rock2.f5.translation b/tests/rock2.f5.translation new file mode 100644 index 0000000..d4564cc Binary files /dev/null and b/tests/rock2.f5.translation differ diff --git a/tests/rock2.f6.translation b/tests/rock2.f6.translation new file mode 100644 index 0000000..6e67196 Binary files /dev/null and b/tests/rock2.f6.translation differ diff --git a/tests/rock2.f7.translation b/tests/rock2.f7.translation new file mode 100644 index 0000000..32cd90c Binary files /dev/null and b/tests/rock2.f7.translation differ diff --git a/tests/rock2.f8.translation b/tests/rock2.f8.translation new file mode 100644 index 0000000..12a45f9 Binary files /dev/null and b/tests/rock2.f8.translation differ diff --git a/tests/rock2.f9.translation b/tests/rock2.f9.translation new file mode 100644 index 0000000..f4f1e55 Binary files /dev/null and b/tests/rock2.f9.translation differ diff --git a/tests/rock2.flatness.translation b/tests/rock2.flatness.translation new file mode 100644 index 0000000..73f988c Binary files /dev/null and b/tests/rock2.flatness.translation differ diff --git a/tests/rock2.fourfloor.translation b/tests/rock2.fourfloor.translation new file mode 100644 index 0000000..64a8f8e Binary files /dev/null and b/tests/rock2.fourfloor.translation differ diff --git a/tests/rock2.highRatio.translation b/tests/rock2.highRatio.translation new file mode 100644 index 0000000..60592a9 Binary files /dev/null and b/tests/rock2.highRatio.translation differ diff --git a/tests/rock2.label.translation b/tests/rock2.label.translation new file mode 100644 index 0000000..06ae0c2 Binary files /dev/null and b/tests/rock2.label.translation differ diff --git a/tests/rock2.lowRatio.translation b/tests/rock2.lowRatio.translation new file mode 100644 index 0000000..7505318 Binary files /dev/null and b/tests/rock2.lowRatio.translation differ diff --git a/tests/rock2.regularity.translation b/tests/rock2.regularity.translation new file mode 100644 index 0000000..04c0268 Binary files /dev/null and b/tests/rock2.regularity.translation differ diff --git a/tests/rock2.s.translation b/tests/rock2.s.translation new file mode 100644 index 0000000..86a1863 Binary files /dev/null and b/tests/rock2.s.translation differ diff --git a/tools/analyze-features.ps1 b/tools/analyze-features.ps1 new file mode 100644 index 0000000..eebf81b --- /dev/null +++ b/tools/analyze-features.ps1 @@ -0,0 +1,73 @@ +<# +.SYNOPSIS + Analizza i CSV prodotti da capture-features.ps1. + +.DESCRIPTION + Per ogni file riporta: + - distribuzione delle etichette emesse; + - media delle feature NORMALIZZATE (cio' che il classificatore vede davvero); + - media dei punteggi grezzi per classe e il divario rispetto alla vincente. + + Serve a rispondere a "perche' sbaglia su questo genere" invece di + ritoccare i pesi a caso. + +.PARAMETER Csv + Uno o piu' file CSV. Il nome del file viene usato come etichetta. + +.PARAMETER SkipSeconds + Righe iniziali da scartare (warm-up del folding ritmico). + +.EXAMPLE + powershell -ExecutionPolicy Bypass -File tools\analyze-features.ps1 -Csv C:\temp\rock.csv,C:\temp\hiphop.csv +#> +param( + [Parameter(Mandatory = $true)][string[]]$Csv, + [int]$SkipSeconds = 16 +) + +$featureNames = @( + "dembow", "fourFloor", "tempo(latin)", "lowRatio", "flatness", + "highRatio", "density", "centroid", "regularity", "regMid", "dynamics" +) +$classCols = @("s_latin", "s_electronic", "s_hiphop", "s_rock", "s_classical") + +foreach ($path in $Csv) { + if (-not (Test-Path $path)) { Write-Host "manca: $path" -ForegroundColor Yellow; continue } + $all = @(Import-Csv $path) + $rows = @($all | Select-Object -Skip $SkipSeconds) + if ($rows.Count -eq 0) { Write-Host "nessuna riga utile in $path" -ForegroundColor Yellow; continue } + + Write-Host "" + Write-Host ("=== {0} ({1} righe utili) ===" -f (Split-Path -Leaf $path), $rows.Count) -ForegroundColor Cyan + + Write-Host "etichette:" + $rows | Group-Object label | Sort-Object Count -Descending | + ForEach-Object { Write-Host (" {0,-11} {1,3} ({2:P0})" -f $_.Name, $_.Count, ($_.Count / $rows.Count)) } + + Write-Host "feature normalizzate (media):" + for ($i = 0; $i -lt $featureNames.Count; $i++) { + $col = "f{0}_*" -f $i + $name = ($rows[0].PSObject.Properties.Name | Where-Object { $_ -like $col } | Select-Object -First 1) + if (-not $name) { continue } + $avg = ($rows | Measure-Object -Property $name -Average).Average + $bar = "#" * [int]([math]::Round($avg * 30)) + Write-Host (" {0,-14} {1,5:F2} {2}" -f $featureNames[$i], $avg, $bar) + } + + Write-Host "punteggi grezzi (media):" + $scores = @{} + foreach ($c in $classCols) { + $scores[$c] = ($rows | Measure-Object -Property $c -Average).Average + } + $best = ($scores.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 1) + foreach ($c in $classCols) { + $v = $scores[$c] + $gap = $v - $best.Value + $color = if ($c -eq $best.Key) { "Green" } else { "Gray" } + Write-Host (" {0,-14} {1,5:F2} ({2,6:F2})" -f $c.Substring(2), $v, $gap) -ForegroundColor $color + } +} + +Write-Host "" +Write-Host "Nota: 'dynamics' alta premia classical; 'flatness' bassa penalizza rock;" +Write-Host " 'tempo(latin)' e' zero fuori da 85-105 BPM." diff --git a/tools/capture-features.ps1 b/tools/capture-features.ps1 new file mode 100644 index 0000000..21899e0 --- /dev/null +++ b/tools/capture-features.ps1 @@ -0,0 +1,68 @@ +<# +.SYNOPSIS + Registra le feature del classificatore di genere su audio reale. + +.DESCRIPTION + Avvia bin\LoopbackCapture.exe con --dump-features, lascia girare la cattura + per N secondi (durante i quali riproduci i brani da analizzare) e chiude. + + Registra una riga al secondo con feature grezze, feature normalizzate e + punteggi grezzi di ogni classe. Serve alla taratura: senza questi numeri + ogni modifica alle costanti e' un'ipotesi. + +.PARAMETER Out + File CSV di destinazione. Un file per genere e' la scelta piu' comoda: + rock.csv, hiphop.csv, ... + +.PARAMETER Seconds + Durata della cattura. Lascia almeno 20 s per brano: il primo 10-15% e' + warm-up (4 battute) e viene scartato in analisi. + +.PARAMETER Port + Porta di lavoro. Non usare 4242 se il gioco e' in esecuzione. + +.EXAMPLE + powershell -ExecutionPolicy Bypass -File tools\capture-features.ps1 -Out C:\temp\rock.csv -Seconds 120 +#> +param( + [Parameter(Mandatory = $true)][string]$Out, + [int]$Seconds = 90, + [int]$Port = 4340 +) + +$ErrorActionPreference = "Stop" +$root = Split-Path -Parent $PSScriptRoot +$exe = Join-Path $root "bin\LoopbackCapture.exe" +if (-not (Test-Path $exe)) { throw "non trovato: $exe" } + +$Out = [IO.Path]::GetFullPath($Out) +$dir = Split-Path -Parent $Out +if ($dir -and -not (Test-Path $dir)) { New-Item -ItemType Directory -Force -Path $dir | Out-Null } +if (Test-Path $Out) { Remove-Item $Out -Force } + +$proc = Start-Process -FilePath $exe -ArgumentList "$Port", "0", "--dump-features=$Out" -PassThru -WindowStyle Hidden +Start-Sleep -Milliseconds 800 +if ($proc.HasExited) { throw "il bridge e' uscito subito (exit $($proc.ExitCode)). Controlla la porta $Port." } + +Write-Host "" +Write-Host " Registrazione avviata. Riproduci ORA i brani." -ForegroundColor Green +Write-Host " Durata: $Seconds s. Finestra: $Out" +Write-Host "" + +$sw = [Diagnostics.Stopwatch]::StartNew() +while ($sw.Elapsed.TotalSeconds -lt $Seconds) { + $left = [int]($Seconds - $sw.Elapsed.TotalSeconds) + Write-Host ("`r {0,3} s rimanenti " -f $left) -NoNewline + Start-Sleep -Milliseconds 500 + if ($proc.HasExited) { Write-Host ""; Write-Host " il bridge e' terminato in anticipo (exit $($proc.ExitCode))" -ForegroundColor Yellow; break } +} +Write-Host "" + +if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force } +Start-Sleep -Milliseconds 400 + +if (-not (Test-Path $Out)) { throw "nessun file prodotto: $Out" } +$rows = (Get-Content $Out | Measure-Object -Line).Lines - 1 +Write-Host (" Righe raccolte: {0}" -f $rows) -ForegroundColor Green +Write-Host (" File: {0}" -f $Out) +if ($rows -lt 10) { Write-Host " Poche righe: l'audio era fermo o troppo basso?" -ForegroundColor Yellow } diff --git a/tools/genre-regression.ps1 b/tools/genre-regression.ps1 new file mode 100644 index 0000000..0e51924 --- /dev/null +++ b/tools/genre-regression.ps1 @@ -0,0 +1,273 @@ +<# +.SYNOPSIS + Regressione del classificatore di genere su pattern sintetici. + +.DESCRIPTION + Genera pattern ritmici/timbrici noti, li riproduce sull'uscita audio di default + e raccoglie le etichette GENR emesse da bin\LoopbackCapture.exe. + + Serve a verificare che una modifica alle costanti del classificatore + (bin\LoopbackCapture.cs, blocco TUNING TABLE) non abbia rotto il + riconoscimento dei casi elementari. NON sostituisce la taratura su musica + reale etichettata: i timbri sintetici sono grezzi e le confidenze non sono + confrontabili con quelle su brani veri. + +.PARAMETER Seconds + Durata della riproduzione per ogni pattern. Deve coprire almeno 4 battute + al tempo piu' lento (70 BPM = 13,7 s) piu' il tempo di aggancio del BPM. + +.PARAMETER Port + Porta UDP di lavoro. Non usare 4242 se il gioco e' in esecuzione. + +.EXAMPLE + powershell -ExecutionPolicy Bypass -File tools\genre-regression.ps1 +#> +param( + [int]$Seconds = 24, + [int]$Port = 4316, + [string]$Only = "" +) + +$ErrorActionPreference = "Stop" +$root = Split-Path -Parent $PSScriptRoot +$exe = Join-Path $root "bin\LoopbackCapture.exe" +if (-not (Test-Path $exe)) { throw "non trovato: $exe" } + +$work = Join-Path $env:TEMP "ldcc-patterns" +New-Item -ItemType Directory -Force -Path $work | Out-Null + +# --- Sintesi --------------------------------------------------------------- +# C# 5: Add-Type su Windows PowerShell 5.1 non accetta sintassi moderna. +if (-not ("LdccSynth" -as [type])) { +Add-Type -TypeDefinition @' +using System; using System.IO; using System.Text; +public static class LdccSynth +{ + const int SR = 44100; + + public static void Build(string path, string kind, double bpm, double seconds) + { + int n = (int)(SR * seconds); + short[] buf = new short[n]; + double sixteenth = 60.0 / bpm / 4.0; + var rnd = new Random(7); + int[] kick, snare, hat; + bool chord = false, tone = false; + + switch (kind) + { + case "dembow": kick = new int[] { 0, 8 }; snare = new int[] { 0,3,6,8,11,14 }; hat = new int[0]; break; + case "fourfloor": kick = new int[] { 0,4,8,12 }; snare = new int[0]; hat = new int[] { 2,6,10,14 }; break; + case "backbeat": kick = new int[] { 0,6,8 }; snare = new int[] { 4,12 }; hat = new int[] { 0,2,4,6,8,10,12,14 }; chord = true; break; + case "boombap": kick = new int[] { 0,6 }; snare = new int[] { 4,12 }; hat = new int[] { 2,6,10,14 }; break; + case "classical": kick = new int[0]; snare = new int[0]; hat = new int[0]; tone = true; break; + default: throw new ArgumentException("kind sconosciuto: " + kind); + } + + for (int b = 0; ; b++) + { + double barStart = b * 16 * sixteenth; + if (barStart >= seconds) break; + foreach (int s in kick) AddKick(buf, barStart + s * sixteenth, 0.85); + foreach (int s in snare) AddSnare(buf, barStart + s * sixteenth, 0.45, rnd); + foreach (int s in hat) AddHat(buf, barStart + s * sixteenth, 0.18, rnd); + if (chord) AddChord(buf, barStart, sixteenth * 8, 0.30, rnd); + } + if (tone) AddTones(buf, seconds, rnd); + + for (int i = 0; i < n; i++) + { + if (buf[i] > 30000) buf[i] = 30000; + if (buf[i] < -30000) buf[i] = -30000; + } + byte[] data = new byte[n * 2]; + Buffer.BlockCopy(buf, 0, data, 0, data.Length); + using (var f = File.Create(path)) + using (var w = new BinaryWriter(f)) + { + w.Write(Encoding.ASCII.GetBytes("RIFF")); w.Write(36 + data.Length); + w.Write(Encoding.ASCII.GetBytes("WAVEfmt ")); w.Write(16); + w.Write((short)1); w.Write((short)1); + w.Write(SR); w.Write(SR * 2); w.Write((short)2); w.Write((short)16); + w.Write(Encoding.ASCII.GetBytes("data")); w.Write(data.Length); + w.Write(data); + } + } + + static void Add(short[] b, int idx, double v) + { + if (idx < 0 || idx >= b.Length) return; + double s = b[idx] + v * 32000.0; + if (s > 30000) s = 30000; + if (s < -30000) s = -30000; + b[idx] = (short)s; + } + + static void AddKick(short[] b, double t0, double amp) + { + int s0 = (int)(t0 * SR), len = (int)(0.35 * SR); + for (int i = 0; i < len; i++) + { + double t = (double)i / SR; + double phase = 2 * Math.PI * (55 * t + (1 - Math.Exp(-t * 40)) / 40); + Add(b, s0 + i, Math.Sin(phase) * Math.Exp(-t * 16) * amp); + } + } + + static void AddSnare(short[] b, double t0, double amp, Random rnd) + { + int s0 = (int)(t0 * SR), len = (int)(0.15 * SR); + for (int i = 0; i < len; i++) + { + double t = (double)i / SR; + double noise = (rnd.NextDouble() * 2 - 1) * Math.Exp(-t * 28); + double body = Math.Sin(2 * Math.PI * 190 * t) * Math.Exp(-t * 30) * 0.4; + Add(b, s0 + i, (noise + body) * amp); + } + } + + static void AddHat(short[] b, double t0, double amp, Random rnd) + { + int s0 = (int)(t0 * SR), len = (int)(0.04 * SR); + double prev = 0; + for (int i = 0; i < len; i++) + { + double t = (double)i / SR; + double x = (rnd.NextDouble() * 2 - 1); + double hp = x - prev; prev = x; // differenziatore: enfasi sugli acuti + Add(b, s0 + i, hp * Math.Exp(-t * 90) * amp); + } + } + + // Accordo distorto: armoniche dense + clipping => spettro piatto, alta energia acuta. + static void AddChord(short[] b, double t0, double dur, double amp, Random rnd) + { + int s0 = (int)(t0 * SR), len = (int)(dur * SR); + double[] roots = { 110.0, 146.83, 164.81 }; + for (int i = 0; i < len; i++) + { + double t = (double)i / SR; + double env = Math.Exp(-t * 3.0); + double v = 0; + foreach (double f in roots) + { + for (int h = 1; h <= 20; h++) + v += Math.Sin(2 * Math.PI * f * h * t + h) / h; + } + double pick = (i < (int)(0.02 * SR)) ? (rnd.NextDouble() * 2 - 1) * 0.5 : 0; + v = Math.Tanh(v * 6.0) * env * amp / 10.0 + pick * 0.25; + Add(b, s0 + i, v); + } + } + + // Arpeggio lento con dinamica ampia: poca percussione, onset radi. + static void AddTones(short[] b, double seconds, Random rnd) + { + double[] notes = { 220.0, 261.63, 329.63, 392.0, 329.63, 261.63 }; + double t = 0; + int i = 0; + while (t < seconds) + { + double f = notes[i % notes.Length]; + double dur = 1.6 + rnd.NextDouble() * 1.2; + double amp = 0.12 + rnd.NextDouble() * 0.5; + int s0 = (int)(t * SR), len = (int)(dur * SR); + for (int k = 0; k < len; k++) + { + double tt = (double)k / SR; + double env = Math.Exp(-tt * 1.2) * (1 - Math.Exp(-tt * 60)); + double v = (Math.Sin(2 * Math.PI * f * tt) + 0.3 * Math.Sin(4 * Math.PI * f * tt)) * env * amp; + Add(b, s0 + k, v); + } + t += dur * 0.85; i++; + } + } +} +'@ -ErrorAction Stop +} + +$patterns = @( + @{ Name = "dembow-95"; Kind = "dembow" }, + @{ Name = "fourfloor-126"; Kind = "fourfloor" }, + @{ Name = "backbeat-140"; Kind = "backbeat" }, + @{ Name = "boombap-90"; Kind = "boombap" }, + @{ Name = "classical-70"; Kind = "classical" } +) + +$expected = @{ + "dembow-95" = "latin" + "fourfloor-126" = "electronic" + "backbeat-140" = "rock" + "boombap-90" = "hiphop" + "classical-70" = "classical" +} + +$results = @() + +foreach ($pat in $patterns) { + if ($Only -and $pat.Name -ne $Only) { continue } + $wav = Join-Path $work ($pat.Name + ".wav") + + if ($pat.Kind -eq "classical") { [LdccSynth]::Build($wav, $pat.Kind, 70, $Seconds + 6) } + else { [LdccSynth]::Build($wav, $pat.Kind, [int]($pat.Name -split '-')[1], $Seconds) } + + $csv = Join-Path $work ($pat.Name + ".csv") + if (Test-Path $csv) { Remove-Item $csv -Force } + + $udp = New-Object System.Net.Sockets.UdpClient($Port) + $udp.Client.ReceiveTimeout = 400 + $ep = New-Object System.Net.IPEndPoint([System.Net.IPAddress]::Any, 0) + + $proc = Start-Process -FilePath $exe -ArgumentList "$Port", "0", "--dump-features=$csv" -PassThru -WindowStyle Hidden + Start-Sleep -Milliseconds 900 + + $player = New-Object System.Media.SoundPlayer $wav + $player.Play() + + $labels = @() + $sw = [Diagnostics.Stopwatch]::StartNew() + # Raccolta limitata alla durata della riproduzione: il silenzio finale produrrebbe + # etichette "unknown" che non riguardano il pattern. + $limit = $Seconds * 1000 + while ($sw.ElapsedMilliseconds -lt $limit) { + try { + $b = $udp.Receive([ref]$ep) + if ($b.Length -ge 5 -and [Text.Encoding]::ASCII.GetString($b, 0, 5) -eq 'GENR:') { + $txt = [Text.Encoding]::UTF8.GetString($b) + $parts = $txt.Split(';') + if ($parts.Length -ge 3) { $labels += [pscustomobject]@{ Label = $parts[1]; Conf = [double]$parts[2] } } + } + } catch { } + } + + $udp.Close() + if (-not $proc.HasExited) { Stop-Process -Id $proc.Id -Force } + + # Scarta il warm-up: tieni l'ultimo 60% dei campioni. + $skip = [int]($labels.Count * 0.4) + $steady = @($labels | Select-Object -Skip $skip) + + $dominant = "--" + $meanConf = 0.0 + if ($steady.Count -gt 0) { + $g = $steady | Group-Object Label | Sort-Object Count -Descending + $dominant = $g[0].Name + $meanConf = ($steady | Measure-Object Conf -Average).Average + } + + $results += [pscustomobject]@{ + Pattern = $pat.Name + Atteso = $expected[$pat.Name] + Dominante = $dominant + Conf = if ($meanConf) { [math]::Round($meanConf, 2) } else { 0 } + Esito = if ($dominant -eq $expected[$pat.Name]) { "OK" } else { "MISS" } + } + + Write-Host ("{0,-16} atteso={1,-11} ottenuto={2,-11} conf={3}" -f $pat.Name, $expected[$pat.Name], $dominant, [math]::Round($meanConf, 2)) +} + +Write-Host "" +$results | Format-Table -AutoSize +$ok = @($results | Where-Object { $_.Esito -eq "OK" }).Count +Write-Host ("Risultato: {0}/{1} pattern riconosciuti" -f $ok, $results.Count) +Write-Host ("CSV in {0}" -f $work)