-- Copyright 2016 Evan Laforge
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or http://www.gnu.org/licenses/gpl-3.0.txt

{-# LANGUAGE RecordWildCards, DeriveFunctor #-}
-- | Realize an abstract solkattu Notes to concrete mridangam 'Note's.
module Solkattu.Instrument.Mridangam where
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Text as Text

import qualified Util.CallStack as CallStack
import qualified Util.Seq as Seq
import qualified Derive.Expr as Expr
import qualified Derive.Symbols as Symbols
import qualified Solkattu.Realize as Realize
import qualified Solkattu.S as S
import qualified Solkattu.Solkattu as Solkattu
import qualified Solkattu.Technique as Technique

import           Global


data Stroke = Thoppi !Thoppi | Valantalai !Valantalai | Both !Thoppi !Valantalai
    deriving (Stroke -> Stroke -> Bool
(Stroke -> Stroke -> Bool)
-> (Stroke -> Stroke -> Bool) -> Eq Stroke
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Stroke -> Stroke -> Bool
$c/= :: Stroke -> Stroke -> Bool
== :: Stroke -> Stroke -> Bool
$c== :: Stroke -> Stroke -> Bool
Eq, Eq Stroke
Eq Stroke
-> (Stroke -> Stroke -> Ordering)
-> (Stroke -> Stroke -> Bool)
-> (Stroke -> Stroke -> Bool)
-> (Stroke -> Stroke -> Bool)
-> (Stroke -> Stroke -> Bool)
-> (Stroke -> Stroke -> Stroke)
-> (Stroke -> Stroke -> Stroke)
-> Ord Stroke
Stroke -> Stroke -> Bool
Stroke -> Stroke -> Ordering
Stroke -> Stroke -> Stroke
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Stroke -> Stroke -> Stroke
$cmin :: Stroke -> Stroke -> Stroke
max :: Stroke -> Stroke -> Stroke
$cmax :: Stroke -> Stroke -> Stroke
>= :: Stroke -> Stroke -> Bool
$c>= :: Stroke -> Stroke -> Bool
> :: Stroke -> Stroke -> Bool
$c> :: Stroke -> Stroke -> Bool
<= :: Stroke -> Stroke -> Bool
$c<= :: Stroke -> Stroke -> Bool
< :: Stroke -> Stroke -> Bool
$c< :: Stroke -> Stroke -> Bool
compare :: Stroke -> Stroke -> Ordering
$ccompare :: Stroke -> Stroke -> Ordering
Ord, Int -> Stroke -> ShowS
[Stroke] -> ShowS
Stroke -> String
(Int -> Stroke -> ShowS)
-> (Stroke -> String) -> ([Stroke] -> ShowS) -> Show Stroke
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Stroke] -> ShowS
$cshowList :: [Stroke] -> ShowS
show :: Stroke -> String
$cshow :: Stroke -> String
showsPrec :: Int -> Stroke -> ShowS
$cshowsPrec :: Int -> Stroke -> ShowS
Show)
data Thoppi =
    Tha !Tha | Thom !Thom
    -- | Just the gumiki movement, no strike.  Or possibly a light strike to
    -- make it speak if it doesn't sustain.
    | Gum
    deriving (Thoppi -> Thoppi -> Bool
(Thoppi -> Thoppi -> Bool)
-> (Thoppi -> Thoppi -> Bool) -> Eq Thoppi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Thoppi -> Thoppi -> Bool
$c/= :: Thoppi -> Thoppi -> Bool
== :: Thoppi -> Thoppi -> Bool
$c== :: Thoppi -> Thoppi -> Bool
Eq, Eq Thoppi
Eq Thoppi
-> (Thoppi -> Thoppi -> Ordering)
-> (Thoppi -> Thoppi -> Bool)
-> (Thoppi -> Thoppi -> Bool)
-> (Thoppi -> Thoppi -> Bool)
-> (Thoppi -> Thoppi -> Bool)
-> (Thoppi -> Thoppi -> Thoppi)
-> (Thoppi -> Thoppi -> Thoppi)
-> Ord Thoppi
Thoppi -> Thoppi -> Bool
Thoppi -> Thoppi -> Ordering
Thoppi -> Thoppi -> Thoppi
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Thoppi -> Thoppi -> Thoppi
$cmin :: Thoppi -> Thoppi -> Thoppi
max :: Thoppi -> Thoppi -> Thoppi
$cmax :: Thoppi -> Thoppi -> Thoppi
>= :: Thoppi -> Thoppi -> Bool
$c>= :: Thoppi -> Thoppi -> Bool
> :: Thoppi -> Thoppi -> Bool
$c> :: Thoppi -> Thoppi -> Bool
<= :: Thoppi -> Thoppi -> Bool
$c<= :: Thoppi -> Thoppi -> Bool
< :: Thoppi -> Thoppi -> Bool
$c< :: Thoppi -> Thoppi -> Bool
compare :: Thoppi -> Thoppi -> Ordering
$ccompare :: Thoppi -> Thoppi -> Ordering
Ord, Int -> Thoppi -> ShowS
[Thoppi] -> ShowS
Thoppi -> String
(Int -> Thoppi -> ShowS)
-> (Thoppi -> String) -> ([Thoppi] -> ShowS) -> Show Thoppi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Thoppi] -> ShowS
$cshowList :: [Thoppi] -> ShowS
show :: Thoppi -> String
$cshow :: Thoppi -> String
showsPrec :: Int -> Thoppi -> ShowS
$cshowsPrec :: Int -> Thoppi -> ShowS
Show)
data Valantalai = Ki | Ta
    | Mi -- ^ light Ki, played with middle finger
    | Nam
    | Din
    | AraiChapu -- ^ "half chapu", played covering half the valantalai
    | MuruChapu -- ^ "full chapu", played with just the pinky touching saddam
    | Dheem
    | Kin -- ^ ki on meetu
    | Tan -- ^ ta on meetu
    deriving (Valantalai -> Valantalai -> Bool
(Valantalai -> Valantalai -> Bool)
-> (Valantalai -> Valantalai -> Bool) -> Eq Valantalai
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Valantalai -> Valantalai -> Bool
$c/= :: Valantalai -> Valantalai -> Bool
== :: Valantalai -> Valantalai -> Bool
$c== :: Valantalai -> Valantalai -> Bool
Eq, Eq Valantalai
Eq Valantalai
-> (Valantalai -> Valantalai -> Ordering)
-> (Valantalai -> Valantalai -> Bool)
-> (Valantalai -> Valantalai -> Bool)
-> (Valantalai -> Valantalai -> Bool)
-> (Valantalai -> Valantalai -> Bool)
-> (Valantalai -> Valantalai -> Valantalai)
-> (Valantalai -> Valantalai -> Valantalai)
-> Ord Valantalai
Valantalai -> Valantalai -> Bool
Valantalai -> Valantalai -> Ordering
Valantalai -> Valantalai -> Valantalai
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Valantalai -> Valantalai -> Valantalai
$cmin :: Valantalai -> Valantalai -> Valantalai
max :: Valantalai -> Valantalai -> Valantalai
$cmax :: Valantalai -> Valantalai -> Valantalai
>= :: Valantalai -> Valantalai -> Bool
$c>= :: Valantalai -> Valantalai -> Bool
> :: Valantalai -> Valantalai -> Bool
$c> :: Valantalai -> Valantalai -> Bool
<= :: Valantalai -> Valantalai -> Bool
$c<= :: Valantalai -> Valantalai -> Bool
< :: Valantalai -> Valantalai -> Bool
$c< :: Valantalai -> Valantalai -> Bool
compare :: Valantalai -> Valantalai -> Ordering
$ccompare :: Valantalai -> Valantalai -> Ordering
Ord, Int -> Valantalai -> ShowS
[Valantalai] -> ShowS
Valantalai -> String
(Int -> Valantalai -> ShowS)
-> (Valantalai -> String)
-> ([Valantalai] -> ShowS)
-> Show Valantalai
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Valantalai] -> ShowS
$cshowList :: [Valantalai] -> ShowS
show :: Valantalai -> String
$cshow :: Valantalai -> String
showsPrec :: Int -> Valantalai -> ShowS
$cshowsPrec :: Int -> Valantalai -> ShowS
Show, Int -> Valantalai
Valantalai -> Int
Valantalai -> [Valantalai]
Valantalai -> Valantalai
Valantalai -> Valantalai -> [Valantalai]
Valantalai -> Valantalai -> Valantalai -> [Valantalai]
(Valantalai -> Valantalai)
-> (Valantalai -> Valantalai)
-> (Int -> Valantalai)
-> (Valantalai -> Int)
-> (Valantalai -> [Valantalai])
-> (Valantalai -> Valantalai -> [Valantalai])
-> (Valantalai -> Valantalai -> [Valantalai])
-> (Valantalai -> Valantalai -> Valantalai -> [Valantalai])
-> Enum Valantalai
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Valantalai -> Valantalai -> Valantalai -> [Valantalai]
$cenumFromThenTo :: Valantalai -> Valantalai -> Valantalai -> [Valantalai]
enumFromTo :: Valantalai -> Valantalai -> [Valantalai]
$cenumFromTo :: Valantalai -> Valantalai -> [Valantalai]
enumFromThen :: Valantalai -> Valantalai -> [Valantalai]
$cenumFromThen :: Valantalai -> Valantalai -> [Valantalai]
enumFrom :: Valantalai -> [Valantalai]
$cenumFrom :: Valantalai -> [Valantalai]
fromEnum :: Valantalai -> Int
$cfromEnum :: Valantalai -> Int
toEnum :: Int -> Valantalai
$ctoEnum :: Int -> Valantalai
pred :: Valantalai -> Valantalai
$cpred :: Valantalai -> Valantalai
succ :: Valantalai -> Valantalai
$csucc :: Valantalai -> Valantalai
Enum, Valantalai
Valantalai -> Valantalai -> Bounded Valantalai
forall a. a -> a -> Bounded a
maxBound :: Valantalai
$cmaxBound :: Valantalai
minBound :: Valantalai
$cminBound :: Valantalai
Bounded)

