Skip to content

Instantly share code, notes, and snippets.

View mimetaur's full-sized avatar

Nathan Koch mimetaur

View GitHub Profile
@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 / 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 / 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 / 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
// Example 5-6: Bouncing Ball
int x = 0;
int speedx = 2;
int y = 120;
int speedy = 2;
void setup() {
size(480, 270);
}
@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;
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 / 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
@mimetaur
mimetaur / noise_displacement.c
Created June 19, 2018 23:00
Sketch 6 / Noise displacement wrangle
float noise_freq = ch("noise_freq");
float strength = ch("strength");
vector2 noise_offset = chu("noise_offset");
float time_speed = ch("time_speed");
float x_noise = (@P.x * noise_freq) + (@Time * time_speed) + noise_offset.x;
float z_noise = (@P.z * noise_freq) + (@Time * time_speed) + noise_offset.y;
vector noise_seed = set(x_noise, 0, z_noise);
// let downstream nodes access this value
@mimetaur
mimetaur / noise_cull.c
Created June 19, 2018 22:54
Sketch 5 / Noise Cull Attribute Wrangle
float noise_freq = ch("noise_freq");
float threshold = ch("threshold");
vector seed = @P * noise_freq;
// let downstream nodes access this value
f@noiseval = noise(seed);
if (@noiseval < threshold) {
removepoint(0, i@ptnum);