Skip to content

Instantly share code, notes, and snippets.

View schollz's full-sized avatar
🎺

Zack schollz

🎺
View GitHub Profile
@schollz
schollz / align_offsets.py
Created October 22, 2024 15:49
A gist for aligning offsets in samples
import os
import subprocess
def trim_audio(input_file):
temp_file = "temp.wav"
os.system(f"sox {input_file} 1.wav norm")
cmd = "aubioonset -t 0.1 -H 256 -B 256 -O energy 1.wav"
onsets = subprocess.check_output(cmd, shell=True).decode("utf-8").split("\n")
first_onset = 0
// var f = FoldersOfSound.new(Server.default);
// var server2 = Server.new(name, "192.168.0.24:57110", options, clientID)
// var f2 = FolderOfSound.new(server2);
// (
// s.waitForBoot({
// ~bikes=FoldersOfSound.new(s);
// ~birds=FoldersOfSound.new(s);
// });
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M320 192h17.1c22.1 38.3 63.5 64 110.9 64c11 0 21.8-1.4 32-4v4 32V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V339.2L280 448h56c17.7 0 32 14.3 32 32s-14.3 32-32 32H192c-53 0-96-43-96-96V192.5c0-16.1-12-29.8-28-31.8l-7.9-1c-17.5-2.2-30-18.2-27.8-35.7s18.2-30 35.7-27.8l7.9 1c48 6 84.1 46.8 84.1 95.3v85.3c34.4-51.7 93.2-85.8 160-85.8zm160 26.5v0c-10 3.5-20.8 5.5-32 5.5c-28.4 0-54-12.4-71.6-32h0c-3.7-4.1-7-8.5-9.9-13.2C357.3 164 352 146.6 352 128v0V32 12 10.7C352 4.8 356.7 .1 362.6 0h.2c3.3 0 6.4 1.6 8.4 4.2l0 .1L384 21.3l27.2 36.3L416 64h64l4.8-6.4L512 21.3 524.8 4.3l0-.1c2-2.6 5.1-4.2 8.4-4.2h.2C539.3 .1 544 4.8 544 10.7V12 32v96c0 17.3-4.6 33.6-12.6 47.6c-11.3 19.8-29.6 35.2-51.4 42.9zM432 128a16 16 0 1 0 -32 0 16 16 0 1 0 32 0zm48 16a16 16 0 1 0 0-32 16 16 0 1 0 0 32z"/></svg>
<svg xmlns="http://
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 36.0755
longitude: -79.0741
# C for Celsius, F for Fahrenheit
temperature_unit: F
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/New_York
// live here: https://schollz.com/wambamjam/
var mouseX = 0;
var mouseY = 0;
var started = 0;
var playNext = false;
var doFly = false;
var doStop = false;
const comp = new Tone.Compressor(-30, 3).toDestination();
// const comp = new Tone.PanVol(0,-12).toDestination();
// move mouse from left to the right of the screen!
// exponential
(
s.waitForBoot({
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav"); // remember to free the buffer later.
SynthDef("tapestop1",{
var tape_env=EnvGen.kr(Env.new([1,0.047,1],[1,1],\exponential,releaseNode:1),MouseX.kr()>0.5);
var snd = PlayBuf.ar(1, b, tape_env,loop:1);
snd = Pan2.ar(snd);
@schollz
schollz / deep_dreams_music_video.ipynb
Last active April 18, 2024 14:49
aimovie.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# Function to generate a random string of characters
generate_random_string() {
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1
}
# Function to recursively rename files and directories
rename_files_and_dirs() {
local path="$1"
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
<span class="ant"></span>
(
s.waitForBoot({
{
arg freq = 220;
var resFreq = freq * 1.5;
var sr = SampleRate.ir;
var baseFrequencyPeriod = sr / freq;
var resFrequencyPeriod = sr / resFreq;
var baseFrequencyCounter = Phasor.ar(
end: baseFrequencyPeriod,