This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autowatch = 1 | |
mgraphics.init() | |
mgraphics.relative_coords = 0 | |
mgraphics.autofill = 0 | |
// we want to draw this many bars | |
var bars = [] | |
for (var i=0; i < 8; i++) { | |
bars.push(Math.random()) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from concurrent.futures import ThreadPoolExecutor | |
def do_work(work_list): | |
with ThreadPoolExecutor() as pool: | |
def work(inp): | |
return f'{inp}----COMPLETE' | |
futures = [pool.submit(work, work_item) for work_item in work_list] | |
for future in futures: | |
print( future.result() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local math = require('hs.math') | |
local hyper = {"cmd"} | |
local function getWindows() | |
local win = hs.window.focusedWindow() | |
local screen = win:screen() | |
return win, screen | |
end | |
local function getFrames(win, screen) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from pathlib import Path | |
help_files = [Path(x) for x in Path("help").glob("*.maxhelp")] | |
def ezdac_search(patch, patch_name): | |
if patch.get("maxclass") == "ezdac~" and not patch.get("local"): | |
print(patch_name, patch) | |
for k, v in patch.items(): | |
if isinstance(v, dict): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
from pathlib import Path | |
help_file_input = Path(sys.argv[1]) | |
s = '' | |
with open(help_file_input, 'r') as f: | |
s = f.read() | |
s = s.replace('"default_fontsize" : 12.0', '"default_fontsize" : 13.0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc: Mapping for PHONOS system | |
author: James Bradbury | |
slider1:0<-60,0,0.1>1+2 | |
slider2:0<-60,0,0.1>3+4 | |
slider3:0<-60,0,0.1>5+6 | |
slider4:0<-60,0,0.1>7+8 | |
slider5:0<-60,0,0.1>9 | |
slider6:0<-60,0,0.1>10+11 | |
slider7:0<-60,0,0.1>12+13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colour import Color | |
import random | |
massive_fucking_string = '' | |
for x in range(200): | |
hue = random.uniform(0, 1) | |
saturation = random.uniform(0.5, 1.0) | |
value = random.uniform(0.3, 0.7) | |
c = Color(hsl=(hue, saturation, value)) | |
massive_fucking_string += (str(c)[1:]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
NUM_CHUNKS = 4 # or this could be a ratio of original data | |
raw_audio = np.array([1, 2, 3, 4, 5, 6, 7, 8]) | |
chunks = np.split(raw_audio, NUM_CHUNKS) | |
downsampled = [max(chunk) for chunk in chunks] | |
print(downsampled) | |