music-transcription 0.6.3 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/examples/hip.yml +516 -0
  3. data/examples/make_hip.rb +63 -0
  4. data/examples/make_missed_connection.rb +65 -0
  5. data/examples/make_song1.rb +71 -0
  6. data/examples/make_song2.rb +58 -0
  7. data/examples/missed_connection.yml +305 -0
  8. data/examples/song1.yml +367 -0
  9. data/examples/song2.yml +236 -0
  10. data/lib/music-transcription/accent.rb +4 -15
  11. data/lib/music-transcription/accents.rb +12 -0
  12. data/lib/music-transcription/dynamic.rb +6 -15
  13. data/lib/music-transcription/meter.rb +15 -0
  14. data/lib/music-transcription/note.rb +28 -91
  15. data/lib/music-transcription/part.rb +9 -65
  16. data/lib/music-transcription/score.rb +14 -43
  17. data/lib/music-transcription/version.rb +1 -1
  18. data/lib/music-transcription.rb +2 -0
  19. data/spec/meter_spec.rb +25 -0
  20. data/spec/note_spec.rb +20 -33
  21. data/spec/part_spec.rb +13 -82
  22. data/spec/score_spec.rb +28 -16
  23. data/spec/spec_helper.rb +7 -2
  24. metadata +14 -20
  25. data/samples/arrangements/glissando_test.yml +0 -71
  26. data/samples/arrangements/hip.yml +0 -952
  27. data/samples/arrangements/instrument_test.yml +0 -119
  28. data/samples/arrangements/legato_test.yml +0 -237
  29. data/samples/arrangements/make_glissando_test.rb +0 -27
  30. data/samples/arrangements/make_hip.rb +0 -75
  31. data/samples/arrangements/make_instrument_test.rb +0 -34
  32. data/samples/arrangements/make_legato_test.rb +0 -37
  33. data/samples/arrangements/make_missed_connection.rb +0 -72
  34. data/samples/arrangements/make_portamento_test.rb +0 -27
  35. data/samples/arrangements/make_slur_test.rb +0 -37
  36. data/samples/arrangements/make_song1.rb +0 -84
  37. data/samples/arrangements/make_song2.rb +0 -69
  38. data/samples/arrangements/missed_connection.yml +0 -481
  39. data/samples/arrangements/portamento_test.yml +0 -71
  40. data/samples/arrangements/slur_test.yml +0 -237
  41. data/samples/arrangements/song1.yml +0 -640
  42. data/samples/arrangements/song2.yml +0 -429
