Skip to content

Instantly share code, notes, and snippets.

View chriskiefer's full-sized avatar

Chris Kiefer chriskiefer

View GitHub Profile
; divide a bar into 13 beats and play seven of them, evenly(ish) spaced
(d1 (euclid bar 13 7))
; an even 4-4 beat
(d2 (euclid bar 16 4))
[[t >> 9] & 50] * t >> [c>>2] << 24-> seq1;
[[t >> 8] & 39] * t >> [c>>8] << 22 -> seq2;
seq1 + seq2
@chriskiefer
chriskiefer / godti.lang
Last active March 29, 2022 16:34
removing sources of ambiguity
# GRAMMAR FOR GODTI LANGUAGE
# (Godti? it's from Transmetropolitan)
# Lexer [or tokenizer] definition with language lexemes [or tokens]
# number: /([0-9]+\.?[0-9]*)|(\.[0-9]+)/, (//doen't work)
@{%
@chriskiefer
chriskiefer / example.html
Created January 27, 2021 18:44
maximilian FFT example
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>
Javascript Audio Processing
</title>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=css" defer="defer"></script>
<!-- show all line numbers-->
<style type="text/css">
@chriskiefer
chriskiefer / env
Created April 15, 2020 19:49
test env 2 sema
[{"drag":{"top":null,"left":null,"dragging":false},"resize":{"width":null,"height":null,"resizing":false},"responsive":{"valueW":0},"static":false,"resizable":true,"draggable":true,"min":{},"max":{},"x":0,"y":0,"w":7,"h":3,"id":"_uj7tdlhe0","type":"liveCodeEditor","name":"hello-world","background":"#151515","lineNumbers":true,"hasFocus":false,"theme":"icecoder","data":"{0.11}clfreq;\n{1}barfreq;\n\n\t\t\t \n:k1:{{16}clp,<1,3>}rsq;\n:k2:{{8}clp,<2,2,1,2,1>}rsq;\n:kk:{{1}clp,<3,1>,<:k1:,:k2:>}rsq;\n:kick1:{:kk:,{{{:kk:,100}line,5,0.1}ulin,-0.1}add,0}\\909b;\n:kick1:{{:kk:,{{{:kk:,20}line,1,1}ulin,0}add,0}\\909b, :kick1:}mix;\n:t4:{:kick1:,20}dist;\t \n\n:hh:{{{16,0.5}clp,<1,3>}rsq,0.9,0.03}\\909open;\n:hh:{:hh:,3}dist;\n\t\t \n\n:tr:{{32}clp,<1,1>}rsq;\n:pit:{{24}clp,<1,2>,<40,20,60,1,40,20,1,20>}rsq;\n:cut:{{1}clp,300,300}uexp;\n:slide:{{32}clp,<1>,<1,0,0,0,0>}rsq;\t\t\t\n:a:{:tr:,{:pit:,10}add,:slide:,0,1,:cut:,90,100,10,50}o303;\n:a:{{:a:,500,3}hpz,12}dist;\n:a:{:a:,0.8}mul;\n\t\t\t\t\n:trb:{{16,0.5}clp,<1>}
[{"drag":{"top":null,"left":null,"dragging":false},"resize":{"width":null,"height":null,"resizing":false},"responsive":{"valueW":0},"static":false,"resizable":true,"draggable":true,"min":{},"max":{},"x":0,"y":0,"w":7,"h":3,"id":"_uj7tdlhe0","type":"liveCodeEditor","name":"hello-world","background":"#151515","lineNumbers":true,"hasFocus":false,"theme":"icecoder","data":"{0.11}clfreq;\n{1}barfreq;\n\n\t\t\t \n:k1:{{16}clp,<1,3>}rsq;\n:k2:{{8}clp,<2,2,1,2,1>}rsq;\n:kk:{{1}clp,<3,1>,<:k1:,:k2:>}rsq;\n:kick1:{:kk:,{{{:kk:,100}line,5,0.1}ulin,-0.1}add,0}\\909b;\n:kick1:{{:kk:,{{{:kk:,20}line,1,1}ulin,0}add,0}\\909b, :kick1:}mix;\n:t4:{:kick1:,20}dist;\t \n\n:hh:{{{16,0.5}clp,<1,3>}rsq,0.9,0.03}\\909open;\n:hh:{:hh:,3}dist;\n\t\t \n\n:tr:{{32}clp,<1,1>}rsq;\n:pit:{{24}clp,<1,2>,<40,20,60,1,40,20,1,20>}rsq;\n:cut:{{1}clp,300,300}uexp;\n:slide:{{32}clp,<1>,<1,0,0,0,0>}rsq;\t\t\t\n:a:{:tr:,{:pit:,10}add,:slide:,0,1,:cut:,90,100,10,50}o303;\n:a:{{:a:,500,3}hpz,12}dist;\n:a:{:a:,0.8}mul;\n\t\t\t\t\n:trb:{{16,0.5}clp,<1>}
@{%
const lexer = moo.compile({
click: /click/,
convol1: /convol1/,
heart: /heart/,
insec3: /insec3/,
paper: /paper/,
separator: />/,
@{%
const lexer = moo.compile({
click: /click/,
convol1: /convol1/,
heart: /heart/,
separator: />/,
number: /-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,
ws: {match: /\s+/, lineBreaks: true},
@chriskiefer
chriskiefer / pingpong.scd
Created February 10, 2016 15:20
Example code from an AHRC CCN+ workshop, exploring minimalist musical notation cues with LEDs and vibrators. The code shows how the LEDs were controlled.
SerialPort.listDevices
q = SerialPort.new('/dev/tty.usbmodem1411', 115200);
~jo = NetAddr(~ipAddress, 57120);
~jo.sendMsg(\clock)
~jo.sendBundle(0, [\clock])
(
~led = {|i, r, g, b| q.putAll([i, round(r*255), round(g*255), round(b*255)].as(Int8Array))};
~bpm = 80;
~ppqn = 12;
///////////////////////////////////////////////////
// History, as it was on Wed Dec 2 20:37:59 2015.
///////////////////////////////////////////////////
// - 0:0:0 -
x = 8 // a number
// - 0:0:1.45 -
x = [8] //a list with a number