coltrane 2.1.0 → 2.1.5
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 +4 -4
- data/README.md +25 -47
- data/coltrane.gemspec +1 -1
- data/exe/coltrane +20 -20
- data/lib/cli/chord.rb +2 -0
- data/lib/cli/errors.rb +12 -0
- data/lib/cli/scale.rb +1 -0
- data/lib/coltrane/chord.rb +3 -3
- data/lib/coltrane/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af07ab95dbc675d21b3543f87c30389a38a95685d963a6f6b0af48b60fb5653
|
4
|
+
data.tar.gz: d066a320b2d192feafcc7bea90e0aaee0977c7bb5284392c555de1689afc900f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d76f287e71bf910e9ca40e8d586ea35e03f30d9598ab6ed7ee249b9341ad0ff99269ff73ea2dc2b945af8d97e8941bc9da87a88cba39913f71ab42c3c371ec
|
7
|
+
data.tar.gz: 3b43103aa6830b80faa581586b87099a56186dfa4bfa7e6f9fa19da388f119ae88e6a20b8a7e83de5ff2afbc7d2ad342a176a885853ce744989209095237cc67
|
data/README.md
CHANGED
@@ -1,75 +1,53 @@
|
|
1
1
|
# Coltrane
|
2
2
|
|
3
|
-
A
|
3
|
+
A music calculation library/CLI written in Ruby.
|
4
4
|
|
5
5
|