data Tha = Palm -- ^ standard tha
    | Fingertips -- ^ touch with fingertips
    | Fingers -- ^ flat of the fingers
    deriving (Tha -> Tha -> Bool
(Tha -> Tha -> Bool) -> (Tha -> Tha -> Bool) -> Eq Tha
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tha -> Tha -> Bool
$c/= :: Tha -> Tha -> Bool
== :: Tha -> Tha -> Bool
$c== :: Tha -> Tha -> Bool
Eq, Eq Tha
Eq Tha
-> (Tha -> Tha -> Ordering)
-> (Tha -> Tha -> Bool)
-> (Tha -> Tha -> Bool)
-> (Tha -> Tha -> Bool)
-> (Tha -> Tha -> Bool)
-> (Tha -> Tha -> Tha)
-> (Tha -> Tha -> Tha)
-> Ord Tha
Tha -> Tha -> Bool
Tha -> Tha -> Ordering
Tha -> Tha -> Tha
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Tha -> Tha -> Tha
$cmin :: Tha -> Tha -> Tha
max :: Tha -> Tha -> Tha
$cmax :: Tha -> Tha -> Tha
>= :: Tha -> Tha -> Bool
$c>= :: Tha -> Tha -> Bool
> :: Tha -> Tha -> Bool
$c> :: Tha -> Tha -> Bool
<= :: Tha -> Tha -> Bool
$c<= :: Tha -> Tha -> Bool
< :: Tha -> Tha -> Bool
$c< :: Tha -> Tha -> Bool
compare :: Tha -> Tha -> Ordering
$ccompare :: Tha -> Tha -> Ordering
Ord, Int -> Tha -> ShowS
[Tha] -> ShowS
Tha -> String
(Int -> Tha -> ShowS)
-> (Tha -> String) -> ([Tha] -> ShowS) -> Show Tha
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tha] -> ShowS
$cshowList :: [Tha] -> ShowS
show :: Tha -> String
$cshow :: Tha -> String
showsPrec :: Int -> Tha -> ShowS
$cshowsPrec :: Int -> Tha -> ShowS
Show)

