Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@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 December 19, 2024 16:41
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
#
@SpotlightKid
SpotlightKid / lv2_list_plugin_presets.py
Last active November 8, 2019 01:33
List all preset URIs of an LV2 plugin with the given URI
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""List all preset URIs of an LV2 plugin with the given URI."""
import sys
import lilv
PRESET_NS = 'http://lv2plug.in/ns/ext/presets'
RDFS_NS = 'http://www.w3.org/2000/01/rdf-schema'
@SpotlightKid
SpotlightKid / jack-property-listener.py
Last active November 8, 2019 01:33
Listen to and print JACK client/port meta-data changes.
#!/usr/bin/env python3
"""Listen to and print JACK client/port meta-data changes."""
import jack
PROPERTY_CHANGE_MAP = {
jack.PROPERTY_CREATED: 'created',
jack.PROPERTY_CHANGED: 'changed',
jack.PROPERTY_DELETED: 'deleted'