Skip to content

Instantly share code, notes, and snippets.

View mimetaur's full-sized avatar

Nathan Koch mimetaur

View GitHub Profile
@mimetaur
mimetaur / week_5_sketch_4_solution.js
Last active October 28, 2019 21:36
Code 1 Week 5 Sketch #4 solution
function setup() {
createCanvas(400, 400);
background(220);
noStroke();
fill(80);
}
function draw() {
drawSpiral();
@mimetaur
mimetaur / code_1_week_4_assignment_3.js
Created October 25, 2019 16:12
Code 1 Week 4 assignment 3 solution
// p5 adaptation of: https://massmoca.org/event/walldrawing160/
let angle = 0;
let x = 50;
let y = 50;
let step = 0; // you were missing this variable so the sketch didn't run
function setup() {
createCanvas(800, 800);
angleMode(DEGREES)
frameRate(10);
@mimetaur
mimetaur / code_1_week_5_sketch_2.js
Last active October 24, 2019 19:29
Code 1 2019: Homework Week 5 - Sketch 2 solution
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
drawButton(width / 2, height / 2, 200, 100);
}
@mimetaur
mimetaur / code_1_assignment_4_sketch_3.js
Created October 24, 2019 18:58
Code 1 2019: Assignment 4 sketch 3 - solution
function setup() {
createCanvas(400, 400);
}
function draw() {
// draw the frame
background("#E6E0E2");
stroke("#887987");
noFill();
rectMode(CENTER);
@mimetaur
mimetaur / strokes_example.js
Created September 2, 2019 15:13
Strokes example in p5 js
function setup() {
createCanvas(600, 600);
background(0);
}
function draw() {
background(0);
strokeWeight(9); // this sets a thick stroke width
@mimetaur
mimetaur / !norns_on_mac.md
Last active February 14, 2025 00:55
Norns Engine Development on MacOS - quick guide
  1. Pull the norns repository

  2. Make symbolic links from norns sc folders -> SuperCollider Extensions folder:

    • ln -s ~/Developer/monome/norns/sc/core ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-core
    • ln -s ~/Developer/monome/norns/sc/engines ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-engines
    • ln -s ~/Developer/monome/norns/sc/ugens ~/Library/Application\ Support/SuperCollider/Extensions/monome-norns-ugens
  3. Make symlinks to Norns community repos e.g. ln -s ~/Developer/monome/we/ ~/Library/Application\ Support/SuperCollider/Extensions/monome-we

  4. Make symlinks for custom engine development

@mimetaur
mimetaur / deploy_scripts.txt
Last active March 26, 2019 13:02
Norns Deploy Scripts
Basic norns deploy scripts. Still requires hitting "play" in Maiden.
norns.script.load("agents/random_walkers.lua")
# script load: /home/we/dust/agents/random_walkers.lua
# cleanup
# script clear
### SCRIPT ERROR: load fail
/home/we/dust/agents/random_walkers.lua:36: module 'agents/lib/world' not found:
no field package.preload['agents/lib/world']
no file '/home/we/norns/lua/agents/lib/world.lua'
no file '/home/we/norns/lua/core/agents/lib/world.lua'
no file '/home/we/norns/lua/core/params/agents/lib/world.lua'
-- 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
@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)