musa-dsl 0.14.26 → 0.21.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/Gemfile +0 -1
  4. data/README.md +5 -1
  5. data/lib/musa-dsl.rb +54 -11
  6. data/lib/musa-dsl/core-ext.rb +7 -13
  7. data/lib/musa-dsl/core-ext/array-explode-ranges.rb +15 -23
  8. data/lib/musa-dsl/core-ext/arrayfy.rb +30 -12
  9. data/lib/musa-dsl/core-ext/attribute-builder.rb +194 -0
  10. data/lib/musa-dsl/core-ext/deep-copy.rb +185 -0
  11. data/lib/musa-dsl/core-ext/dynamic-proxy.rb +44 -40
  12. data/lib/musa-dsl/core-ext/inspect-nice.rb +40 -22
  13. data/lib/musa-dsl/core-ext/smart-proc-binder.rb +108 -0
  14. data/lib/musa-dsl/core-ext/with.rb +26 -0
  15. data/lib/musa-dsl/datasets.rb +8 -3
  16. data/lib/musa-dsl/datasets/dataset.rb +3 -0
  17. data/lib/musa-dsl/datasets/delta-d.rb +12 -0
  18. data/lib/musa-dsl/datasets/e.rb +61 -0
  19. data/lib/musa-dsl/datasets/gdv.rb +51 -411
  20. data/lib/musa-dsl/datasets/gdvd.rb +179 -0
  21. data/lib/musa-dsl/datasets/helper.rb +41 -0
  22. data/lib/musa-dsl/datasets/p.rb +68 -0
  23. data/lib/musa-dsl/datasets/packed-v.rb +19 -0
  24. data/lib/musa-dsl/datasets/pdv.rb +22 -15
  25. data/lib/musa-dsl/datasets/ps.rb +113 -0
  26. data/lib/musa-dsl/datasets/score.rb +210 -0
  27. data/lib/musa-dsl/datasets/score/queriable.rb +48 -0
  28. data/lib/musa-dsl/datasets/score/render.rb +31 -0
  29. data/lib/musa-dsl/datasets/score/to-mxml/process-pdv.rb +160 -0
  30. data/lib/musa-dsl/datasets/score/to-mxml/process-ps.rb +51 -0
  31. data/lib/musa-dsl/datasets/score/to-mxml/process-time.rb +153 -0
  32. data/lib/musa-dsl/datasets/score/to-mxml/to-mxml.rb +158 -0
  33. data/lib/musa-dsl/datasets/v.rb +23 -0
  34. data/lib/musa-dsl/generative.rb +5 -5
  35. data/lib/musa-dsl/generative/backboner.rb +274 -0
  36. data/lib/musa-dsl/generative/darwin.rb +102 -96
  37. data/lib/musa-dsl/generative/generative-grammar.rb +182 -187
  38. data/lib/musa-dsl/generative/markov.rb +56 -53
  39. data/lib/musa-dsl/generative/variatio.rb +234 -222
  40. data/lib/musa-dsl/logger.rb +1 -0
  41. data/lib/musa-dsl/logger/logger.rb +31 -0
  42. data/lib/musa-dsl/matrix.rb +1 -0
  43. data/lib/musa-dsl/matrix/matrix.rb +210 -0
  44. data/lib/musa-dsl/midi.rb +2 -2
  45. data/lib/musa-dsl/midi/midi-recorder.rb +54 -52
  46. data/lib/musa-dsl/midi/midi-voices.rb +183 -182
  47. data/lib/musa-dsl/music.rb +5 -5
  48. data/lib/musa-dsl/music/chord-definition.rb +54 -50
  49. data/lib/musa-dsl/music/chord-definitions.rb +13 -9
  50. data/lib/musa-dsl/music/chords.rb +236 -238
  51. data/lib/musa-dsl/music/equally-tempered-12-tone-scale-system.rb +187 -183
  52. data/lib/musa-dsl/music/scales.rb +331 -332
  53. data/lib/musa-dsl/musicxml.rb +1 -0
  54. data/lib/musa-dsl/musicxml/builder/attributes.rb +155 -0
  55. data/lib/musa-dsl/musicxml/builder/backup-forward.rb +45 -0
  56. data/lib/musa-dsl/musicxml/builder/direction.rb +322 -0
  57. data/lib/musa-dsl/musicxml/builder/helper.rb +90 -0
  58. data/lib/musa-dsl/musicxml/builder/measure.rb +137 -0
  59. data/lib/musa-dsl/musicxml/builder/note-complexities.rb +152 -0
  60. data/lib/musa-dsl/musicxml/builder/note.rb +577 -0
  61. data/lib/musa-dsl/musicxml/builder/part-group.rb +44 -0
  62. data/lib/musa-dsl/musicxml/builder/part.rb +67 -0
  63. data/lib/musa-dsl/musicxml/builder/pitched-note.rb +126 -0
  64. data/lib/musa-dsl/musicxml/builder/rest.rb +117 -0
  65. data/lib/musa-dsl/musicxml/builder/score-partwise.rb +120 -0
  66. data/lib/musa-dsl/musicxml/builder/typed-text.rb +43 -0
  67. data/lib/musa-dsl/musicxml/builder/unpitched-note.rb +112 -0
  68. data/lib/musa-dsl/neumalang.rb +1 -1
  69. data/lib/musa-dsl/neumalang/datatypes.citrus +79 -0
  70. data/lib/musa-dsl/neumalang/neuma.citrus +165 -0
  71. data/lib/musa-dsl/neumalang/neumalang.citrus +32 -242
  72. data/lib/musa-dsl/neumalang/neumalang.rb +373 -142
  73. data/lib/musa-dsl/neumalang/process.citrus +21 -0
  74. data/lib/musa-dsl/neumalang/terminals.citrus +67 -0
  75. data/lib/musa-dsl/neumalang/vectors.citrus +23 -0
  76. data/lib/musa-dsl/neumas.rb +5 -0
  77. data/lib/musa-dsl/neumas/array-to-neumas.rb +34 -0
  78. data/lib/musa-dsl/neumas/neuma-decoder.rb +63 -0
  79. data/lib/musa-dsl/neumas/neuma-gdv-decoder.rb +57 -0
  80. data/lib/musa-dsl/neumas/neuma-gdvd-decoder.rb +15 -0
  81. data/lib/musa-dsl/neumas/neumas.rb +37 -0
  82. data/lib/musa-dsl/neumas/string-to-neumas.rb +34 -0
  83. data/lib/musa-dsl/repl.rb +1 -1
  84. data/lib/musa-dsl/repl/repl.rb +105 -105
  85. data/lib/musa-dsl/sequencer.rb +1 -1
  86. data/lib/musa-dsl/sequencer/base-sequencer-implementation-control.rb +163 -136
  87. data/lib/musa-dsl/sequencer/base-sequencer-implementation-play-helper.rb +301 -286
  88. data/lib/musa-dsl/sequencer/base-sequencer-implementation.rb +562 -270
  89. data/lib/musa-dsl/sequencer/base-sequencer-public.rb +199 -199
  90. data/lib/musa-dsl/sequencer/base-sequencer-tick-based.rb +77 -0
  91. data/lib/musa-dsl/sequencer/base-sequencer-tickless-based.rb +75 -0
  92. data/lib/musa-dsl/sequencer/sequencer-dsl.rb +105 -85
  93. data/lib/musa-dsl/sequencer/timeslots.rb +34 -0
  94. data/lib/musa-dsl/series.rb +1 -1
  95. data/lib/musa-dsl/{core-ext → series}/array-to-serie.rb +1 -1
  96. data/lib/musa-dsl/series/base-series.rb +171 -168
  97. data/lib/musa-dsl/series/hash-serie-splitter.rb +134 -132
  98. data/lib/musa-dsl/series/holder-serie.rb +1 -1
  99. data/lib/musa-dsl/series/main-serie-constructors.rb +6 -1
  100. data/lib/musa-dsl/series/main-serie-operations.rb +807 -797
  101. data/lib/musa-dsl/series/proxy-serie.rb +6 -6
  102. data/lib/musa-dsl/series/queue-serie.rb +5 -5
  103. data/lib/musa-dsl/series/series.rb +2 -0
  104. data/lib/musa-dsl/transcription.rb +4 -0
  105. data/lib/musa-dsl/transcription/from-gdv-to-midi.rb +227 -0
  106. data/lib/musa-dsl/transcription/from-gdv-to-musicxml.rb +36 -0
  107. data/lib/musa-dsl/transcription/from-gdv.rb +17 -0
  108. data/lib/musa-dsl/transcription/transcription.rb +55 -0
  109. data/lib/musa-dsl/transport.rb +6 -6
  110. data/lib/musa-dsl/transport/clock.rb +26 -26
  111. data/lib/musa-dsl/transport/dummy-clock.rb +32 -30
  112. data/lib/musa-dsl/transport/external-tick-clock.rb +21 -20
  113. data/lib/musa-dsl/transport/input-midi-clock.rb +82 -80
  114. data/lib/musa-dsl/transport/timer-clock.rb +72 -71
  115. data/lib/musa-dsl/transport/timer.rb +28 -26
  116. data/lib/musa-dsl/transport/transport.rb +99 -95
  117. data/musa-dsl.gemspec +3 -3
  118. metadata +73 -24
  119. data/lib/musa-dsl/core-ext/array-apply-get.rb +0 -18
  120. data/lib/musa-dsl/core-ext/array-to-neumas.rb +0 -28
  121. data/lib/musa-dsl/core-ext/as-context-run.rb +0 -44
  122. data/lib/musa-dsl/core-ext/duplicate.rb +0 -134
  123. data/lib/musa-dsl/core-ext/key-parameters-procedure-binder.rb +0 -85
  124. data/lib/musa-dsl/core-ext/proc-nice.rb +0 -13
  125. data/lib/musa-dsl/core-ext/send-nice.rb +0 -21
  126. data/lib/musa-dsl/core-ext/string-to-neumas.rb +0 -27
  127. data/lib/musa-dsl/datasets/gdv-decorators.rb +0 -221
  128. data/lib/musa-dsl/generative/rules.rb +0 -282
  129. data/lib/musa-dsl/neuma.rb +0 -1
  130. data/lib/musa-dsl/neuma/neuma.rb +0 -181