@@ -0,0 +1,367 @@
1
+ --- !ruby/object:Music::Transcription::Score
2
+ start_meter: !ruby/object:Music::Transcription::Meter
3
+ beats_per_measure: 4
4
+ beat_duration: !ruby/object:Rational
5
+ denominator: 4
6
+ numerator: 1
7
+ measure_duration: !ruby/object:Rational
8
+ denominator: 1
9
+ numerator: 1
10
+ start_tempo: 120
11
+ meter_changes: {}
12
+ tempo_changes: {}
13
+ parts:
14
+ 1: !ruby/object:Music::Transcription::Part
15
+ notes:
16
+ - !ruby/object:Music::Transcription::Note::DottedQuarter
17
+ duration: !ruby/object:Rational
18
+ denominator: 8
19
+ numerator: 3
20
+ pitches:
21
+ - &3 !ruby/object:Music::Transcription::Pitch
22
+ octave: 2
23
+ semitone: 0
24
+ links: {}
25
+ accent: &1 !ruby/class 'Music::Transcription::Accent::None'
26
+ - !ruby/object:Music::Transcription::Note::Quarter
27
+ duration: !ruby/object:Rational
28
+ denominator: 4
29
+ numerator: 1
30
+ pitches:
31
+ - &2 !ruby/object:Music::Transcription::Pitch
32
+ octave: 2
33
+ semitone: 3
34
+ links: {}
35
+ accent: *1
36
+ - !ruby/object:Music::Transcription::Note
37
+ duration: !ruby/object:Rational
38
+ denominator: 16
39
+ numerator: 5
40
+ pitches:
41
+ - &4 !ruby/object:Music::Transcription::Pitch
42
+ octave: 2
43
+ semitone: 5
44
+ links: {}
45
+ accent: *1
46
+ - !ruby/object:Music::Transcription::Note
47
+ duration: !ruby/object:Rational
48
+ denominator: 16
49
+ numerator: 1
50
+ pitches:
51
+ - *2
52
+ links: {}
53
+ accent: *1
54
+ - !ruby/object:Music::Transcription::Note::Eighth
55
+ duration: !ruby/object:Rational
56
+ denominator: 8
57
+ numerator: 1
58
+ pitches: []
59
+ links: {}
60
+ accent: *1
61
+ - !ruby/object:Music::Transcription::Note::Quarter
62
+ duration: !ruby/object:Rational
63
+ denominator: 4
64
+ numerator: 1
65
+ pitches:
66
+ - *3
67
+ links: {}
68
+ accent: *1
69
+ - !ruby/object:Music::Transcription::Note::Quarter
70
+ duration: !ruby/object:Rational
71
+ denominator: 4
72
+ numerator: 1
73
+ pitches:
74
+ - *2
75
+ links: {}
76
+ accent: *1
77
+ - !ruby/object:Music::Transcription::Note::DottedQuarter
78
+ duration: !ruby/object:Rational
79
+ denominator: 8
80
+ numerator: 3
81
+ pitches: []
82
+ links: {}
83
+ accent: *1
84
+ - !ruby/object:Music::Transcription::Note::DottedQuarter
85
+ duration: !ruby/object:Rational
86
+ denominator: 8
87
+ numerator: 3
88
+ pitches:
89
+ - *3
90
+ links: {}
91
+ accent: *1
92
+ - !ruby/object:Music::Transcription::Note::Quarter
93
+ duration: !ruby/object:Rational
94
+ denominator: 4
95
+ numerator: 1
96
+ pitches:
97
+ - *2
98
+ links: {}
99
+ accent: *1
100
+ - !ruby/object:Music::Transcription::Note
101
+ duration: !ruby/object:Rational
102
+ denominator: 16
103
+ numerator: 5
104
+ pitches:
105
+ - *4
106
+ links: {}
107
+ accent: *1
108
+ - !ruby/object:Music::Transcription::Note
109
+ duration: !ruby/object:Rational
110
+ denominator: 16
111
+ numerator: 1
112
+ pitches:
113
+ - *2
114
+ links: {}
115
+ accent: *1
116
+ - !ruby/object:Music::Transcription::Note::Eighth
117
+ duration: !ruby/object:Rational
118
+ denominator: 8
119
+ numerator: 1
120
+ pitches: []
121
+ links: {}
122
+ accent: *1
123
+ - !ruby/object:Music::Transcription::Note::Quarter
124
+ duration: !ruby/object:Rational
125
+ denominator: 4
126
+ numerator: 1
127
+ pitches:
128
+ - *3
129
+ links: {}
130
+ accent: *1
131
+ - !ruby/object:Music::Transcription::Note::Quarter
132
+ duration: !ruby/object:Rational
133
+ denominator: 4
134
+ numerator: 1
135
+ pitches:
136
+ - *2
137
+ links: {}
138
+ accent: *1
139
+ start_dynamic: &13 !ruby/object:Music::Transcription::Dynamic::MezzoForte {}
140
+ dynamic_changes: {}
141
+ 2: !ruby/object:Music::Transcription::Part
142
+ notes:
143
+ - !ruby/object:Music::Transcription::Note::Eighth
144
+ duration: !ruby/object:Rational
145
+ denominator: 8
146
+ numerator: 1
147
+ pitches: []
148
+ links: {}
149
+ accent: *1
150
+ - !ruby/object:Music::Transcription::Note::Eighth
151
+ duration: !ruby/object:Rational
152
+ denominator: 8
153
+ numerator: 1
154
+ pitches:
155
+ - &5 !ruby/object:Music::Transcription::Pitch
156
+ octave: 3
157
+ semitone: 10
158
+ links: {}
159
+ accent: *1
160
+ - !ruby/object:Music::Transcription::Note::Eighth
161
+ duration: !ruby/object:Rational
162
+ denominator: 8
163
+ numerator: 1
164
+ pitches:
165
+ - *5
166
+ links: {}
167
+ accent: *1
168
+ - !ruby/object:Music::Transcription::Note::Eighth
169
+ duration: !ruby/object:Rational
170
+ denominator: 8
171
+ numerator: 1
172
+ pitches:
173
+ - *5
174
+ links: {}
175
+ accent: *1
176
+ - !ruby/object:Music::Transcription::Note::Eighth
177
+ duration: !ruby/object:Rational
178
+ denominator: 8
179
+ numerator: 1
180
+ pitches:
181
+ - *5
182
+ links: {}
183
+ accent: *1
184
+ - !ruby/object:Music::Transcription::Note::Quarter
185
+ duration: !ruby/object:Rational
186
+ denominator: 4
187
+ numerator: 1
188
+ pitches:
189
+ - &9 !ruby/object:Music::Transcription::Pitch
190
+ octave: 4
191
+ semitone: 0
192
+ links: {}
193
+ accent: *1
194
+ - !ruby/object:Music::Transcription::Note::Quarter
195
+ duration: !ruby/object:Rational
196
+ denominator: 4
197
+ numerator: 1
198
+ pitches:
199
+ - &10 !ruby/object:Music::Transcription::Pitch
200
+ octave: 3
201
+ semitone: 9
202
+ links: {}
203
+ accent: *1
204
+ - !ruby/object:Music::Transcription::Note::Eighth
205
+ duration: !ruby/object:Rational
206
+ denominator: 8
207
+ numerator: 1
208
+ pitches:
209
+ - &6 !ruby/object:Music::Transcription::Pitch
210
+ octave: 3
211
+ semitone: 7
212
+ links: {}
213
+ accent: *1
214
+ - !ruby/object:Music::Transcription::Note::Eighth
215
+ duration: !ruby/object:Rational
216
+ denominator: 8
217
+ numerator: 1
218
+ pitches:
219
+ - &7 !ruby/object:Music::Transcription::Pitch
220
+ octave: 3
221
+ semitone: 5
222
+ links: {}
223
+ accent: *1
224
+ - !ruby/object:Music::Transcription::Note
225
+ duration: !ruby/object:Rational
226
+ denominator: 16
227
+ numerator: 5
228
+ pitches:
229
+ - *6
230
+ links:
231
+ *6: !ruby/object:Music::Transcription::Link::Slur
232
+ target_pitch: *7
233
+ accent: *1
234
+ - !ruby/object:Music::Transcription::Note
235
+ duration: !ruby/object:Rational
236
+ denominator: 16
237
+ numerator: 1
238
+ pitches:
239
+ - *7
240
+ links:
241
+ *7: !ruby/object:Music::Transcription::Link::Slur
242
+ target_pitch: &8 !ruby/object:Music::Transcription::Pitch
243
+ octave: 3
244
+ semitone: 4
245
+ accent: *1
246
+ - !ruby/object:Music::Transcription::Note::Eighth
247
+ duration: !ruby/object:Rational
248
+ denominator: 8
249
+ numerator: 1
250
+ pitches:
251
+ - *8
252
+ links: {}
253
+ accent: *1
254
+ - !ruby/object:Music::Transcription::Note::Eighth
255
+ duration: !ruby/object:Rational
256
+ denominator: 8
257
+ numerator: 1
258
+ pitches: []
259
+ links: {}
260
+ accent: *1
261
+ - !ruby/object:Music::Transcription::Note::Eighth
262
+ duration: !ruby/object:Rational
263
+ denominator: 8
264
+ numerator: 1
265
+ pitches: []
266
+ links: {}
267
+ accent: *1
268
+ - !ruby/object:Music::Transcription::Note::Eighth
269
+ duration: !ruby/object:Rational
270
+ denominator: 8
271
+ numerator: 1
272
+ pitches:
273
+ - *5
274
+ links: {}
275
+ accent: *1
276
+ - !ruby/object:Music::Transcription::Note::Eighth
277
+ duration: !ruby/object:Rational
278
+ denominator: 8
279
+ numerator: 1
280
+ pitches:
281
+ - *5
282
+ links: {}
283
+ accent: *1
284
+ - !ruby/object:Music::Transcription::Note::Eighth
285
+ duration: !ruby/object:Rational
286
+ denominator: 8
287
+ numerator: 1
288
+ pitches:
289
+ - *5
290
+ links: {}
291
+ accent: *1
292
+ - !ruby/object:Music::Transcription::Note::Eighth
293
+ duration: !ruby/object:Rational
294
+ denominator: 8
295
+ numerator: 1
296
+ pitches:
297
+ - *5
298
+ links: {}
299
+ accent: *1
300
+ - !ruby/object:Music::Transcription::Note::Quarter
301
+ duration: !ruby/object:Rational
302
+ denominator: 4
303
+ numerator: 1
304
+ pitches:
305
+ - *9
306
+ links: {}
307
+ accent: *1
308
+ - !ruby/object:Music::Transcription::Note::Eighth
309
+ duration: !ruby/object:Rational
310
+ denominator: 8
311
+ numerator: 1
312
+ pitches:
313
+ - *10
314
+ links: {}
315
+ accent: *1
316
+ - !ruby/object:Music::Transcription::Note::Eighth
317
+ duration: !ruby/object:Rational
318
+ denominator: 8
319
+ numerator: 1
320
+ pitches:
321
+ - &11 !ruby/object:Music::Transcription::Pitch
322
+ octave: 4
323
+ semitone: 4
324
+ links: {}
325
+ accent: *1
326
+ - !ruby/object:Music::Transcription::Note::Eighth
327
+ duration: !ruby/object:Rational
328
+ denominator: 8
329
+ numerator: 1
330
+ pitches:
331
+ - *11
332
+ links:
333
+ *11: !ruby/object:Music::Transcription::Link::Slur
334
+ target_pitch: &12 !ruby/object:Music::Transcription::Pitch
335
+ octave: 4
336
+ semitone: 2
337
+ accent: *1
338
+ - !ruby/object:Music::Transcription::Note::Eighth
339
+ duration: !ruby/object:Rational
340
+ denominator: 8
341
+ numerator: 1
342
+ pitches:
343
+ - *12
344
+ links:
345
+ *12: !ruby/object:Music::Transcription::Link::Slur
346
+ target_pitch: *9
347
+ accent: *1
348
+ - !ruby/object:Music::Transcription::Note::Eighth
349
+ duration: !ruby/object:Rational
350
+ denominator: 8
351
+ numerator: 1
352
+ pitches:
353
+ - *9
354
+ links: {}
355
+ accent: *1
356
+ start_dynamic: *13
357
+ dynamic_changes: {}
358
+ program: !ruby/object:Music::Transcription::Program
359
+ segments:
360
+ - !ruby/range
361
+ begin: 0
362
+ end: 4.0
363
+ excl: true
364
+ - !ruby/range
365
+ begin: 0
366
+ end: 4.0
367
+ excl: true
@@ -0,0 +1,236 @@
1
+ --- !ruby/object:Music::Transcription::Score
2
+ start_meter: !ruby/object:Music::Transcription::Meter
3
+ beats_per_measure: 4
4
+ beat_duration: !ruby/object:Rational
5
+ denominator: 4
6
+ numerator: 1
7
+ measure_duration: !ruby/object:Rational
8
+ denominator: 1
9
+ numerator: 1
10
+ start_tempo: 120
11
+ meter_changes: {}
12
+ tempo_changes: {}
13
+ parts:
14
+ 1: !ruby/object:Music::Transcription::Part
15
+ notes:
16
+ - !ruby/object:Music::Transcription::Note::Whole
17
+ duration: !ruby/object:Rational
18
+ denominator: 1
19
+ numerator: 1
20
+ pitches:
21
+ - !ruby/object:Music::Transcription::Pitch
22
+ octave: 4
23
+ semitone: 0
24
+ links: {}
25
+ accent: &1 !ruby/class 'Music::Transcription::Accent::None'
26
+ - !ruby/object:Music::Transcription::Note::Whole
27
+ duration: !ruby/object:Rational
28
+ denominator: 1
29
+ numerator: 1
30
+ pitches:
31
+ - &2 !ruby/object:Music::Transcription::Pitch
32
+ octave: 3
33
+ semitone: 10
34
+ links: {}
35
+ accent: *1
36
+ - !ruby/object:Music::Transcription::Note::Whole
37
+ duration: !ruby/object:Rational
38
+ denominator: 1
39
+ numerator: 1
40
+ pitches:
41
+ - !ruby/object:Music::Transcription::Pitch
42
+ octave: 3
43
+ semitone: 8
44
+ links: {}
45
+ accent: *1
46
+ - !ruby/object:Music::Transcription::Note::Half
47
+ duration: !ruby/object:Rational
48
+ denominator: 2
49
+ numerator: 1
50
+ pitches:
51
+ - !ruby/object:Music::Transcription::Pitch
52
+ octave: 3
53
+ semitone: 7
54
+ links: {}
55
+ accent: *1
56
+ - !ruby/object:Music::Transcription::Note::Half
57
+ duration: !ruby/object:Rational
58
+ denominator: 2
59
+ numerator: 1
60
+ pitches:
61
+ - *2
62
+ links: {}
63
+ accent: *1
64
+ start_dynamic: &5 !ruby/object:Music::Transcription::Dynamic::MezzoForte {}
65
+ dynamic_changes: {}
66
+ 2: !ruby/object:Music::Transcription::Part
67
+ notes:
68
+ - !ruby/object:Music::Transcription::Note::DottedQuarter
69
+ duration: !ruby/object:Rational
70
+ denominator: 8
71
+ numerator: 3
72
+ pitches:
73
+ - !ruby/object:Music::Transcription::Pitch
74
+ octave: 5
75
+ semitone: 4
76
+ links: {}
77
+ accent: *1
78
+ - !ruby/object:Music::Transcription::Note::Whole
79
+ duration: !ruby/object:Rational
80
+ denominator: 1
81
+ numerator: 1
82
+ pitches:
83
+ - &4 !ruby/object:Music::Transcription::Pitch
84
+ octave: 5
85
+ semitone: 2
86
+ links: {}
87
+ accent: *1
88
+ - !ruby/object:Music::Transcription::Note::Whole
89
+ duration: !ruby/object:Rational
90
+ denominator: 1
91
+ numerator: 1
92
+ pitches:
93
+ - &3 !ruby/object:Music::Transcription::Pitch
94
+ octave: 5
95
+ semitone: 0
96
+ links: {}
97
+ accent: *1
98
+ - !ruby/object:Music::Transcription::Note
99
+ duration: !ruby/object:Rational
100
+ denominator: 8
101
+ numerator: 5
102
+ pitches:
103
+ - *3
104
+ links: {}
105
+ accent: *1
106
+ - !ruby/object:Music::Transcription::Note::Half
107
+ duration: !ruby/object:Rational
108
+ denominator: 2
109
+ numerator: 1
110
+ pitches:
111
+ - *3
112
+ links: {}
113
+ accent: *1
114
+ - !ruby/object:Music::Transcription::Note::Half
115
+ duration: !ruby/object:Rational
116
+ denominator: 2
117
+ numerator: 1
118
+ pitches:
119
+ - *4
120
+ links: {}
121
+ accent: *1
122
+ start_dynamic: *5
123
+ dynamic_changes: {}
124
+ 3: !ruby/object:Music::Transcription::Part
125
+ notes:
126
+ - !ruby/object:Music::Transcription::Note::Eighth
127
+ duration: !ruby/object:Rational
128
+ denominator: 8
129
+ numerator: 1
130
+ pitches: []
131
+ links: {}
132
+ accent: *1
133
+ - !ruby/object:Music::Transcription::Note::Quarter
134
+ duration: !ruby/object:Rational
135
+ denominator: 4
136
+ numerator: 1
137
+ pitches:
138
+ - !ruby/object:Music::Transcription::Pitch
139
+ octave: 5
140
+ semitone: 7
141
+ links: {}
142
+ accent: *1
143
+ - !ruby/object:Music::Transcription::Note::Half
144
+ duration: !ruby/object:Rational
145
+ denominator: 2
146
+ numerator: 1
147
+ pitches:
148
+ - &6 !ruby/object:Music::Transcription::Pitch
149
+ octave: 5
150
+ semitone: 5
151
+ links: {}
152
+ accent: *1
153
+ - !ruby/object:Music::Transcription::Note::Quarter
154
+ duration: !ruby/object:Rational
155
+ denominator: 4
156
+ numerator: 1
157
+ pitches: []
158
+ links: {}
159
+ accent: *1
160
+ - !ruby/object:Music::Transcription::Note::Quarter
161
+ duration: !ruby/object:Rational
162
+ denominator: 4
163
+ numerator: 1
164
+ pitches:
165
+ - *6
166
+ links: {}
167
+ accent: *1
168
+ - !ruby/object:Music::Transcription::Note::Half
169
+ duration: !ruby/object:Rational
170
+ denominator: 2
171
+ numerator: 1
172
+ pitches:
173
+ - &7 !ruby/object:Music::Transcription::Pitch
174
+ octave: 5
175
+ semitone: 3
176
+ links: {}
177
+ accent: *1
178
+ - !ruby/object:Music::Transcription::Note::Quarter
179
+ duration: !ruby/object:Rational
180
+ denominator: 4
181
+ numerator: 1
182
+ pitches: []
183
+ links: {}
184
+ accent: *1
185
+ - !ruby/object:Music::Transcription::Note::Quarter
186
+ duration: !ruby/object:Rational
187
+ denominator: 4
188
+ numerator: 1
189
+ pitches:
190
+ - *7
191
+ links: {}
192
+ accent: *1
193
+ - !ruby/object:Music::Transcription::Note::Half
194
+ duration: !ruby/object:Rational
195
+ denominator: 2
196
+ numerator: 1
197
+ pitches:
198
+ - *7
199
+ links: {}
200
+ accent: *1
201
+ - !ruby/object:Music::Transcription::Note::Eighth
202
+ duration: !ruby/object:Rational
203
+ denominator: 8
204
+ numerator: 1
205
+ pitches: []
206
+ links: {}
207
+ accent: *1
208
+ - !ruby/object:Music::Transcription::Note::Half
209
+ duration: !ruby/object:Rational
210
+ denominator: 2
211
+ numerator: 1
212
+ pitches:
213
+ - *7
214
+ links: {}
215
+ accent: *1
216
+ - !ruby/object:Music::Transcription::Note::Half
217
+ duration: !ruby/object:Rational
218
+ denominator: 2
219
+ numerator: 1
220
+ pitches:
221
+ - *6
222
+ links: {}
223
+ accent: *1
224
+ start_dynamic: *5
225
+ dynamic_changes: {}
226
+ program: !ruby/object:Music::Transcription::Program
227
+ segments:
228
+ :segments:
229
+ - !ruby/range
230
+ begin: 0
231
+ end: 4.0
232
+ excl: true
233
+ - !ruby/range
234
+ begin: 0
235
+ end: 4.0
236
+ excl: true
@@ -14,21 +14,10 @@ class Accent
14
14
  self.class.new
