Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rejig everything #1031

Open
wants to merge 86 commits into
base: 2.0-beatmode-retired
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
9cfc5db
add seqSqueezeJoin, promote metadata utils, fix tests
yaxu Jun 3, 2023
2b1be07
move old stuff out and delint
yaxu Jun 3, 2023
e00d8b9
move old stuff out and delint
yaxu Jun 3, 2023
7ec5e3b
more delinting
yaxu Jun 3, 2023
a87d0de
fix bite
yaxu Jun 3, 2023
5fd3f26
fix some warns
yaxu Jun 3, 2023
4ce69ef
remove warns
yaxu Jun 3, 2023
3637c99
promote off and ~>
yaxu Jun 3, 2023
7f83d07
comment out missing test file for now
yaxu Jun 6, 2023
fabb7ff
comment out missing test file for now
yaxu Jun 6, 2023
6a19f7c
temporary arch PKGBUILD file
yaxu Jun 6, 2023
933623d
missing PatternTest file
yaxu Jun 6, 2023
933125c
bugfix beatmode
yaxu Jun 6, 2023
b9ba9bd
bugfix alignment of stacks
yaxu Jun 6, 2023
8ac95d3
remove version suffix
yaxu Jun 8, 2023
e1a3c4f
Merge branch 'cycseq' of github.com:tidalcycles/tidal into cycseq
yaxu Jun 8, 2023
cc309d9
alphabetise pattern type instance declarations, and start generalisin…
yaxu Jun 9, 2023
49e183e
try to simplify sequence join, fix toCycle some more
yaxu Jun 12, 2023
670bc01
fix subsequences in mininotation
yaxu Jun 13, 2023
a0dacc6
fix test warnings
yaxu Jun 13, 2023
fd11e79
update arch stuff
yaxu Jun 13, 2023
18dc42e
clarify
yaxu Jun 13, 2023
a4c448c
generic instances
yaxu Jun 13, 2023
894a5cb
Merge branch 'cycseq' of github.com:tidalcycles/tidal into cycseq
yaxu Jun 13, 2023
cc6870c
update pkgbuild
yaxu Jun 13, 2023
7f3b15d
tidy metadata, adding new field for alignment
yaxu Jun 14, 2023
8248e96
fix tests, fix warnings
yaxu Jun 14, 2023
27270ef
failed alignment proof of concept
yaxu Jun 19, 2023
e5becc0
remove old stuff
yaxu Jun 24, 2023
1c4d59b
import minimal sketch of tidal-core from yaxu/mvt
yaxu Jul 26, 2023
33bfa64
tidy patternification, add euclid
yaxu Aug 2, 2023
920af6e
tidy patternification, add euclid
yaxu Aug 2, 2023
094b57a
fix warnings
yaxu Aug 12, 2023
0b060cd
port more things to tidal-core, tidy pattern joins and binds
yaxu Aug 13, 2023
d282169
more porting and tidying
yaxu Aug 13, 2023
ba139a9
more porting, including pattern-as-number hacks
yaxu Aug 15, 2023
ee9919d
add missing files
yaxu Aug 15, 2023
04a2374
bite and segment
yaxu Aug 16, 2023
78119de
fix warnings
yaxu Aug 16, 2023
2e68e4e
fix up Show
yaxu Aug 16, 2023
e544d60
re-add controls to query
yaxu Aug 16, 2023
1925a5b
the return of the mininotation
yaxu Aug 17, 2023
e0e3c00
workarounds for realtalk parser
yaxu Aug 17, 2023
8923460
more realtalk workarounds
yaxu Aug 17, 2023
c2f7711
more realtalk workarounds
yaxu Aug 17, 2023
5c6b426
more realtalk workarounds
yaxu Aug 17, 2023
84f873a
start porting tests and tidy
yaxu Aug 17, 2023
64f7393
Merge branch 'cycseq' of github.com:tidalcycles/Tidal into cycseq
yaxu Aug 17, 2023
fbd8359
avoid collision with json value type
yaxu Aug 18, 2023
cea1d6e
avoid collision with json value type
yaxu Aug 18, 2023
e8cb7d0
Revert "avoid collision with json value type"
yaxu Aug 19, 2023
7c4fcbd
Revert "avoid collision with json value type"
yaxu Aug 19, 2023
40e602d
port more tests
yaxu Aug 19, 2023
deaa645
rejig patternification, to allow a pattern (just signal for now) to c…
yaxu Aug 22, 2023
7fd68ec
patBind / patAlign for sequences
yaxu Aug 22, 2023
8f76338
tidy
yaxu Aug 22, 2023
9ec7217
tidy
yaxu Aug 23, 2023
a311014
tidy
yaxu Aug 23, 2023
88497f9
add trig / trigzero
yaxu Aug 23, 2023
abbcba5
Sound.Tidal.Params
yaxu Aug 23, 2023
f848ddb
split out tidal-stream
yaxu Aug 23, 2023
a453f36
Sound.Tidal.Boot
yaxu Aug 23, 2023
28e778f
fix up binds and applicative
yaxu Aug 24, 2023
7eb1083
default to flexible bind
yaxu Aug 24, 2023
cde769d
missing import
yaxu Aug 24, 2023
bf1de41
split out the dirt params
yaxu Aug 24, 2023
05274e5
get bindalignment working for applicative
yaxu Aug 25, 2023
c11d00e
age
yaxu Aug 25, 2023
d65130e
age
yaxu Aug 25, 2023
525c57e
age
yaxu Aug 25, 2023
f1c5655
Merge branch 'main' into cycseq
yaxu Aug 25, 2023
9ac45ba
tidy
yaxu Aug 25, 2023
2391a88
Merge branch 'cycseq' of github.com:tidalcycles/Tidal into cycseq
yaxu Aug 25, 2023
809c372
inner/outer
yaxu Aug 25, 2023
2020324
Merge branch 'cycseq' of github.com:tidalcycles/Tidal into cycseq
yaxu Aug 25, 2023
17e7d6c
tidy up tests
yaxu Aug 26, 2023
f2ef572
temporarily turn off pattern alignment in applicative
yaxu Aug 27, 2023
b9b138f
move old tests
yaxu Aug 27, 2023
3f5bd9f
port more (failing) tests
yaxu Aug 27, 2023
aea9901
port more (failing) tests
yaxu Aug 27, 2023
771f8fd
more porting
yaxu Aug 30, 2023
9a84fd0
more test breakage
yaxu Aug 30, 2023
42a7073
more test breakage
yaxu Aug 30, 2023
3eaa801
move stream tests
yaxu Aug 30, 2023
2a6a221
bump primitive to < 0.10 (metadata already updated on hackage)
yaxu Oct 11, 2023
d347b65
Merge branch 'cycseq' of github.com:tidalcycles/Tidal into cycseq
yaxu Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/generate-params.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/runhaskell

