Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / audio.gd
Last active February 3, 2026 23:20
loading and playing from a list of sounds with timed Xfade. provides a very basic test UI for the task. When the fancy meta options are too much for your needs.
extends Node3D
# Enhanced 3D Audio Player with crossfade, debug UI, and auto-setup
# Audio players for crossfading
var audio_player1: AudioStreamPlayer3D
var audio_player2: AudioStreamPlayer3D
var current_player: AudioStreamPlayer3D
var next_player: AudioStreamPlayer3D
# Playlist configuration
@twobob
twobob / commands_for_windows.cmd
Last active January 28, 2026 01:03
counts words passed from stdio in go, learning script
taskkill /F /IM counter.exe /T 2>$null
del /F counter.exe
go build -o counter.exe counter.go
echo yeah baby | counter.exe
2
@twobob
twobob / UnityGuidRegenerator.cs
Created January 27, 2026 23:42 — forked from ZimM-LostPolygon/UnityGuidRegenerator.cs
Unity asset GUIDs regenerator
// Drop into Assets/Editor, use "Tools/Regenerate asset GUIDs"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEditor;
namespace UnityGuidRegenerator {
public class UnityGuidRegeneratorMenu {
@twobob
twobob / jam.strudel
Created January 27, 2026 20:53
strudel file for a rando xylo player with beats
setcpm(60/4)
addVoicings('cookie', {
7: ['3M 7m 9M 12P 15P', '7m 10M 13M 16M 19P', '3M 6M 9M 13M 15P', '7m 9M 13M 16M 20P'],
'^7': ['3M 6M 9M 12P 14M', '7M 10M 13M 16M 19P', '3M 7M 10M 14M 17M', '6M 10M 14M 17M 21M'],
m7: ['8P 11P 14m 17m 19P', '5P 8P 11P 14m 17m', '3m 7m 10m 14m 17m', '5P 10m 14m 17m 19P'],
m7b5: ['3m 5d 8P 11P 14m', '5d 8P 11P 14m 17m', '3m 5d 10m 14m 17m', '8P 12d 15P 17m 21m'],
o7: ['3m 6M 9M 11A 15P', '3m 5d 8P 11A 14d', '6M 9M 12d 15P 18d'],
'7alt': ['3M 7m 10m 13m 15P', '3M 6m 10m 13m 16m', '7m 10m 13m 16m 18A'],
'7#11': ['7m 10m 13m 15P 17m', '3M 7m 11A 14M 17m', '7m 11A 14M 17m 19P'],
@twobob
twobob / beats.py
Last active January 19, 2026 18:58
I need some breaky beats. Now. no deps
import struct
import math
import random
import os
# --- MIDI CONSTANTS ---
PPQ = 960
# General MIDI Map
KICK = 36
@twobob
twobob / TryFoxy.html
Created October 30, 2025 22:45
Tunnel Vision Dissolve Shader
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tunnel Vision Dissolve Shader</title>
<style>
body { margin: 0; overflow: hidden; background-color: #add8e6; }
canvas { display: block; }
.info {
# Made by @xdavidhu (github.com/xdavidhu, https://xdavidhu.me/)
# Merge with https://github.com/Pinoccio/tool-serial-pcap/blob/master/serial-pcap
# And https://wiki.wireshark.org/CaptureSetup/Pipes
import serial
import io
import os
import subprocess
import signal
import time
@twobob
twobob / normaliseVideo.ps1
Created October 22, 2025 17:04
two pass audio normalise ffmpeg powershell
# --- Configuration ---
$inputFile = "C:\Users\new\Videos\someVideo.mp4"
$outputFile = "C:\Users\new\Videos\someVideoNormalised.mp4"
# --- Target Loudness ---
$target_I = "-14"
$target_LRA = "7"
$target_TP = "-1.5"
Write-Host "Running Pass 1 (analysis)..." -ForegroundColor Yellow
@twobob
twobob / chromakey.ts
Last active October 18, 2025 00:13
do chroma for cheapa
export interface ChromaKeyOptions {
keyColor?: [number, number, number] // RGB color to key out (default: magenta)
tolerance?: number // Tolerance range for color matching (0-100)
softness?: number // Edge softness (0-100)
spill?: number // Spill suppression strength (0-100)
preserveEdges?: boolean // Preserve edge detail
}
export interface ImageData {
data: Uint8ClampedArray
export interface DeSepAIOptions {
strength?: number
notchWhiten?: boolean
shiftBase?: [number, number, number]
preserveDark?: boolean
}
export interface ImageData {
data: Uint8ClampedArray
width: number