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/make_hip.rb
CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
include Music::Transcription
|
5
5
|
include Pitches
|
6
|
+
include Articulations
|
6
7
|
|
7
8
|
bass_riff = [
|
8
9
|
# 0.0
|
@@ -13,17 +14,17 @@ bass_riff = [
|
|
13
14
|
Note.new(Rational(1,12), [ Ab2 ]),
|
14
15
|
# 1.0
|
15
16
|
Note.new(Rational(1,6), [ Bb2 ]),
|
16
|
-
Note::
|
17
|
+
Note::quarter,
|
17
18
|
Note.new(Rational(1,3), [ Ab2 ]),
|
18
|
-
Note::
|
19
|
+
Note::quarter([ Ab2 ]),
|
19
20
|
]
|
20
21
|
|
21
22
|
lead_riff = [
|
22
23
|
# 0.0
|
23
24
|
Note.new(Rational(1,6), [ Bb3 ]),
|
24
25
|
Note.new(Rational(1,4)),
|
25
|
-
Note.new(Rational(1,12), [ Db4 ],
|
26
|
-
Note.new(Rational(1,6), [ Db4 ],
|
26
|
+
Note.new(Rational(1,12), [ Db4 ], articulation: SLUR),
|
27
|
+
Note.new(Rational(1,6), [ Db4 ], articulation: SLUR),
|
27
28
|
Note.new(Rational(1,36), [ Db4 ]),
|
28
29
|
Note.new(Rational(1,36), [ Eb4 ]),
|
29
30
|
Note.new(Rational(1,36), [ Db4 ]),
|
@@ -32,10 +33,10 @@ lead_riff = [
|
|
32
33
|
# 1.0
|
33
34
|
Note.new(Rational(1,6), [ Bb3 ]),
|
34
35
|
Note.new(Rational(1,4)),
|
35
|
-
Note.new(Rational(1,12), [ Db4 ],
|
36
|
-
Note::
|
37
|
-
Note::
|
38
|
-
Note::
|
36
|
+
Note.new(Rational(1,12), [ Db4 ], articulation: SLUR),
|
37
|
+
Note::quarter([ Db4 ], articulation: SLUR),
|
38
|
+
Note::eighth([ Db4 ], articulation: SLUR),
|
39
|
+
Note::eighth([ C4 ]),
|
39
40
|
]
|
40
41
|
|
41
42
|
whole_step = Pitch.new(:semitone => 2)
|
@@ -3,6 +3,7 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
include Music::Transcription
|
5
5
|
include Pitches
|
6
|
+
include Articulations
|
6
7
|
|
7
8
|
score = Score.new(
|
8
9
|
Meter.new(4,"1/4".to_r),
|
@@ -13,46 +14,46 @@ score = Score.new(
|
|
13
14
|
Dynamics::MF,
|
14
15
|
notes: [
|
15
16
|
# 0.0
|
16
|
-
Note::
|
17
|
-
Note::
|
18
|
-
Note::
|
19
|
-
Note::
|
20
|
-
Note::
|
21
|
-
Note::
|
22
|
-
Note::
|
23
|
-
Note::
|
24
|
-
Note::
|
17
|
+
Note::quarter([Eb2]),
|
18
|
+
Note::quarter,
|
19
|
+
Note::quarter([Bb2]),
|
20
|
+
Note::quarter,
|
21
|
+
Note::quarter([Eb2]),
|
22
|
+
Note::eighth,
|
23
|
+
Note::eighth([B2]),
|
24
|
+
Note::quarter([Bb2]),
|
25
|
+
Note::quarter([Ab2]),
|
25
26
|
|
26
27
|
# 2.0
|
27
|
-
Note::
|
28
|
-
Note::
|
29
|
-
Note::
|
30
|
-
Note::
|
31
|
-
Note::
|
32
|
-
Note::
|
33
|
-
Note::
|
34
|
-
Note::
|
35
|
-
Note::
|
28
|
+
Note::quarter([Eb2]),
|
29
|
+
Note::quarter,
|
30
|
+
Note::quarter([Bb2]),
|
31
|
+
Note::quarter,
|
32
|
+
Note::quarter([Eb2]),
|
33
|
+
Note::eighth,
|
34
|
+
Note::eighth([B2]),
|
35
|
+
Note::quarter([Bb2]),
|
36
|
+
Note::quarter([Ab2]),
|
36
37
|
|
37
38
|
# 4.0
|
38
|
-
Note::
|
39
|
-
Note::
|
40
|
-
Note::
|
41
|
-
Note::
|
42
|
-
Note::
|
43
|
-
Note::
|
44
|
-
Note::
|
45
|
-
Note::
|
39
|
+
Note::quarter([Bb2]),
|
40
|
+
Note::eighth,
|
41
|
+
Note::eighth([F3], articulation: SLUR),
|
42
|
+
Note::half([F3]),
|
43
|
+
Note::quarter([Bb2]),
|
44
|
+
Note::eighth,
|
45
|
+
Note::eighth([F3], articulation: SLUR),
|
46
|
+
Note::half([F3]),
|
46
47
|
|
47
48
|
# 6.0
|
48
|
-
Note::
|
49
|
-
Note::
|
50
|
-
Note::
|
51
|
-
Note::
|
52
|
-
Note::
|
53
|
-
Note::
|
54
|
-
Note::
|
55
|
-
Note::
|
49
|
+
Note::quarter([B2]),
|
50
|
+
Note::eighth,
|
51
|
+
Note::eighth([Gb3], articulation: SLUR),
|
52
|
+
Note::half([Gb3]),
|
53
|
+
Note::quarter([B2]),
|
54
|
+
Note::eighth,
|
55
|
+
Note::eighth([Gb3], articulation: SLUR),
|
56
|
+
Note::half([Gb3]),
|
56
57
|
|
57
58
|
#8.0
|
58
59
|
]
|
data/examples/make_song1.rb
CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
include Music::Transcription
|
5
5
|
include Pitches
|
6
|
+
include Articulations
|
6
7
|
|
7
8
|
score = Score.new(
|
8
9
|
Meter.new(4,"1/4".to_r),
|
@@ -12,55 +13,55 @@ score = Score.new(
|
|
12
13
|
1 => Part.new(
|
13
14
|
Dynamics::MF,
|
14
15
|
notes: [
|
15
|
-
Note::
|
16
|
-
Note::
|
16
|
+
Note::dotted_quarter([C2]),
|
17
|
+
Note::quarter([Eb2]),
|
17
18
|
Note.new("5/16".to_r,[F2]),
|
18
19
|
Note.new("1/16".to_r, [Eb2]),
|
19
20
|
# 1.0
|
20
|
-
Note::
|
21
|
-
Note::
|
22
|
-
Note::
|
23
|
-
Note::
|
21
|
+
Note::eighth,
|
22
|
+
Note::quarter([C2]),
|
23
|
+
Note::quarter([Eb2]),
|
24
|
+
Note::dotted_quarter,
|
24
25
|
# 2.0
|
25
|
-
Note::
|
26
|
-
Note::
|
26
|
+
Note::dotted_quarter([C2]),
|
27
|
+
Note::quarter([Eb2]),
|
27
28
|
Note.new("5/16".to_r,[F2]),
|
28
29
|
Note.new("1/16".to_r, [Eb2]),
|
29
30
|
# 3.0
|
30
|
-
Note::
|
31
|
-
Note::
|
32
|
-
Note::
|
31
|
+
Note::eighth,
|
32
|
+
Note::quarter([C2]),
|
33
|
+
Note::quarter([Eb2]),
|
33
34
|
]
|
34
35
|
),
|
35
36
|
2 => Part.new(
|
36
37
|
Dynamics::MF,
|
37
38
|
notes: [
|
38
39
|
# 0.0
|
39
|
-
Note::
|
40
|
-
Note::
|
41
|
-
Note::
|
42
|
-
Note::
|
43
|
-
Note::
|
44
|
-
Note::
|
45
|
-
Note::
|
46
|
-
Note::
|
47
|
-
Note::
|
48
|
-
Note.new("5/16".to_r, [G3],
|
49
|
-
Note.new("1/16".to_r, [F3],
|
50
|
-
Note::
|
51
|
-
Note::
|
40
|
+
Note::eighth,
|
41
|
+
Note::eighth([Bb3]),
|
42
|
+
Note::eighth([Bb3]),
|
43
|
+
Note::eighth([Bb3]),
|
44
|
+
Note::eighth([Bb3]),
|
45
|
+
Note::quarter([C4]),
|
46
|
+
Note::quarter([A3]),
|
47
|
+
Note::eighth([G3]),
|
48
|
+
Note::eighth([F3]),
|
49
|
+
Note.new("5/16".to_r, [G3], articulation: SLUR),
|
50
|
+
Note.new("1/16".to_r, [F3], articulation: SLUR),
|
51
|
+
Note::eighth([E3]),
|
52
|
+
Note::eighth,
|
52
53
|
# 2.0
|
53
|
-
Note::
|
54
|
-
Note::
|
55
|
-
Note::
|
56
|
-
Note::
|
57
|
-
Note::
|
58
|
-
Note::
|
59
|
-
Note::
|
60
|
-
Note::
|
61
|
-
Note::
|
62
|
-
Note::
|
63
|
-
Note::
|
54
|
+
Note::eighth,
|
55
|
+
Note::eighth([Bb3]),
|
56
|
+
Note::eighth([Bb3]),
|
57
|
+
Note::eighth([Bb3]),
|
58
|
+
Note::eighth([Bb3]),
|
59
|
+
Note::quarter([C4]),
|
60
|
+
Note::eighth([A3]),
|
61
|
+
Note::eighth([E4]),
|
62
|
+
Note::eighth([E4], articulation: SLUR),
|
63
|
+
Note::eighth([D4], articulation: SLUR),
|
64
|
+
Note::eighth([C4]),
|
64
65
|
]
|
65
66
|
)
|
66
67
|
}
|
data/examples/make_song2.rb
CHANGED
@@ -14,39 +14,39 @@ score = Score.new(
|
|
14
14
|
1 => Part.new(
|
15
15
|
Dynamics::MF,
|
16
16
|
notes: [
|
17
|
-
Note::
|
18
|
-
Note::
|
19
|
-
Note::
|
20
|
-
Note::
|
21
|
-
Note::
|
17
|
+
Note::whole([C4]),
|
18
|
+
Note::whole([Bb3]),
|
19
|
+
Note::whole([Ab3]),
|
20
|
+
Note::half([G3]),
|
21
|
+
Note::half([Bb3]),
|
22
22
|
]
|
23
23
|
),
|
24
24
|
2 => Part.new(
|
25
25
|
Dynamics::MF,
|
26
26
|
notes: [
|
27
|
-
Note::
|
28
|
-
Note::
|
29
|
-
Note::
|
27
|
+
Note::dotted_quarter([E5]),
|
28
|
+
Note::whole([D5]),
|
29
|
+
Note::whole([C5]),
|
30
30
|
Note::new("5/8".to_r, [C5]),
|
31
|
-
Note::
|
32
|
-
Note::
|
31
|
+
Note::half([C5]),
|
32
|
+
Note::half([D5]),
|
33
33
|
]
|
34
34
|
),
|
35
35
|
3 => Part.new(
|
36
36
|
Dynamics::MF,
|
37
37
|
notes: [
|
38
|
-
Note::
|
39
|
-
Note::
|
40
|
-
Note::
|
41
|
-
Note::
|
42
|
-
Note::
|
43
|
-
Note::
|
44
|
-
Note::
|
45
|
-
Note::
|
46
|
-
Note::
|
47
|
-
Note::
|
48
|
-
Note::
|
49
|
-
Note::
|
38
|
+
Note::eighth,
|
39
|
+
Note::quarter([G5]),
|
40
|
+
Note::half([F5]),
|
41
|
+
Note::quarter,
|
42
|
+
Note::quarter([F5]),
|
43
|
+
Note::half([Eb5]),
|
44
|
+
Note::quarter,
|
45
|
+
Note::quarter([Eb5]),
|
46
|
+
Note::half([Eb5]),
|
47
|
+
Note::eighth,
|
48
|
+
Note::half([Eb5]),
|
49
|
+
Note::half([F5]),
|
50
50
|
]
|
51
51
|
)
|
52
52
|
}
|