-- Copyright 2017 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

module Solkattu.Score.Vathapi where
import Prelude hiding ((.), repeat)

import Solkattu.Dsl.Mridangam


    -- pallavi
    --
    -- vaataapi gaNapatim bajEham |         <-- many sangatis
    -- vaaraNaasyam varapradam shree ||

sarva0 :: Korvai
sarva0 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => Int -> a -> a
repeat Int
4 forall a b. (a -> b) -> a -> b
$
    forall a. Monoid a => Int -> a -> a
repeat Int
2 (forall {g}. Sequence g (Note (Stroke Stroke))
nforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
lforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
dforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
d) Stack => Sequence -> Sequence -> Sequence
& (forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__)

    -- ... varapradam shree ||

fill0 :: Korvai
fill0 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall g sollu. Sequence g sollu -> Sequence g sollu
su forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => Int -> a -> a
repeat Int
2 forall a b. (a -> b) -> a -> b
$
    forall a. Monoid a => Int -> a -> a
repeat Int
4 (forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
tforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
tforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__) forall a. Monoid a => a -> a -> a
. forall {g}. Sequence g (Note (Stroke Stroke))
nforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
uforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
tforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__
    -- repeat 4 (ta.ri.ki.ta.thom.__) . (di.ku.ta.ri.ki.ta.thom.__)

tir1 :: Korvai
tir1 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall sollu. Stack => Duration -> SequenceT sollu
restD Duration
2 forall a. Monoid a => a -> a -> a
. forall sollu. SequenceT sollu -> SequenceT sollu -> SequenceT sollu
tri_ (forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o) (forall g sollu. Sequence g sollu -> Sequence g sollu
su (Sequence
ktktforall a. Monoid a => a -> a -> a
.Sequence
pk)forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k) forall a. Monoid a => a -> a -> a
. forall {g}. Sequence g (Note (Stroke Stroke))
od
    -- tarikitataka tat din na thom __ ga

    -- anupallavi
    --
    -- bootaadi sam sEvita caraNam |
    -- boota bowdika prapanca baraNam ||

sarva1 :: Korvai
sarva1 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$
    forall a. Monoid a => Int -> a -> a
repeat Int
2 forall a b. (a -> b) -> a -> b
$
    forall a. Monoid a => Int -> a -> a
repeat Int
2 (forall {g}. Sequence g (Note (Stroke Stroke))
nforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
dforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
n) Stack => Sequence -> Sequence -> Sequence
& (forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o)
    forall a. Monoid a => a -> a -> a
. forall a. Monoid a => Int -> a -> a
repeat Int
2 (forall {g}. Sequence g (Note (Stroke Stroke))
nforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
dforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
n) Stack => Sequence -> Sequence -> Sequence
& (forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall sollu. Int -> SequenceT sollu
__n Int
8)
    -- oonnpktk naka

    -- veetaraagiNam vinata yOginam (shree) |
    -- vishva kaaraNam vigna vaaraNam ||
    -- (vaathapi)

sarva2 :: Korvai
sarva2 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => Int -> a -> a
repeat Int
2 forall a b. (a -> b) -> a -> b
$
    Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
. forall g sollu. Sequence g sollu -> Sequence g sollu
su (Sequence
pkforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
nforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o)forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.Sequence
on forall a. Monoid a => a -> a -> a
. forall g sollu. Sequence g sollu -> Sequence g sollu
su Sequence
pk
    -- ta din ta din takadin ta din

    -- caraNam
    --
    -- puraa kumba sambhava munivara prapoojitam |
    -- trikONa madya gatam |

sarva3 :: Korvai
sarva3 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$
      Sequence
onforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall sollu. SequenceT sollu
__5forall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall sollu. SequenceT sollu
__2forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o
    forall a. Monoid a => a -> a -> a
. Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall sollu. SequenceT sollu
__5forall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.Sequence
onforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall sollu. SequenceT sollu
__2forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o

    -- muraari pramukaat yupaasitam |
    -- moolaadhaara kshEtraa stitam |
    -- paraadi sattvaari vaakaatmagam |

-- sarva4 = korvaiS1 adi $ nakanadin

    -- praNava svaroopa vakratunDam |

sarva5 :: Korvai
sarva5 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall g sollu. Sequence g sollu -> Sequence g sollu
su forall a b. (a -> b) -> a -> b
$
    forall a. Monoid a => Int -> a -> a
repeat Int
2 forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => Int -> a -> a
repeat Int
3 (forall {g}. Sequence g (Note (Stroke Stroke))
yjyjforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
dforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall stroke.
SequenceT (Stroke stroke) -> SequenceT (Stroke stroke)
lt forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k) forall a. Monoid a => a -> a -> a
. (forall {g}. Sequence g (Note (Stroke Stroke))
tforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
kforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
tforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
oforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k)
    where yjyj :: Sequence g (Note (Stroke Stroke))
yjyj = forall {g}. Sequence g (Note (Stroke Stroke))
yforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
jforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
yforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
j

    -- nirandaram niDala candra kaNDam |
    -- nija vaamakara vidrutEkshutanDam |
    -- karaambuja paaSa beejaapooram |
    -- kaloosha vidhooram bootaahaaram |
    -- haraadi guruguha tOshita bimbam |
    -- hamsadhwani booshita hErambam ||


tir2 :: Korvai
tir2 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall sollu. Stack => Duration -> SequenceT sollu
restD Duration
1 forall a. Monoid a => a -> a -> a
. forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
. forall sollu. SequenceT sollu -> SequenceT sollu -> SequenceT sollu
tri_ (forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k) (forall g sollu. Sequence g sollu -> Sequence g sollu
su (forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktforall a. Monoid a => a -> a -> a
.Sequence
pk) forall a. Monoid a => a -> a -> a
. forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k)
tir3 :: Korvai
tir3 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall sollu. Int -> SequenceT sollu
__n Int
3 forall a. Monoid a => a -> a -> a
. forall sollu. SequenceT sollu -> SequenceT sollu -> SequenceT sollu
tri_ (forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k) (forall g sollu. Sequence g sollu -> Sequence g sollu
su (forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktktforall a. Monoid a => a -> a -> a
.Sequence
pk) forall a. Monoid a => a -> a -> a
. forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k)
    -- od.__.k instead of od.__.o, since it starts with p
    -- kitataka tarikitataka tat din na tang __ ga
tir4 :: Korvai
tir4 = Tala -> Sequence -> Korvai
korvaiS1 Tala
adi forall a b. (a -> b) -> a -> b
$ forall sollu. SequenceT sollu -> SequenceT sollu -> SequenceT sollu
tri_ (forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall a. Rest a => a
__forall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
o) (forall g sollu. Sequence g sollu -> Sequence g sollu
su (Sequence
ktktforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
pforall a. Monoid a => a -> a -> a
.Sequence
ktktforall a. Monoid a => a -> a -> a
.Sequence
pk) forall a. Monoid a => a -> a -> a
. forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
odforall a. Monoid a => a -> a -> a
.forall {g}. Sequence g (Note (Stroke Stroke))
k)