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
module Main where | |
import System.Posix | |
import Network | |
import qualified Data.ByteString.Lazy as B | |
import Data.Binary | |
import Network.Socket (close) | |
import Control.Monad (forever, replicateM_) | |
import System.Environment (getArgs) | |
import System.IO |
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
//jeffs pad example | |
( | |
SynthDef(\frp1, { | |
var x = Saw.ar( \freq.kr(440) ) * 0.5.dup; | |
var env = EnvGen.ar( Env.adsr, \gate.kr(1) ); | |
Out.ar(0, x*env) | |
}).add |
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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import System.Environment ( getArgs ) --part of base | |
import System.Console.GetOpt --part of base | |
import Shelly (shelly, run_, verbosely, Sh) | |
import qualified Data.ByteString.Char8 as B | |
import qualified Data.Text as T |
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
module Main where | |
import System.Directory | |
import Control.Monad (when) | |
rename :: String -> String | |
rename xs = "20"++take 2 xs++"_"++f 2++"_"++(take 5 $ drop 4 xs)++"_"++f 9++"_"++drop 11 xs | |
where f n = take 2 $ drop n xs | |
main :: IO () |
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
with (import <nixpkgs> {}); | |
#{ stdenv, fetchurl, cmake, pkgconfig | |
#, jack2, libsndfile, fftw, curl | |
#, libXt, qt, readline | |
#, useSCEL ? false, emacs | |
#}: | |
let optional = stdenv.lib.optional; useSCEL = false; 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
{ | |
packageOverrides = pkgs : rec { | |
haskellngPackages = pkgs.haskellngPackages.override { | |
overrides = self: super: rec { | |
cmdl = self.callPackage /home/miguel/bin/cmdl-source/default.nix {}; | |
openl = self.callPackage /home/miguel/Development/Haskell/projects/misc/openl/default.nix {}; | |
#hosc2 = self.callPackage ./haskell/hosc2.nix {}; | |
#wxc = self.callPackage ./haskell/wxc.nix {}; | |
vividNew = self.callPackage ./haskell/vivid-0.1.0.3.nix {}; |
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
/** | |
* | |
* Newton-Raphson Square Roots | |
* as is shown in "why functional programming matters" | |
* http://www.cs.utexas.edu/~shmat/courses/cs345/whyfp.pdf | |
*/ | |
object NewtonRoots { | |
//algorithm to approach the square root of n |
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
/** | |
* User: miguelnegrao | |
* Date: 20/04/12 | |
*/ | |
import annotation.tailrec | |
import javax.sound.sampled._ | |
import math._ | |
import scalaz._ | |
import Scalaz._ |
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
( | |
i = 2**(1/9); | |
~innerIntervals = [i,i,i**2,i,i,i,i**2]; | |
~intervalsToRoot = ([1]++~innerIntervals).inject([], { |state,x| | |
if(state.size == 0){ | |
[x] | |
} { | |
state ++ [state.last*x] | |
} |
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
( | |
var r = { |f| { | |
var combF, sawF, c, r, sine , pulse; | |
sine = { SinOsc.kr(rrand(0.01,0.03)).range(0.0,1.0) }; | |
pulse = { Pulse.kr(rrand(0.1,0.3)) }; | |
r = 10.collect{ | |
sawF = 2.collect{ ( ( (pulse ! 2).sum + LFNoise2.kr(1) ) / 3).range(f,f+300) }; | |
y = Saw.ar( sawF ); | |
combF = ( ( (pulse ! 2).sum + (sine ! 3).sum ) /5).rangeExp(0.0001,0.009); | |
c = CombC.ar(y, 0.01, combF, 0.2); |
OlderNewer