Skip to content

Instantly share code, notes, and snippets.

View josephwilk's full-sized avatar
💭
💻 🎨 🎵

Joseph Wilk josephwilk

💭
💻 🎨 🎵
View GitHub Profile
@daveray
daveray / hystrix.txt
Created January 3, 2013 13:43
Hystrix-clj
Functions for defining and executing Hystrix dependency commands and collapers.
The definition of commands and collapers is separated from their instantiation and execution.
They are represented as plain Clojure maps (see below) which are later instantiated into
functional HystrixCommand or HystrixCollapser instances.
A command definition map can be passed to the execute, and queue functions
to invoke the command.
HystrixCommand
@weavejester
weavejester / gist:5484183
Created April 29, 2013 19:45
jMonkeyEngine in Clojure example
(ns jme3-example.core
(:import com.jme3.app.SimpleApplication
com.jme3.material.Material
com.jme3.math.Vector3f
com.jme3.scene.Geometry
com.jme3.scene.shape.Box
com.jme3.texture.Texture))
(defn application
"Create an jMonkeyEngine application."
defmodule Punk do
def hip? do
true
end
def hop? do
hip?
end
end
@jackrusher
jackrusher / heart-murmur.clj
Last active December 24, 2015 16:09
My first attempt at an aleatoric composition with Overtone. An example of the audio output is here: https://soundcloud.com/jackrusher/heart-murmur
(ns overtone-playground.heart-murmur
(:use overtone.core
overtone.inst.sampled-piano
overtone.samples.piano))
;; (boot-server)
;; (sampled-piano)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Reproducible randomness
@meh
meh / lol.exs
Created December 16, 2013 17:29
defmodule Fun do
def arity(fun) do
case :erlang.fun_info(fun, :arity) do
{ :arity, arity } ->
arity
end
end
def adapt!(fun, 0) do
fn -> fun.([]) end
@rogerallen
rogerallen / beethoven.clj
Last active January 1, 2016 04:39
Code works!
(ns explore-overtone.beethoven
(:use [overtone.live]))
;; Beginning with some of the ideas in Sam Aaron's example[1],
;; let's see about trying to get rid of the limitation on sequence
;; length.
;;
;; I'd like to create a composition outside the server in "beat space"
;; (play note N at beat B). This should allow for composing notes via
;; an abstraction that a library like Leipzig [2] provides. But,
@daveray
daveray / mr-jr.clj
Created January 28, 2014 04:48
Map-Reduce Jr. via core.async
(ns mr-jr
(:refer-clojure :exclude [shuffle])
(:require [clojure.string :as string]
[clojure.core.async :as async]))
(defn async-group-by
"Kinda like clojure.core/group-by, but takes a channel and returns a channel"
[f g ch]
(->> ch
(async/reduce
@xavriley
xavriley / README.md
Last active February 26, 2019 13:56
Designing a DSL for slicing samples in Sonic Pi

Sample slicing DSL in Sonic Pi

I'm stealing/playing around with ideas from the tidal language here.

Tidal is more focussed on creating loop based music and manipulating samples. It has a good (although initially scary looking) DSL for this purpose.

  every 6 (density 2) $ jux (iter 8) $ every 8 rev $ 
  every 5 (0.25 <~) $ sound "[808a/4*16, 808a/2 [808a/3 ~ ~ 808b] [~ 808b/3 808b/3 ~] [~],  [~ ~ ~ [~ 808b/2]]/2]"
 |+| speed "[1 1 1 [1.5 0.8] 1 1 1 [1 0.5]]/8"
@postspectacular
postspectacular / retune-dnb.rb
Last active August 22, 2021 16:08
Sonic-PI livecoding demo @ Retune 2014 - only temporary home here until repo w/ talk slides is up
# Live coding example for Retune conference 2014
# 1) Press Run (Cmd+R) to start
# 2) Make changes (e.g. comment in/out various lines in :beats & :amen)
# 3) Press Run again (changes will only be audible from next queue point)
# compute loop length (4 bars), bar & quarter note durations
dur = sample_duration :loop_compus
bar = dur / 4
quart = dur / 16
require 'rubygems'
$LOAD_PATH.unshift '/Users/josephwilk/Workspace/ruby/ashton/lib/'
require "ashton"
class TestWindow < Gosu::Window
NOISE_FRAGMENT =<<-END
#version 110
// Use 3D Simplex noise, even though the shader operates on a 2D
// texture, since then we can make the Z-coordinate act as time.