@@ -1,273 +1,273 @@
1
- require 'musa-dsl/core-ext/arrayfy'
2
- require 'musa-dsl/core-ext/key-parameters-procedure-binder'
1
+ require_relative '../core-ext/arrayfy'
2
+ require_relative '../core-ext/smart-proc-binder'
3
+ require_relative '../logger'
3
4
 
4
- require 'musa-dsl/series'
5
+ require_relative '../series'
5
6
 
6
- class Musa::BaseSequencer
7
- attr_reader :beats_per_bar, :ticks_per_beat, :ticks_per_bar, :tick_duration, :running_position
8
- attr_reader :everying, :playing, :moving
7
+ require_relative 'timeslots'
9
8
 
10
- @@tick_mutex = Mutex.new
9
+ require_relative 'base-sequencer-tick-based'
10
+ require_relative 'base-sequencer-tickless-based'
11
11
 
12
- def initialize(beats_per_bar, ticks_per_beat, do_log: nil)
13
- do_log ||= false
12
+ module Musa
13
+ module Sequencer
14
+ class BaseSequencer
15
+ attr_reader :beats_per_bar, :ticks_per_beat
16
+ attr_reader :running_position
17
+ attr_reader :everying, :playing, :moving
18
+ attr_reader :logger
14
19
 