data Thom =
    Low -- ^ This could be either normal open stroke, or gumiki low stroke.
    | Up -- ^ gumiki up
    deriving (Thom -> Thom -> Bool
(Thom -> Thom -> Bool) -> (Thom -> Thom -> Bool) -> Eq Thom
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Thom -> Thom -> Bool
$c/= :: Thom -> Thom -> Bool
== :: Thom -> Thom -> Bool
$c== :: Thom -> Thom -> Bool
Eq, Eq Thom
Eq Thom
-> (Thom -> Thom -> Ordering)
-> (Thom -> Thom -> Bool)
-> (Thom -> Thom -> Bool)
-> (Thom -> Thom -> Bool)
-> (Thom -> Thom -> Bool)
-> (Thom -> Thom -> Thom)
-> (Thom -> Thom -> Thom)
-> Ord Thom
Thom -> Thom -> Bool
Thom -> Thom -> Ordering
Thom -> Thom -> Thom
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Thom -> Thom -> Thom
$cmin :: Thom -> Thom -> Thom
max :: Thom -> Thom -> Thom
$cmax :: Thom -> Thom -> Thom
>= :: Thom -> Thom -> Bool
$c>= :: Thom -> Thom -> Bool
> :: Thom -> Thom -> Bool
$c> :: Thom -> Thom -> Bool
<= :: Thom -> Thom -> Bool
$c<= :: Thom -> Thom -> Bool
< :: Thom -> Thom -> Bool
$c< :: Thom -> Thom -> Bool
compare :: Thom -> Thom -> Ordering
$ccompare :: Thom -> Thom -> Ordering
Ord, Int -> Thom -> ShowS
[Thom] -> ShowS
Thom -> String
(Int -> Thom -> ShowS)
-> (Thom -> String) -> ([Thom] -> ShowS) -> Show Thom
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Thom] -> ShowS
$cshowList :: [Thom] -> ShowS
show :: Thom -> String
$cshow :: Thom -> String
showsPrec :: Int -> Thom -> ShowS
$cshowsPrec :: Int -> Thom -> ShowS
Show)

-- * strokes

instance Solkattu.Notation Stroke where
    notation :: Stroke -> (Style, Text)
notation (Thoppi Thoppi
t) = Thoppi -> (Style, Text)
forall a. Notation a => a -> (Style, Text)
Solkattu.notation Thoppi
t
    notation (Valantalai Valantalai
v) = Valantalai -> (Style, Text)
forall a. Notation a => a -> (Style, Text)
Solkattu.notation Valantalai
v
    notation (Both Thoppi
t Valantalai
v) = Text -> (Style, Text)
Solkattu.textNotation (Text -> (Style, Text)) -> Text -> (Style, Text)
forall a b. (a -> b) -> a -> b
$ case Thoppi
t of
        Tha Tha
_ -> case Valantalai
v of
            Valantalai
Ki -> Text
"P"
            Valantalai
Ta -> Text
"X"
            -- Hopefully this is big enough to not look like screen gunk, but
            -- small enough to not be too distracting or make the original
            -- character unreadable.
            Valantalai
_ -> Valantalai -> Text
forall a. Notation a => a -> Text
Solkattu.notationText Valantalai
v Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
overline
        Thom Thom
Low -> case Valantalai
v of
            -- These are symbols, so they have no uppercase.
            Valantalai
Kin -> Text
"o" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
cedillaBelow
            Valantalai
Mi -> Text
"o" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
dotBelow
            Valantalai
Tan -> Text
"ô"
            Valantalai
_ -> Text -> Text
Text.toUpper (Valantalai -> Text
forall a. Notation a => a -> Text
Solkattu.notationText Valantalai
v)
        Thom Thom
Up -> Thoppi -> Text
forall a. Notation a => a -> Text
Solkattu.notationText (Thom -> Thoppi
Thom Thom
Up)
        Thoppi
Gum -> Text
"/"

instance Pretty Stroke where pretty :: Stroke -> Text
pretty = Stroke -> Text
forall a. Notation a => a -> Text
Solkattu.notationText

-- COMBINING CEDILLA
cedillaBelow :: Text
cedillaBelow :: Text
cedillaBelow = Text
"\x0327"

-- COMBINING DOT BELOW
dotBelow :: Text
dotBelow :: Text
dotBelow = Text
"\x0323"

-- COMBINING OVERLINE
overline :: Text
overline :: Text
overline = Text
"\x0305"

instance Solkattu.Notation Thoppi where
    notation :: Thoppi -> (Style, Text)
