Class: Brevity::ScoreMaker
- Inherits:
-
Object
- Object
- Brevity::ScoreMaker
show all
- Includes:
- Commands
- Defined in:
- lib/brevity/score_maker.rb
Constant Summary
Constants included
from Commands
Commands::DYNAMIC_PARSER, Commands::ENV_EXPRS, Commands::ENV_METER_CHANGES, Commands::ENV_PARTS, Commands::ENV_START_METER, Commands::ENV_START_TEMPO, Commands::ENV_TEMPO_CHANGES, Commands::EXPR_PARSER, Commands::LABEL_PARSER
Instance Method Summary
collapse
Methods included from Commands
#class_const, #expr, #meter, #part, #tempo
Instance Method Details
#make_score ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/brevity/score_maker.rb', line 26
def make_score
start_tempo = @env[ENV_START_TEMPO]
start_meter = @env[ENV_START_METER]\
unless start_tempo.is_a? Numeric
raise MissingStartTempoError
end
unless start_meter.is_a? Music::Transcription::Meter
raise MissingStartMeterError
end
tcs = @env[ENV_TEMPO_CHANGES]
mcs = @env[ENV_METER_CHANGES]
parts = @env[ENV_PARTS]
return Music::Transcription::Score.new(
start_meter,
start_tempo,
parts: parts,
tempo_changes: tcs,
meter_changes: mcs
)
end
|
#process_nodes(cmd_nodes) ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/brevity/score_maker.rb', line 17
def process_nodes cmd_nodes
self.reset_env
cmd_nodes.each do |cmd_node|
cmd_method = cmd_node.name.to_sym
self.send(cmd_method,*cmd_node.args)
end
end
|