15
- @on_debug_at = []
16
- @on_block_error = []
20
+ def initialize(beats_per_bar = nil, ticks_per_beat = nil, logger: nil, do_log: nil, do_error_log: nil, log_position_format: nil)
17
21
 
18
- @before_tick = []
19
- @on_fast_forward = []
22
+ raise ArgumentError,
23
+ "'beats_per_bar' and 'ticks_per_beat' parameters should be both nil or both have values" \
24
+ unless beats_per_bar && ticks_per_beat || beats_per_bar.nil? && ticks_per_beat.nil?
20
25
 
21
- @beats_per_bar = Rational(beats_per_bar)
22
- @ticks_per_beat = Rational(ticks_per_beat)
23
-
24
- @ticks_per_bar = Rational(beats_per_bar * ticks_per_beat)
25
- @tick_duration = Rational(1, @ticks_per_bar)
26
-
27
- @score = {}
28
-
29
- @everying = []
30
- @playing = []
31
- @moving = []
32
-
33
- @do_log = do_log
34
-
35
- reset
36
- end
37
-
38
- def reset
39
- @score.clear
40
- @everying.clear
41
- @playing.clear
42
- @moving.clear
43
-
44
- @event_handlers = [EventHandler.new]
26
+ if logger
27
+ @logger = logger
28
+ else
29
+ @logger = Musa::Logger::Logger.new(sequencer: self, position_format: log_position_format)
45
30
 
