Skip to content

Instantly share code, notes, and snippets.

View gavq's full-sized avatar
What's happening?

gavq

What's happening?
View GitHub Profile
@gavq
gavq / removeCollaborator.js
Created February 4, 2021 08:24 — forked from pimentel/removeCollaborator.js
Remove yourself as a collaborator from many github repositories
var GithubApi = require("github");
// you can install the required module using `npm install github`
var user = "myUsername";
var password = "myPassword";
function filterRepos(item) {
var lowerName = item.full_name.toLowerCase();
return item.owner.login !== 'berkeley-stat243' &&
@gavq
gavq / frere.clj
Created June 8, 2012 11:27
Frere Jacques
(def frere-intervals
[[:i :_ :ii :_ :iii :_ :i :_
:i :_ :ii :_ :iii :_ :i :_
:iii :_ :iv :_ :v :_ :_ :_
:iii :_ :iv :_ :v :_ :_ :_
:v :vi :v :iv :iii :_ :i :_
:v :vi :v :iv :iii :_ :i :_
:i :_ :v- :_ :i :_ :_ :_
:i :_ :v- :_ :i :_ :_ :_
]])
@gavq
gavq / musicxml.clj
Created April 14, 2012 14:23
Extract note and chord information from a MusicXML file and emit clojure
(ns examples.musicxml
(:require [clojure.zip :as zip]
[clojure.xml :as xml])
(:use [clojure.data.zip.xml]))
(defn measure-label [loc]
[ "part" (xml1-> loc zip/up (attr :id))
"bar" (xml1-> loc (attr :number))])
(defn pitch [loc]
@gavq
gavq / musicxml2clj.xsl
Created April 13, 2012 08:56
Convert a subset of MusicXML to Overtone-compatible clojure
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:output method="text"/>
<xsl:template match="score-partwise">
@gavq
gavq / mozart_game.clj
Created April 9, 2012 19:34
Musical Dice Game
(ns examples.mozart-game
(:use
[overtone.at-at :only [now at mk-pool]]
[overtone.midi :only [midi-out midi-note-on midi-note-off]]
[overtone.music.pitch :as pitch]))
;;
;; "Mozart" Musical Dice Game
;;
;; Select random bars from a pre-determined dataset.
@gavq
gavq / midi
Created March 10, 2012 08:15
Clojure for General MIDI
;;
;; General MIDI defines instruments for 128 program numbers
;; http://www.midi.org/techspecs/gm1sound.php
;;
;; javax.sound.midi numbers the instruments from 0 rather than 1, so acoustic-grand-piano is 0.
;;
(def GM
{:acoustic-grand-piano 0
:bright-acoustic-piano 1