Skip to content

Instantly share code, notes, and snippets.

@dingodoppelt
dingodoppelt / gist:0ed7c04aeb9440227ec010224232df2e
Created October 1, 2023 15:56
Quickly create a color palette for a Novation Launchpad Pro
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import comb
def bezier(t, control_points):
n = len(control_points) - 1
result = np.zeros(3)
for i, point in enumerate(control_points):
result += comb(n, i) * (1 - t)**(n - i) * t**i * np.array(point)
return result
@dingodoppelt
dingodoppelt / rem-dups.py
Created April 4, 2023 12:41
remove duplicates from csv file and export to csv and json simultaneously
import csv
import sys
import os.path
import json
def writeJSONFile(dataArray, csvFileOut):
with open(csvFileOut, 'w', encoding = 'utf-8') as json_file_handler:
json_file_handler.write(json.dumps(dataArray))
def removeDuplicates(inputCsvFile, outputCsvFile, outputJsonFile):
USER PID SPID CLS PRI COMMAND COMMAND
jamulus 1842 1852 TS 39 QThread /usr/local/bin/Jamulus -s -F -n -u 25 -w <br><h1 style=text-align:center>FetteHupeBackstage</h1><p style=text-align:center>Willkommen auf dem <b>privaten</b> Jamulus Server der Big Band <b>Fette Hupe</b> aus Hannover</p><p style=text-align:center><b>https://fettehupe.de</b></p><p style=text-align:left></p> -o FetteHupe;Frankfurt;82
jamulus 1842 1842 RR 139 Jamulus /usr/local/bin/Jamulus -s -F -n -u 25 -w <br><h1 style=text-align:center>FetteHupeBackstage</h1><p style=text-align:center>Willkommen auf dem <b>privaten</b> Jamulus Server der Big Band <b>Fette Hupe</b> aus Hannover</p><p style=text-align:center><b>https://fettehupe.de</b></p><p style=text-align:left></p> -o FetteHupe;Frankfurt;82
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
45.60 217.33 217.33 18976358 11.45 11.45 CServer::ProcessData(CVector<CVector<short> > const&, CVector<double> const&, CVector<double> const&, CVector<int> const&, CVector<double>&, CVector<short>&, int, int)
6.73 249.39 32.06 transient_analysis
4.94 272.95 23.56 clt_compute_allocation
2.93 286.90 13.95 op_pvq_search_c
2.85 300.48 13.57 quant_partition
@dingodoppelt
dingodoppelt / gprof.txt
Created August 4, 2020 18:58
4cores, 2gb, ram 20 clients, multithreaded
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
7.95 102.28 102.28 remove_doubling
5.80 176.95 74.67 transient_analysis
4.96 240.74 63.79 clt_compute_allocation
4.95 304.47 63.73 op_pvq_search_c
4.64 364.12 59.65 celt_pitch_xcorr_c
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
9.02 78.91 78.91 remove_doubling
5.73 129.02 50.11 transient_analysis
5.65 178.49 49.47 celt_pitch_xcorr_c
5.39 225.66 47.17 find_best_pitch
4.82 267.82 42.16 clt_compute_allocation
@dingodoppelt
dingodoppelt / gprof.txt
Created July 15, 2020 07:49
Jamulus server mode profiling
Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
18.22 3.16 3.16 379138 8.33 8.33 CServer::ProcessData(CVector<CVector<short> > const&, CVector<double> const&, CVector<double> const&, CVector<int> const&, CVector<short>&, int, int)
8.91 4.71 1.55 op_pvq_search_c
7.44 6.00 1.29 transient_analysis
4.73 6.82 0.82 quant_partition
4.09 7.53 0.71 celt_encode_with_ec