46
- @position = @ticks_per_bar - 1
47
- end
31
+ @logger.error! if do_error_log || do_error_log.nil?
32
+ @logger.debug! if do_log
33
+ end
48
34
 
49
- def tick
50
- position_to_run = (@position += 1)
35
+ if beats_per_bar && ticks_per_beat
36
+ @beats_per_bar = Rational(beats_per_bar)
37
+ @ticks_per_beat = Rational(ticks_per_beat)
51
38
 
52
- @before_tick.each { |block| block.call Rational(position_to_run, @ticks_per_bar) }
39
+ self.singleton_class.include TickBasedTiming
40
+ else
41
+ self.singleton_class.include TicklessBasedTiming
42
+ end
53
43
 
54
- if @score[position_to_run]
55
- @score[position_to_run].each do |command|
44
+ _init_timing
56
45
 
57
- if command.key?(:parent_control) && !command[:parent_control].stopped?
58
- @event_handlers.push command[:parent_control]
46
+ @on_debug_at = []
47
+ @on_error = []
59
48
 
60
- @@tick_mutex.synchronize do
61
- original_stdout = $stdout
62
- original_stderr = $stderr
49
+ @before_tick = []
50
+ @on_fast_forward = []
63
51
 
64
- $stdout = command[:parent_control].stdout
65
- $stderr = command[:parent_control].stderr
52
+ @tick_mutex = Mutex.new
53
+ @position_mutex = Mutex.new
66
54
 
67
- command[:block]._call command[:value_parameters], command[:key_parameters] if command[:block]
55
+ @timeslots = Timeslots.new
68
56
 
69
- $stdout = original_stdout
70
- $stderr = original_stderr
71
- end
57
+ @everying = []
58
+ @playing = []
59
+ @moving = []
72
60
 
73
- @event_handlers.pop
74
- else
75
- @@tick_mutex.synchronize do
76
- command[:block]._call command[:value_parameters], command[:key_parameters] if command[:block]
77
- end
78
- end
61
+ reset
79
62
  end
80
63
 
81
- @score.delete position_to_run
82
- end
83
- end
64
+ def reset
65
+ @timeslots.clear
66
+ @everying.clear
67
+ @playing.clear
68
+ @moving.clear
84
69
 
85
- def size
86
- @score.size
87
- end
88
-
89
- def empty?
90
- @score.empty?
91
- end
70
+ @event_handlers = [EventHandler.new]
92
71
 
