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

Reformat #1112

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 20 additions & 20 deletions src/Sound/Tidal/Bjorklund.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ module Sound.Tidal.Bjorklund (bjorklund) where
-- the library but removed for now due to dependency problems.. We
-- could however likely benefit from other parts of the library..

type STEP a = ((Int,Int),([[a]],[[a]]))
type STEP a = ((Int, Int), ([[a]], [[a]]))

left :: STEP a -> STEP a
left ((i,j),(xs,ys)) =
let (xs',xs'') = splitAt j xs
in ((j,i-j),(zipWith (++) xs' ys,xs''))
left ((i, j), (xs, ys)) =
let (xs', xs'') = splitAt j xs
in ((j, i - j), (zipWith (++) xs' ys, xs''))

right :: STEP a -> STEP a
right ((i,j),(xs,ys)) =
let (ys',ys'') = splitAt i ys
in ((i,j-i),(zipWith (++) xs ys',ys''))
right ((i, j), (xs, ys)) =
let (ys', ys'') = splitAt i ys
in ((i, j - i), (zipWith (++) xs ys', ys''))

bjorklund' :: STEP a -> STEP a
bjorklund' (n,x) =
let (i,j) = n
in if min i j <= 1
then (n,x)
else bjorklund' (if i > j then left (n,x) else right (n,x))

bjorklund :: (Int,Int) -> [Bool]
bjorklund (i,j') =
let j = j' - i
x = replicate i [True]
y = replicate j [False]
(_,(x',y')) = bjorklund' ((i,j),(x,y))
in concat x' ++ concat y'
bjorklund' (n, x) =
let (i, j) = n
in if min i j <= 1
then (n, x)
else bjorklund' (if i > j then left (n, x) else right (n, x))

bjorklund :: (Int, Int) -> [Bool]
bjorklund (i, j') =
let j = j' - i
x = replicate i [True]
y = replicate j [False]
(_, (x', y')) = bjorklund' ((i, j), (x, y))
in concat x' ++ concat y'
180 changes: 90 additions & 90 deletions src/Sound/Tidal/Boot.hs
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}

module Sound.Tidal.Boot
( Tidally (..)
, OscMap
, mkOscMap
, mkTidal
, mkTidalWith
, only
, p
, _p
, p_
, hush
, panic
, list
, mute
, unmute
, unmuteAll
, unsoloAll
, solo
, unsolo
, once
, asap
, first
, nudgeAll
, all
, resetCycles
, setCycle
, setcps
, getcps
, setbpm
, getbpm
, getnow
, d1
, d2
, d3
, d4
, d5
, d6
, d7
, d8
, d9
, d10
, d11
, d12
, d13
, d14
, d15
, d16
, _d1
, _d2
, _d3
, _d4
, _d5
, _d6
, _d7
, _d8
, _d9
, _d10
, _d11
, _d12
, _d13
, _d14
, _d15
, _d16
, d1_
, d2_
, d3_
, d4_
, d5_
, d6_
, d7_
, d8_
, d9_
, d10_
, d11_
, d12_
, d13_
, d14_
, d15_
, d16_
, getState
, setI
, setF
, setS
, setR
, setB
, module Sound.Tidal.Context
( Tidally (..),
OscMap,
mkOscMap,
mkTidal,
mkTidalWith,
only,
p,
_p,
p_,
hush,
panic,
list,
mute,
unmute,
unmuteAll,
unsoloAll,
solo,
unsolo,
once,
asap,
first,
nudgeAll,
all,
resetCycles,
setCycle,
setcps,
getcps,
setbpm,
getbpm,
getnow,
d1,
d2,
d3,
d4,
d5,
d6,
d7,
d8,
d9,
d10,
d11,
d12,
d13,
d14,
d15,
d16,
_d1,
_d2,
_d3,
_d4,
_d5,
_d6,
_d7,
_d8,
_d9,
_d10,
_d11,
_d12,
_d13,
_d14,
_d15,
_d16,
d1_,
d2_,
d3_,
d4_,
d5_,
d6_,
d7_,
d8_,
d9_,
d10_,
d11_,
d12_,
d13_,
d14_,
d15_,
d16_,
getState,
setI,
setF,
setS,
setR,
setB,
module Sound.Tidal.Context,
)
where

Expand All @@ -108,10 +108,10 @@ where
along with this library. If not, see <http://www.gnu.org/licenses/>.
-}

import Prelude hiding (all, (*>), (<*))
import Sound.Tidal.Context
import Sound.Tidal.ID (ID)
import System.IO (hSetEncoding, stdout, utf8)
import Sound.Tidal.Context
import Sound.Tidal.ID (ID)
import System.IO (hSetEncoding, stdout, utf8)
import Prelude hiding (all, (*>), (<*))

-- | Functions using this constraint can access the in-scope Tidal instance.
-- You must implement an instance of this in 'BootTidal.hs'. Note that GHC
Expand Down
Loading
Loading