Skip to content

Instantly share code, notes, and snippets.

@rogerallen
rogerallen / cello sample analysis.ipynb
Last active August 29, 2015 13:57
Cello sample analysis python notebook. Go to http://nbviewer.ipython.org/gist/rogerallen/9908551 to view this.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rogerallen
rogerallen / lakeo.js
Last active August 29, 2015 14:01
Lake Oswego DEM function for ScriptCraft
// Function for drawing Lake Oswego, OR elevation data via ScriptCraft for
// Minecraft.
// See this post for more information:
// http://rogerallen.github.io/minecraft/2014/05/09/scriptcraft-for-creating-topography-in-minecraft/
// May, 2014
var lakeo = function() {
// saves the drone position so it can return there later
this.chkpt('lakeo');
var x, y;
var w = 3;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rogerallen
rogerallen / 00README.txt
Last active August 29, 2015 14:02
Homebrew GCC 4.8.3 install fails on Mac 10.9.3
1. Created the BrewInstallGccErrors.log by following steps here https://github.com/Homebrew/homebrew/wiki/troubleshooting
2. The real error seems to be located in the x86_64-apple-darwin13.2.0/libgcc/config.log (included below) file which is normally deleted by the build. I (finally) figured out how to access it via the --debug option.
Looking in that file, I think this is the real error
dyld: Library not loaded: /usr/local/lib/libcloog-isl.4.dylib
Referenced from: /private/tmp/gcc-DShr/gcc-4.8.3/build/./gcc/cc1
Reason: image not found
xgcc: internal compiler error: Trace/BPT trap: 5 (program cc1)
@rogerallen
rogerallen / stdout.txt
Last active August 29, 2015 14:02 — forked from fmasanori/jogos.py
readable world cup output
> ./wc.py
BRAZIL 3 x 1 croatia
MEXICO 1 x 0 cameroon
spain 1 x 5 NETHERLANDS
CHILE 3 x 1 australia
COLOMBIA 3 x 0 greece
IVORY COAST 2 x 1 japan
uruguay 1 x 3 COSTA RICA
england 1 x 2 ITALY
SWITZERLAND 2 x 1 ecuador
@rogerallen
rogerallen / chord.clj
Last active August 29, 2015 14:06
Simple Chord Progression Map
;; http://mugglinworks.com/chordmapsArchive/images/map1.gif
;; http://mugglinworks.com/chordmapsArchive/part3.htm
;;
;; To use the map, remember two things.
;; First, you may jump anywhere from I.
;; Second, if a chord appears at more than one place, there is an "imaginary tunnel"
;; connecting both spots, so you can move from one to the other.
;;
;; reddit discussion
;; http://www.reddit.com/r/WeAreTheMusicMakers/comments/2g3p7a/chord_progression_map_pick_a_key_and_play_a_chord/
// global variables
int top_x = 250;
int top_y = 150;
int cubert_move = 50;
int cubert_x = top_x;
int cubert_y = top_y;
float MOVE_TIME = 0.5;
float cubert_move_time = -1.0;
int cubert_start_x, cubert_start_y, cubert_end_x = top_x, cubert_end_y = top_y;
@rogerallen
rogerallen / example.clj
Created October 27, 2014 20:01
trove additive synth example
(use 'overtone.live)
(defsynth add-synth
[n 60 c0 0.1 c1 0.1 c2 0.1 c3 0.1 c4 0.1 c5 0.5 c6 0.1 c7 0.1]
(let [f (midicps n)]
(out 0 (+ (* c0 (sin-osc (* 1 f)))
(* c1 (sin-osc (* 2 f)))
(* c2 (sin-osc (* 3 f)))
(* c3 (sin-osc (* 4 f)))
(* c4 (sin-osc (* 5 f)))
@rogerallen
rogerallen / overtone-at-example.clj
Created January 19, 2015 15:29
overtone at & recursive playing example
(ns overtone-at-example
(:use [overtone.live]
[overtone.inst.sampled-piano]))
(def metro (metronome 110))
(defn play
[beat note]
(let [{:keys [pitch level dur]} note
cur-synth (at (metro beat) (sampled-piano :note pitch :level level))]
@rogerallen
rogerallen / SpinningDotsTrianglesCircle.pde
Created February 6, 2015 16:50
Spinning Dots Triangles Circle -- processing code that created https://www.youtube.com/watch?v=4LWCJvquuvo
int W=1280;
int H=720;
int N=16;
boolean SAVE_FRAMES=false;
float DT = 1.0/30.0;
float time;
int frame;
float[] dots_speed;