15
15
  end
16
16
 
17
- { :Staccato => ".",
18
- :Staccatissimo => "'",
19
- :Marcato => ">",
20
- :Martellato => "^",
21
- :Tenuto => "_",
22
- :Forte => "f",
23
- :Fortissimo => "ff",
24
- :Fortississimo => "fff"
25
- }.each do |name,print_str|
26
- klass = Class.new(Accent) do
27
- def to_s
28
- print_str
29
- end
30
- end
31
- Accent.const_set(name.to_sym, klass)
17
+ [
18
+ :None, :Staccato, :Staccatissimo, :Marcato, :Martellato, :Tenuto
19
+ ].each do |name|
20
+ Accent.const_set(name, Class.new(Accent))
32
21
  end
33
22
  end
34
23
 
@@ -0,0 +1,12 @@
1
+ module Music
2
+ module Transcription
3
+ module Accents
4
+ NONE = Accent::None
5
+ STACCATO = Accent::Staccato.new
6
+ STACCATISSIMO = Accent::Staccatissimo.new
7
+ MARCATO = Accent::Marcato.new
8
+ MARTELLATO = Accent::Martellato.new
9
+ TENUTO = Accent::Tenuto.new
10
+ end
11
+ end
12
+ end
@@ -14,21 +14,12 @@ class Dynamic
14
14
  self.class.new
