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.
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::Quarter.new,
17
+ Note::quarter,
17
18
  Note.new(Rational(1,3), [ Ab2 ]),
18
- Note::Quarter.new([ Ab2 ]),
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 ], links: {Db4 => Link::Slur.new(Db4)}),
26
- Note.new(Rational(1,6), [ Db4 ], links: {Db4 => Link::Slur.new(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 ], links: {Db4 => Link::Slur.new(Db4)}),
36
- Note::Quarter.new([ Db4 ], links: {Db4 => Link::Slur.new(Db4)}),
37
- Note::Eighth.new([ Db4 ], links: {Db4 => Link::Portamento.new(C4)}),
38
- Note::Eighth.new([ C4 ]),
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::Quarter.new([Eb2]),
17
- Note::Quarter.new,
18
- Note::Quarter.new([Bb2]),
19
- Note::Quarter.new,
20
- Note::Quarter.new([Eb2]),
21
- Note::Eighth.new,
22
- Note::Eighth.new([B2]),
23
- Note::Quarter.new([Bb2]),
24
- Note::Quarter.new([Ab2]),
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::Quarter.new([Eb2]),
28
- Note::Quarter.new,
29
- Note::Quarter.new([Bb2]),
30
- Note::Quarter.new,
31
- Note::Quarter.new([Eb2]),
32
- Note::Eighth.new,
33
- Note::Eighth.new([B2]),
34
- Note::Quarter.new([Bb2]),
35
- Note::Quarter.new([Ab2]),
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::Quarter.new([Bb2]),
39
- Note::Eighth.new,
40
- Note::Eighth.new([F3], links: { F3 => Link::Slur.new(F3)}),
41
- Note::Half.new([F3]),
42
- Note::Quarter.new([Bb2]),
43
- Note::Eighth.new,
44
- Note::Eighth.new([F3], links: { F3 => Link::Slur.new(F3)}),
45
- Note::Half.new([F3]),
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::Quarter.new([B2]),
49
- Note::Eighth.new,
50
- Note::Eighth.new([Gb3], links: { Gb3 => Link::Slur.new(Gb3)}),
51
- Note::Half.new([Gb3]),
52
- Note::Quarter.new([B2]),
53
- Note::Eighth.new,
54
- Note::Eighth.new([Gb3], links: { Gb3 => Link::Slur.new(Gb3)}),
55
- Note::Half.new([Gb3]),
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
  ]
@@ -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::DottedQuarter.new([C2]),
16
- Note::Quarter.new([Eb2]),
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::Eighth.new,
21
- Note::Quarter.new([C2]),
22
- Note::Quarter.new([Eb2]),
23
- Note::DottedQuarter.new,
21
+ Note::eighth,
22
+ Note::quarter([C2]),
23
+ Note::quarter([Eb2]),
24
+ Note::dotted_quarter,
24
25
  # 2.0
25
- Note::DottedQuarter.new([C2]),
26
- Note::Quarter.new([Eb2]),
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::Eighth.new,
31
- Note::Quarter.new([C2]),
32
- Note::Quarter.new([Eb2]),
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::Eighth.new,
40
- Note::Eighth.new([Bb3]),
41
- Note::Eighth.new([Bb3]),
42
- Note::Eighth.new([Bb3]),
43
- Note::Eighth.new([Bb3]),
44
- Note::Quarter.new([C4]),
45
- Note::Quarter.new([A3]),
46
- Note::Eighth.new([G3]),
47
- Note::Eighth.new([F3]),
48
- Note.new("5/16".to_r, [G3], links: { G3 => Link::Slur.new(F3) }),
49
- Note.new("1/16".to_r, [F3], links: { F3 => Link::Slur.new(E3) }),
50
- Note::Eighth.new([E3]),
51
- Note::Eighth.new,
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::Eighth.new,
54
- Note::Eighth.new([Bb3]),
55
- Note::Eighth.new([Bb3]),
56
- Note::Eighth.new([Bb3]),
57
- Note::Eighth.new([Bb3]),
58
- Note::Quarter.new([C4]),
59
- Note::Eighth.new([A3]),
60
- Note::Eighth.new([E4]),
61
- Note::Eighth.new([E4], links: { E4 => Link::Slur.new(D4) }),
62
- Note::Eighth.new([D4], links: { D4 => Link::Slur.new(C4) }),
63
- Note::Eighth.new([C4]),
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
  }
@@ -14,39 +14,39 @@ score = Score.new(
14
14
  1 => Part.new(
15
15
  Dynamics::MF,
16
16
  notes: [
17
- Note::Whole.new([C4]),
18
- Note::Whole.new([Bb3]),
19
- Note::Whole.new([Ab3]),
20
- Note::Half.new([G3]),
21
- Note::Half.new([Bb3]),
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::DottedQuarter.new([E5]),
28
- Note::Whole.new([D5]),
29
- Note::Whole.new([C5]),
27
+ Note::dotted_quarter([E5]),
28
+ Note::whole([D5]),
29
+ Note::whole([C5]),
30
30
  Note::new("5/8".to_r, [C5]),
31
- Note::Half.new([C5]),
32
- Note::Half.new([D5]),
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::Eighth.new,
39
- Note::Quarter.new([G5]),
40
- Note::Half.new([F5]),
41
- Note::Quarter.new,
42
- Note::Quarter.new([F5]),
43
- Note::Half.new([Eb5]),
44
- Note::Quarter.new,
45
- Note::Quarter.new([Eb5]),
46
- Note::Half.new([Eb5]),
47
- Note::Eighth.new,
48
- Note::Half.new([Eb5]),
49
- Note::Half.new([F5]),
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
  }