Skip to content

Instantly share code, notes, and snippets.

View bgold-cosmos's full-sized avatar

Ben Gold bgold-cosmos

View GitHub Profile
@bgold-cosmos
bgold-cosmos / install-tidal.pl
Last active September 7, 2018 07:17
Tidal install script for MacOS
#!/usr/bin/perl -w
# --------------------------------------------
# install-tidal.pl
# created by Ben Gold at 09:35 Sat Oct 28 2017
# --------------------------------------------
use strict;
my($url,$exists);
my(%pageURL) = (
@bgold-cosmos
bgold-cosmos / synths.scd
Created January 25, 2017 21:28
SuperDirt synths (experimental)
(
var server = server ? Server.default;
var numChannels = ~dirt.numChannels;
var synthbuf = Buffer.alloc(server, server.sampleRate * 4, 1);
var recbuf = Array.fill(9, {|x| Buffer.alloc(server, server.sampleRate*4,1)});
SynthDef(\noop, {}).add;
// to try - square wave plus FM (bassy) with sawtooth LFO on LPF cutoff
// three octave saw detuned, pitch envelope sine LFO high cutoff filter
@bgold-cosmos
bgold-cosmos / effects.scd
Created January 25, 2017 21:24
SuperDirt effects
// Sonic Pi's krush
// moified a bit so krush "0" is the same as dry signal
~dirt.addModule('krush', { |dirtEvent| dirtEvent.sendSynth("dirt_krush" ++ ~dirt.numChannels,
[krush: ~krush, kcutoff: ~kcutoff, out: ~out])}, { ~krush.notNil});
SynthDef("dirt_krush" ++ ~dirt.numChannels, {|out, krush, kcutoff|
var orig, signal, freq;
freq = Select.kr(kcutoff > 0, [DC.kr(4000), kcutoff]);
orig = In.ar(out, ~dirt.numChannels);
signal = (orig.squared + (krush*orig)) / (orig.squared + (orig.abs * (krush-1.0)) + 1.0);
signal = RLPF.ar(signal, clip(freq, 20, 10000), 1);
let (***) = foldl (|*|)
(+++) = foldl (|+|)
(###) = foldl (#)
outside n f p = slow n $ f (density n p)
every' n o f = when ((== o) . (`mod` n)) f
withArc (s,e) f p = stack [sliceArc (0,s) p, f $ sliceArc (s,e) p, sliceArc (e,1) p]
shiftArc (s,e) t = withArc (s,e) (t ~>)
beginend bpat durpat = (begin bpat) # (end $ (+) <$> bpat <*> durpat)
flange n t p = stack [ (toRational i*t) ~> p # begin (pure $ i/n) # end (pure $ (i+1)/n) | i <- [0..n-1] ]
sometimesBy' x f p = (1024 ~>) $ sometimesBy x f p
;FLAVOR:UltiGCode
;TIME:2366
;MATERIAL:10084
;MATERIAL2:0
;NOZZLE_DIAMETER:0.8
;Generated with Cura_SteamEngine 2.3.0
;LAYER_COUNT:21
;LAYER:0
M107
@bgold-cosmos
bgold-cosmos / spirangle.obj
Created November 11, 2016 16:53
Spirangle OBJ file (Blender export)
# Blender v2.78 (sub 0) OBJ File: 'spirangle.blend'
# www.blender.org
mtllib spirangle.mtl
o Curve_Mesh
v 0.354749 0.000000 -0.259201
v 0.328878 0.000000 -0.214480
v 0.440135 0.000000 -0.214480
v 0.361762 0.000000 -0.350600
v 0.260329 0.000000 -0.174907
v 0.508652 0.000000 -0.174907