notation = Text -> (Style, Text)
Solkattu.textNotation (Text -> (Style, Text))
-> (Thoppi -> Text) -> Thoppi -> (Style, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
        Thom Thom
Low -> Text
"o"
        Thom Thom
Up -> Text
"ó"
        Tha Tha
_ -> Text
"p"
        Thoppi
Gum -> Text
"/"

instance Solkattu.Notation Valantalai where
    notation :: Valantalai -> (Style, Text)
notation = Text -> (Style, Text)
Solkattu.textNotation (Text -> (Style, Text))
-> (Valantalai -> Text) -> Valantalai -> (Style, Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. \case
        Valantalai
Ki -> Text
"k"
        Valantalai
Ta -> Text
"t"
        Valantalai
Mi -> Text
"."
        Valantalai
Nam -> Text
"n"
        Valantalai
Din -> Text
"d"
        Valantalai
AraiChapu -> Text
"u"
        Valantalai
MuruChapu -> Text
"v"
        Valantalai
Dheem -> Text
"i"
        Valantalai
Kin -> Text
","
        Valantalai
Tan -> Text
"^"

ganeshNotationThoppi :: Thoppi -> Text
ganeshNotationThoppi :: Thoppi -> Text
ganeshNotationThoppi = \case
    Thom Thom
Low -> Text
"d"
    Thom Thom
Up -> Text
"d"
    Tha Tha
_ -> Text
"h"
    Thoppi
Gum -> Text
"?"

ganeshNotationValantalai :: Valantalai -> Text
ganeshNotationValantalai :: Valantalai -> Text
ganeshNotationValantalai = \case
    Valantalai
Ki -> Text
"k"
    Valantalai
Ta -> Text
"t"
    Valantalai
Mi -> Text
"?"
    Valantalai
Nam -> Text
"n"
    Valantalai
Din -> Text
"i"
    Valantalai
AraiChapu -> Text
"l"
    Valantalai
MuruChapu -> Text
"l"
    Valantalai
Dheem -> Text
"?"
    Valantalai
Kin -> Text
","
    Valantalai
Tan -> Text
"^"

instance Pretty Thoppi where pretty :: Thoppi -> Text
pretty = Thoppi -> Text
forall a. Notation a => a -> Text
Solkattu.notationText
instance Pretty Valantalai where pretty :: Valantalai -> Text
pretty = Valantalai -> Text
forall a. Notation a => a -> Text
Solkattu.notationText

-- | Pretty reproduces the "Derive.Solkattu.Dsl" syntax, which has to be
-- haskell syntax, so it can't use +, and I have to put thoppi first to avoid
-- the keyword @do@.  It would be nice if I could make the tracklang syntax
-- consistent, but maybe not a huge deal at the moment.
instance Expr.ToExpr Stroke where
    to_expr :: Stroke -> Expr MiniVal
to_expr Stroke
s = Symbol -> Expr MiniVal
forall val. Symbol -> Expr val
Expr.generator0 (Symbol -> Expr MiniVal) -> Symbol -> Expr MiniVal
forall a b. (a -> b) -> a -> b
$ Text -> Symbol
Expr.Symbol (Text -> Symbol) -> Text -> Symbol
forall a b. (a -> b) -> a -> b
$ case Stroke
s of
        Thoppi Thoppi
t -> Thoppi -> Text
forall {a}. IsString a => Thoppi -> a
thoppi Thoppi
t
        Valantalai Valantalai
v -> Valantalai -> Text
forall a. Notation a => a -> Text
Solkattu.notationText Valantalai
v
        Both Thoppi
t Valantalai
v -> Thoppi -> Text
forall {a}. IsString a => Thoppi -> a
thoppi Thoppi
t Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Valantalai -> Text
forall a. Notation a => a -> Text
Solkattu.notationText Valantalai
v
        where
        thoppi :: Thoppi -> a
thoppi Thoppi
t = case Thoppi
t of
            Thom Thom
Low -> a
"o"
            Thom Thom
Up -> a
"o/"
            Tha Tha
_ -> a
"+"
            Thoppi
Gum -> a
"/"

instance Expr.ToExpr (Realize.Stroke Stroke) where
    to_expr :: Stroke Stroke -> Expr MiniVal
to_expr (Realize.Stroke Emphasis
emphasis Stroke
stroke) = case (Emphasis
emphasis, Stroke
stroke) of
        (Emphasis
Realize.Normal, Stroke
_) -> Stroke -> Expr MiniVal
forall a. ToExpr a => a -> Expr MiniVal
Expr.to_expr Stroke
stroke
        (Emphasis
Realize.Light, Thoppi (Thom Thom
Low)) -> Expr MiniVal
"."
        (Emphasis
Realize.Light, Thoppi (Tha Tha
_)) -> Expr MiniVal
"-"
        (Emphasis
Realize.Heavy, Thoppi (Tha Tha
_)) -> Expr MiniVal
"*"
        (Emphasis
Realize.Light, Stroke
_) -> Symbol -> Stroke -> Expr MiniVal
forall a. ToExpr a => Symbol -> a -> Expr MiniVal
Expr.with Symbol
Symbols.weak Stroke
stroke
        (Emphasis
Realize.Heavy, Stroke
_) -> Symbol -> Stroke -> Expr MiniVal
forall a. ToExpr a => Symbol -> a -> Expr MiniVal
Expr.with Symbol
Symbols.accent Stroke
stroke

data Strokes a = Strokes {
    forall a. Strokes a -> a
k :: a, forall a. Strokes a -> a
t :: a
    , forall a. Strokes a -> a
l :: a
    , forall a. Strokes a -> a
n :: a, forall a. Strokes a -> a
d :: a, forall a. Strokes a -> a
u :: a, forall a. Strokes a -> a
v :: a, forall a. Strokes a -> a
i :: a
    -- | Mnemonic: y = kin = , uses 3 fingers, j = tan = ^ uses 1.
    , forall a. Strokes a -> a
y :: a, forall a. Strokes a -> a
j :: a
    , forall a. Strokes a -> a
p :: a, forall a. Strokes a -> a
p' :: a
    , forall a. Strokes a -> a
o :: a, forall a. Strokes a -> a
o' :: a -- ^ gumiki up
    , forall a. Strokes a -> a
_' :: a -- Gum
    -- | @do@ would match score notation, but @do@ is a keyword.  Ultimately
    -- that's because score uses + for tha, and +o is an attr, while o+ is
    -- a bareword.  But perhaps I should change + to p in the score, and then
    -- the left hand can go on the left side?
    , forall a. Strokes a -> a
od :: a
    -- Less common combinations can use (&).
    } deriving ((forall a b. (a -> b) -> Strokes a -> Strokes b)
-> (forall a b. a -> Strokes b -> Strokes a) -> Functor Strokes
forall a b. a -> Strokes b -> Strokes a
forall a b. (a -> b) -> Strokes a -> Strokes b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Strokes b -> Strokes a
$c<$ :: forall a b. a -> Strokes b -> Strokes a
fmap :: forall a b. (a -> b) -> Strokes a -> Strokes b
$cfmap :: forall a b. (a -> b) -> Strokes a -> Strokes b
Functor, Int -> Strokes a -> ShowS
[Strokes a] -> ShowS
Strokes a -> String
(Int -> Strokes a -> ShowS)
-> (Strokes a -> String)
-> ([Strokes a] -> ShowS)
-> Show (Strokes a)
forall a. Show a => Int -> Strokes a -> ShowS
forall a. Show a => [Strokes a] -> ShowS
forall a. Show a => Strokes a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Strokes a] -> ShowS
$cshowList :: forall a. Show a => [Strokes a] -> ShowS
show :: Strokes a -> String
$cshow :: forall a. Show a => Strokes a -> String
showsPrec :: Int -> Strokes a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Strokes a -> ShowS
Show)

strokes :: Strokes Stroke
strokes :: Strokes Stroke
strokes = Strokes
    { k :: Stroke
k = Valantalai -> Stroke
Valantalai Valantalai
Ki
    , t :: Stroke
t = Valantalai -> Stroke
Valantalai Valantalai
Ta
    , l :: Stroke
l = Valantalai -> Stroke
Valantalai Valantalai
Mi
    , n :: Stroke
n = Valantalai -> Stroke
Valantalai Valantalai
Nam
    , d :: Stroke
d = Valantalai -> Stroke
Valantalai Valantalai
Din
    , u :: Stroke
u = Valantalai -> Stroke
Valantalai Valantalai
AraiChapu
    , v :: Stroke
v = Valantalai -> Stroke
Valantalai Valantalai
MuruChapu
    , i :: Stroke
i = Valantalai -> Stroke
Valantalai Valantalai
Dheem
    , y :: Stroke
y = Valantalai -> Stroke
Valantalai Valantalai
Kin
    , j :: Stroke
j = Valantalai -> Stroke
Valantalai Valantalai
Tan
    , p :: Stroke
p = Thoppi -> Stroke
Thoppi (Tha -> Thoppi
Tha Tha
Palm)
    , p' :: Stroke
p' = Thoppi -> Stroke
Thoppi (Tha -> Thoppi
Tha Tha
Fingertips)
    , o :: Stroke
o = Thoppi -> Stroke
Thoppi (Thom -> Thoppi
Thom Thom
Low)
    , o' :: Stroke
o' = Thoppi -> Stroke
Thoppi (Thom -> Thoppi
Thom Thom
Up)
    , _' :: Stroke
_' = Thoppi -> Stroke
Thoppi Thoppi
Gum
    , od :: Stroke
od = Thoppi -> Valantalai -> Stroke
Both (Thom -> Thoppi
Thom Thom
Low) Valantalai
Din
    }

notes :: Strokes (S.Sequence g (Solkattu.Note (Realize.Stroke Stroke)))
notes :: forall g. Strokes (Sequence g (Note (Stroke Stroke)))
notes = Stroke -> Sequence g (Note (Stroke Stroke))
forall stroke g. stroke -> Sequence g (Note (Stroke stroke))
Realize.strokeToSequence (Stroke -> Sequence g (Note (Stroke Stroke)))
-> Strokes Stroke -> Strokes (Sequence g (Note (Stroke Stroke)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Strokes Stroke
strokes

type SequenceR = S.Sequence () (Realize.Note Stroke)

rnotes :: Strokes SequenceR
rnotes :: Strokes (Sequence () (Note Stroke))
rnotes = Note () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Note g a -> Sequence g a
S.singleton (Note () (Note Stroke) -> Sequence () (Note Stroke))
-> (Stroke -> Note () (Note Stroke))
-> Stroke
-> Sequence () (Note Stroke)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Note Stroke -> Note () (Note Stroke)
forall g a. a -> Note g a
S.Note (Note Stroke -> Note () (Note Stroke))
-> (Stroke -> Note Stroke) -> Stroke -> Note () (Note Stroke)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stroke Stroke -> Note Stroke
forall stroke. Stroke stroke -> Note stroke
Realize.Note (Stroke Stroke -> Note Stroke)
-> (Stroke -> Stroke Stroke) -> Stroke -> Note Stroke
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Stroke -> Stroke Stroke
forall stroke. stroke -> Stroke stroke
Realize.stroke (Stroke -> Sequence () (Note Stroke))
-> Strokes Stroke -> Strokes (Sequence () (Note Stroke))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Strokes Stroke
strokes

bothRStrokes :: CallStack.Stack => Realize.Stroke Stroke
    -> Realize.Stroke Stroke -> Realize.Stroke Stroke
bothRStrokes :: Stack => Stroke Stroke -> Stroke Stroke -> Stroke Stroke
bothRStrokes (Realize.Stroke Emphasis
em1 Stroke
s1) (Realize.Stroke Emphasis
em2 Stroke
s2) =
    Emphasis -> Stroke -> Stroke Stroke
forall stroke. Emphasis -> stroke -> Stroke stroke
Realize.Stroke (Emphasis
em1 Emphasis -> Emphasis -> Emphasis
forall a. Semigroup a => a -> a -> a
<> Emphasis
em2) (Stack => Stroke -> Stroke -> Stroke
Stroke -> Stroke -> Stroke
bothStrokes Stroke
s1 Stroke
s2)

bothStrokes :: CallStack.Stack => Stroke -> Stroke -> Stroke
bothStrokes :: Stack => Stroke -> Stroke -> Stroke
bothStrokes (Thoppi Thoppi
a) (Valantalai Valantalai
b) = Thoppi -> Valantalai -> Stroke
Both Thoppi
a Valantalai
b
bothStrokes (Valantalai Valantalai
b) (Thoppi Thoppi
a) = Thoppi -> Valantalai -> Stroke
Both Thoppi
a Valantalai
b
bothStrokes Stroke
a Stroke
b =
    Text -> Stroke
forall a. Stack => Text -> a
Solkattu.throw (Text -> Stroke) -> Text -> Stroke
forall a b. (a -> b) -> a -> b
$ Text
"requires thoppi & valantalai: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> (Stroke, Stroke) -> Text
forall a. Show a => a -> Text
showt (Stroke
a, Stroke
b)

val :: Stroke -> Maybe Valantalai
val :: Stroke -> Maybe Valantalai
val (Valantalai Valantalai
s) = Valantalai -> Maybe Valantalai
forall a. a -> Maybe a
Just Valantalai
s
val (Both Thoppi
_ Valantalai
s) = Valantalai -> Maybe Valantalai
forall a. a -> Maybe a
Just Valantalai
s
val (Thoppi Thoppi
_) = Maybe Valantalai
forall a. Maybe a
Nothing

setVal :: Valantalai -> Stroke -> Stroke
setVal :: Valantalai -> Stroke -> Stroke
setVal Valantalai
v (Valantalai Valantalai
_) = Valantalai -> Stroke
Valantalai Valantalai
v
setVal Valantalai
v (Both Thoppi
t Valantalai
_) = Thoppi -> Valantalai -> Stroke
Both Thoppi
t Valantalai
v
setVal Valantalai
_ (Thoppi Thoppi
t) = Thoppi -> Stroke
Thoppi Thoppi
t

thoppi :: Stroke -> Maybe Thoppi
thoppi :: Stroke -> Maybe Thoppi
thoppi (Thoppi Thoppi
s) = Thoppi -> Maybe Thoppi
forall a. a -> Maybe a
Just Thoppi
s
thoppi (Both Thoppi
s Valantalai
_) = Thoppi -> Maybe Thoppi
forall a. a -> Maybe a
Just Thoppi
s
thoppi (Valantalai Valantalai
_) = Maybe Thoppi
forall a. Maybe a
Nothing

setThoppi :: Thoppi -> Stroke -> Stroke
setThoppi :: Thoppi -> Stroke -> Stroke
setThoppi Thoppi
_ (Valantalai Valantalai
v) = Valantalai -> Stroke
Valantalai Valantalai
v
setThoppi Thoppi
t (Both Thoppi
_ Valantalai
v) = Thoppi -> Valantalai -> Stroke
Both Thoppi
t Valantalai
v
setThoppi Thoppi
t (Thoppi Thoppi
_) = Thoppi -> Stroke
Thoppi Thoppi
t

addThoppi :: Thoppi -> Stroke -> Stroke
addThoppi :: Thoppi -> Stroke -> Stroke
addThoppi Thoppi
t (Valantalai Valantalai
v) = Thoppi -> Valantalai -> Stroke
Both Thoppi
t Valantalai
v
addThoppi Thoppi
t (Both Thoppi
_ Valantalai
v) = Thoppi -> Valantalai -> Stroke
Both Thoppi
t Valantalai
v
addThoppi Thoppi
t (Thoppi Thoppi
_) = Thoppi -> Stroke
Thoppi Thoppi
t

-- * fromString

fromString :: String -> Either Text [Maybe Stroke]
fromString :: String -> Either Text [Maybe Stroke]
fromString = (Char -> Either Text (Maybe (Maybe Stroke)))
-> String -> Either Text [Maybe Stroke]
forall (m :: * -> *) a b.
Monad m =>
(a -> m (Maybe b)) -> [a] -> m [b]
mapMaybeM Char -> Either Text (Maybe (Maybe Stroke))
parse
    where
    parse :: Char -> Either Text (Maybe (Maybe Stroke))
parse Char
c = case Char
c of
        Char
' ' -> Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke))
forall a b. b -> Either a b
Right Maybe (Maybe Stroke)
forall a. Maybe a
Nothing
        Char
'_' -> Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke))
forall a b. b -> Either a b
Right (Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke)))
-> Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke))
forall a b. (a -> b) -> a -> b
$ Maybe Stroke -> Maybe (Maybe Stroke)
forall a. a -> Maybe a
Just Maybe Stroke
forall a. Maybe a
Nothing
        Char
