ruby-mext 0.15.1 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28a4013db3acd54130cea14908a473af1995e6305dc076f745c0df0fd39fee4e
4
- data.tar.gz: 3d000b5df323a872be365c786066f8a9aee8e24b37945846ed8846a5dca034d0
3
+ metadata.gz: a96e593b1907f7f809ebf6749fcb08f4eb5df98776af5228f150e3fe61a7d72d
4
+ data.tar.gz: 1be4db352142785ed91a8bc296730083abb8f1832d99b8462d6bcf0fd81d7078
5
5
  SHA512:
6
- metadata.gz: 9cba68333d146085b14fc491fe4faf5843a8ffced4bfc0528f738a51beb7100f5b7327a4ab2ee222ff0b96be9ba45ce7f7102289f556697be960b8b56f6d038c
7
- data.tar.gz: da29c1c57a3868fc95c6ebbebeaa71775c2587d5a3aade044c4a9d8592488a7e5ade59b5c0f63e16f78c78cf852b8904e62818bcf711ff868f786e5921200ff7
6
+ metadata.gz: 389edc3a3a5a67485dbeb2e8b731cb178899d464f9527aa7fc0c6e09c0c949e04dcceef980082e1ea61887ecceb7dd83a80906ca83c62cbf76dfbd23312840a3
7
+ data.tar.gz: dc027c5e60ca811cae9757fcb987e28d2952a25a9a5d256796c05a8664505d6187aba99bd0213125d0ce930190d449a1ec6bed4c853ff4f41c1e89136bc6369b
@@ -202,12 +202,30 @@ module Mext
202
202
  #
203
203
  # - +semi+: the semitones to add; can be any sort of +Numeric+, also
204
204
  # negative to subtract.
205
- #
205
+ #:nodoc:
206
206
  def add_semitones!(semi)
207
207
  @semi += semi
208
208
  self
209
209
  end
210
210
 
211
+ #:doc
212
+ #
213
+ # +anglo_note_name+:
214
+ #
215
+ # returns the name of the note, in anglosaxon notation, with the sharps
216
+ # as only enharmonics (reported as 's'). The octave considers central C
217
+ # as C4
218
+ #
219
+ #
220
+ SEMI_NAMES = %w(C Cs D Ds E F Fs G Gs A As B Bs)
221
+ OCT_DIFF = 4
222
+
223
+ def anglo_note_name
224
+ oct = self.octave - OCT_DIFF
225
+ name = SEMI_NAMES[self.semi.round]
226
+ "%s%d" % [ name, oct ]
227
+ end
228
+
211
229
  class << self
212
230
 
213
231
  #:doc:
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mext
2
- VERSION = '0.15.1'
2
+ VERSION = '0.15.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Bernardini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-19 00:00:00.000000000 Z
11
+ date: 2019-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler