This file contains hidden or 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
betweenTimes :: Integral b => b -> Time -> Time -> Time -> Bool | |
betweenTimes n s e t = and [normT >= s, normT < e] where normT = fromIntegral (mod (floor t) n) | |
playForLoop :: Integral b => b -> Time -> Time -> Pattern a -> Pattern a | |
playForLoop n s e = playWhen (betweenTimes n s e) | |
seqPLoop :: Integral b => b -> [(Time, Time, Pattern a)] -> Pattern a | |
seqPLoop n = stack . (map (\(s, e, p) -> playForLoop n s e ((sam s) ~> p))) |
This file contains hidden or 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
import qualified Data.Maybe as M | |
import Debug.Trace | |
-- Type type | |
data Type = Val Char | Arrow Type Type deriving Eq | |
instance Show Type where | |
show (Val c) = [c] | |
show (Arrow t1 t2) = "(" ++ (show t1) ++ " -> " ++ (show t2) ++ ")" | |
-- Substitution type |
This file contains hidden or 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
#/bin/python | |
# Mandelbrot pattern generator by Bob Webb, 2012. | |
# Generates a Mandelbrot pattern as a 2D array of numerical values (number of iterations) that's then pickled. | |
# I need to get round to pickling metadata as well but not now. Har har. | |
import sys | |
import numpy | |
import pickle | |
import math |
NewerOlder