Tidal
Tidal copied to clipboard
Make 'controlpattern as string or number' default off
trafficstars
Adding # 1 and # 1.1 and # "foo" to a controlpattern will add an n, speed or sound control respectively. This seems helpful but can cause a lot of confusion. Lets not have that on by default.
Naming control pattern as string default off is just a case of moving this:
instance {-# OVERLAPPING #-} IsString ControlPattern where
fromString = s . parseBP_E
from Sound.Tidal.Simple into another module not included in Sound.Tidal.Context.
"controlpattern as number" is something we generally want though, so that e.g. (n 2) + (n 3) can work.
From Sound.Tidal.Pattern:
instance Num ControlMap where
negate = (applyFIS negate negate id <$>)
(+) = Map.unionWith (fNum2 (+) (+))
(*) = Map.unionWith (fNum2 (*) (*))
fromInteger i = Map.singleton "n" $ VI $ fromInteger i
signum = (applyFIS signum signum id <$>)
abs = (applyFIS abs abs id <$>)
We could just make fromInteger raise an error, but probably not in an optional way.. hm