brevity 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a75a79f97d04f510ba6fe4b19c2f9d16ad4e29c4
4
- data.tar.gz: ffd37ed1f4e1bdb122b5482fb06c6de9a9798549
3
+ metadata.gz: ad6e32b3d5a76cb443ee950e31cd4032b2327a3c
4
+ data.tar.gz: 3aef2e05e8f62bd4a6458003724d5d200d49ced8
5
5
  SHA512:
6
- metadata.gz: a68eff07683640d944d6d620bd24f65f14263d399099dedeaea6a402f1bc80de4a05dfea84cb073ddd2f3b552655c6ab628202f58a6545042fb75e31b2e4b35d
7
- data.tar.gz: 46252d7032b3ec064c85aa59f66685f7d0fdfe90eca956148ce8efcc79b8c936b553e38527ef9db1b088e0d8ae384f735819407b2eca90fd76e49f007372eed9
6
+ metadata.gz: d2a45ec2ce37828fc75074339194336976006fa4e322e987b805f90882828048cf279d978ea3519b954cc485a23024167403c5c15785ffb26d3aa55a1f49967c
7
+ data.tar.gz: a473944786b996ffef85412a6e84a6e620a1b364b73e5a3a10b5400dfd387270d132fd841c2c7ea72810ed4c6003daa7132396691d9a9320f30b4340c1f873bb
data/bin/debrief CHANGED
@@ -10,14 +10,15 @@ doc = <<DOCOPT
10
10
  Parses a Brevity file, outputting a music-transcription parts as YAML.
11
11
 
12
12
  Usage:
13
- #{exe_name} <input>
14
- #{exe_name} <input> <output>
13
+ #{exe_name} <input> [options]
14
+ #{exe_name} <input> <output> [options]
15
15
  #{exe_name} -h | --help
16
16
  #{exe_name} --version
17
17
 
18
18
  Options:
19
- -h --help Show this screen.
20
- --version Show version.
19
+ --validate Check score validity and display any errors found
20
+ -h --help Show this screen.
21
+ --version Show version.
21
22
 
22
23
  DOCOPT
23
24
 
@@ -44,7 +45,19 @@ puts "complete"
44
45
  print "Making score..."
45
46
  score = sm.make_score
46
47
  puts "complete"
48
+
49
+ if args["--validate"]
50
+ print "Validating score..."
51
+ errors = score.validate
52
+ puts "complete. #{errors.size} errors found."
47
53
 
54
+ if errors.any?
55
+ puts "Error list:"
56
+ errors.each {|e| puts "\t#{e}"}
57
+ puts ""
58
+ end
59
+ end
60
+
48
61
  fout = args["[output]"]
49
62
  if fout.nil?
50
63
  fout = "#{File.dirname(fin)}/#{File.basename(fin,File.extname(fin))}.yml"
data/brevity.gemspec CHANGED
@@ -24,5 +24,6 @@ Gem::Specification.new do |gem|
24
24
  gem.add_development_dependency 'pry'
25
25
 
26
26
  gem.add_dependency 'treetop'
27
- gem.add_dependency 'music-transcription', '~> 0.7'
27
+ gem.add_dependency 'docopt'
28
+ gem.add_dependency 'music-transcription', '~> 0.7.2'
28
29
  end
@@ -23,16 +23,15 @@ module Brevity
23
23
  note = p
24
24
  notes.push note
25
25
  offset += note.duration
26
- when Music::Transcription::Dynamic
26
+ when Numeric
27
27
  dynamic = p
28
28
  if change_mark.nil?
29
- change = Music::Transcription::Change::Immediate.new(dynamic)
29
+ dynamic_changes[offset] = Music::Transcription::Change::Immediate.new(dynamic)
30
30
  else
31
31
  duration = offset - change_mark
32
- change = Music::Transcription::Change::Gradual.new(dynamic,duration)
32
+ dynamic_changes[change_mark] = Music::Transcription::Change::Gradual.new(dynamic,duration)
33
33
  change_mark = nil
34
34
  end
35
- dynamic_changes[offset] = change
36
35
  when GradualNode
37
36
  change_mark = offset