_ -> case Char -> Map Char Stroke -> Maybe Stroke
forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup Char
c Map Char Stroke
notations of
            Maybe Stroke
Nothing -> Text -> Either Text (Maybe (Maybe Stroke))
forall a b. a -> Either a b
Left (Text -> Either Text (Maybe (Maybe Stroke)))
-> Text -> Either Text (Maybe (Maybe Stroke))
forall a b. (a -> b) -> a -> b
$ Text
"unknown mridangam stroke: " Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Char -> Text
forall a. Show a => a -> Text
showt Char
c
            Just Stroke
s -> Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke))
forall a b. b -> Either a b
Right (Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke)))
-> Maybe (Maybe Stroke) -> Either Text (Maybe (Maybe Stroke))
forall a b. (a -> b) -> a -> b
$ Maybe Stroke -> Maybe (Maybe Stroke)
forall a. a -> Maybe a
Just (Maybe Stroke -> Maybe (Maybe Stroke))
-> Maybe Stroke -> Maybe (Maybe Stroke)
forall a b. (a -> b) -> a -> b
$ Stroke -> Maybe Stroke
forall a. a -> Maybe a
Just Stroke
s

notations :: Map Char Stroke
notations :: Map Char Stroke
notations = [(Char, Stroke)] -> Map Char Stroke
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList ([(Char, Stroke)] -> Map Char Stroke)
-> [(Char, Stroke)] -> Map Char Stroke
forall a b. (a -> b) -> a -> b
$ ([(Char, Stroke)]
extras++) ([(Char, Stroke)] -> [(Char, Stroke)])
-> [(Char, Stroke)] -> [(Char, Stroke)]
forall a b. (a -> b) -> a -> b
$ (Text -> Maybe Char) -> [(Text, Stroke)] -> [(Char, Stroke)]
forall a a2 b. (a -> Maybe a2) -> [(a, b)] -> [(a2, b)]
Seq.map_maybe_fst Text -> Maybe Char
isChar ([(Text, Stroke)] -> [(Char, Stroke)])
-> [(Text, Stroke)] -> [(Char, Stroke)]
forall a b. (a -> b) -> a -> b
$
    (Stroke -> Text) -> [Stroke] -> [(Text, Stroke)]
