Skip to content

Instantly share code, notes, and snippets.

@grinsted
grinsted / drumkit_split64.py
Last active April 18, 2021 22:14
Tool for quickly making drumkits for the novation circuit
# This file contains code to save 64 samples as a syx file for Novation Circuit
#
# * It reads a single long wave file.
# * splits it into 64 equal chunks
# * crops the sound
# * adds a super fast fadein and "an appropriate fadeout". To remove clicks
# * normalizes every sample
# * Saves the whole thing as a syx file.
#
import subprocess
import os
import glob
for filename in glob.iglob(os.path.join(".", "**", "*.nc"), recursive=True):
if os.stat(filename).st_size < 50:
continue
result = subprocess.run(["gdalinfo.exe", filename], stdout=subprocess.PIPE)
if result.stdout.rfind(b"COMPRESSION=") > 0:
@grinsted
grinsted / ulln.py
Last active December 19, 2017 09:27
from sympy import *
init_printing(use_unicode=False, wrap_line=False, no_global=True)
x = Symbol('x', positive=True)
xmax = Symbol('xmax', positive=True)
sigma = Symbol('sigma', positive=True)
mu = Symbol('mu')
lx = log(x)-log(xmax-x)
@grinsted
grinsted / ffmpegtips.md
Last active October 15, 2016 19:25
newbie ffmpeg tips for composers