jazz_model 0.1.0

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.
Files changed (49) hide show
  1. data/CHANGELOG.rdoc +14 -0
  2. data/Gemfile +4 -0
  3. data/README.rdoc +186 -0
  4. data/Rakefile +14 -0
  5. data/lib/jazz_model.rb +34 -0
  6. data/lib/jazz_model/base.rb +15 -0
  7. data/lib/jazz_model/chord.rb +141 -0
  8. data/lib/jazz_model/chord_collection.rb +68 -0
  9. data/lib/jazz_model/chord_quality.rb +19 -0
  10. data/lib/jazz_model/chord_scale.rb +30 -0
  11. data/lib/jazz_model/chord_symbol.rb +27 -0
  12. data/lib/jazz_model/chord_symbol_collection.rb +17 -0
  13. data/lib/jazz_model/chord_tone.rb +32 -0
  14. data/lib/jazz_model/definition.rb +66 -0
  15. data/lib/jazz_model/definitions/default.rb +502 -0
  16. data/lib/jazz_model/definitions/keys.rb +48 -0
  17. data/lib/jazz_model/key.rb +49 -0
  18. data/lib/jazz_model/key_context.rb +28 -0
  19. data/lib/jazz_model/mode.rb +47 -0
  20. data/lib/jazz_model/mode_context.rb +32 -0
  21. data/lib/jazz_model/mode_sequence.rb +15 -0
  22. data/lib/jazz_model/note_sequence.rb +15 -0
  23. data/lib/jazz_model/notes_collection.rb +89 -0
  24. data/lib/jazz_model/scale.rb +136 -0
  25. data/lib/jazz_model/scale_tone.rb +24 -0
  26. data/lib/jazz_model/tone.rb +51 -0
  27. data/lib/jazz_model/tone_sequence.rb +62 -0
  28. data/lib/jazz_model/version.rb +3 -0
  29. data/lib/jazz_model/voicing.rb +12 -0
  30. data/lib/jazz_model/voicing_tone.rb +11 -0
  31. data/spec/chord_collection_spec.rb +21 -0
  32. data/spec/chord_quality_spec.rb +27 -0
  33. data/spec/chord_scale_spec.rb +7 -0
  34. data/spec/chord_spec.rb +29 -0
  35. data/spec/chord_symbol_spec.rb +6 -0
  36. data/spec/chord_tone_spec.rb +6 -0
  37. data/spec/definition_spec.rb +35 -0
  38. data/spec/key_context_spec.rb +27 -0
  39. data/spec/key_spec.rb +15 -0
  40. data/spec/mode_spec.rb +9 -0
  41. data/spec/notes_collection_spec.rb +25 -0
  42. data/spec/scale_spec.rb +42 -0
  43. data/spec/scale_tone_spec.rb +6 -0
  44. data/spec/spec_helper.rb +12 -0
  45. data/spec/tone_sequence_spec.rb +17 -0
  46. data/spec/tone_spec.rb +4 -0
  47. data/spec/voicing_spec.rb +6 -0
  48. data/spec/voicing_tone_spec.rb +6 -0
  49. metadata +194 -0