93
- def round(bar)
94
- Rational((bar * @ticks_per_bar).round(0), @ticks_per_bar)
95
- end
96
-
97
- def event_handler
98
- @event_handlers.last
99
- end
72
+ _reset_timing
73
+ end
100
74
 
101
- def on_debug_at(&block)
102
- @on_debug_at << KeyParametersProcedureBinder.new(block)
103
- end
75
+ def size
76
+ @timeslots.values.sum(&:size)
77
+ end
104
78
 
105
- def on_block_error(&block)
106
- @on_block_error << KeyParametersProcedureBinder.new(block)
107
- end
79
+ def empty?
80
+ @timeslots.empty?
81
+ end
108
82
 
109
- def on_fast_forward(&block)
110
- @on_fast_forward << KeyParametersProcedureBinder.new(block)
111
- end
83
+ def run
84
+ tick until empty?
85
+ end
112
86
 
113
- def before_tick(&block)
114
- @before_tick << KeyParametersProcedureBinder.new(block)
115
- end
87
+ def event_handler
88
+ @event_handlers.last
89
+ end
116
90
 
117
- def position
118
- Rational(@position, @ticks_per_bar)
119
- end
91
+ def on_debug_at(&block)
92
+ @on_debug_at << SmartProcBinder.new(block)
93
+ end
120
94
 
121
- def position=(bposition)
122
- position = bposition * @ticks_per_bar
95
+ def on_error(&block)
96
+ @on_error << SmartProcBinder.new(block)
97
+ end
123
98
 
124
- raise ArgumentError, "Sequencer #{self}: cannot move back. current position: #{@position} new position: #{position}" if position < @position
99
+ def on_fast_forward(&block)
100
+ @on_fast_forward << SmartProcBinder.new(block)
101
+ end
125
102
 
126
- @on_fast_forward.each { |block| block.call(true) }
103
+ def before_tick(&block)
104
+ @before_tick << SmartProcBinder.new(block)
105
+ end
127
106
 
128
- tick while @position < position
107
+ def on(event, &block)
108
+ @event_handlers.last.on event, &block
109
+ end
129
110
 
130
- @on_fast_forward.each { |block| block.call(false) }
131
- end
111
+ def launch(event, *value_parameters, **key_parameters)
112
+ @event_handlers.last.launch event, *value_parameters, **key_parameters
113
+ end
132
114
 
133
- def on(event, &block)
134
- @event_handlers.last.on event, &block
135
- end
115
+ def wait(bars_delay, with: nil, debug: nil, &block)
116
+ debug ||= false
136
117
 
137
- def launch(event, *value_parameters, **key_parameters)
138
- @event_handlers.last.launch event, *value_parameters, **key_parameters
139
- end
118
+ control = EventHandler.new @event_handlers.last
119
+ @event_handlers.push control
140
120
 
141
- def wait(bars_delay, with: nil, debug: nil, &block)
142
- debug ||= false
121
+ if bars_delay.is_a? Numeric
122
+ _numeric_at position + bars_delay.rationalize, control, with: with, debug: debug, &block
123
+ else
124
+ bars_delay = Series::S(*bars_delay) if bars_delay.is_a?(Array)
125
+ bars_delay = bars_delay.instance if bars_delay
143
126
 
144
- control = EventHandler.new @event_handlers.last, capture_stdout: true
145
- @event_handlers.push control
127
+ with = Series::S(*with).repeat if with.is_a?(Array)
128
+ with = with.instance if with
146
129
 
147
- if bars_delay.is_a? Numeric
148
- _numeric_at position + bars_delay.rationalize, control, with: with, debug: debug, &block
149
- else
150
- bars_delay = Series::S(*bars_delay) if bars_delay.is_a? Array
151
- bars_delay = bars_delay.instance if bars_delay
130
+ _serie_at bars_delay.eval { |delay| position + delay }, control, with: with, debug: debug, &block
131
+ end
152
132
 
