Skip to content

Instantly share code, notes, and snippets.

import requests
import subprocess
community_url = "https://raw.githubusercontent.com/monome/norns-community/main/community.json"
def clone_all(url, location):
res = requests.get(url)
cat = res.json()
for entry in cat['entries']:
proj_url = entry['project_url']
@catfact
catfact / equal_slices.scd
Last active August 24, 2023 18:16
slice an audio file into N equal segments with supercollider
n = 256;
// change to your location...
// ~input = PathName("/Users/emb/code/z-elements/resources/dont_explain_short_48k.wav");
// ~input = PathName(Platform.userHomeDir ++ "/Desktop/slice/input.wav");
~perform_slices = {
~filename = ~input.fileNameWithoutExtension;
~location = ~input.pathOnly;
SampleSliceSequencer {
// initial variables
var <server;
var <pathList;
var <targetNode;
var <addAction;
var <doneLoadingCallback;
// sample data
var window, userView;
var lineHistory, lineBuffer;
var historyOffset = 0;
var numHistoryLines = 10;
var lineHeight = 20;
var font = Font("Monaco");
var bgColor = Color.black;
var fgColorHistory = Color.cyan;
var fgColorEntry = Color.white;
sox -b 16 -Dr 48000 -n pulse.wav synth 24s square pad 47976s
-- performance comparison of bitfields vs tables
-- in this v2, we add some dummy work using a callback for each field (as in the reference application)
-- this tanks the performance of the bitfield version since it now has to loop over all fields anyway
--------------------
-- bitfield method
function binary_get(data, bit) --get bit
return (data >> bit) & 1
end
--- lua bitfield performance test
-- given a sequence of frames, where each frame holds N binary values,
-- measure the speed of computing the difference between successive frames
--------------------
-- bitfield method
function binary_get(data, bit) --get bit
return (data >> bit) & 1
end
FxBusDemo2 {
var <synths;
var <busses;
var <g;
*new { arg server;
^super.new.init(server);
}
// needed extension to Engine class
+ ContiguousBlockAllocator {
totalUsed {
var sum = 0;
array.do({ arg block;
if (block.notNil, {
if (block.used, { sum = sum + block.size });
});
});
local mod = require 'core/mods'
local tabutil = require 'tabutil'
print('!!!!!!!!!\n HIIII \n !!!!!!!')
-- utility hack
local system_param_ids = {
comp_release = true,
monitor_level = true,