Compare commits

...

2 Commits

Author SHA1 Message Date
loooph fb92e20524 add type for patternize 2023-03-01 04:24:13 +01:00
loooph 43d12171d0 Add p and k variants with offset 2023-03-01 04:23:43 +01:00
1 changed files with 7 additions and 4 deletions

View File

@ -73,11 +73,13 @@ instrument g e = case edgeType g e of
L -> "sn"
NE -> " " -- let super collider deal with it
-- complete graph
k n = buildG (1,n) [(u,v)|u <- [1..n],v <- [1..n]]
k n = k' n 0
-- complete graph with offset to all nodes
k' n o = buildG (1+o,n+o) [(u,v)|u <- [1..n],v <- [1+o..n+o]]
-- path
p n = buildG (1,n) [(u,u+1)|u <- [1..n-1]]
-- reversed path TODO function to reverse all edges for arbitary graphs
p' n = buildG (1,n) [(u+1,u)|u <- [1..n-1]]
p n = p' n 0
-- path with offset to all nodes
p' n o = buildG (1 + o, n + o) [(u,u + 1)|u <- [1+o..n-1+o]]
-- TODO Tiefe
-- TODO Wurzel betonen
@ -97,6 +99,7 @@ let edgePattern g e = (n $ pure $ toEnum $ (snd e) `mod` 31) # (s $ pure $ instr
# resonance 0.2
# end 0.2
# gain 0.8
patternize :: Graph -> [[Pattern ValueMap]]
patternize g = map (map (\(x,y) -> fastcat [x,y])) $ map (\(x,y) -> zip (repeat $ vertexPattern g x) (map (edgePattern g) y)) $ nodeEdgePairs g
gs = [ k 30, buildG (32,33) [(32,33)] ]
in d1 $ id