15
15
  end
16
16
 
17
- { :Piano => "p",
18
- :Pianissimo => "pp",
19
- :Pianississimo => "ppp",
20
- :MezzoPiano => "mp",
21
- :MezzoForte => "mf",
22
- :Forte => "f",
23
- :Fortissimo => "ff",
24
- :Fortississimo => "fff"
25
- }.each do |name,print_str|
26
- klass = Class.new(Dynamic) do
27
- def to_s
28
- print_str
29
- end
30
- end
31
- Dynamic.const_set(name.to_sym, klass)
17
+ [
18
+ :Piano, :Pianissimo, :Pianississimo,
19
+ :MezzoPiano, :MezzoForte,
20
+ :Forte, :Fortissimo, :Fortississimo
21
+ ].each do |name|
22
+ Dynamic.const_set(name, Class.new(Dynamic))
32
23
  end
33
24
  end
34
25
 
@@ -0,0 +1,15 @@
1
+ module Music
2
+ module Transcription
3
+
4
+ class Meter
5
+
6
+ attr_reader :measure_duration, :beat_duration, :beats_per_measure
7
+ def initialize beats_per_measure, beat_duration
8
+ @beats_per_measure = beats_per_measure
9
+ @beat_duration = beat_duration
10
+ @measure_duration = beats_per_measure * beat_duration
11
+ end
12
+ end
13
+
14
+ end
15
+ end