Skip to content

Instantly share code, notes, and snippets.

View SpotlightKid's full-sized avatar

Christopher Arndt SpotlightKid

View GitHub Profile
@SpotlightKid
SpotlightKid / pico_setup.sh
Created December 2, 2022 21:40
pico_setup.sh - Set up a development environment for the Raspberry Pi Pico
#!/bin/bash
#
# pico_setup.sh - Set up a development environment for the Raspberry Pi Pico
#
# See the "Getting started with Raspberry Pi Pico" guide for reference:
#
# https://www.raspberrypi.com/documentation/microcontrollers/c_sdk.html
#
# The script will:
#
import argparse
import logging
import sys
import time
from rtmidi.midiutil import open_midioutput
from rtmidi.midiconstants import *
log = logging.getLogger("midi-send-all")
@SpotlightKid
SpotlightKid / parse_srcinfo.py
Last active April 1, 2022 22:09
Get info from a PKGBUILD file by calling makepkg --printsrcinfo and parsing the output
#!/usr/bin/env python3
import json
import sys
from subprocess import CalledProcessError, run
ARRAY_FIELDS = (
"arch",
"arch",
"b2sums",
@SpotlightKid
SpotlightKid / smfinfo.py
Created July 9, 2021 20:57
Show basic tempo and time/key signature information of a standard MIDI file using miditk-smf
import sys
from miditk.smf.reader import MidiFileReader
from miditk.smf.sequence import MidiSequence, ObjectMidiEventHandler
# This defines callbacks called while parsing the MIDI sequence
# We only need to overwrite the event handlers we want to handle specially
class MySequenceHandler(ObjectMidiEventHandler):
def __init__(self, instance=None, debug=False):
@SpotlightKid
SpotlightKid / notes.md
Created February 17, 2021 19:42
Kurztipp: SF2 Soundfonts mit Polyphone nach SFZ konvertieren und in sfizz laden
@SpotlightKid
SpotlightKid / prequests.py
Created January 18, 2021 22:51
urequests.py from pfalcon/pycopy-lib fixed for current upstream micropython
import usocket
class Response:
def __init__(self, f):
self.raw = f
self.encoding = "utf-8"
self._cached = None
def close(self):
@SpotlightKid
SpotlightKid / joystick2midi.py
Last active April 11, 2024 13:10
Convert joystick axis position into MIDI Control Change value in-/decrements using pygame.joystick and python-rtmidi
#!/usr/bin/env python
"""Convert joystick axis position into MIDI Control Change value in-/decrements."""
import os
import sys
import pygame
from rtmidi.midiutil import open_midioutput
@SpotlightKid
SpotlightKid / lua.env
Last active October 27, 2020 15:08
Lua environment variables for multiple version support
# Lua dev
LUA_DIR="$HOME/share/lua"
LUA_CDIR="$HOME/lib/lua"
if which lua5.1 >/dev/null 2>&1; then
if which luarocks >/dev/null 2>&1; then
LUA_PATH_5_1="$(luarocks --lua-version 5.1 --local path --lr-path)"
LUA_CPATH_5_1="$(luarocks --lua-version 5.1 --local path --lr-cpath)"
fi
@SpotlightKid
SpotlightKid / stereocrossdelay.dsp
Last active October 23, 2020 15:44
A FAUST stereo delay with feedback and cross-mixing
declare name "StereoCrossDelay";
declare description "A stereo delay with feedback and cross-mixing";
declare author "Christopher Arndt";
declare license "MIT license";
import("stdfaust.lib");
MAX_DELAY = 2.0;
time_l = ba.sec2samp(hslider("[0]Delay Left[symbol: delay_l][unit: ms]", 250.0, 0, MAX_DELAY * 1000, 0.1) * 0.001 : si.smoo);
@SpotlightKid
SpotlightKid / PKGBUILD-kicad-packages3d-git.sh
Last active October 15, 2020 22:49
Updated PKGBUILD for kicad-packages3d-git
# Maintainer: Frederic Van Assche <frederic@fredericva.com>
# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de>
_pkgname=kicad-packages3d
pkgname="${_pkgname}-git"
pkgver=r2020.10.06.27d653ce
pkgrel=1
pkgdesc="KiCad component 3D model libraries from the official git repo"
arch=('any')
url="https://github.com/KiCad/kicad-packages3D"