forall a k. (a -> k) -> [a] -> [(k, a)]
Seq.key_on Stroke -> Text
forall a. Notation a => a -> Text
Solkattu.notationText ([Stroke] -> [(Text, Stroke)]) -> [Stroke] -> [(Text, Stroke)]
forall a b. (a -> b) -> a -> b
$ [[Stroke]] -> [Stroke]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
        [ (Thoppi -> Stroke) -> [Thoppi] -> [Stroke]
forall a b. (a -> b) -> [a] -> [b]
map Thoppi -> Stroke
Thoppi ([Thoppi]
lhs [Thoppi] -> [Thoppi] -> [Thoppi]
forall a. [a] -> [a] -> [a]
++ [Thom -> Thoppi
Thom Thom
Up])
        , (Valantalai -> Stroke) -> [Valantalai] -> [Stroke]
forall a b. (a -> b) -> [a] -> [b]
map Valantalai -> Stroke
Valantalai [Valantalai]
rhs
        -- Omit little strokes, they're probably inaudible on Both anyway.
        , [Thoppi -> Valantalai -> Stroke
Both Thoppi
lh Valantalai
rh | Thoppi
lh <- [Thoppi]
lhs, Valantalai
rh <- [Valantalai]
rhs, Valantalai
rh Valantalai -> [Valantalai] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`notElem` [Valantalai
Mi, Valantalai
Kin, Valantalai
Tan]]
        ]
    where
    -- Two ways to write these.
    extras :: [(Char, Stroke)]
extras =
        [ (Char
'y', Strokes Stroke -> Stroke
forall a. Strokes a -> a
y Strokes Stroke
strokes)
        , (Char
'j', Strokes Stroke -> Stroke
forall a. Strokes a -> a
j Strokes Stroke
strokes)
        , (Char
'l', Strokes Stroke -> Stroke
forall a. Strokes a -> a
l Strokes Stroke
strokes)
        ]
    isChar :: Text -> Maybe Char
isChar Text
t = case Text -> String
untxt Text
t of
        [Char
c] -> Char -> Maybe Char
forall a. a -> Maybe a
Just Char
c
        String
_ -> Maybe Char
forall a. Maybe a
Nothing
    lhs :: [Thoppi]
lhs = [Tha -> Thoppi
Tha Tha
Palm, Thom -> Thoppi
Thom Thom
Low]
    rhs :: [Valantalai]
rhs = [Valantalai
forall a. Bounded a => a
minBound .. Valantalai
forall a. Bounded a => a
maxBound]

printNotations :: IO ()
printNotations :: IO ()
printNotations = (String -> IO ()) -> [String] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ String -> IO ()
putStrLn
    [ [Char
k] String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
": " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Stroke -> String
forall a. Show a => a -> String
show Stroke
v
    | (Char
k, Stroke
v) <- ((Char, Stroke) -> Stroke) -> [(Char, Stroke)] -> [(Char, Stroke)]
forall b a. Ord b => (a -> b) -> [a] -> [a]
List.sortOn (Char, Stroke) -> Stroke
forall a b. (a, b) -> b
snd (Map Char Stroke -> [(Char, Stroke)]
forall k a. Map k a -> [(k, a)]
Map.toList Map Char Stroke
notations)
    ]

-- * postprocess

postprocess :: [Technique.Flat Stroke] -> [Technique.Flat Stroke]
postprocess :: [Flat Stroke] -> [Flat Stroke]
postprocess = Technique (Stroke Stroke) -> [Flat Stroke] -> [Flat Stroke]
forall stroke.
Technique (Stroke stroke) -> [Flat stroke] -> [Flat stroke]
Technique.postprocess (Technique (Stroke Stroke) -> [Flat Stroke] -> [Flat Stroke])
-> Technique (Stroke Stroke) -> [Flat Stroke] -> [Flat Stroke]
forall a b. (a -> b) -> a -> b
$ Technique Stroke -> Technique (Stroke Stroke)
forall stroke. Technique stroke -> Technique (Stroke stroke)
Technique.plain Technique Stroke
technique