@@ -0,0 +1,6 @@
1
+ require "spec_helper"
2
+
3
+ describe JazzModel::ScaleTone do
4
+ subject { JazzModel::ScaleTone.new }
5
+ it { should be_valid }
6
+ end
@@ -0,0 +1,12 @@
1
+ require "rspec"
2
+ require "shoulda"
3
+ require "active_support"
4
+ require "active_model"
5
+ require "jazz_model"
6
+
7
+ RSpec.configure do |config|
8
+
9
+ end
10
+
11
+ # TODO: Move to context in individual specs, or test in a separate namespace
12
+ JazzModel::Base.load_definitions
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+
3
+ describe JazzModel::ToneSequence do
4
+ subject { JazzModel::Chord['Cmaj7'] }
5
+
6
+ it "should should accept key context" do
7
+ subject.tones.in_key_of('F').notes.first.should == 'F'
8
+ end
9
+
10
+ it "should yield all notes" do
11
+ subject.tones.all.first.position.should == 1
12
+ end
13
+
14
+ it "should accept mode context" do
15
+ subject.tones.in_mode(2).notes.first.should == 'E'
16
+ end
17
+ end
data/spec/tone_spec.rb ADDED
@@ -0,0 +1,4 @@
1
+ require "spec_helper"
2
+
3
+ describe JazzModel::Tone do
4
+ end
@@ -0,0 +1,6 @@
1
+ require "spec_helper"
2
+
3
+ describe JazzModel::Voicing do
4
+ subject { JazzModel::Voicing.new }
5
+ it { should be_valid }
6
+ end
@@ -0,0 +1,6 @@
1
+ require "spec_helper"
2
+
3
+ describe JazzModel::VoicingTone do
4
+ subject { JazzModel::VoicingTone.new }
5
+ it { should be_valid }
6
+ end
metadata ADDED
@@ -0,0 +1,194 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jazz_model
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Ben Hughes
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-25 00:00:00 +03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: activerecord
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 3
32
+ - 0
33
+ - 0
34
+ version: 3.0.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: activesupport
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 7
46
+ segments:
47
+ - 3
48
+ - 0
49
+ - 0
50
+ version: 3.0.0
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: acts_as_list
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 31
62
+ segments:
63
+ - 0
64
+ - 1
65
+ - 2
66
+ version: 0.1.2
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: acts_as_tree
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 25
78
+ segments:
79
+ - 0
80
+ - 1
81
+ - 1
82
+ version: 0.1.1
83
+ type: :runtime
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: rspec
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 2
96
+ - 0
97
+ version: "2.0"
98
+ type: :development
99
+ version_requirements: *id005
100
+ description: Jazz theory is a mathematical system of concepts and relationships, why not make an ActiveModel representation of those concepts?
101
+ email: ben@railsgarden.com
102
+ executables: []
103
+
104
+ extensions: []
105
+
106
+ extra_rdoc_files: []
107
+
108
+ files:
109
+ - lib/jazz_model/base.rb
110
+ - lib/jazz_model/chord.rb
111
+ - lib/jazz_model/chord_collection.rb
112
+ - lib/jazz_model/chord_quality.rb
113
+ - lib/jazz_model/chord_scale.rb
114
+ - lib/jazz_model/chord_symbol.rb
115
+ - lib/jazz_model/chord_symbol_collection.rb
116
+ - lib/jazz_model/chord_tone.rb
117
+ - lib/jazz_model/definition.rb
118
+ - lib/jazz_model/definitions/default.rb
119
+ - lib/jazz_model/definitions/keys.rb
120
+ - lib/jazz_model/key.rb
121
+ - lib/jazz_model/key_context.rb
122
+ - lib/jazz_model/mode.rb
123
+ - lib/jazz_model/mode_context.rb
124
+ - lib/jazz_model/mode_sequence.rb
125
+ - lib/jazz_model/note_sequence.rb
126
+ - lib/jazz_model/notes_collection.rb
127
+ - lib/jazz_model/scale.rb
128
+ - lib/jazz_model/scale_tone.rb
129
+ - lib/jazz_model/tone.rb
130
+ - lib/jazz_model/tone_sequence.rb
131
+ - lib/jazz_model/version.rb
132
+ - lib/jazz_model/voicing.rb
133
+ - lib/jazz_model/voicing_tone.rb
134
+ - lib/jazz_model.rb
135
+ - spec/chord_collection_spec.rb
136
+ - spec/chord_quality_spec.rb
137
+ - spec/chord_scale_spec.rb
138
+ - spec/chord_spec.rb
139
+ - spec/chord_symbol_spec.rb
140
+ - spec/chord_tone_spec.rb
141
+ - spec/definition_spec.rb
142
+ - spec/key_context_spec.rb
143
+ - spec/key_spec.rb
144
+ - spec/mode_spec.rb
145
+ - spec/notes_collection_spec.rb
146
+ - spec/scale_spec.rb
147
+ - spec/scale_tone_spec.rb
148
+ - spec/spec_helper.rb
149
+ - spec/tone_sequence_spec.rb
150
+ - spec/tone_spec.rb
151
+ - spec/voicing_spec.rb
152
+ - spec/voicing_tone_spec.rb
153
+ - CHANGELOG.rdoc
154
+ - Gemfile
155
+ - Rakefile
156
+ - README.rdoc
157
+ has_rdoc: true
158
+ homepage: http://github.com/rubiety/jazz_model
159
+ licenses: []
160
+
161
+ post_install_message:
162
+ rdoc_options: []
163
+
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ none: false
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ hash: 3
172
+ segments:
173
+ - 0
174
+ version: "0"
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ hash: 19
181
+ segments:
182
+ - 1
183
+ - 3
184
+ - 4
185
+ version: 1.3.4
186
+ requirements: []
187
+
188
+ rubyforge_project: jazz_model
189
+ rubygems_version: 1.3.7
190
+ signing_key:
191
+ specification_version: 3
192
+ summary: An object model of jazz theory.
193
+ test_files: []
194
+