153
- with = Series::S(*with).repeat if with.is_a? Array
154
- with = with.instance if with
133
+ @event_handlers.pop
155
134
 
156
- _serie_at bars_delay.eval { |delay| position + delay }, control, with: with, debug: debug, &block
157
- end
135
+ control
136
+ end
158
137
 
159
- @event_handlers.pop
138
+ def now(with: nil, &block)
139
+ control = EventHandler.new @event_handlers.last
140
+ @event_handlers.push control
160
141
 
161
- control
162
- end
142
+ _numeric_at position, control, with: with, &block
163
143
 
164
- def now(with: nil, &block)
165
- control = EventHandler.new @event_handlers.last, capture_stdout: true
166
- @event_handlers.push control
144
+ @event_handlers.pop
167
145
 
168
- _numeric_at position, control, with: with, &block
146
+ control
147
+ end
169
148
 
170
- @event_handlers.pop
149
+ def raw_at(bar_position, force_first: nil, &block)
150
+ _raw_numeric_at bar_position.rationalize, force_first: force_first, &block
171
151
 
172
- control
173
- end
152
+ nil
153
+ end
174
154
 
175
- def raw_at(bar_position, force_first: nil, &block)
176
- _raw_numeric_at bar_position, force_first: force_first, &block
155
+ def at(bar_position, with: nil, debug: nil, &block)
156
+ debug ||= false
177
157
 
178
- nil
179
- end
158
+ control = EventHandler.new @event_handlers.last
159
+ @event_handlers.push control
180
160
 
181
- def at(bar_position, with: nil, debug: nil, &block)
182
- debug ||= false
161
+ if bar_position.is_a? Numeric
162
+ _numeric_at bar_position.rationalize, control, with: with, debug: debug, &block
163
+ else
164
+ bar_position = Series::S(*bar_position) if bar_position.is_a? Array
165
+ bar_position = bar_position.instance if bar_position
183
166
 
184
- control = EventHandler.new @event_handlers.last, capture_stdout: true
185
- @event_handlers.push control
167
+ with = Series::S(*with).repeat if with.is_a? Array
168
+ with = with.instance if with
186
169
 
187
- if bar_position.is_a? Numeric
188
- _numeric_at bar_position, control, with: with, debug: debug, &block
189
- else
190
- bar_position = Series::S(*bar_position) if bar_position.is_a? Array
191
- bar_position = bar_position.instance if bar_position
170
+ _serie_at bar_position, control, with: with, debug: debug, &block
171
+ end
192
172
 
193
- with = Series::S(*with).repeat if with.is_a? Array
194
- with = with.instance if with
173
+ @event_handlers.pop
195
174
 
196
- _serie_at bar_position, control, with: with, debug: debug, &block
197
- end
175
+ control
176
+ end
198
177
 
199
- @event_handlers.pop
178
+ def play(serie, mode: nil, parameter: nil, after: nil, context: nil, **mode_args, &block)
179
+ mode ||= :wait
200
180
 
201
- control
202
- end
181
+ control = PlayControl.new @event_handlers.last, after: after
182
+ @event_handlers.push control
203
183
 
204
- def play(serie, mode: nil, parameter: nil, after: nil, context: nil, **mode_args, &block)
205
- mode ||= :wait
184
+ _play serie.instance, control, context, mode: mode, parameter: parameter, **mode_args, &block
206
185
 
207
- control = PlayControl.new @event_handlers.last, after: after, capture_stdout: true
208
- @event_handlers.push control
186
+ @event_handlers.pop
209
187
 
210
- _play serie.instance, control, context, mode: mode, parameter: parameter, **mode_args, &block
188
+ @playing << control
211
189
 
212
- @event_handlers.pop
190
+ control.after do
191
+ @playing.delete control
192
+ end
213
193
 