-- There are extended analogues of this, e.g.:
-- [on, k] to [k, on, k] -> on [k, on, ..]
-- But to apply it I'd have to extend from ktk to ntn, and also to apply
-- across intervening 'k's, so no need until I see more examples.
technique :: Technique.Technique Stroke
technique :: Technique Stroke
technique prevs :: [Stroke]
prevs@(Stroke
prev:[Stroke]
_) Stroke
cur (Stroke
next:[Stroke]
_)
    -- (k, t, [k, ..]) -> k, [k, ..]
    | (Stroke -> Maybe Valantalai) -> [Stroke] -> [Maybe Valantalai]
forall a b. (a -> b) -> [a] -> [b]
map Stroke -> Maybe Valantalai
val [Stroke
prev, Stroke
cur, Stroke
next] [Maybe Valantalai] -> [Maybe Valantalai] -> Bool
forall a. Eq a => a -> a -> Bool
== (Valantalai -> Maybe Valantalai)
-> [Valantalai] -> [Maybe Valantalai]
forall a b. (a -> b) -> [a] -> [b]
map Valantalai -> Maybe Valantalai
forall a. a -> Maybe a
Just [Valantalai
Ki, Valantalai
Ta, Valantalai
Ki] = Stroke -> Maybe Stroke
forall a. a -> Maybe a
Just (Stroke -> Maybe Stroke) -> Stroke -> Maybe Stroke
forall a b. (a -> b) -> a -> b
$ Valantalai -> Stroke -> Stroke
setVal Valantalai
Ki Stroke
cur
    -- (ko, o, [k, ..]) -> p, [k, ..]
    | Int -> [Stroke] -> [Stroke]
