musique 0.0.1 → 0.0.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 +22 -34
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f7ef8eaeb5eefe9a921b71da62d03c9d4729001
|
4
|
+
data.tar.gz: eca0fd64569bf2ba665ab9ae1a5af3275db6c6e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b9a9f7fee0552a7b9559fc8f6529f7655dcf2d173a71b82f5631634b88115b7075410eedf5cba32ea9d5b17eaab13e1c467752c012f7f7c4021e2aa8a5d955b
|
7
|
+
data.tar.gz: 9b601f35d8475e19fccbf24b7b7a7d67c6ce5f43942f6505beb622b0d0210046418d78118585bc13b7a2b561fa7369da92667f1780341d4650392613291b6a6c
|
data/README.md
CHANGED
@@ -16,77 +16,65 @@ Usage
|
|
16
16
|
### `Music::Note`
|
17
17
|
|
18
18
|
```rb
|
19
|
-
|
20
|
-
|
21
|
-
include Music
|
22
|
-
|
23
|
-
note = Note.new("C#1")
|
19
|
+
note = Music::Note.new("C#1")
|
24
20
|
note.letter #=> "C"
|
25
21
|
note.accidental #=> "#"
|
26
22
|
note.octave #=> 1
|
27
23
|
|
28
24
|
# Comparison
|
29
|
-
Note.new("C1") < Note.new("E1") #=> true
|
30
|
-
Note.new("C#1") == Note.new("
|
25
|
+
Music::Note.new("C1") < Music::Note.new("E1") #=> true
|
26
|
+
Music::Note.new("C#1") == Music::Note.new("Db1") #=> true
|
31
27
|
|
32
28
|
# Transposing
|
33
|
-
major_third = Interval.new(3, :major)
|
34
|
-
Note.new("C1").transpose_up(major_third).name #=> "E1"
|
35
|
-
Note.new("E1").transpose_down(major_third).name #=> "C1"
|
29
|
+
major_third = Music::Interval.new(3, :major)
|
30
|
+
Music::Note.new("C1").transpose_up(major_third).name #=> "E1"
|
31
|
+
Music::Note.new("E1").transpose_down(major_third).name #=> "C1"
|
36
32
|
|
37
33
|
# Difference
|
38
|
-
Note.new("C2") - Note.new("C1") #=> #<Music::Interval @number=8, @quality=:perfect>
|
34
|
+
Music::Note.new("C2") - Music::Note.new("C1") #=> #<Music::Interval @number=8, @quality=:perfect>
|
39
35
|
```
|
40
36
|
|
41
37
|
### `Music::Chord`
|
42
38
|
|
43
39
|
```rb
|
44
|
-
|
45
|
-
|
46
|
-
include Music
|
47
|
-
|
48
|
-
chord = Chord.new("C#7")
|
40
|
+
chord = Music::Chord.new("C#7")
|
49
41
|
chord.root.name #=> "C#"
|
50
42
|
chord.kind #=> "7"
|
51
43
|
|
52
44
|
# Notes
|
53
|
-
Chord.new("C").notes.map(&:name) #=> ["C", "E", "G"]
|
54
|
-
Chord.new("Cm7").notes.map(&:name) #=> ["C", "
|
45
|
+
Music::Chord.new("C").notes.map(&:name) #=> ["C", "E", "G"]
|
46
|
+
Music::Chord.new("Cm7").notes.map(&:name) #=> ["C", "Eb", "G", "Bb"]
|
55
47
|
|
56
48
|
# Transposing
|
57
|
-
major_third = Interval.new(3, :major)
|
58
|
-
Chord.new("C").transpose_up(major_third).notes.map(&:name) #=> ["E", "G#", "B"]
|
49
|
+
major_third = Music::Interval.new(3, :major)
|
50
|
+
Music::Chord.new("C").transpose_up(major_third).notes.map(&:name) #=> ["E", "G#", "B"]
|
59
51
|
```
|
60
52
|
|
61
|
-
Into `Chord.new(...)` you should be able to pass in any chord name. For example,
|
53
|
+
Into `Music::Chord.new(...)` you should be able to pass in any chord name. For example,
|
62
54
|
`"Cm"` and `"Cmin"` both represent the "C minor" chord, and both can be passed in.
|
63
55
|
|
64
56
|
If you come across a chord name that doesn't work, please open an issue,
|
65
|
-
I would like to know about it
|
57
|
+
I would like to know about it :)
|
66
58
|
|
67
59
|
### `Music::Interval`
|
68
60
|
|
69
61
|
```rb
|
70
|
-
|
71
|
-
|
72
|
-
include Music
|
73
|
-
|
74
|
-
interval = Interval.new(3, :minor)
|
62
|
+
interval = Music::Interval.new(3, :minor)
|
75
63
|
interval.number #=> 3
|
76
64
|
interval.quality #=> :minor
|
77
65
|
|
78
66
|
# Comparison
|
79
|
-
Interval.new(3, :minor) > Interval.new(2, :major) #=> true
|
80
|
-
Interval.new(3, :minor) == Interval.new(2, :augmented) #=> true
|
67
|
+
Music::Interval.new(3, :minor) > Music::Interval.new(2, :major) #=> true
|
68
|
+
Music::Interval.new(3, :minor) == Music::Interval.new(2, :augmented) #=> true
|
81
69
|
|
82
70
|
# Kinds
|
83
|
-
Interval.new(6, :major).consonance? #=> true
|
84
|
-
Interval.new(6, :major).perfect_consonance? #=> false (perfect consonances are 1, 4, and 5)
|
85
|
-
Interval.new(6, :major).imperfect_consonance? #=> true
|
86
|
-
Interval.new(6, :major).dissonance? #=> false
|
71
|
+
Music::Interval.new(6, :major).consonance? #=> true
|
72
|
+
Music::Interval.new(6, :major).perfect_consonance? #=> false (perfect consonances are 1, 4, and 5)
|
73
|
+
Music::Interval.new(6, :major).imperfect_consonance? #=> true
|
74
|
+
Music::Interval.new(6, :major).dissonance? #=> false
|
87
75
|
|
88
76
|
# Size
|
89
|
-
Interval.new(3, :major).size #=> 4 (semitones)
|
77
|
+
Music::Interval.new(3, :major).size #=> 4 (semitones)
|
90
78
|
```
|
91
79
|
|
92
80
|
Social
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: musique
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
@@ -10,7 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: Musique is a gem for manipulating with musical constructs, such as notes,
|
14
|
+
chords and intervals.
|
14
15
|
email:
|
15
16
|
- janko.marohnic@gmail.com
|
16
17
|
executables: []
|
@@ -24,7 +25,7 @@ files:
|
|
24
25
|
- lib/music/interval.rb
|
25
26
|
- lib/music/note.rb
|
26
27
|
- lib/musique.rb
|
27
|
-
homepage: http://
|
28
|
+
homepage: http://github.com/janko-m/musique
|
28
29
|
licenses:
|
29
30
|
- MIT
|
30
31
|
metadata: {}
|
@@ -47,6 +48,7 @@ rubyforge_project:
|
|
47
48
|
rubygems_version: 2.2.0
|
48
49
|
signing_key:
|
49
50
|
specification_version: 4
|
50
|
-
summary:
|
51
|
+
summary: Musique is a gem for manipulating with musical constructs, such as notes,
|
52
|
+
chords and intervals.
|
51
53
|
test_files: []
|
52
54
|
has_rdoc:
|