stave 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10860c4906c91ed85b0eaf4bf769d89e786d6c889d316610d6dff4477f5abe8c
4
- data.tar.gz: '0930d6304e76d6cda5c6c899e55e5f21805653ae78a32190e17445bf324fc2cd'
3
+ metadata.gz: 8dbd5c1307918d3c9af4689f6126d374ab8d7a31b03777f0bc3e9a32cf127188
4
+ data.tar.gz: 985afcf77f58ea34b29e1f16f3ee98b01b711ae2701d0c7f0b084586ca553b64
5
5
  SHA512:
6
- metadata.gz: cf4f49e8b76f5e0a2230355e509d3b9e1f8607d171be5775db0a030a4008c7ee09daacf5d41ce1dc9e6a38a330f3cffdc23a67751d84947092f90721d6e79b8a
7
- data.tar.gz: 064a179f62697d1a3d12b0a1fa41849e4c1dfab51d4569f0d46020673a96fb52906c18b27a1b1c5d02e9e2ab61e955660e9dbb290afc4ef8a491e8dd2b8106f5
6
+ metadata.gz: 0d318f7a0cf99045f8e7191734c8d0adb6f41af1d7fc0d63e91176ca2c60328cbe8c731011a2697736068bf0e4326d6032eb287ee818928ef06f900fdb2326b9
7
+ data.tar.gz: 26f57ce7d59c8b333c2f4db3988763eb46c1ec1ab2c36cea23df1ac387ebd2104fc15e24293fe41929f37c3018136fc0c84701e78fc55b734952344ee8ea5d0a
@@ -214,6 +214,10 @@ module Stave
214
214
  note_above(interval.invert!)
215
215
  end
216
216
 
217
+ def self.double_flats
218
+ where(accidental: Accidental.double_flat)
219
+ end
220
+
217
221
  def self.flats
218
222
  where(accidental: Accidental.flat)
219
223
  end
@@ -226,6 +230,10 @@ module Stave
226
230
  where(accidental: Accidental.sharp)
227
231
  end
228
232
 
233
+ def self.double_sharps
234
+ where(accidental: Accidental.double_sharp)
235
+ end
236
+
229
237
  def self.single_accidental
230
238
  flats + naturals + sharps
231
239
  end
@@ -6,13 +6,13 @@ module Stave
6
6
  end
7
7
 
8
8
  def triads
9
- return unless type.hexatonic?
9
+ return unless type.heptatonic?
10
10
 
11
11
  harmonise!(type.triad_types)
12
12
  end
13
13
 
14
14
  def sevenths
15
- return unless type.hexatonic?
15
+ return unless type.heptatonic?
16
16
 
17
17
  harmonise!(type.seventh_types)
18
18
  end
@@ -26,6 +26,10 @@ module Stave
26
26
  )
27
27
  end
28
28
 
29
+ def symbol
30
+ "#{root.symbol} #{type.symbol}"
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def harmonise!(chord_types)
@@ -1,7 +1,7 @@
1
1
  module Stave
2
2
  module Theory
3
3
  class ScaleType < Core::DegreeCollection
4
- variant :major, degrees: [
4
+ variant :major, symbol: "major", degrees: [
5
5
  Degree.root,
6
6
  Degree.two,
7
7
  Degree.three,
@@ -12,7 +12,7 @@ module Stave
12
12
  Degree.octave
13
13
  ]
14
14
 
15
- variant :minor, degrees: [
15
+ variant :minor, symbol: "minor", degrees: [
16
16
  Degree.root,
17
17
  Degree.two,
18
18
  Degree.flat_three,
@@ -24,7 +24,7 @@ module Stave
24
24
  ]
25
25
 
26
26
  with_options suffix: :pentatonic do
27
- variant :major, degrees: [
27
+ variant :major, symbol: "major pentatonic", degrees: [
28
28
  Degree.root,
29
29
  Degree.two,
30
30
  Degree.three,
@@ -33,7 +33,7 @@ module Stave
33
33
  Degree.octave
34
34
  ]
35
35
 
36
- variant :minor, degrees: [
36
+ variant :minor, symbol: "minor pentatonic", degrees: [
37
37
  Degree.root,
38
38
  Degree.flat_three,
39
39
  Degree.four,
@@ -47,7 +47,7 @@ module Stave
47
47
  count == 5
48
48
  end
49
49
 
50
- def hexatonic?
50
+ def heptatonic?
51
51
  count == 7
52
52
  end
53
53
 
data/lib/stave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stave
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
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.1
4
+ version: 0.1.2
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-06 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk