This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def SCALE | |
(let [ionian-sequence [2 2 1 2 2 2 1] | |
pentatonic-sequence [3 2 2 3 2] | |
rotate (fn [scale-sequence offset] | |
(take (count scale-sequence) | |
(drop offset (cycle scale-sequence))))] | |
{:diatonic ionian-sequence | |
:ionian (rotate ionian-sequence 0) | |
:major (rotate ionian-sequence 0) | |
:dorian (rotate ionian-sequence 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; A Stringed Synth Generator Macro & Guitar Example Instrument | |
;; | |
;; See overtone/examples/instruments/guitar_synth.clj for example usage. | |
;; | |
;; Other instruments (like bass-guitar, ukelele, mandolin, etc.) may | |
;; use the same basic instrument. Watch this space... | |
(ns overtone.synth.stringed | |
^{:doc "A Stringed Synth Generator Macro & Guitar Instrument" | |
:author "Roger Allen"} | |
(:use [overtone.music pitch time] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns explore-overtone.leipzig-poly-player | |
(:use | |
leipzig.melody | |
leipzig.scale | |
leipzig.canon) | |
(:require [overtone.live :as o] | |
[overtone.inst.sampled-piano :as p])) | |
;; "un-scale" -- the inverse translations to go from raw pitches 60, | |
;; 62, etc. to scale indices 0, 1, etc. Then, you can "re-scale" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns onlrt.core | |
(:gen-class)) | |
;; Ray-Tracing in Clojure from | |
;; http://nakkaya.com/2010/12/26/ray-tracing-in-clojure/ | |
(defstruct v3d-struct :x :y :z) | |
(defn v3d [x y z] | |
(struct v3d-struct x y z)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns explore-overtone.leip-polyrhythm | |
(:require [overtone.live :as o] | |
[leipzig.live :as ll] | |
[leipzig.melody :as lm])) | |
(def snare (o/sample (o/freesound-path 26903))) | |
(def kick (o/sample (o/freesound-path 2086))) | |
(def close-hihat (o/sample (o/freesound-path 802))) | |
(def open-hihat (o/sample (o/freesound-path 26657))) | |
(def clap (o/sample (o/freesound-path 48310))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; an attempt to translate | |
;; https://twitter.com/redFrik/status/333317729073381377 | |
;; play{a=LFSaw;mean({|i|Ringz.ar(Blip.ar(a.ar(i+1/[3,4])>(a.ar(i+1/8)+1)*25+50,i+[2,3])*a.ar(i+1/50,i/25),i+1*99,0.1)}!50)/5} | |
;; to Overtone | |
;; | |
;; play { | |
;; a=LFSaw; | |
;; mean( | |
;; { |i| | |
;; Ringz.ar( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Overtone Translation of Vi Hart's Sound Braid by Roger Allen | |
;; http://www.youtube.com/watch?v=VB6a4nI0BPA | |
;; | |
;; Listen to what this sounds like here: http://goo.gl/HSzgM | |
;; | |
(ns vihart-braid | |
(:require [overtone.live :as o] | |
[overtone.synth.stringed :as strings] | |
[leipzig.canon :as lc] | |
[leipzig.live :as ll] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sonogram.glsl for Shadertone | |
// | |
// Now with explicit commentary...feel free to ask questions! | |
// | |
// Use a call like this to start the window from Clojure & Shadertone. | |
// See similar code in https://github.com/overtone/shadertone/tree/master/examples | |
// (t/start "examples/sonogram.glsl" | |
// :width 1024 :height 512 ;; note width matches WIN_WIDTH, height is 1:1 with FFT data | |
// :textures [ :overtone-audio :previous-frame ]) ;; this puts the FFT data in iChannel0 and | |
// ;; a texture of the previous frame in iChannel1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; play{a=LFTri;l=LocalBuf(b=600,9).clear;BufWr.ar(a.ar(c=(3..11)*3.5),l,a.ar(9/c,c/99)*b);Splay.ar(PlayBuf.ar(9,l,loop:1)/2)} | |
;; | |
;; play{ | |
;; a=LFTri; | |
;; l=LocalBuf(b=600,9).clear; | |
;; BufWr.ar( | |
;; a.ar( | |
;; c=(3..11)*3.5 | |
;; ), | |
;; l, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns explore-overtone.violin | |
(:use [overtone.live])) | |
;; From the second article in the 4-part series... | |
;; http://www.soundonsound.com/sos/may03/articles/synthsecrets49.asp | |
;; See Image 5/Figure 4 as a good orientation point. | |
;; | |
;; 1) we used the synth to generate a sawtooth wave, and filtered it | |
;; using the internal low-pass and high-pass filters. | |
;; |