stave 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stave/theory/note.rb +135 -37
- data/lib/stave/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10860c4906c91ed85b0eaf4bf769d89e786d6c889d316610d6dff4477f5abe8c
|
4
|
+
data.tar.gz: '0930d6304e76d6cda5c6c899e55e5f21805653ae78a32190e17445bf324fc2cd'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf4f49e8b76f5e0a2230355e509d3b9e1f8607d171be5775db0a030a4008c7ee09daacf5d41ce1dc9e6a38a330f3cffdc23a67751d84947092f90721d6e79b8a
|
7
|
+
data.tar.gz: 064a179f62697d1a3d12b0a1fa41849e4c1dfab51d4569f0d46020673a96fb52906c18b27a1b1c5d02e9e2ab61e955660e9dbb290afc4ef8a491e8dd2b8106f5
|
data/lib/stave/theory/note.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Stave
|
2
2
|
module Theory
|
3
|
-
class Note < Core::Lookup
|
3
|
+
class Note < Core::Lookup # rubocop:disable Metrics/ClassLength
|
4
4
|
class PitchClass < Core::Lookup
|
5
5
|
variant :c, index: 0, symbol: "C", to_i: 0
|
6
6
|
variant :d, index: 1, symbol: "D", to_i: 2
|
@@ -26,59 +26,157 @@ module Stave
|
|
26
26
|
end
|
27
27
|
|
28
28
|
with_options pitch_class: PitchClass.a do
|
29
|
-
variant :a_double_flat,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
variant :
|
29
|
+
variant :a_double_flat,
|
30
|
+
accidental: Accidental.double_flat,
|
31
|
+
circle_of_fifths?: false
|
32
|
+
|
33
|
+
variant :a_flat,
|
34
|
+
accidental: Accidental.flat,
|
35
|
+
circle_of_fifths?: true
|
36
|
+
|
37
|
+
variant :a_natural,
|
38
|
+
accidental: Accidental.natural,
|
39
|
+
circle_of_fifths?: true
|
40
|
+
|
41
|
+
variant :a_sharp,
|
42
|
+
accidental: Accidental.sharp,
|
43
|
+
circle_of_fifths?: false
|
44
|
+
|
45
|
+
variant :a_double_sharp,
|
46
|
+
accidental: Accidental.double_sharp,
|
47
|
+
circle_of_fifths?: false
|
34
48
|
end
|
35
49
|
|
36
50
|
with_options pitch_class: PitchClass.b do
|
37
|
-
variant :b_double_flat,
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
variant :
|
51
|
+
variant :b_double_flat,
|
52
|
+
accidental: Accidental.double_flat,
|
53
|
+
circle_of_fifths?: false
|
54
|
+
|
55
|
+
variant :b_flat,
|
56
|
+
accidental: Accidental.flat,
|
57
|
+
circle_of_fifths?: true
|
58
|
+
|
59
|
+
variant :b_natural,
|
60
|
+
accidental: Accidental.natural,
|
61
|
+
circle_of_fifths?: true
|
62
|
+
|
63
|
+
variant :b_sharp,
|
64
|
+
accidental: Accidental.sharp,
|
65
|
+
circle_of_fifths?: false
|
66
|
+
|
67
|
+
variant :b_double_sharp,
|
68
|
+
accidental: Accidental.double_sharp,
|
69
|
+
circle_of_fifths?: false
|
42
70
|
end
|
43
71
|
|
44
72
|
with_options pitch_class: PitchClass.c do
|
45
|
-
variant :c_double_flat,
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
variant :
|
73
|
+
variant :c_double_flat,
|
74
|
+
accidental: Accidental.double_flat,
|
75
|
+
circle_of_fifths?: false
|
76
|
+
|
77
|
+
variant :c_flat,
|
78
|
+
accidental: Accidental.flat,
|
79
|
+
circle_of_fifths?: true
|
80
|
+
|
81
|
+
variant :c_natural,
|
82
|
+
accidental: Accidental.natural,
|
83
|
+
circle_of_fifths?: true
|
84
|
+
|
85
|
+
variant :c_sharp,
|
86
|
+
accidental: Accidental.sharp,
|
87
|
+
circle_of_fifths?: true
|
88
|
+
|
89
|
+
variant :c_double_sharp,
|
90
|
+
accidental: Accidental.double_sharp,
|
91
|
+
circle_of_fifths?: false
|
50
92
|
end
|
51
93
|
|
52
94
|
with_options pitch_class: PitchClass.d do
|
53
|
-
variant :d_double_flat,
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
variant :
|
95
|
+
variant :d_double_flat,
|
96
|
+
accidental: Accidental.double_flat,
|
97
|
+
circle_of_fifths?: false
|
98
|
+
|
99
|
+
variant :d_flat,
|
100
|
+
accidental: Accidental.flat,
|
101
|
+
circle_of_fifths?: true
|
102
|
+
|
103
|
+
variant :d_natural,
|
104
|
+
accidental: Accidental.natural,
|
105
|
+
circle_of_fifths?: true
|
106
|
+
|
107
|
+
variant :d_sharp,
|
108
|
+
accidental: Accidental.sharp,
|
109
|
+
circle_of_fifths?: false
|
110
|
+
|
111
|
+
variant :d_double_sharp,
|
112
|
+
accidental: Accidental.double_sharp,
|
113
|
+
circle_of_fifths?: false
|
58
114
|
end
|
59
115
|
|
60
116
|
with_options pitch_class: PitchClass.e do
|
61
|
-
variant :e_double_flat,
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
variant :
|
117
|
+
variant :e_double_flat,
|
118
|
+
accidental: Accidental.double_flat,
|
119
|
+
circle_of_fifths?: false
|
120
|
+
|
121
|
+
variant :e_flat,
|
122
|
+
accidental: Accidental.flat,
|
123
|
+
circle_of_fifths?: true
|
124
|
+
|
125
|
+
variant :e_natural,
|
126
|
+
accidental: Accidental.natural,
|
127
|
+
circle_of_fifths?: true
|
128
|
+
|
129
|
+
variant :e_sharp,
|
130
|
+
accidental: Accidental.sharp,
|
131
|
+
circle_of_fifths?: false
|
132
|
+
|
133
|
+
variant :e_double_sharp,
|
134
|
+
accidental: Accidental.double_sharp,
|
135
|
+
circle_of_fifths?: false
|
66
136
|
end
|
67
137
|
|
68
138
|
with_options pitch_class: PitchClass.f do
|
69
|
-
variant :f_double_flat,
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
variant :
|
139
|
+
variant :f_double_flat,
|
140
|
+
accidental: Accidental.double_flat,
|
141
|
+
circle_of_fifths?: false
|
142
|
+
|
143
|
+
variant :f_flat,
|
144
|
+
accidental: Accidental.flat,
|
145
|
+
circle_of_fifths?: false
|
146
|
+
|
147
|
+
variant :f_natural,
|
148
|
+
accidental: Accidental.natural,
|
149
|
+
circle_of_fifths?: true
|
150
|
+
|
151
|
+
variant :f_sharp,
|
152
|
+
accidental: Accidental.sharp,
|
153
|
+
circle_of_fifths?: true
|
154
|
+
|
155
|
+
variant :f_double_sharp,
|
156
|
+
accidental: Accidental.double_sharp,
|
157
|
+
circle_of_fifths?: false
|
74
158
|
end
|
75
159
|
|
76
160
|
with_options pitch_class: PitchClass.g do
|
77
|
-
variant :g_double_flat,
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
variant :
|
161
|
+
variant :g_double_flat,
|
162
|
+
accidental: Accidental.double_flat,
|
163
|
+
circle_of_fifths?: false
|
164
|
+
|
165
|
+
variant :g_flat,
|
166
|
+
accidental: Accidental.flat,
|
167
|
+
circle_of_fifths?: true
|
168
|
+
|
169
|
+
variant :g_natural,
|
170
|
+
accidental: Accidental.natural,
|
171
|
+
circle_of_fifths?: true
|
172
|
+
|
173
|
+
variant :g_sharp,
|
174
|
+
accidental: Accidental.sharp,
|
175
|
+
circle_of_fifths?: false
|
176
|
+
|
177
|
+
variant :g_double_sharp,
|
178
|
+
accidental: Accidental.double_sharp,
|
179
|
+
circle_of_fifths?: false
|
82
180
|
end
|
83
181
|
|
84
182
|
def +(other)
|
@@ -133,7 +231,7 @@ module Stave
|
|
133
231
|
end
|
134
232
|
|
135
233
|
def self.circle_of_fifths
|
136
|
-
|
234
|
+
where(circle_of_fifths?: true)
|
137
235
|
end
|
138
236
|
end
|
139
237
|
end
|
data/lib/stave/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Welham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|