Skip to content

Instantly share code, notes, and snippets.

View dustractor's full-sized avatar

Shams Kitz dustractor

View GitHub Profile
@dustractor
dustractor / tk_calc_bpm_ms_hz.py
Created April 15, 2024 19:31
Calculate ms and hz for bpm, hz for A4 tuning
import tkinter as tk
import tkinter.ttk as ttk
import itertools
import decimal
""" Set a bpm and click the buttons to copy ms and hz values to the clipboard.
Set a frequency for A4 and click the buttons to copy hz values to the clipboard.
"""
_C = decimal.getcontext()
@dustractor
dustractor / tkbpmmshz.py
Created April 14, 2024 03:43
Set a bpm, get values for milliseconds and hertz, click the buttons to copy to clipboard
import tkinter as tk
import tkinter.ttk as ttk
""" Set a bpm and click the buttons to copy ms and hz values to the clipboard
"""
class App(tk.Tk):
def trace_bpm_var(self,*traceargs):
bpm = self.bpm_var.get()
@dustractor
dustractor / pnotes_50k_8x6250.txt
Created March 30, 2024 20:04
prime-number-based sequence for voxglitch's one-point -- first 50k prime numbers modulo 120 times 0.8333 -- 6250 rows of 8-step sequences
-4.8331,-4.7498,-4.5831,-4.4165,-4.0832,-3.9165,-3.5832,-3.4165
-3.0832,-2.5832,-2.4166,-1.9166,-1.5833,-1.4166,-1.0833,-0.5833
-0.0833,0.0833,0.5833,0.9166,1.0833,1.5833,1.9166,2.4166
3.0832,3.4165,3.5832,3.9165,4.0832,4.4165,-4.4165,-4.0832
-3.5832,-3.4165,-2.5832,-2.4166,-1.9166,-1.4166,-1.0833,-0.5833
-0.0833,0.0833,0.9166,1.0833,1.4166,1.5833,2.5832,3.5832
3.9165,4.0832,4.4165,4.9165,-4.9165,-4.0832,-3.5832,-3.0832
-2.5832,-2.4166,-1.9166,-1.5833,-1.4166,-0.5833,0.5833,0.9166
1.0833,1.4166,2.5832,3.0832,3.9165,4.0832,4.4165,4.9165
-4.4165,-3.9165,-3.4165,-3.0832,-2.5832,-1.9166,-1.5833,-0.9166
@dustractor
dustractor / pmask_32x128.txt
Created March 30, 2024 20:01
prime-number-based gate sequence for voxglitch one-zero -- 128 rows of 32-step patterns
1,1,1,1,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1
0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0
0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0
0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0
0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1
0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1
0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0
0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0
0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1,0,0
@dustractor
dustractor / pmask_16x243.txt
Created March 30, 2024 19:59
prime-number-based gate sequence for voxglitch one-zero -- rows of all zeroes removed leaves 243 rows of 16-step patterns
1,1,1,1,0,1,0,1,0,0,0,1,0,1,0,0
0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,1
0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,1
0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0
0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,1
0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0
0,1,0,0,0,1,0,1,0,0,0,1,0,1,0,0
0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1
0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0
0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0
from flpianoroll import *
note_ct = score.noteCount
def createDialog():
form = ScriptDialog("Select every nth note","")
form.AddInputKnobInt("nth",2,2,64)
return form
def apply(form):
@dustractor
dustractor / dssamplegroupfmt.py
Created July 20, 2023 11:44
script i use to turn a folder of samples into a decentsampler dslibrary
import argparse
import pathlib
import os
import sys
import shutil
from xml.dom import minidom
from string import Template
# {{{1 boilerplate
boilerplate = Template(
@dustractor
dustractor / bootstrap-vim-plug.vim
Created April 5, 2022 02:36
bootstrap vim-plug
if has('win32')
if empty(glob(expand('$HOMEDRIVE/$HOMEPATH/vimfiles/autoload/plug.vim')))
exe 'silent !curl -fLo '.expand('$HOMEDRIVE/$HOMEPATH/vimfiles/autoload/plug.vim').' --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
else
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
@dustractor
dustractor / colproptest.py
Created November 2, 2021 00:22
Blender CollectionProperty / template_list example
import bpy
bl_info = {
"name": "CollectionProperty Test",
"blender": (2,80,0),
"category": "Test"
}
def _(a=None,b=[]):
if a:
@dustractor
dustractor / explorer_select_last_recording.py
Created June 18, 2021 02:59
OBS Studio python plugin: select last recorded mkv [windows only]
import obspython as obs
import datetime
import pathlib
import subprocess
class Data:
OutputDir = None
def frontend_event_handler(data):
if data == obs.OBS_FRONTEND_EVENT_RECORDING_STOPPED: