Skip to content

Commit

Permalink
Merge branch 'cycseq' of github.com:tidalcycles/Tidal into cycseq
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxu committed Aug 17, 2023
2 parents 84f873a + 5c6b426 commit 64f7393
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tidal-core/src/Sound/Tidal/Chords.hs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ instance Show Modifier where
show Open = "Open"

applyModifier :: (Enum a, Num a) => Modifier -> [a] -> [a]
applyModifier (Range i) ds = take i $ concatMap (\x -> map (+ x) ds) [0,12..]
applyModifier (Range i) ds = take i $ concatMap (\x -> map (+ x) ds) [0,12 ..]
applyModifier Invert [] = []
applyModifier Invert (d:ds) = ds ++ [d+12]
applyModifier Open ds = if length ds > 2 then
Expand Down
4 changes: 2 additions & 2 deletions tidal-core/src/Sound/Tidal/Pattern.hs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ slowRepeatCycles = repeatCycles

{- | `range` will take a pattern which goes from 0 to 1 (like `sine`),
and scale it to a different range - between the first and second
arguments. In the below example, `range 1 1.5` shifts the range of
`sine1` from 0 - 1 to 1 - 1.5.
arguments. in the below example, `range 1 1.5` shifts the range of
`sine1` from 0 - 1 to 1 - 1.5 .
@
d1 $ jux (iter 4) $ sound "arpy arpy:2*2"
Expand Down
2 changes: 1 addition & 1 deletion tidal-core/src/Sound/Tidal/Signal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ The new resulting signal is played over the time period of the original signal:
d1 $ zoom 0.25 0.75 $ sound "bd*2 hh*3 [sn bd]*2 drum"
@
In the signal above, `zoom` is used with an span from 25% to 75%. It is equivalent to this signal:
in the signal above, `zoom` is used with an span from 25% to 75%. It is equivalent to this signal:
@
d1 $ sound "hh*3 [sn bd]*2"
Expand Down
16 changes: 8 additions & 8 deletions tidal-core/src/Sound/Tidal/Signal/Random.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ time (via `cps (-1)`, then `cps 1.1` or whatever cps you want to
restart with) the random pattern will emit the exact same _random_
numbers again.
In cases where you need two different random patterns, you can shift
in cases where you need two different random patterns, you can shift
one of them around to change the time from which the _random_ pattern
is read, note the difference:
Expand Down Expand Up @@ -108,7 +108,7 @@ irand = (>>= _irand)
_irand :: Num a => Int -> Signal a
_irand i = fromIntegral . (floor :: Double -> Int) . (* fromIntegral i) <$> rand

{- | 1D Perlin (smooth) noise, works like rand but smoothly moves between random
{- | 1 dimensional Perlin (smooth) noise, works like rand but smoothly moves between random
values each cycle. `perlinWith` takes a pattern as the RNG's "input" instead
of automatically using the cycle count.
@
Expand Down Expand Up @@ -137,7 +137,7 @@ d1
# lpq 0.3
@
will generate a smooth random cutoff pattern that repeats every cycle without
any reversals or discontinuities (because the 2D path is a circle).
any reversals or discontinuities (because the 2 dimensional path is a circle).
`perlin2` only needs one input because it uses the cycle count as the
second input.
-}
Expand Down Expand Up @@ -168,7 +168,7 @@ perlin2 = perlin2With (waveform fromRational)
sound "superpiano(3,8)" # note (choose ["a", "e", "g", "c"])
@
plays a melody randomly choosing one of the four notes \"a\", \"e\", \"g\", \"c\".
plays a melody randomly choosing one of the four notes "a", "e", "g", "c".
-}
choose :: [a] -> Signal a
choose = chooseBy rand
Expand All @@ -188,7 +188,7 @@ chooseBy f xs = (xs !!!) . floor <$> range 0 (fromIntegral $ length xs) f
sound "superpiano(3,8)" # note (wchoose [("a",1), ("e",0.5), ("g",2), ("c",1)])
@
In the above example, the "a" and "c" notes are twice as likely to
in the above example, the "a" and "c" notes are twice as likely to
play as the "e" note, and half as likely to play as the "g" note.
-}
Expand Down Expand Up @@ -287,21 +287,21 @@ sometimesBy x f pat = overlay (degradeBy x pat) (f $ unDegradeBy x pat)
sometimesBy' :: Signal Double -> (Signal a -> Signal a) -> Signal a -> Signal a
sometimesBy' x f pat = overlay (degradeBy x pat) (unDegradeBy x $ f pat)

-- | @sometimes@ is an alias for sometimesBy 0.5.
-- | @sometimes@ is an alias for sometimesBy 0.5 .
sometimes :: (Signal a -> Signal a) -> Signal a -> Signal a
sometimes = sometimesBy 0.5

sometimes' :: (Signal a -> Signal a) -> Signal a -> Signal a
sometimes' = sometimesBy' 0.5

-- | @often@ is an alias for sometimesBy 0.75.
-- | @often@ is an alias for sometimesBy 0.75 .
often :: (Signal a -> Signal a) -> Signal a -> Signal a
often = sometimesBy 0.75

often' :: (Signal a -> Signal a) -> Signal a -> Signal a
often' = sometimesBy' 0.75

-- | @rarely@ is an alias for sometimesBy 0.25.
-- | @rarely@ is an alias for sometimesBy 0.25 .
rarely :: (Signal a -> Signal a) -> Signal a -> Signal a
rarely = sometimesBy 0.25

Expand Down
4 changes: 2 additions & 2 deletions tidal-core/src/Sound/Tidal/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ newtype Note = Note { unNote :: Double }
deriving (Generic, Eq, Ord, Enum, Num,
Fractional, Floating, Real, RealFrac, NFData)

-- | In Tidal, time is rational
-- | in Tidal, time is rational
type Time = Rational

-- class Test p where
Expand Down Expand Up @@ -104,7 +104,7 @@ data Value = VS String
deriving (Typeable, Generic)
instance NFData Value

-- | Maps of values, used for representing synth control/trigger
-- | Maps of values, used for representing synth control
-- messages, and state
type ValueMap = (Map.Map String Value)

Expand Down

0 comments on commit 64f7393

Please sign in to comment.