Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@SpotlightKid
SpotlightKid / .gitignore
Last active October 8, 2020 16:58
Updated PKGBUILD for python2-lupa 1.9
pkg/
src/
lupa-*.tar.gz
python2-lupa-*.pkg.tar.xz
python2-lupa-*.pkg.tar.zst
@SpotlightKid
SpotlightKid / Makefile-cython-embed.make
Created October 7, 2020 20:43
Makefile for creating a standalone program via Cython from a *.py / *.pyx file
# Makefile for creating a standalone program via Cython from a *.py / *.pyx file
PYX ?= main.pyx
PROG ?= $(basename $(PYX))
PYTHON ?= python
PYVERSION = $(shell $(PYTHON) -c 'import sys;print("%d.%d" % sys.version_info[:2])')
PYMAJOR = $(shell $(PYTHON) -c 'import sys;print(sys.version_info[0])')
PYPREFIX = /usr
INCLUDES = -I$(PYPREFIX)/include/python$(PYVERSION)
@SpotlightKid
SpotlightKid / pitchdetect.py
Last active September 4, 2020 13:52
Detect pitch of audio files
"""Detect pitch of audio files.
Requires:
* [aubio](https://pypi.org/project/aubio/)
* [NumPy](https://pypi.org/project/numpy/)
"""
import statistics
@SpotlightKid
SpotlightKid / bash_aliases.sh
Last active October 27, 2020 14:46
Some handy bash aliases / functions I don't see elsewhere often
# configure some commands via env variables
# (usually located in another file)
# export EDITOR=micro
# export VISUAL=$EDITOR
# export XEDITOR="geany"
# export BROWSER=xdg-open
# To open any file type via app registered in desktop system
alias xo='xdg-open'
@SpotlightKid
SpotlightKid / lv2_list_class_relations.py
Created August 14, 2020 19:15
List parent and children of an LV2 plugin class
#!/usr/bin/env python
import sys
import lilv
if len(sys.argv) > 1:
pclass = sys.argv[1]
else:
pclass = "SimulatorPlugin"
@SpotlightKid
SpotlightKid / wavefile.py
Created June 25, 2020 15:45
Python WAV file decoder
# -*- coding: utf-8 -*-
__all_ = [
'Error',
'FmtChunk',
'ParsingError',
'SmplChunk',
'UnsupportedCompressionError',
'WavChunk',
'WavFile'
pkg/
src/
*.lv2/
gxplugins-lv2/
gxplugins-lv2-git-*.pkg.tar.xz
gxplugins-lv2-git-*.pkg.tar.zst
@SpotlightKid
SpotlightKid / xdg_get_data.py
Last active November 24, 2019 08:58
Get application data files according to XDG basedir spec
#!/usr/bin/env python
import os
from os.path import expanduser, isdir, isfile, join, sep as pathsep
XDG_DATA_HOME = os.environ.get('XDG_DATA_HOME')
if not XDG_DATA_HOME:
XDG_DATA_HOME = join(expanduser('~'), '.local', 'share')
@SpotlightKid
SpotlightKid / lv_plugin_uris.py
Last active November 8, 2019 01:08
Print URIs associated with an LV2 plugin
#!/usr/bin/env python
import sys
import lilv
if len(sys.argv) < 2:
sys.exit("Usage: %s <plugin URI>" % sys.argv[0])
w = lilv.World()
@SpotlightKid
SpotlightKid / vital-install.sh
Last active July 9, 2020 00:09
Install script for Vital Linux binaries archive
#!/bin/bash -e
#
# Install script for Vital Linux binaries archive
#
# Installs everything under the user's home directory by default.
# Set the environment variables LV2_DIR, BIN_DIR and DATA_DIR
# to change install locations. e.g.:
#
# $ LV2_DIR=/usr/local/lib/lv2 ./vital-install.sh
#