music-transcription 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/hip.yml +254 -145
- data/examples/make_hip.rb +9 -8
- data/examples/make_missed_connection.rb +35 -34
- data/examples/make_song1.rb +36 -35
- data/examples/make_song2.rb +22 -22
- data/examples/missed_connection.yml +242 -197
- data/examples/song1.yml +277 -212
- data/examples/song2.yml +171 -117
- data/lib/music-transcription/articulations.rb +4 -6
- data/lib/music-transcription/link.rb +22 -20
- data/lib/music-transcription/note.rb +9 -8
- data/lib/music-transcription/version.rb +1 -1
- data/spec/link_spec.rb +70 -13
- data/spec/note_spec.rb +16 -6
- metadata +2 -2
data/examples/song1.yml
CHANGED
@@ -7,354 +7,412 @@ start_meter: !ruby/object:Music::Transcription::Meter
|
|
7
7
|
measure_duration: !ruby/object:Rational
|
8
8
|
denominator: 1
|
9
9
|
numerator: 1
|
10
|
+
check_methods:
|
11
|
+
- :check_beats_per_measure
|
12
|
+
- :check_beat_duration
|
10
13
|
start_tempo: 120
|
11
14
|
meter_changes: {}
|
12
15
|
tempo_changes: {}
|
13
16
|
parts:
|
14
17
|
1: !ruby/object:Music::Transcription::Part
|
15
18
|
notes:
|
16
|
-
- !ruby/object:Music::Transcription::Note
|
17
|
-
duration: !ruby/object:Rational
|
19
|
+
- !ruby/object:Music::Transcription::Note
|
20
|
+
duration: &4 !ruby/object:Rational
|
18
21
|
denominator: 8
|
19
22
|
numerator: 3
|
20
23
|
pitches:
|
21
24
|
- &3 !ruby/object:Music::Transcription::Pitch
|
22
25
|
octave: 2
|
23
26
|
semitone: 0
|
27
|
+
articulation: :normal
|
28
|
+
accented: false
|
24
29
|
links: {}
|
25
|
-
|
26
|
-
|
27
|
-
|
30
|
+
check_methods:
|
31
|
+
- :ensure_positive_duration
|
32
|
+
- !ruby/object:Music::Transcription::Note
|
33
|
+
duration: &2 !ruby/object:Rational
|
28
34
|
denominator: 4
|
29
35
|
numerator: 1
|
30
36
|
pitches:
|
31
|
-
- &
|
37
|
+
- &1 !ruby/object:Music::Transcription::Pitch
|
32
38
|
octave: 2
|
33
39
|
semitone: 3
|
40
|
+
articulation: :normal
|
41
|
+
accented: false
|
34
42
|
links: {}
|
35
|
-
|
43
|
+
check_methods:
|
44
|
+
- :ensure_positive_duration
|
36
45
|
- !ruby/object:Music::Transcription::Note
|
37
46
|
duration: !ruby/object:Rational
|
38
47
|
denominator: 16
|
39
48
|
numerator: 5
|
40
49
|
pitches:
|
41
|
-
- &
|
50
|
+
- &5 !ruby/object:Music::Transcription::Pitch
|
42
51
|
octave: 2
|
43
52
|
semitone: 5
|
53
|
+
articulation: :normal
|
54
|
+
accented: false
|
44
55
|
links: {}
|
45
|
-
|
56
|
+
check_methods:
|
57
|
+
- :ensure_positive_duration
|
46
58
|
- !ruby/object:Music::Transcription::Note
|
47
59
|
duration: !ruby/object:Rational
|
48
60
|
denominator: 16
|
49
61
|
numerator: 1
|
50
62
|
pitches:
|
51
|
-
- *
|
63
|
+
- *1
|
64
|
+
articulation: :normal
|
65
|
+
accented: false
|
52
66
|
links: {}
|
53
|
-
|
54
|
-
|
55
|
-
|
67
|
+
check_methods:
|
68
|
+
- :ensure_positive_duration
|
69
|
+
- !ruby/object:Music::Transcription::Note
|
70
|
+
duration: &6 !ruby/object:Rational
|
56
71
|
denominator: 8
|
57
72
|
numerator: 1
|
58
73
|
pitches: []
|
74
|
+
articulation: :normal
|
75
|
+
accented: false
|
59
76
|
links: {}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
numerator: 1
|
77
|
+
check_methods:
|
78
|
+
- :ensure_positive_duration
|
79
|
+
- !ruby/object:Music::Transcription::Note
|
80
|
+
duration: *2
|
65
81
|
pitches:
|
66
82
|
- *3
|
83
|
+
articulation: :normal
|
84
|
+
accented: false
|
67
85
|
links: {}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
numerator: 1
|
86
|
+
check_methods:
|
87
|
+
- :ensure_positive_duration
|
88
|
+
- !ruby/object:Music::Transcription::Note
|
89
|
+
duration: *2
|
73
90
|
pitches:
|
74
|
-
- *
|
91
|
+
- *1
|
92
|
+
articulation: :normal
|
93
|
+
accented: false
|
75
94
|
links: {}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
numerator: 3
|
95
|
+
check_methods:
|
96
|
+
- :ensure_positive_duration
|
97
|
+
- !ruby/object:Music::Transcription::Note
|
98
|
+
duration: *4
|
81
99
|
pitches: []
|
100
|
+
articulation: :normal
|
101
|
+
accented: false
|
82
102
|
links: {}
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
numerator: 3
|
103
|
+
check_methods:
|
104
|
+
- :ensure_positive_duration
|
105
|
+
- !ruby/object:Music::Transcription::Note
|
106
|
+
duration: *4
|
88
107
|
pitches:
|
89
108
|
- *3
|
109
|
+
articulation: :normal
|
110
|
+
accented: false
|
90
111
|
links: {}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
numerator: 1
|
112
|
+
check_methods:
|
113
|
+
- :ensure_positive_duration
|
114
|
+
- !ruby/object:Music::Transcription::Note
|
115
|
+
duration: *2
|
96
116
|
pitches:
|
97
|
-
- *
|
117
|
+
- *1
|
118
|
+
articulation: :normal
|
119
|
+
accented: false
|
98
120
|
links: {}
|
99
|
-
|
121
|
+
check_methods:
|
122
|
+
- :ensure_positive_duration
|
100
123
|
- !ruby/object:Music::Transcription::Note
|
101
124
|
duration: !ruby/object:Rational
|
102
125
|
denominator: 16
|
103
126
|
numerator: 5
|
104
127
|
pitches:
|
105
|
-
- *
|
128
|
+
- *5
|
129
|
+
articulation: :normal
|
130
|
+
accented: false
|
106
131
|
links: {}
|
107
|
-
|
132
|
+
check_methods:
|
133
|
+
- :ensure_positive_duration
|
108
134
|
- !ruby/object:Music::Transcription::Note
|
109
135
|
duration: !ruby/object:Rational
|
110
136
|
denominator: 16
|
111
137
|
numerator: 1
|
112
138
|
pitches:
|
113
|
-
- *
|
139
|
+
- *1
|
140
|
+
articulation: :normal
|
141
|
+
accented: false
|
114
142
|
links: {}
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
numerator: 1
|
143
|
+
check_methods:
|
144
|
+
- :ensure_positive_duration
|
145
|
+
- !ruby/object:Music::Transcription::Note
|
146
|
+
duration: *6
|
120
147
|
pitches: []
|
148
|
+
articulation: :normal
|
149
|
+
accented: false
|
121
150
|
links: {}
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
numerator: 1
|
151
|
+
check_methods:
|
152
|
+
- :ensure_positive_duration
|
153
|
+
- !ruby/object:Music::Transcription::Note
|
154
|
+
duration: *2
|
127
155
|
pitches:
|
128
156
|
- *3
|
157
|
+
articulation: :normal
|
158
|
+
accented: false
|
129
159
|
links: {}
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
numerator: 1
|
160
|
+
check_methods:
|
161
|
+
- :ensure_positive_duration
|
162
|
+
- !ruby/object:Music::Transcription::Note
|
163
|
+
duration: *2
|
135
164
|
pitches:
|
136
|
-
- *
|
165
|
+
- *1
|
166
|
+
articulation: :normal
|
167
|
+
accented: false
|
137
168
|
links: {}
|
138
|
-
|
139
|
-
|
169
|
+
check_methods:
|
170
|
+
- :ensure_positive_duration
|
171
|
+
start_dynamic: 0.625
|
140
172
|
dynamic_changes: {}
|
173
|
+
check_methods:
|
174
|
+
- :ensure_start_dynamic
|
175
|
+
- :ensure_dynamic_change_values_range
|
141
176
|
2: !ruby/object:Music::Transcription::Part
|
142
177
|
notes:
|
143
|
-
- !ruby/object:Music::Transcription::Note
|
144
|
-
duration:
|
145
|
-
denominator: 8
|
146
|
-
numerator: 1
|
178
|
+
- !ruby/object:Music::Transcription::Note
|
179
|
+
duration: *6
|
147
180
|
pitches: []
|
181
|
+
articulation: :normal
|
182
|
+
accented: false
|
148
183
|
links: {}
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
numerator: 1
|
184
|
+
check_methods:
|
185
|
+
- :ensure_positive_duration
|
186
|
+
- !ruby/object:Music::Transcription::Note
|
187
|
+
duration: *6
|
154
188
|
pitches:
|
155
|
-
- &
|
189
|
+
- &7 !ruby/object:Music::Transcription::Pitch
|
156
190
|
octave: 3
|
157
191
|
semitone: 10
|
192
|
+
articulation: :normal
|
193
|
+
accented: false
|
158
194
|
links: {}
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
numerator: 1
|
195
|
+
check_methods:
|
196
|
+
- :ensure_positive_duration
|
197
|
+
- !ruby/object:Music::Transcription::Note
|
198
|
+
duration: *6
|
164
199
|
pitches:
|
165
|
-
- *
|
200
|
+
- *7
|
201
|
+
articulation: :normal
|
202
|
+
accented: false
|
166
203
|
links: {}
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
numerator: 1
|
204
|
+
check_methods:
|
205
|
+
- :ensure_positive_duration
|
206
|
+
- !ruby/object:Music::Transcription::Note
|
207
|
+
duration: *6
|
172
208
|
pitches:
|
173
|
-
- *
|
209
|
+
- *7
|
210
|
+
articulation: :normal
|
211
|
+
accented: false
|
174
212
|
links: {}
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
numerator: 1
|
213
|
+
check_methods:
|
214
|
+
- :ensure_positive_duration
|
215
|
+
- !ruby/object:Music::Transcription::Note
|
216
|
+
duration: *6
|
180
217
|
pitches:
|
181
|
-
- *
|
218
|
+
- *7
|
219
|
+
articulation: :normal
|
220
|
+
accented: false
|
182
221
|
links: {}
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
numerator: 1
|
222
|
+
check_methods:
|
223
|
+
- :ensure_positive_duration
|
224
|
+
- !ruby/object:Music::Transcription::Note
|
225
|
+
duration: *2
|
188
226
|
pitches:
|
189
|
-
- &
|
227
|
+
- &10 !ruby/object:Music::Transcription::Pitch
|
190
228
|
octave: 4
|
191
229
|
semitone: 0
|
230
|
+
articulation: :normal
|
231
|
+
accented: false
|
192
232
|
links: {}
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
numerator: 1
|
233
|
+
check_methods:
|
234
|
+
- :ensure_positive_duration
|
235
|
+
- !ruby/object:Music::Transcription::Note
|
236
|
+
duration: *2
|
198
237
|
pitches:
|
199
|
-
- &
|
238
|
+
- &11 !ruby/object:Music::Transcription::Pitch
|
200
239
|
octave: 3
|
201
240
|
semitone: 9
|
241
|
+
articulation: :normal
|
242
|
+
accented: false
|
202
243
|
links: {}
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
numerator: 1
|
244
|
+
check_methods:
|
245
|
+
- :ensure_positive_duration
|
246
|
+
- !ruby/object:Music::Transcription::Note
|
247
|
+
duration: *6
|
208
248
|
pitches:
|
209
|
-
- &
|
249
|
+
- &8 !ruby/object:Music::Transcription::Pitch
|
210
250
|
octave: 3
|
211
251
|
semitone: 7
|
252
|
+
articulation: :normal
|
253
|
+
accented: false
|
212
254
|
links: {}
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
numerator: 1
|
255
|
+
check_methods:
|
256
|
+
- :ensure_positive_duration
|
257
|
+
- !ruby/object:Music::Transcription::Note
|
258
|
+
duration: *6
|
218
259
|
pitches:
|
219
|
-
- &
|
260
|
+
- &9 !ruby/object:Music::Transcription::Pitch
|
220
261
|
octave: 3
|
221
262
|
semitone: 5
|
263
|
+
articulation: :normal
|
264
|
+
accented: false
|
222
265
|
links: {}
|
223
|
-
|
266
|
+
check_methods:
|
267
|
+
- :ensure_positive_duration
|
224
268
|
- !ruby/object:Music::Transcription::Note
|
225
269
|
duration: !ruby/object:Rational
|
226
270
|
denominator: 16
|
227
271
|
numerator: 5
|
228
272
|
pitches:
|
229
|
-
- *
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
273
|
+
- *8
|
274
|
+
articulation: :slur
|
275
|
+
accented: false
|
276
|
+
links: {}
|
277
|
+
check_methods:
|
278
|
+
- :ensure_positive_duration
|
234
279
|
- !ruby/object:Music::Transcription::Note
|
235
280
|
duration: !ruby/object:Rational
|
236
281
|
denominator: 16
|
237
282
|
numerator: 1
|
238
283
|
pitches:
|
239
|
-
- *
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
duration: !ruby/object:Rational
|
248
|
-
denominator: 8
|
249
|
-
numerator: 1
|
284
|
+
- *9
|
285
|
+
articulation: :slur
|
286
|
+
accented: false
|
287
|
+
links: {}
|
288
|
+
check_methods:
|
289
|
+
- :ensure_positive_duration
|
290
|
+
- !ruby/object:Music::Transcription::Note
|
291
|
+
duration: *6
|
250
292
|
pitches:
|
251
|
-
-
|
293
|
+
- !ruby/object:Music::Transcription::Pitch
|
294
|
+
octave: 3
|
295
|
+
semitone: 4
|
296
|
+
articulation: :normal
|
297
|
+
accented: false
|
252
298
|
links: {}
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
numerator: 1
|
299
|
+
check_methods:
|
300
|
+
- :ensure_positive_duration
|
301
|
+
- !ruby/object:Music::Transcription::Note
|
302
|
+
duration: *6
|
258
303
|
pitches: []
|
304
|
+
articulation: :normal
|
305
|
+
accented: false
|
259
306
|
links: {}
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
numerator: 1
|
307
|
+
check_methods:
|
308
|
+
- :ensure_positive_duration
|
309
|
+
- !ruby/object:Music::Transcription::Note
|
310
|
+
duration: *6
|
265
311
|
pitches: []
|
312
|
+
articulation: :normal
|
313
|
+
accented: false
|
266
314
|
links: {}
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
numerator: 1
|
315
|
+
check_methods:
|
316
|
+
- :ensure_positive_duration
|
317
|
+
- !ruby/object:Music::Transcription::Note
|
318
|
+
duration: *6
|
272
319
|
pitches:
|
273
|
-
- *
|
320
|
+
- *7
|
321
|
+
articulation: :normal
|
322
|
+
accented: false
|
274
323
|
links: {}
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
numerator: 1
|
324
|
+
check_methods:
|
325
|
+
- :ensure_positive_duration
|
326
|
+
- !ruby/object:Music::Transcription::Note
|
327
|
+
duration: *6
|
280
328
|
pitches:
|
281
|
-
- *
|
329
|
+
- *7
|
330
|
+
articulation: :normal
|
331
|
+
accented: false
|
282
332
|
links: {}
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
numerator: 1
|
333
|
+
check_methods:
|
334
|
+
- :ensure_positive_duration
|
335
|
+
- !ruby/object:Music::Transcription::Note
|
336
|
+
duration: *6
|
288
337
|
pitches:
|
289
|
-
- *
|
338
|
+
- *7
|
339
|
+
articulation: :normal
|
340
|
+
accented: false
|
290
341
|
links: {}
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
numerator: 1
|
342
|
+
check_methods:
|
343
|
+
- :ensure_positive_duration
|
344
|
+
- !ruby/object:Music::Transcription::Note
|
345
|
+
duration: *6
|
296
346
|
pitches:
|
297
|
-
- *
|
347
|
+
- *7
|
348
|
+
articulation: :normal
|
349
|
+
accented: false
|
298
350
|
links: {}
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
numerator: 1
|
351
|
+
check_methods:
|
352
|
+
- :ensure_positive_duration
|
353
|
+
- !ruby/object:Music::Transcription::Note
|
354
|
+
duration: *2
|
304
355
|
pitches:
|
305
|
-
- *
|
356
|
+
- *10
|
357
|
+
articulation: :normal
|
358
|
+
accented: false
|
306
359
|
links: {}
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
numerator: 1
|
360
|
+
check_methods:
|
361
|
+
- :ensure_positive_duration
|
362
|
+
- !ruby/object:Music::Transcription::Note
|
363
|
+
duration: *6
|
312
364
|
pitches:
|
313
|
-
- *
|
365
|
+
- *11
|
366
|
+
articulation: :normal
|
367
|
+
accented: false
|
314
368
|
links: {}
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
numerator: 1
|
369
|
+
check_methods:
|
370
|
+
- :ensure_positive_duration
|
371
|
+
- !ruby/object:Music::Transcription::Note
|
372
|
+
duration: *6
|
320
373
|
pitches:
|
321
|
-
- &
|
374
|
+
- &12 !ruby/object:Music::Transcription::Pitch
|
322
375
|
octave: 4
|
323
376
|
semitone: 4
|
377
|
+
articulation: :normal
|
378
|
+
accented: false
|
324
379
|
links: {}
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
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
|
380
|
+
check_methods:
|
381
|
+
- :ensure_positive_duration
|
382
|
+
- !ruby/object:Music::Transcription::Note
|
383
|
+
duration: *6
|
342
384
|
pitches:
|
343
385
|
- *12
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
numerator: 1
|
386
|
+
articulation: :slur
|
387
|
+
accented: false
|
388
|
+
links: {}
|
389
|
+
check_methods:
|
390
|
+
- :ensure_positive_duration
|
391
|
+
- !ruby/object:Music::Transcription::Note
|
392
|
+
duration: *6
|
352
393
|
pitches:
|
353
|
-
-
|
394
|
+
- !ruby/object:Music::Transcription::Pitch
|
395
|
+
octave: 4
|
396
|
+
semitone: 2
|
397
|
+
articulation: :slur
|
398
|
+
accented: false
|
399
|
+
links: {}
|
400
|
+
check_methods:
|
401
|
+
- :ensure_positive_duration
|
402
|
+
- !ruby/object:Music::Transcription::Note
|
403
|
+
duration: *6
|
404
|
+
pitches:
|
405
|
+
- *10
|
406
|
+
articulation: :normal
|
407
|
+
accented: false
|
354
408
|
links: {}
|
355
|
-
|
356
|
-
|
409
|
+
check_methods:
|
410
|
+
- :ensure_positive_duration
|
411
|
+
start_dynamic: 0.625
|
357
412
|
dynamic_changes: {}
|
413
|
+
check_methods:
|
414
|
+
- :ensure_start_dynamic
|
415
|
+
- :ensure_dynamic_change_values_range
|
358
416
|
program: !ruby/object:Music::Transcription::Program
|
359
417
|
segments:
|
360
418
|
- !ruby/range
|
@@ -365,3 +423,10 @@ program: !ruby/object:Music::Transcription::Program
|
|
365
423
|
begin: 0
|
366
424
|
end: 4.0
|
367
425
|
excl: true
|
426
|
+
check_methods:
|
427
|
+
- :ensure_increasing_segments
|
428
|
+
- :ensure_nonnegative_segments
|
429
|
+
check_methods:
|
430
|
+
- :check_start_tempo
|
431
|
+
- :check_tempo_changes
|
432
|
+
- :check_meter_changes
|