38
37
  end
@@ -7,49 +7,49 @@ module Brevity
7
7
 
8
8
  class PianississimoNode < DynamicNode
9
9
  def to_dynamic
10
- Music::Transcription::Dynamic::Pianississimo.new
10
+ Music::Transcription::Dynamics::PPP
11
11
  end
12
12
  end
13
13
 
14
14
  class PianissimoNode < DynamicNode
15
15
  def to_dynamic
16
- Music::Transcription::Dynamic::Pianissimo.new
16
+ Music::Transcription::Dynamics::PP
17
17
  end
18
18
  end
19
19
 
20
20
  class PianoNode < DynamicNode
21
21
  def to_dynamic
22
- Music::Transcription::Dynamic::Piano.new
22
+ Music::Transcription::Dynamics::P
23
23
  end
24
24
  end
25
25
 
26
26
  class MezzoPianoNode < DynamicNode
27
27
  def to_dynamic
28
- Music::Transcription::Dynamic::MezzoPiano.new
28
+ Music::Transcription::Dynamics::MP
29
29
  end
30
30
  end
31
31
 
32
32
  class MezzoForteNode < DynamicNode
33
33
  def to_dynamic
34
- Music::Transcription::Dynamic::MezzoForte.new
34
+ Music::Transcription::Dynamics::MF
35
35
  end
36
36
  end
37
37
 
38
38
  class ForteNode < DynamicNode
39
39
  def to_dynamic
40
- Music::Transcription::Dynamic::Forte.new
40
+ Music::Transcription::Dynamics::F
41
41
  end
42
42
  end
43
43
 
44
44
  class FortissimoNode < DynamicNode
45
45
  def to_dynamic
46
- Music::Transcription::Dynamic::Fortissimo.new
46
+ Music::Transcription::Dynamics::FF
47
47
  end
48
48
  end
49
49
 
50
50
  class FortississimoNode < DynamicNode
51
51
  def to_dynamic
52
- Music::Transcription::Dynamic::Fortississimo.new
52
+ Music::Transcription::Dynamics::FFF
53
53
  end
54
54
  end
55
55
  end
@@ -1,4 +1,4 @@
1
1
  module Brevity
2
2
  # Brevity version
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
@@ -8,8 +8,9 @@ describe 'Commands.part' do
8
8
  context 'given valid expression' do
9
9
  it 'should assign primitives to given label under @env[ENV_EXPRS]' do
10
10
  notes = [ Note::Half.new([C2]), Note::Half.new, Note::Quarter.new([E2]) ]
11
- tgt = Part.new(notes: notes, dynamic_profile: Profile.new(Dynamics::MF))
12
- @tester.part("hello","mf","/2C2 /2 /4D2+2")
11
+ dcs = { "1/2".to_r => Change::Gradual.new(Dynamics::FF, "1/2".to_r) }
12
+ tgt = Part.new(Dynamics::MF, notes: notes, dynamic_changes: dcs)
13
+ @tester.part("hello","mf","/2C2 < /2 ff /4D2+2")
13
14
  @tester.env[Commands::ENV_PARTS]["hello"].should eq(tgt)
14
15
  end
15
16
  end
@@ -21,7 +21,7 @@ describe DynamicNode do
21
21
  describe '#to_dynamic' do
22
22
  d = res.to_dynamic
23
23
  it 'should produce a Dynamic' do
24
- d.should be_a Dynamic
24
+ d.should be_a Numeric
25
25
  end
26
26
 
27
27
  it 'should produce a value matching input str' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brevity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Tunnell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-21 00:00:00.000000000 Z
11
+ date: 2014-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,20 +94,34 @@ dependencies:
94
94
  - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: docopt
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: music-transcription
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ~>
102
116
  - !ruby/object:Gem::Version
103
- version: '0.7'
117
+ version: 0.7.2
104
118
  type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
122
  - - ~>
109
123
  - !ruby/object:Gem::Version
110
- version: '0.7'
124
+ version: 0.7.2
111
125
  description: Parse and process brevity files, used for music notation. Convert them
112
126
  to other formats.
113
127
  email: jamestunnell@gmail.com