-- This can be run with e.g.:
-- runhaskell generate-params.hs > ../src/Sound/Tidal/Params.hs
-- runhaskell generate-params.hs > ../tidal-params-dirt/src/Sound/Tidal/Params/Dirt.hs

import Data.Function
import Data.List
Expand Down
84 changes: 6 additions & 78 deletions bin/params-header.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module Sound.Tidal.Params where
module Sound.Tidal.Params.Dirt where

-- Please note, this file is generated by bin/generate-params.hs
-- Submit any pull requests against that file and/or params-header.hs
-- in the same folder, thanks.

{-
Params.hs - Provides the basic control patterns available to TidalCycles by default
Copyright (C) 2021, Alex McLean and contributors
Dirt.hs - Provides Tidal parameters for communicating with Dirt
and similar OSC endpoints.

Copyright (C) 2023, Alex McLean and contributors

This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -22,81 +24,7 @@ module Sound.Tidal.Params where
along with this library. If not, see <http://www.gnu.org/licenses/>.
-}

import qualified Data.Map.Strict as Map

import Sound.Tidal.Pattern
import Sound.Tidal.Signal.Base
import Sound.Tidal.Signal.Compose ((#))
import Sound.Tidal.Types
import Sound.Tidal.Value
-- import Sound.Tidal.Core ((#))
import Data.Fixed (mod')
import Data.Maybe (fromMaybe)
import Data.Word (Word8)
import Sound.Tidal.Utils

-- | group multiple params into one
grp :: Pattern p => [String -> ValueMap] -> p String -> p ValueMap
grp [] _ = silence
grp fs p = splitby <$> p
where splitby name = Map.unions $ map (\(v, f) -> f v) $ zip (split name) fs
split :: String -> [String]
split = wordsBy (==':')

mF :: String -> String -> ValueMap
mF name v = fromMaybe Map.empty $ do f <- readMaybe v
return $ Map.singleton name (VF f)

mI :: String -> String -> ValueMap
mI name v = fromMaybe Map.empty $ do i <- readMaybe v
return $ Map.singleton name (VI i)

mS :: String -> String -> ValueMap
mS name v = Map.singleton name (VS v)

-- | Param makers

pF :: Pattern p => String -> p Double -> p ValueMap
pF name = fmap (Map.singleton name . VF)

pI :: Pattern p => String -> p Int -> p ValueMap
pI name = fmap (Map.singleton name . VI)

pB :: Pattern p => String -> p Bool -> p ValueMap
pB name = fmap (Map.singleton name . VB)

pR :: Pattern p => String -> p Time -> p ValueMap
pR name = fmap (Map.singleton name . VR)

pN :: Pattern p => String -> p Note -> p ValueMap
pN name = fmap (Map.singleton name . VN)

pS :: Pattern p => String -> p String -> p ValueMap
pS name = fmap (Map.singleton name . VS)

pX :: Pattern p => String -> p [Word8] -> p ValueMap
pX name = fmap (Map.singleton name . VX)

pStateF :: Pattern p => String -> String -> (Maybe Double -> Double) -> p ValueMap
pStateF name sName update = pure $ Map.singleton name $ VState statef
where statef :: ValueMap -> (ValueMap, Value)
statef sMap = (Map.insert sName v sMap, v)
where v = VF $ update $ Map.lookup sName sMap >>= getF

pStateList :: Pattern p => String -> String -> [Value] -> p ValueMap
pStateList name sName xs = pure $ Map.singleton name $ VState statef
where statef :: ValueMap -> (ValueMap, Value)
statef sMap = (Map.insert sName (VList $ tail looped) sMap, head looped)
where xs' = fromMaybe xs (Map.lookup sName sMap >>= getList)
-- do this instead of a cycle, so it can get updated with the a list
looped | null xs' = xs
| otherwise = xs'

pStateListF :: Pattern p => String -> String -> [Double] -> p ValueMap
pStateListF name sName = pStateList name sName . map VF

pStateListS :: Pattern p => String -> String -> [String] -> p ValueMap
pStateListS name sName = pStateList name sName . map VS
import Sound.Tidal.Params

-- | Grouped params

Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1 +1 @@
packages: ./ tidal-link
packages: tidal-core, tidal-stream, tidal-link, tidal-params-dirt
19 changes: 19 additions & 0 deletions old/Sound/Tidal/Alignment.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Sound.Tidal.Alignment where

import Sound.Tidal.Pattern
import Sound.Tidal.Types

squeeze :: Pattern p => p a -> p a
squeeze = setStrategy SqueezeIn

squeezeIn :: Pattern p => p a -> p a
squeezeIn = squeeze

squeezeOut :: Pattern p => p a -> p a
squeezeOut = setStrategy SqueezeOut

expand :: Pattern p => p a -> p a
expand = setStrategy Expand

repeat :: Pattern p => p a -> p a
repeat = setStrategy Repeat
File renamed without changes.
File renamed without changes.
File renamed without changes.
79 changes: 39 additions & 40 deletions src/Sound/Tidal/Compose.hs → old/Sound/Tidal/Compose.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

module Sound.Tidal.Compose where

import Control.Monad (forM)
import Data.Bits
import Prelude hiding ((*>), (<*))

Expand Down Expand Up @@ -44,16 +43,16 @@ opOut :: Pattern p => (a -> b -> c) -> p a -> p b -> p c
opOut f a b = f <$> a *> b

opSqueeze :: (a -> b -> c) -> Signal a -> Signal b -> Signal c
opSqueeze f a b = squeezeJoin $ fmap (\a -> fmap (\b -> f a b) b) a
opSqueeze f pata patb = squeezeJoin $ fmap (\a -> fmap (f a) patb) pata

opSqueezeOut :: (a -> b -> c) -> Signal a -> Signal b -> Signal c
opSqueezeOut f pata patb = squeezeJoin $ fmap (\a -> fmap (\b -> f b a) pata) patb
opSqueezeOut f pata patb = squeezeJoin $ fmap (\a -> fmap (`f` a) pata) patb

opTrig :: (a -> b -> c) -> Signal a -> Signal b -> Signal c
opTrig f a b = trigJoin $ fmap (\a -> fmap (\b -> f a b) b) a
opTrig f pata patb = trigJoin $ fmap (\a -> fmap (f a) patb) pata

opTrigzero :: (a -> b -> c) -> Signal a -> Signal b -> Signal c
opTrigzero f a b = trigzeroJoin $ fmap (\a -> fmap (\b -> f a b) b) a
opTrigzero f pata patb = trigzeroJoin $ fmap (\a -> fmap (f a) patb) pata

-- ************************************************************ --

Expand Down Expand Up @@ -123,31 +122,31 @@ infixl 4 |=|, |=, =|, ||=, =||, !=, !!=
-- keep

keepMix, (|.|) :: (Pattern p, Unionable a) => p a -> p a -> p a
keepMix pata patb = opMix (union) pata patb
keepMix pata patb = opMix union pata patb
(|.|) = keepMix

keepIn, (|.) :: (Pattern p, Unionable a) => p a -> p a -> p a
keepIn pata patb = opIn (union) pata patb
keepIn pata patb = opIn union pata patb
(|.) = keepIn

keepOut, (.|) :: (Pattern p, Unionable a) => p a -> p a -> p a
keepOut pata patb = opOut (union) pata patb
keepOut pata patb = opOut union pata patb
(.|) = keepOut

keepSqueeze, (||.) :: (Unionable a) => Signal a -> Signal a -> Signal a
keepSqueeze pata patb = opSqueeze (union) pata patb
keepSqueeze pata patb = opSqueeze union pata patb
(||.) = keepSqueeze

keepSqueezeOut, (.||) :: (Unionable a) => Signal a -> Signal a -> Signal a
keepSqueezeOut pata patb = opSqueezeOut (union) pata patb
keepSqueezeOut pata patb = opSqueezeOut union pata patb
(.||) = keepSqueezeOut

keepTrig, (!.) :: (Unionable a) => Signal a -> Signal a -> Signal a
keepTrig pata patb = opTrig (union) pata patb
keepTrig pata patb = opTrig union pata patb
(!.) = keepTrig

keepTrigzero, (!!.) :: (Unionable a) => Signal a -> Signal a -> Signal a
keepTrigzero pata patb = opTrigzero (union) pata patb
keepTrigzero pata patb = opTrigzero union pata patb
(!!.) = keepTrigzero

infixl 4 |.|, |., .|, ||., .||, !., !!.
Expand Down Expand Up @@ -315,31 +314,31 @@ infixl 4 |/|, |/, /|, ||/, /||, !/, !!/
-- mod

modMix, (|%|) :: (Pattern p, Integral a) => p a -> p a -> p a
modMix pata patb = opMix (mod) pata patb
modMix pata patb = opMix mod pata patb
(|%|) = modMix

modIn, (|%) :: (Pattern p, Integral a) => p a -> p a -> p a
modIn pata patb = opIn (mod) pata patb
modIn pata patb = opIn mod pata patb
(|%) = modIn

modOut, (%|) :: (Pattern p, Integral a) => p a -> p a -> p a
modOut pata patb = opOut (mod) pata patb
modOut pata patb = opOut mod pata patb
(%|) = modOut

modSqueeze, (||%) :: (Integral a) => Signal a -> Signal a -> Signal a
modSqueeze pata patb = opSqueeze (mod) pata patb
modSqueeze pata patb = opSqueeze mod pata patb
(||%) = modSqueeze

modSqueezeOut, (%||) :: (Integral a) => Signal a -> Signal a -> Signal a
modSqueezeOut pata patb = opSqueezeOut (mod) pata patb
modSqueezeOut pata patb = opSqueezeOut mod pata patb
(%||) = modSqueezeOut

modTrig, (!%) :: (Integral a) => Signal a -> Signal a -> Signal a
modTrig pata patb = opTrig (mod) pata patb
modTrig pata patb = opTrig mod pata patb
(!%) = modTrig

modTrigzero, (!!%) :: (Integral a) => Signal a -> Signal a -> Signal a
modTrigzero pata patb = opTrigzero (mod) pata patb
modTrigzero pata patb = opTrigzero mod pata patb
(!!%) = modTrigzero

infixl 4 |%|, |%, %|, ||%, %||, !%, !!%
Expand Down Expand Up @@ -507,95 +506,95 @@ infixl 4 |.|.|, |.|., .|.|, ||.|., .|.||, !.|., !!.|.
-- bxor

bxorMix, (|.^.|) :: (Pattern p, Bits a) => p a -> p a -> p a
bxorMix pata patb = opMix (xor) pata patb
bxorMix pata patb = opMix xor pata patb
(|.^.|) = bxorMix

bxorIn, (|.^.) :: (Pattern p, Bits a) => p a -> p a -> p a
bxorIn pata patb = opIn (xor) pata patb
bxorIn pata patb = opIn xor pata patb
(|.^.) = bxorIn

bxorOut, (.^.|) :: (Pattern p, Bits a) => p a -> p a -> p a
bxorOut pata patb = opOut (xor) pata patb
bxorOut pata patb = opOut xor pata patb
(.^.|) = bxorOut

bxorSqueeze, (||.^.) :: (Bits a) => Signal a -> Signal a -> Signal a
bxorSqueeze pata patb = opSqueeze (xor) pata patb
bxorSqueeze pata patb = opSqueeze xor pata patb
(||.^.) = bxorSqueeze

bxorSqueezeOut, (.^.||) :: (Bits a) => Signal a -> Signal a -> Signal a
bxorSqueezeOut pata patb = opSqueezeOut (xor) pata patb
bxorSqueezeOut pata patb = opSqueezeOut xor pata patb
(.^.||) = bxorSqueezeOut

bxorTrig, (!.^.) :: (Bits a) => Signal a -> Signal a -> Signal a
bxorTrig pata patb = opTrig (xor) pata patb
bxorTrig pata patb = opTrig xor pata patb
(!.^.) = bxorTrig

bxorTrigzero, (!!.^.) :: (Bits a) => Signal a -> Signal a -> Signal a
bxorTrigzero pata patb = opTrigzero (xor) pata patb
bxorTrigzero pata patb = opTrigzero xor pata patb
(!!.^.) = bxorTrigzero

infixl 4 |.^.|, |.^., .^.|, ||.^., .^.||, !.^., !!.^.

-- bshiftl

bshiftlMix, (|.<<.|) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftlMix pata patb = opMix (shiftL) pata patb
bshiftlMix pata patb = opMix shiftL pata patb
(|.<<.|) = bshiftlMix

bshiftlIn, (|.<<.) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftlIn pata patb = opIn (shiftL) pata patb
bshiftlIn pata patb = opIn shiftL pata patb
(|.<<.) = bshiftlIn

bshiftlOut, (.<<.|) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftlOut pata patb = opOut (shiftL) pata patb
bshiftlOut pata patb = opOut shiftL pata patb
(.<<.|) = bshiftlOut

bshiftlSqueeze, (||.<<.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftlSqueeze pata patb = opSqueeze (shiftL) pata patb
bshiftlSqueeze pata patb = opSqueeze shiftL pata patb
(||.<<.) = bshiftlSqueeze

bshiftlSqueezeOut, (.<<.||) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftlSqueezeOut pata patb = opSqueezeOut (shiftL) pata patb
bshiftlSqueezeOut pata patb = opSqueezeOut shiftL pata patb
(.<<.||) = bshiftlSqueezeOut

bshiftlTrig, (!.<<.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftlTrig pata patb = opTrig (shiftL) pata patb
bshiftlTrig pata patb = opTrig shiftL pata patb
(!.<<.) = bshiftlTrig

bshiftlTrigzero, (!!.<<.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftlTrigzero pata patb = opTrigzero (shiftL) pata patb
bshiftlTrigzero pata patb = opTrigzero shiftL pata patb
(!!.<<.) = bshiftlTrigzero

infixl 4 |.<<.|, |.<<., .<<.|, ||.<<., .<<.||, !.<<., !!.<<.

-- bshiftr

bshiftrMix, (|.>>.|) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftrMix pata patb = opMix (shiftR) pata patb
bshiftrMix pata patb = opMix shiftR pata patb
(|.>>.|) = bshiftrMix

bshiftrIn, (|.>>.) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftrIn pata patb = opIn (shiftR) pata patb
bshiftrIn pata patb = opIn shiftR pata patb
(|.>>.) = bshiftrIn

bshiftrOut, (.>>.|) :: (Pattern p, Bits a) => p a -> p Int -> p a
bshiftrOut pata patb = opOut (shiftR) pata patb
bshiftrOut pata patb = opOut shiftR pata patb
(.>>.|) = bshiftrOut

bshiftrSqueeze, (||.>>.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftrSqueeze pata patb = opSqueeze (shiftR) pata patb
bshiftrSqueeze pata patb = opSqueeze shiftR pata patb
(||.>>.) = bshiftrSqueeze

bshiftrSqueezeOut, (.>>.||) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftrSqueezeOut pata patb = opSqueezeOut (shiftR) pata patb
bshiftrSqueezeOut pata patb = opSqueezeOut shiftR pata patb
(.>>.||) = bshiftrSqueezeOut

bshiftrTrig, (!.>>.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftrTrig pata patb = opTrig (shiftR) pata patb
bshiftrTrig pata patb = opTrig shiftR pata patb
(!.>>.) = bshiftrTrig

bshiftrTrigzero, (!!.>>.) :: (Bits a) => Signal a -> Signal Int -> Signal a
bshiftrTrigzero pata patb = opTrigzero (shiftR) pata patb
bshiftrTrigzero pata patb = opTrigzero shiftR pata patb
(!!.>>.) = bshiftrTrigzero

infixl 4 |.>>.|, |.>>., .>>.|, ||.>>., .>>.||, !.>>., !!.>>.
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/Sound/Tidal/Context.hs → old/Sound/Tidal/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ import Sound.Tidal.Signal.Waveform as C
import Sound.Tidal.Stream as C
-- import Sound.Tidal.Time as C
-- import Sound.Tidal.Transition as C
import Sound.Tidal.Alignment as C
import Sound.Tidal.Types as C
import Sound.Tidal.Version as C
Loading
Loading