Skip to content

Instantly share code, notes, and snippets.

@xavriley
xavriley / wavetable_stuff.sc
Created November 13, 2017 08:20
SuperCollider wavetable experiments for Sonic Pi
s.boot
// BEGIN code to convert AKWF wavetables from 600 samples in length to 1024
// because VOsc3 needs a buffer which is a power of two to work properly
// this pipes in stdout from ls
(
var p, l;
p = Pipe.new("find ~/Projects/sonic-pi/etc/wavetables/AKWF/AKWF_0001 -iname *.wav", "r"); // list directory contents in long format
l = p.getLine; // get the first line
@reborg
reborg / rich-already-answered-that.md
Last active February 23, 2024 13:09
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

;; warm up: balancing
=> (s/def ::balanced
(s/* (s/cat :open #{'<} :children ::balanced :close #{'>})))
:user/balanced
=> (s/conform ::balanced '[< < > < > > < >])
[{:open <, :children [{:open <, :close >} {:open <, :close >}], :close >} {:open <, :close >}]
=> (s/conform ::balanced '[< < > < < > > > < >])
[{:open <, :children [{:open <, :close >} {:open <, :children [{:open <, :close >}], :close >}], :close >} {:open <, :close >}]
;; infix to prefix
@mbutz
mbutz / otaku
Created May 30, 2016 19:44
From the series R(emodelling) E(electronic) C(lassics) with Sonic Pi: Otaku (1992)
# From the series R(emodelling) E(electronic) C(lassics) with Sonic Pi
# Black Dog Productions - Otaku (1992)
use_bpm 120
# Download sample and adjust path to your environement
path = "/home/marty/projects/leuphana-local/sonic-pi/mb/samples/", 0
load_sample path, 2
# http://www.freesound.org/people/kendallbear/sounds/123804/
clap = path, 2
@jasongilman
jasongilman / atom_clojure_setup.md
Last active January 11, 2024 09:13
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@xavriley
xavriley / README.md
Created February 11, 2016 09:44
Emulating the 2A03 NES sound chip in SuperCollider
@xavriley
xavriley / README.md
Created February 5, 2016 21:09
Getting LADSPA plugins working on Sonic Pi

Getting LADSPA plugins working on Sonic Pi

This is an evil experiment at the moment but it works

  • Download and install LMMS from http://lmms.io
  • Run the attached SuperCollider file to create the synthdef locally (Overtone doesn't have ladspa yet)
  • patch the named ruby files as per the other attachments
  • start Sonic Pi
@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5
@rauhs
rauhs / humanize-schema-errors.clj
Last active May 27, 2023 05:29
Translate prismatic's schema.core errors to a human readable form. Use this for presenting validation errors to users. Don't use this for programming errors like a missing map key etc.
(ns x.y
(:use [plumbing.core]) ;; Just for the map-vals
(:require [clojure.walk :refer [postwalk prewalk prewalk-demo postwalk-demo]]
[clojure.core.match :refer [match]]
[schema.utils :refer [named-error-explain validation-error-explain]]
[schema.core :as s])
(:import (schema.utils NamedError ValidationError)))
;; Partially FROM:
;; https://github.com/puppetlabs/clj-schema-tools