note-transpose 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 +4 -4
- data/README.md +28 -12
- data/bin/note-transpose +13 -12
- data/lib/note-transpose.rb +1 -3
- metadata +74 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bbc3b677dae36c2aaaa2393f654a9fe2b2163c13550ec6cdb3459d82f04e544
|
4
|
+
data.tar.gz: ce229a4e097d362523b077527d88ff99f55868f5f54e13c0fd849b925a83ae88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a02bfa6abdc76a894ccc09e6884a8b41e1c217769f639e89643dbf64669e8ab75bbf85e2510f617dac56497da36882960ea89cd6b99adecc6c4b67995b0634
|
7
|
+
data.tar.gz: 89396d0778695cf3b1453d701810ba46453b0fd720aac5f4c5bf2f3dda669db2f8a859df7e217becce0729924e459cc8b1faa81efe04c95e8be86623943a5bab
|
data/README.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# Note Transpose
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/note-transpose.svg)](https://badge.fury.io/rb/note-transpose)
|
3
|
+
[![Build Status](https://travis-ci.org/vyder/note-transpose.svg?branch=master)](https://travis-ci.org/vyder/note-transpose)
|
4
|
+
[![Inline docs](http://inch-ci.org/github/vyder/note-transpose.svg?branch=master)](http://inch-ci.org/github/vyder/note-transpose)
|
2
5
|
|
3
6
|
A CLI tool to transpose notes by half steps
|
4
7
|
|
@@ -6,6 +9,7 @@ A CLI tool to transpose notes by half steps
|
|
6
9
|
|
7
10
|
- [Install](#install)
|
8
11
|
- [Usage](#usage)
|
12
|
+
- [Documentation](#documentation)
|
9
13
|
- [Support](#support)
|
10
14
|
- [Contributing](#contributing)
|
11
15
|
|
@@ -18,27 +22,39 @@ A CLI tool to transpose notes by half steps
|
|
18
22
|
❯ note-transpose --help
|
19
23
|
|
20
24
|
Usage: note-transpose [-]<number half steps> <notes> [--pref-flat]
|
21
|
-
--pref-flat Always uses flat notes in output instead of sharp ones
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
=> Db Ab Gb Bbm
|
26
|
+
Options:
|
27
|
+
--pref-flat Always uses flat notes in output instead of sharp ones
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
Examples:
|
30
|
+
❯ note-transpose +1 C G F Am
|
31
|
+
=> Db Ab Gb Bbm
|
29
32
|
|
30
|
-
|
31
|
-
|
33
|
+
❯ note-transpose 2 C G F Am
|
34
|
+
=> D A G Bm
|
32
35
|
|
33
|
-
|
34
|
-
|
36
|
+
❯ note-transpose -2 D# G7 F Am7 Cadd7
|
37
|
+
=> C# F7 Eb Gm7 Bbadd7
|
38
|
+
|
39
|
+
❯ note-transpose -2 D# G7 F Am7 Cadd7 --pref-flat
|
40
|
+
=> Db F7 Eb Gm7 Bbadd7
|
35
41
|
|
36
42
|
You can even include the module in your code if you need that for some reason:
|
37
43
|
|
38
44
|
require 'note-transpose'
|
39
45
|
|
40
|
-
NoteTranspose.transpose(
|
41
|
-
# => ["
|
46
|
+
NoteTranspose.transpose(3, "D#", "F", "Bm", "G7")
|
47
|
+
# => ["F#", "Ab", "Dm", "Bb7"]
|
48
|
+
|
49
|
+
NoteTranspose.transpose(3, "D#", "F", "Bm", "G7", pref_flat: true)
|
50
|
+
# => ["Gb", "Ab", "Dm", "Bb7"]
|
51
|
+
|
52
|
+
## Documentation
|
53
|
+
|
54
|
+
You can find the docs hosted at:
|
55
|
+
|
56
|
+
- [This repo's Github pages](https://vyder.github.io/note-transpose/)
|
57
|
+
- [RubyGems](https://rubygems.org/gems/note-transpose)
|
42
58
|
|
43
59
|
## Support
|
44
60
|
|
data/bin/note-transpose
CHANGED
@@ -8,21 +8,23 @@ def print_help
|
|
8
8
|
basename = File.basename(__FILE__)
|
9
9
|
puts <<EOF
|
10
10
|
|
11
|
-
Usage: #{basename} [-]<number half steps> <notes> [
|
12
|
-
#{PREF_FLAT_OPT} Always uses flat notes in output instead of sharp ones
|
11
|
+
Usage: #{basename} [-]<number half steps> <notes> [options]
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
=> #{NoteTranspose.transpose(1, %w(C G F Am))}
|
13
|
+
Options:
|
14
|
+
#{PREF_FLAT_OPT} Always uses flat notes in output instead of sharp ones
|
17
15
|
|
18
|
-
|
19
|
-
|
16
|
+
Examples:
|
17
|
+
❯ #{basename} +1 C G F Am
|
18
|
+
=> #{NoteTranspose.transpose(1, %w(C G F Am))}
|
20
19
|
|
21
|
-
❯ #{basename}
|
22
|
-
=> #{NoteTranspose.transpose(
|
20
|
+
❯ #{basename} 2 C G F Am
|
21
|
+
=> #{NoteTranspose.transpose(2, %w(C G F Am))}
|
23
22
|
|
24
|
-
❯ #{basename} -2 D# G7 F Am7 Cadd7
|
25
|
-
=> #{NoteTranspose.transpose(-2, %w(D# G7 F Am7 Cadd7)
|
23
|
+
❯ #{basename} -2 D# G7 F Am7 Cadd7
|
24
|
+
=> #{NoteTranspose.transpose(-2, %w(D# G7 F Am7 Cadd7))}
|
25
|
+
|
26
|
+
❯ #{basename} -2 D# G7 F Am7 Cadd7 --pref-flat
|
27
|
+
=> #{NoteTranspose.transpose(-2, %w(D# G7 F Am7 Cadd7), pref_flat: true)}
|
26
28
|
EOF
|
27
29
|
end
|
28
30
|
|
@@ -40,6 +42,5 @@ pref_flat = !input.delete(PREF_FLAT_OPT).nil?
|
|
40
42
|
result = NoteTranspose.transpose(half_steps, input, pref_flat: pref_flat)
|
41
43
|
|
42
44
|
puts <<EOF
|
43
|
-
|
44
45
|
=> #{result.join(' ')}
|
45
46
|
EOF
|
data/lib/note-transpose.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
1
|
|
3
2
|
# List of musical notes, as sharps and flats
|
4
3
|
NOTES = {
|
@@ -59,8 +58,7 @@ module NoteTranspose
|
|
59
58
|
|
60
59
|
transposed_notes << note.gsub(actual_note, transposed_note).capitalize
|
61
60
|
rescue
|
62
|
-
|
63
|
-
exit 1
|
61
|
+
raise "'#{note.capitalize}' is not a valid note!"
|
64
62
|
end
|
65
63
|
end
|
66
64
|
|
metadata
CHANGED
@@ -1,15 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: note-transpose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vidur Murali
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
12
|
-
dependencies:
|
11
|
+
date: 2020-08-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 13.0.1
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 13.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.9.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.9.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubygems-tasks
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.2.5
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.2.5
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: simplecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.19.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.19.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: yard
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.9.25
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.9.25
|
13
83
|
description:
|
14
84
|
email:
|
15
85
|
- vidur@monkeychai.com
|
@@ -40,8 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
110
|
- !ruby/object:Gem::Version
|
41
111
|
version: '0'
|
42
112
|
requirements: []
|
43
|
-
|
44
|
-
rubygems_version: 2.7.3
|
113
|
+
rubygems_version: 3.1.4
|
45
114
|
signing_key:
|
46
115
|
specification_version: 4
|
47
116
|
summary: A CLI tool to transpose notes by half steps
|