forall a. Int -> [a] -> [a]
Seq.rtake Int
2 [Stroke]
prevs [Stroke] -> [Stroke] -> [Stroke]
forall a. [a] -> [a] -> [a]
++ [Stroke
cur, Stroke
next] [Stroke] -> [Stroke] -> Bool
forall a. Eq a => a -> a -> Bool
== [Stroke
k, Stroke
o, Stroke
o, Stroke
k] = Stroke -> Maybe Stroke
forall a. a -> Maybe a
Just Stroke
p
    where
    Strokes {Stroke
od :: Stroke
_' :: Stroke
o' :: Stroke
p' :: Stroke
j :: Stroke
y :: Stroke
i :: Stroke
v :: Stroke
u :: Stroke
d :: Stroke
n :: Stroke
l :: Stroke
t :: Stroke
p :: Stroke
o :: Stroke
k :: Stroke
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes Stroke
strokes
    val :: Stroke -> Maybe Valantalai
val (Valantalai Valantalai
s) = Valantalai -> Maybe Valantalai
forall a. a -> Maybe a
Just Valantalai
s
    val (Both Thoppi
_ Valantalai
s) = Valantalai -> Maybe Valantalai
forall a. a -> Maybe a
Just Valantalai
s
    val Stroke
_ = Maybe Valantalai
forall a. Maybe a
Nothing
technique [Stroke]
_ Stroke
_ [Stroke]
_ = Maybe Stroke
forall a. Maybe a
Nothing

-- * patterns

__ :: SequenceR
__ :: Sequence () (Note Stroke)
__ = Note () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Note g a -> Sequence g a
S.singleton Note () (Note Stroke)
forall stroke. SNote stroke
Realize.rest

defaultPatterns :: Realize.PatternMap Stroke
defaultPatterns :: PatternMap Stroke
defaultPatterns = Either Text (PatternMap Stroke) -> PatternMap Stroke
forall a. Stack => Either Text a -> a
Solkattu.check (Either Text (PatternMap Stroke) -> PatternMap Stroke)
-> Either Text (PatternMap Stroke) -> PatternMap Stroke
forall a b. (a -> b) -> a -> b
$ [(Int, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
patterns
    [ (Int
5, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
6, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
7, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
8, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
9, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    ]
    where
    Strokes {Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes
    . :: Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
(.) = Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a. Semigroup a => a -> a -> a
(<>)

-- | Misc patterns I should figure out how to integrate some day.
misc :: [(S.Matra, SequenceR)]
misc :: [(Int, Sequence () (Note Stroke))]
misc =
    [ (Int
7, Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Sequence g a -> Sequence g a
su (Sequence () (Note Stroke) -> Sequence () (Note Stroke))
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a b. (a -> b) -> a -> b
$ [Sequence () (Note Stroke)] -> Sequence () (Note Stroke)
forall a. Monoid a => [a] -> a
mconcat [Sequence () (Note Stroke)
k, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
t, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
k, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
n, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
__, Sequence () (Note Stroke)
o, Sequence () (Note Stroke)
__])
    ]
    where Strokes {Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes

kt_kn_o :: Realize.PatternMap Stroke
kt_kn_o :: PatternMap Stroke
kt_kn_o = Either Text (PatternMap Stroke) -> PatternMap Stroke
forall a. Stack => Either Text a -> a
Solkattu.check (Either Text (PatternMap Stroke) -> PatternMap Stroke)
-> Either Text (PatternMap Stroke) -> PatternMap Stroke
forall a b. (a -> b) -> a -> b
$ [(Int, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
patterns
    [ (Int
5, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
7, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    , (Int
9, Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o)
    ]
    where
    Strokes {Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes
    . :: Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
(.) = Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a. Semigroup a => a -> a -> a
(<>)

fives :: [SequenceR]
fives :: [Sequence () (Note Stroke)]
fives =
    [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Sequence g a -> Sequence g a
su (Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
t)Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Sequence g a -> Sequence g a
su (Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
t)Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    ]
    where
    Strokes {Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes
    . :: Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
(.) = Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a. Semigroup a => a -> a -> a
(<>)

-- | Intense variations of sequences, usually on the 3rd time.  I don't have a
-- way to use these yet.
intense :: [SequenceR]
intense :: [Sequence () (Note Stroke)]
intense =
    [ Sequence () (Note Stroke)
iSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    , Sequence () (Note Stroke)
iSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
iSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Sequence g a -> Sequence g a
su (Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
t)Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    ]
    where
    Strokes {Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes
    . :: Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
(.) = Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a. Semigroup a => a -> a -> a
(<>)

families567 :: [Realize.PatternMap Stroke]
families567 :: [PatternMap Stroke]
families567 = (Either Text (PatternMap Stroke) -> PatternMap Stroke)
-> [Either Text (PatternMap Stroke)] -> [PatternMap Stroke]
forall a b. (a -> b) -> [a] -> [b]
map Either Text (PatternMap Stroke) -> PatternMap Stroke
forall a. Stack => Either Text a -> a
Solkattu.check ([Either Text (PatternMap Stroke)] -> [PatternMap Stroke])
-> [Either Text (PatternMap Stroke)] -> [PatternMap Stroke]
forall a b. (a -> b) -> a -> b
$ ([(Int, Sequence () (Note Stroke))]
 -> Either Text (PatternMap Stroke))
-> [[(Int, Sequence () (Note Stroke))]]
-> [Either Text (PatternMap Stroke)]
forall a b. (a -> b) -> [a] -> [b]
map [(Int, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
patterns ([[(Int, Sequence () (Note Stroke))]]
 -> [Either Text (PatternMap Stroke)])
-> [[(Int, Sequence () (Note Stroke))]]
-> [Either Text (PatternMap Stroke)]
forall a b. (a -> b) -> a -> b
$ ([Sequence () (Note Stroke)] -> [(Int, Sequence () (Note Stroke))])
-> [[Sequence () (Note Stroke)]]
-> [[(Int, Sequence () (Note Stroke))]]
forall a b. (a -> b) -> [a] -> [b]
map ([Int]
-> [Sequence () (Note Stroke)]
-> [(Int, Sequence () (Note Stroke))]
forall a b. [a] -> [b] -> [(a, b)]
zip [Int
5..]) ([[Sequence () (Note Stroke)]]
 -> [[(Int, Sequence () (Note Stroke))]])
-> [[Sequence () (Note Stroke)]]
-> [[(Int, Sequence () (Note Stroke))]]
forall a b. (a -> b) -> a -> b
$
    [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
    ] [Sequence () (Note Stroke)]
-> [[Sequence () (Note Stroke)]] -> [[Sequence () (Note Stroke)]]
forall a. a -> [a] -> [a]
: ([Sequence () (Note Stroke)] -> [Sequence () (Note Stroke)])
-> [[Sequence () (Note Stroke)]] -> [[Sequence () (Note Stroke)]]
forall a b. (a -> b) -> [a] -> [b]
map ((Sequence () (Note Stroke) -> Sequence () (Note Stroke))
-> [Sequence () (Note Stroke)] -> [Sequence () (Note Stroke)]
forall a b. (a -> b) -> [a] -> [b]
map Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall g a. Sequence g a -> Sequence g a
su)
    [ [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      ]
    , [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      ]
    , [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kpnpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      ]
    , [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kpnpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      ]
    , [ Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      ]
    , [ Sequence () (Note Stroke)
uSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
uSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
uSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
oSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__
      ]
    , [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kpnpSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      ]
    , [ Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
odSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
odSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      , Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
odSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
tSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
__Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
o
      ]
    ]
    where
    Strokes {Sequence () (Note Stroke)
_' :: Sequence () (Note Stroke)
o' :: Sequence () (Note Stroke)
p' :: Sequence () (Note Stroke)
j :: Sequence () (Note Stroke)
y :: Sequence () (Note Stroke)
i :: Sequence () (Note Stroke)
v :: Sequence () (Note Stroke)
d :: Sequence () (Note Stroke)
l :: Sequence () (Note Stroke)
od :: Sequence () (Note Stroke)
u :: Sequence () (Note Stroke)
p :: Sequence () (Note Stroke)
o :: Sequence () (Note Stroke)
n :: Sequence () (Note Stroke)
t :: Sequence () (Note Stroke)
k :: Sequence () (Note Stroke)
od :: forall a. Strokes a -> a
_' :: forall a. Strokes a -> a
o' :: forall a. Strokes a -> a
o :: forall a. Strokes a -> a
p' :: forall a. Strokes a -> a
p :: forall a. Strokes a -> a
j :: forall a. Strokes a -> a
y :: forall a. Strokes a -> a
i :: forall a. Strokes a -> a
v :: forall a. Strokes a -> a
u :: forall a. Strokes a -> a
d :: forall a. Strokes a -> a
n :: forall a. Strokes a -> a
l :: forall a. Strokes a -> a
t :: forall a. Strokes a -> a
k :: forall a. Strokes a -> a
..} = Strokes (Sequence () (Note Stroke))
rnotes
    . :: Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
(.) = Sequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
forall a. Semigroup a => a -> a -> a
(<>)
    kp :: Sequence () (Note Stroke)
kp = Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
p
    kpnp :: Sequence () (Note Stroke)
kpnp = Sequence () (Note Stroke)
kSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
pSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
nSequence () (Note Stroke)
-> Sequence () (Note Stroke) -> Sequence () (Note Stroke)
.Sequence () (Note Stroke)
p

su :: S.Sequence g a -> S.Sequence g a
su :: forall g a. Sequence g a -> Sequence g a
su = Note g a -> Sequence g a
forall g a. Note g a -> Sequence g a
S.singleton (Note g a -> Sequence g a)
-> (Sequence g a -> Note g a) -> Sequence g a -> Sequence g a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [Note g a] -> Note g a
forall g a. Int -> [Note g a] -> Note g a
S.changeSpeed Int
1 ([Note g a] -> Note g a)
-> (Sequence g a -> [Note g a]) -> Sequence g a -> Note g a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Sequence g a -> [Note g a]
forall g a. Sequence g a -> [Note g a]
S.toList

patterns :: [(S.Matra, SequenceR)]
    -> Either Realize.Error (Realize.PatternMap Stroke)
patterns :: [(Int, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
patterns = [(Pattern, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
forall stroke.
[(Pattern, Sequence () (Note stroke))]
-> Either Text (PatternMap stroke)
Realize.patternMap ([(Pattern, Sequence () (Note Stroke))]
 -> Either Text (PatternMap Stroke))
-> ([(Int, Sequence () (Note Stroke))]
    -> [(Pattern, Sequence () (Note Stroke))])
-> [(Int, Sequence () (Note Stroke))]
-> Either Text (PatternMap Stroke)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Int, Sequence () (Note Stroke))
 -> (Pattern, Sequence () (Note Stroke)))
-> [(Int, Sequence () (Note Stroke))]
-> [(Pattern, Sequence () (Note Stroke))]
forall a b. (a -> b) -> [a] -> [b]
map ((Int -> Pattern)
-> (Int, Sequence () (Note Stroke))
-> (Pattern, Sequence () (Note Stroke))
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first Int -> Pattern
Solkattu.pattern)