214
- @playing << control
194
+ control
195
+ end
215
196
 
216
- control.after do
217
- @playing.delete control
218
- end
197
+ def continuation_play(parameters)
198
+ _play parameters[:serie],
199
+ parameters[:control],
200
+ parameters[:nl_context],
201
+ mode: parameters[:mode],
202
+ decoder: parameters[:decoder],
203
+ __play_eval: parameters[:play_eval],
204
+ **parameters[:mode_args]
205
+ end
219
206
 
220
- control
221
- end
207
+ def every(interval, duration: nil, till: nil, condition: nil, on_stop: nil, after_bars: nil, after: nil, &block)
208
+ # nil interval means 'only once'
209
+ interval = interval.rationalize unless interval.nil?
222
210
 
223
- def continuation_play(parameters)
224
- _play parameters[:serie],
225
- parameters[:control],
226
- parameters[:nl_context],
227
- mode: parameters[:mode],
228
- decoder: parameters[:decoder],
229
- __play_eval: parameters[:play_eval],
230
- **parameters[:mode_args]
231
- end
211
+ control = EveryControl.new @event_handlers.last,
212
+ duration: duration,
213
+ till: till,
214
+ condition: condition,
215
+ on_stop: on_stop,
216
+ after_bars: after_bars,
217
+ after: after
232
218
 
233
- def every(binterval, duration: nil, till: nil, condition: nil, on_stop: nil, after_bars: nil, after: nil, &block)
234
- binterval = binterval.rationalize
219
+ @event_handlers.push control
235
220
 
236
- control = EveryControl.new @event_handlers.last, capture_stdout: true, duration: duration, till: till, condition: condition, on_stop: on_stop, after_bars: after_bars, after: after
237
- @event_handlers.push control
221
+ _every interval, control, &block
238
222
 
239
- _every binterval, control, &block
223
+ @event_handlers.pop
240
224
 
241
- @event_handlers.pop
225
+ @everying << control
242
226
 
243
- @everying << control
227
+ control.after do
228
+ @everying.delete control
229
+ end
244
230
 
245
- control.after do
246
- @everying.delete control
247
- end
231
+ control
232
+ end
248
233
 
249
- control
250
- end
234
+ def move(every: nil,
235
+ from: nil, to: nil, step: nil,
236
+ duration: nil, till: nil,
237
+ function: nil,
238
+ right_open: nil,
239
+ on_stop: nil,
240
+ after_bars: nil,
241
+ after: nil,
242
+ &block)
243
+
244
+ control = _move every: every,
245
+ from: from, to: to, step: step,
246
+ duration: duration, till: till,
247
+ function: function,
248
+ right_open: right_open,
249
+ on_stop: on_stop,
250
+ after_bars: after_bars,
251
+ after: after,
252
+ &block
253
+
254
+ @moving << control
255
+
256
+ control.after do
257
+ @moving.delete control
258
+ end
251
259
 
252
- def move(every: nil, from: nil, to: nil, step: nil, duration: nil, till: nil, right_open: nil, on_stop: nil, after_bars: nil, after: nil, &block)
253
- control = _move every: every, from: from, to: to, step: step, duration: duration, till: till, right_open: right_open, on_stop: on_stop, after_bars: after_bars, after: after, &block
260
+ control
261
+ end
254
262
 
255
- @moving << control
263
+ def debug(msg = nil)
264
+ @logger.debug { msg || '...' }
265
+ end
256
266
 
257
- control.after do
258
- @moving.delete control
267
+ def to_s
268
+ super + ": position=#{position}"
269
+ end
259
270
  end
260
-
261
- control
262
- end
263
-
264
- def log(msg = nil)
265
- _log msg
266
271
  end
267
-
268
- def inspect
269
- super + ": position=#{position}"
270
- end
271
-
272
- alias to_s inspect
273
272
  end
273
+