-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequences.py
136 lines (116 loc) · 4.35 KB
/
sequences.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
from asanas import *
SPEED=3
class Sequence:
def __init__(self, name):
self.name = name
self.asanas = []
self.breath_duration = 4/SPEED
def add_asana(self, asana, breath=None, time=None):
self.asanas.append(asana)
if time is None:
time = 2 if breath is None else self.breath_duration * len(breath)
asana.time = time
if breath is not None:
asana.breath = breath
def append_sequence(self, sequence):
self.asanas += sequence.asanas
def get_asana(self, time, shift_index=0):
# time = time % self.total_time()
if time >= self.total_time():
return self.asanas[-1], self.total_time() - time
index = -1
while time >= 0:
index += 1
time -= self.asanas[index].time
index += shift_index
index = max(index, 0)
return self.asanas[index], -time
def total_time(self):
return sum([a.time for a in self.asanas])
meditation = Sequence("Meditation")
meditation.add_asana(ChildsPose(), "oi"*15)
catcow = Sequence("Cat&Cow")
catcow.add_asana(AllFours(), "io"*2)
for i in range(5):
catcow.add_asana(Cow(), "i")
catcow.add_asana(Cat(), "o")
vinyasa_cat_to_stand = Sequence("Vinyasa")
vinyasa_cat_to_stand.add_asana(AllFours(), "i")
vinyasa_cat_to_stand.add_asana(DownDog(), "o")
vinyasa_cat_to_stand.add_asana(LegToChest(), time=1.5/SPEED, breath="")
vinyasa_cat_to_stand.add_asana(LowLunge(), "i")
vinyasa_cat_to_stand.add_asana(ForwardFold(), "o")
vinyasa_cat_to_stand.add_asana(UpwardSalute(), "i")
vinyasa_cat_to_stand.add_asana(Standing(), "o")
sun_A = Sequence("Sun Salutation A")
sun_A.add_asana(Standing(), "o")
sun_A.add_asana(UpwardSalute(), "i")
sun_A.add_asana(ForwardFold(), "o")
sun_A.add_asana(HalfwayLift(), "i")
sun_A.add_asana(LowLunge(), "o")
sun_A.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_A.add_asana(Plank(), "i")
sun_A.add_asana(Chaturanga(), "o")
sun_A.add_asana(UpDog(), "i")
sun_A.add_asana(DownDog(), "oioio")
sun_A.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_A.add_asana(LowLunge(), "i")
sun_A.add_asana(ForwardFold(), "o")
sun_A.add_asana(UpwardSalute(), "i")
sun_A.add_asana(Standing(), "o")
sun_B = Sequence("Sun Salutation B")
sun_B.add_asana(Chair(), "ioi")
sun_B.add_asana(ForwardFold(), "o")
sun_B.add_asana(HalfwayLift(), "i")
sun_B.add_asana(LowLunge(), "o")
sun_B.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_B.add_asana(Plank(), "i")
sun_B.add_asana(Chaturanga(), "o")
sun_B.add_asana(UpDog(), "i")
sun_B.add_asana(DownDog(), "o")
sun_B.add_asana(LegToChest(), time=1/SPEED, breath="")
sun_B.add_asana(LowLunge(), time=1/SPEED, breath="")
sun_B.add_asana(Warrior1(), "i")
sun_B.add_asana(LowLunge(), "o")
sun_B.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_B.add_asana(Plank(), "i")
sun_B.add_asana(Chaturanga(), "o")
sun_B.add_asana(UpDog(), "i")
sun_B.add_asana(DownDog(), "o")
sun_B.add_asana(LegToChest(), time=1/SPEED, breath="")
sun_B.add_asana(LowLunge(), time=1/SPEED, breath="")
sun_B.add_asana(Warrior1(), "i")
sun_B.add_asana(LowLunge(), "o")
sun_B.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_B.add_asana(Plank(), "i")
sun_B.add_asana(Chaturanga(), "o")
sun_B.add_asana(UpDog(), "i")
sun_B.add_asana(DownDog(), "oioioioioio")
sun_B.add_asana(LegToChest(), time=1.5/SPEED, breath="")
sun_B.add_asana(LowLunge(), "i")
sun_B.add_asana(ForwardFold(), "o")
sun_B.add_asana(Chair(), "i")
sun_B.add_asana(Standing(), "o")
ashtanga = Sequence("Ashtanga Yoga")
# ashtanga.append_sequence(meditation)
ashtanga.append_sequence(catcow)
ashtanga.append_sequence(vinyasa_cat_to_stand)
for i in range(4):
ashtanga.append_sequence(sun_A)
for i in range(4):
ashtanga.append_sequence(sun_B)
ashtanga.add_asana(Standing(), "o")
linda_55 = Sequence("Linda 5.5")
linda_55.add_asana(LotusLiftedArms(), "ioi")
linda_55.add_asana(SeatedSideBend(right=True), "oioioio")
linda_55.add_asana(LotusLiftedArms(), "ioi")
linda_55.add_asana(SeatedSideBend(right=False), "oioioio")
linda_55.add_asana(LotusLiftedArms(), "ioi")
linda_55.add_asana(SeatedTwist(right=True), "oioioio")
linda_55.add_asana(LotusLiftedArms(), "ioi")
linda_55.add_asana(SeatedTwist(right=False), "oioioio")
linda_55.add_asana(LotusLiftedArms(), "ioi")
linda_55.add_asana(LotusFront(), "ioioioioio")
linda_55.append_sequence(catcow)
for i in range(4):
linda_55.append_sequence(sun_A)