Skip to content

Instantly share code, notes, and snippets.

# Create Chords in Sonic Pi, to send via MIDI to your other DAW or synth
# See https://www.youtube.com/watch?v=qd8SEL_rTNw
define :chordSeq do | tonic, mode, degs |
majorKeyTriads = [:M,:m,:m,:M,:M,:m,:dim]
minorKeyTriads = [:m,:dim,:M,:m,:m,:M,:M]
majorKey7s = [:M7,:m7,:m7,:M7,:dom7,:m7,:halfdiminished]
minorKey7s = [:m7,:halfdiminished,:M7,:m7,:m7,:M7,:dom7]
cs = []
@interstar
interstar / bytebeats.edscript
Created March 15, 2021 02:33
ByteBeats in Edison (FL Studio Sample Editor)
script "JavaScript ByteBeats" language "javascript";
function generator(t) {
return (128&t*(4|7&t>>13)>>(1&-t>>11))+(127&t*(t>>11&t>>13)*(3&-t>>9)) ;
}
function makeSample(length,srate,norm) {
var start = 0;
var end = 0;
var s;
@interstar
interstar / trap3.rb
Last active August 3, 2021 21:32
Trap beat for sonic pi
use_bpm 145
# Our chord sequence
p1 = [chord(:E3,"minor7"),
chord(:G3,"major7"),
chord(:A3,"minor7"),
chord(:G3,"m9"),
chord(:E3,"m9"),
chord(:C3,"minor7"),
@interstar
interstar / gist:fbfd0391e9d33f5a2fb7334398f60ee8
Created July 30, 2017 19:14
Versao services.clj no exemplo de grupo FP de Calango
(ns clojure-web-server.routes.services
(:require [ring.util.http-response :refer :all]
[compojure.api.sweet :refer :all]
[schema.core :as s])
)
(defonce ideias (atom {:id 0 :nome "root" :criancas
[{:id 1 :nome "hello" :criancas {}}]}))
(defn buscar [id ids]
@interstar
interstar / .block
Created March 11, 2017 19:29
Directed Graph Editor
license: mit
@interstar
interstar / gist:33098d0fa9cb843cd9b5300fe9bb9655
Created June 7, 2016 16:29
Useless Things #1 : Five Minutes
# Five Minutes
# requires Phil's Sonic Pi Lib ( https://github.com/interstar/Phil-s-Sonic-Pi-Lib )
section = :a
live_loop :clock do
section=wait_then(1,:b)
puts section
@interstar
interstar / Sonic Pi sketch
Created April 16, 2016 00:45
Started as a quick play with Sonic Pi to see if I could create functions that process and transform sequences of notes. Grew into a tune.
define :trans do |xs, d|
return xs.collect { |x| (x+d) }
end
ritmo = [0.2,0.4,0.2,0.4]
i = [:c3,:eb3,:g3,:c4,:c3,:eb3,:g3,:c4]
iv = (trans i, 5)
v = (trans i, 7)
#include <Bounce.h>
int anaPin = 5; // Analogue in pin
int button = 2; // button pin
int beepPin = 3; // piezo buzzer
// edges of our calibration window
float aMax;
float aMin;
@interstar
interstar / gist:6051618
Last active December 20, 2015 01:49
Quora Scraper: And here's a quick page which takes the files containing my answers that I pulled via RSS and makes an HTML page out of them.
from os import listdir
from os.path import isfile, join
onlyfiles = [ f for f in listdir(".") if isfile(join("",f)) ]
import json
print """
<html>
<style>
body {
@interstar
interstar / quorascraper.py
Created July 22, 2013 04:15
Quora RSS scraper.
import feedparser
import hashlib
import json
from bs4 import BeautifulSoup
d = feedparser.parse("http://www.quora.com/YOUR-QUORA-NAME/answers/rss")
for e in d["entries"] :
title = e["title"]
summary = e["summary"]