|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Chat room for discussing the project, answering questions, etc
|
10
|
-
https://gitter.im/coltrane-music/Lobby
|
7
|
+
* [How to use this library](https://github.com/pedrozath/coltrane/wiki/Core-music-theory-library).
|
8
|
+
* [Why did I wrote this library](https://medium.com/@pedrozath/so-i-wrote-a-library-to-help-me-compose-music-ddb4ae7c8227).
|
9
|
+
* [Chat room for discussing the project, answering questions, etc.](https://gitter.im/coltrane-music/Lobby)
|
11
10
|
|
12
11
|
## CLI (Command Line Interface)
|
13
12
|
|
14
13
|

|
14
|
+

|
15
|
+
|
16
|
+
## Features
|
15
17
|
|
16
|
-
|
18
|
+
* Generate chord progressions for Jazz, Blues, Pop, or custom and see how to play them
|
19
|
+
* Seek chords, see their notes and how to play them
|
20
|
+
* Seek scales, see their notes and see how to play them
|
21
|
+
* Find chords that are common between 2 scales
|
22
|
+
* Find scales containing a chord or a set of notes
|
23
|
+
* Find possible progressions of a chord sequence
|
24
|
+
* All of the above can be seen on guitar, bass, piano or ukelele representations, no sheet music needed
|
17
25
|
|
18
|
-
|
26
|
+
## Installation
|
19
27
|
|
20
28
|
```bash
|
21
29
|
$ gem install coltrane
|
22
30
|
```
|
23
31
|
|
24
|
-
Once you install the gem the CLI is instaled in your system and it's ready to be used.
|
25
|
-
|
26
|
-
### Usage
|
27
|
-
|
28
|
-
It allows you to query for notes and chords and display them on your favorite instrument. No sheet music reading skills needed. It also allows you to find scales with a chord and find chords shared between two scales (that is actually the main goal when I did this project).
|
29
|
-
|
30
|
-
## As a library
|
31
|
-
|
32
|
-
Add this line to your application's Gemfile:
|
33
|
-
|
34
|
-
```ruby
|
35
|
-
gem 'coltrane'
|
36
|
-
```
|
37
|
-
|
38
|
-
And then execute:
|
39
|
-
```sh
|
40
|
-
$ bundle
|
41
|
-
```
|
42
|
-
|
43
|
-
The whole library will be available under the `Coltrane` module. The CLI code won't be imported to your application as default. Here's a quick example on how to use it:
|
44
|
-
|
45
|
-
```ruby
|
46
|
-
require 'coltrane'
|
47
|
-
|
48
|
-
puts Coltrane::Scale.major('C').sevenths.map(&:name)
|
49
|
-
# => ["CM7", "Dm7", "Em7", "FM7", "G7", "Am7", "Bm7b5"]
|
50
|
-
|
51
|
-
puts Coltrane::Scale.having_chord('CM7').scales.map(&:name)
|
52
|
-
# => ["C Major", "G Major", "E Natural Minor", "A Natural Minor", "E Harmonic Minor", "B Flamenco"]
|
53
|
-
```
|
32
|
+
PS: Once you install the gem the CLI is instaled in your system and it's ready to be used.
|
54
33
|
|
55
34
|
## Changelog
|
56
35
|
|
57
|
-
See the changelog
|
36
|
+
[See the changelog](CHANGELOG.md)
|
58
37
|
|
59
38
|
## Contributing
|
60
39
|
|
61
|
-
|
62
|
-
|
63
|
-
Fork the code, make your changes and maybe write a test or two. Then run:
|
64
|
-
|
65
|
-
Then run:
|
66
|
-
```
|
67
|
-
bundle exec rspec spec
|
68
|
-
```
|
40
|
+
We are looking for contributors. Find me on [our chatroom](https://gitter.im/coltrane-music/Lobby) if you need any kind of information.
|
69
41
|
|
70
|
-
|
42
|
+
### How to contribute
|
43
|
+
1. Fork this code
|
44
|
+
2. Install the test suite (RSpec) by running good old `bundle` command
|
45
|
+
3. Make your changes and maybe write a test or two.
|
46
|
+
4. Check if specs pass `bundle exec rspec spec`
|
47
|
+
5. Submit a PR.
|
71
48
|
|
72
49
|
## License
|
73
50
|
|
74
51
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
75
52
|
|
53
|
+
by Pedro Maciel | [twitter](http://twitter.com/pedrozath) | pedro@pedromaciel.com
|
data/coltrane.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
33
|
spec.require_paths = ["lib"]
|
34
34
|
|
35
|
-
spec.add_runtime_dependency 'coreaudio'
|
35
|
+
# spec.add_runtime_dependency 'coreaudio'
|
36
36
|
spec.add_runtime_dependency 'paint', '~> 2.0'
|
37
37
|
spec.add_runtime_dependency 'color', '~> 1.8'
|
38
38
|
spec.add_runtime_dependency 'pedrozath-mercenary', '~> 0.3'
|
data/exe/coltrane
CHANGED
@@ -222,26 +222,26 @@ Mercenary.program(:Coltrane) do |p|
|
|
222
222
|
end
|
223
223
|
end
|
224
224
|
|
225
|
-
p.command(:start) do |c|
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
end
|
243
|
-
|
244
|
-
p.default_command(:start)
|
225
|
+
# p.command(:start) do |c|
|
226
|
+
# c.description 'Starts interactive mode'
|
227
|
+
# c.action do
|
228
|
+
# begin
|
229
|
+
# Coltrane::Cli.erase_config
|
230
|
+
# puts "\n"
|
231
|
+
# print Paint['coltrane ', '#F88550']
|
232
|
+
# cmd = gets.chomp
|
233
|
+
# return if %w[exit exit q quit stop].include?(cmd)
|
234
|
+
# puts "\n"
|
235
|
+
# p.go(cmd.split(' '))
|
236
|
+
# rescue Exception
|
237
|
+
# ensure
|
238
|
+
# p.instance_variable_set :'@config', {}
|
239
|
+
# end
|
240
|
+
# p.execute(['start'], {})
|
241
|
+
# end
|
242
|
+
# end
|
243
|
+
|
244
|
+
# p.default_command(:start)
|
245
245
|
end
|
246
246
|
|
247
247
|
# rubocop:enable Metrics/BlockLength
|
data/lib/cli/chord.rb
CHANGED
data/lib/cli/errors.rb
CHANGED
@@ -28,6 +28,18 @@ module Coltrane
|
|
28
28
|
'is not available at the moment.'
|
29
29
|
end
|
30
30
|
end
|
31
|
+
|
32
|
+
class BadScaleError < ColtraneCliError
|
33
|
+
def initialize(msg = nil)
|
34
|
+
super msg || 'Incorrect scale, please specify scale and root separated by `-`. Ex: `coltrane scale major-C'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class BadChordError < ColtraneCliError
|
39
|
+
def initialize(msg = nil)
|
40
|
+
super msg || 'Incorrect chord, please specify a set of chords separated by `-`. Ex: coltrane chord CM7'
|
41
|
+
end
|
42
|
+
end
|
31
43
|
end
|
32
44
|
end
|
33
45
|
|
data/lib/cli/scale.rb
CHANGED
data/lib/coltrane/chord.rb
CHANGED
@@ -48,15 +48,15 @@ module Coltrane
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def next_inversion
|
51
|
-
Chord.new(notes.rotate(1))
|
51
|
+
Chord.new(notes: notes.rotate(1))
|
52
52
|
end
|
53
53
|
|
54
54
|
def invert(n = 1)
|
55
|
-
Chord.new(notes.rotate(n))
|
55
|
+
Chord.new(notes: notes.rotate(n))
|
56
56
|
end
|
57
57
|
|
58
58
|
def previous_inversion
|
59
|
-
Chord.new(notes.rotate(-1))
|
59
|
+
Chord.new(notes: notes.rotate(-1))
|
60
60
|
end
|
61
61
|
|
62
62
|
def +(other)
|
data/lib/coltrane/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coltrane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Maciel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: coreaudio
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: paint
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|