Skip to content

Instantly share code, notes, and snippets.

View mimetaur's full-sized avatar

Nathan Koch mimetaur

View GitHub Profile
@mimetaur
mimetaur / point_relaxation.c
Last active June 25, 2018 21:34
Procedural Systems Week 3 / Sketch 7
int geohandle = 0;
float strength = ch("strength");
float width_divisor = 32.0;
// radius is derived from the width of the square
// valid radius values were very low so
// manipulating a scale value is more readable
f@radius = ((detail(0, "width")) / width_divisor) * ch("radius_scale");
// get all the neighbors within the radius around this point
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class CreateCube : MonoBehaviour
{
public int xSize, ySize, zSize;
private Mesh mesh;
@mimetaur
mimetaur / day02_exercise_variables.pde
Created July 31, 2018 12:13
Filling variables with random values
// Example 4-7: Filling variables with random values
float r;
float g;
float b;
float a;
float diam;
float x;
float y;
// Example 5-6: Bouncing Ball
int x = 0;
int speedx = 2;
int y = 120;
int speedy = 2;
void setup() {
size(480, 270);
}
@mimetaur
mimetaur / l-system-example-01.txt
Created September 26, 2018 20:17
More complex L-System in Houdini
FX
X = F/(10)~TF[+FHJ]X:0.5
X = F!/(10)~TF[+FX]X:0.3
X = H!/(30)~TF[+FK]X:0.1
X = H!/(30)~TF[+FJ]:0.1
@mimetaur
mimetaur / convert_exr_to_png.sh
Last active October 11, 2018 21:50
Script to convert EXRs from C4D/Houdini to PNG with appropriate settings
#!/bin/bash
if [ ! -d ./png ]; then mkdir ./png; fi;
# creates the screen image
for f in *.exr;
do
echo "Processing $f"
convert -alpha off -background black $f ./png/$f.png
done
@mimetaur
mimetaur / norns_study02_modified.lua
Created February 17, 2019 21:37
Modified Norns Study #2 to expose synth release length
-- patterning
-- norns study 2
engine.name = "PolyPerc"
function init()
engine.release(3)
notes = {}
selected = {}
-- build a scale, clear selected notes
@mimetaur
mimetaur / harmonics.lua
Created February 20, 2019 17:45
Limits of Guitar Study #1: Harmonic Sequences
-- harmonics
engine.name = "Sines"
function init()
root_note = 30
base_freq = midi_to_hz(root_note)
freqs = {}
amps = {}
@mimetaur
mimetaur / loop.hs
Last active February 26, 2019 23:19
dub techno loop
-- dX is the number of the sound channel used (up to 6)
-- sound sets a sound playing, you can include multiple sounds
-- and they all play within the time of one cycle
-- a sine LFO is slowly changing the cutoff over 7 cycles
-- from 200hz to 400hz
-- playing every 1/4 note in this case
d1 $ sound "bd*4" # cutoff (range 200 400 $ slow 7 $ sine)
-- claps on the off beats
d2 $ sound "~ cp ~ cp" # cutoff (range 400 1000 $ slow (range 1 3 $ rand) $ sine)
-- 102bpm
setcps (102/60/4)
let the_scale = "hexMajor6"
d1 $ cat [ n (scale the_scale "0 4 8 13?"), n (scale the_scale "<[0,4,7,11]>") ] # s "supersquare" # attack "1.2" # sustain "4" # release "3" # cutoff (range 300 500 $ slow 11 $ sine) # pitch1 (slow 9 $ range 0.95 1.05 $ sine) # gain 0.6
d1 silence
d2 $ euclid 5 16 $ every 3 (rev) $ every 7 (euclid 5 22 ) $ n (scale the_scale "<[-3 2]*2>") # s "supercomparator" # cutoff (range 320 1100 $ rand) # attack "0.24" # sustain "2" # release "0.7" # voice (slow 17 $ range 0.4 0.9 $ sine) # gain 0.9