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 +4 -4
- data/bin/debrief +17 -4
- data/brevity.gemspec +2 -1
- data/lib/brevity/commands/part.rb +3 -4
- data/lib/brevity/parsing/expression/dynamic_nodes.rb +8 -8
- data/lib/brevity/version.rb +1 -1
- data/spec/commands/part_spec.rb +3 -2
- data/spec/parsing/expression/dynamic_nodes_spec.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad6e32b3d5a76cb443ee950e31cd4032b2327a3c
|
4
|
+
data.tar.gz: 3aef2e05e8f62bd4a6458003724d5d200d49ced8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
20
|
-
--
|
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
@@ -23,16 +23,15 @@ module Brevity
|
|
23
23
|
note = p
|
24
24
|
notes.push note
|
25
25
|
offset += note.duration
|
26
|
-
when
|
26
|
+
when Numeric
|
27
27
|
dynamic = p
|
28
28
|
if change_mark.nil?
|
29
|
-
|
29
|
+
dynamic_changes[offset] = Music::Transcription::Change::Immediate.new(dynamic)
|
30
30
|
else
|
31
31
|
duration = offset - change_mark
|
32
|
-
|
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::
|
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::
|
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::
|
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::
|
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::
|
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::
|
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::
|
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::
|
52
|
+
Music::Transcription::Dynamics::FFF
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
data/lib/brevity/version.rb
CHANGED
data/spec/commands/part_spec.rb
CHANGED
@@ -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
|
-
|
12
|
-
|
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
|
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.
|
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-
|
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:
|
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:
|
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
|