musa-dsl 0.14.29 → 0.21.3

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 +187 -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 +128 -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 +552 -308
  89. data/lib/musa-dsl/sequencer/base-sequencer-public.rb +198 -176
  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 +111 -93
  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
@@ -0,0 +1 @@
1
+ require_relative 'musicxml/builder/score-partwise'
@@ -0,0 +1,155 @@
1
+ require_relative '../../core-ext/with'
2
+
3
+ require_relative 'helper'
4
+
5
+ module Musa
6
+ module MusicXML
7
+ module Builder
8
+ module Internal
9
+ class Key
10
+ include Helper::ToXML
11
+
12
+ def initialize(number = nil, cancel: nil, fifths:, mode: nil)
13
+ @number = number
14
+
15
+ @cancel = cancel
16
+ @fifths = fifths
17
+ @mode = mode
18
+ end
19
+
20
+ attr_reader :number
21
+ attr_accessor :cancel, :fifths, :mode
22
+
23
+ def _to_xml(io, indent:, tabs:)
24
+ io ||= StringIO.new
25
+ indent ||= 0
26
+
27
+ tabs = "\t" * indent
28
+
29
+ io.puts "#{tabs}<key#{" number=\"#{@number.to_i}\"" if @number}>"
30
+
31
+ io.puts "#{tabs}\t<cancel>#{@cancel}</cancel>" if @cancel
32
+ io.puts "#{tabs}\t<fifths>#{@fifths.to_i}</fifths>"
33
+ io.puts "#{tabs}\t<mode>#{@mode}</mode>"
34
+
35
+ io.puts "#{tabs}</key>"
36
+
37
+ io
38
+ end
39
+ end
40
+
41
+ class Time
42
+ include Helper::ToXML
43
+
44
+ def initialize(number = nil, senza_misura: nil, beats: nil, beat_type: nil)
45
+ @number = number
46
+
47
+ @senza_misura = senza_misura unless beats && beat_type
48
+ @beats = []
49
+
50
+ add_beats beats: beats, beat_type: beat_type if beats && beat_type
51
+ end
52
+
53
+ attr_reader :number
54
+ attr_accessor :senza_misura
55
+ attr_reader :beats
56
+
57
+ def add_beats(beats:, beat_type:)
58
+ @beats << { beats: beats, beat_type: beat_type }
59
+ end
60
+
61
+ def _to_xml(io, indent:, tabs:)
62
+ io.puts "#{tabs}<time#{" number=\"#{@number.to_i}\"" if @number}>"
63
+
64
+ io.puts "#{tabs}\t<senza-misura>#{@senza_misura}</senza-misura>" if @senza_misura
65
+ @beats.each do |beats|
66
+ io.puts "#{tabs}\t<beats>#{beats[:beats].to_i}</beats>"
67
+ io.puts "#{tabs}\t<beat-type>#{beats[:beat_type].to_i}</beat-type>"
68
+ end
69
+
70
+ io.puts "#{tabs}</time>"
71
+ end
72
+ end
73
+
74
+ class Clef
75
+ include Helper::ToXML
76
+
77
+ def initialize(number = nil, sign:, line:, octave_change: nil)
78
+ @number = number
79
+ @sign = sign
80
+ @line = line
81
+ @octave_change = octave_change
82
+ end
83
+
84
+ attr_reader :number
85
+ attr_accessor :sign, :line, :octave_change
86
+
87
+ def _to_xml(io, indent:, tabs:)
88
+ io.puts "#{tabs}<clef#{" number=\"#{@number.to_i}\"" if @number}>"
89
+
90
+ io.puts "#{tabs}\t<sign>#{@sign}</sign>"
91
+ io.puts "#{tabs}\t<line>#{@line.to_i}</line>" if @line
92
+ io.puts "#{tabs}\t<clef-octave-change>#{@octave_change.to_i}</clef-octave-change>" if @octave_change
93
+
94
+ io.puts "#{tabs}</clef>"
95
+ end
96
+ end
97
+
98
+ class Attributes
99
+ extend Musa::Extension::AttributeBuilder
100
+ include Musa::Extension::With
101
+
102
+ include Helper::ToXML
103
+
104
+ def initialize(divisions: nil,
105
+ key_cancel: nil, key_fifths: nil, key_mode: nil,
106
+ time_senza_misura: nil, time_beats: nil, time_beat_type: nil,
107
+ clef_sign: nil, clef_line: nil, clef_octave_change: nil,
108
+ &block)
109
+
110
+ @divisions = divisions
111
+
112
+ @keys = []
113
+ @times = []
114
+ @clefs = []
115
+
116
+ add_key cancel: key_cancel, fifths: key_fifths, mode: key_mode if key_fifths
117
+ add_time senza_misura: time_senza_misura, beats: time_beats, beat_type: time_beat_type if time_senza_misura || (time_beats && time_beat_type)
118
+ add_clef sign: clef_sign, line: clef_line, octave_change: clef_octave_change if clef_sign
119
+
120
+ with &block if block_given?
121
+ end
122
+
123
+ attr_simple_builder :divisions
124
+
125
+ attr_complex_adder_to_array :key, Key
126
+ attr_complex_adder_to_array :time, Time
127
+ attr_complex_adder_to_array :clef, Clef
128
+
129
+ def _to_xml(io, indent:, tabs:)
130
+ io.puts "#{tabs}<attributes>"
131
+
132
+ io.puts "#{tabs}\t<divisions>#{@divisions.to_i}</divisions>" if @divisions
133
+
134
+ @keys.each do |key|
135
+ key.to_xml(io, indent: indent + 1)
136
+ end
137
+
138
+ @times.each do |time|
139
+ time.to_xml(io, indent: indent + 1)
140
+ end
141
+
142
+ staves = [@keys.size, @times.size, @clefs.size].max
143
+ io.puts "#{tabs}\t<staves>#{staves}</staves>" if staves > 1
144
+
145
+ @clefs.each do |clef|
146
+ clef.to_xml(io, indent: indent + 1)
147
+ end
148
+
149
+ io.puts "#{tabs}</attributes>"
150
+ end
151
+ end
152
+ end
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,45 @@
1
+ require_relative 'helper'
2
+
3
+ module Musa
4
+ module MusicXML
5
+ module Builder
6
+ module Internal
7
+ class Backup
8
+ include Helper::ToXML
9
+
10
+ def initialize(duration)
11
+ @duration = duration
12
+ end
13
+
14
+ attr_accessor :duration
15
+
16
+ def _to_xml(io, indent:, tabs:)
17
+ io.puts "#{tabs}<backup><duration>#{@duration.to_i}</duration></backup>"
18
+ end
19
+ end
20
+
21
+ class Forward
22
+ include Helper::ToXML
23
+
24
+ def initialize(duration, voice: nil, staff: nil)
25
+ @duration = duration
26
+ @voice = voice
27
+ @staff = staff
28
+ end
29
+
30
+ attr_accessor :duration, :voice, :staff
31
+
32
+ def _to_xml(io, indent:, tabs:)
33
+ io.puts "#{tabs}<forward>"
34
+
35
+ io.puts "#{tabs}\t<duration>#{@duration.to_i}</duration>"
36
+ io.puts "#{tabs}\t<voice>#{@voice.to_i}</voice>" if @voice
37
+ io.puts "#{tabs}\t<staff>#{@staff.to_i}</staff>" if @staff
38
+
39
+ io.puts "#{tabs}</forward>"
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,322 @@
1
+ require_relative '../../core-ext/with'
2
+ require_relative 'helper'
3
+
4
+ using Musa::Extension::Arrayfy
5
+
6
+ module Musa
7
+ module MusicXML
8
+ module Builder
9
+ module Internal
10
+ class Direction
11
+ extend Musa::Extension::AttributeBuilder
12
+ include Musa::Extension::With
13
+
14
+ include Helper
15
+ include ToXML
16
+
17
+ def initialize(placement: nil, # above / below
18
+ voice: nil, # number
19
+ staff: nil, # number
20
+ offset: nil, # number
21
+ **directions,
22
+ &block)
23
+
24
+ @placement = placement
25
+
26
+ @types = []
27
+ @voice = voice
28
+ @staff = staff
29
+ @offset = offset
30
+
31
+ directions.each_pair do |direction, value|
32
+ send direction, value
33
+ end
34
+
35
+ with &block if block_given?
36
+ end
37
+
38
+ attr_simple_builder :voice
39
+ attr_simple_builder :staff
40
+ attr_simple_builder :offset
41
+ attr_simple_builder :placement
42
+
43
+ attr_complex_adder_to_custom(:metronome) { |*p, **kp, &b| Metronome.new(*p, **kp, &b).tap { |t| @types << t } }
44
+ attr_complex_adder_to_custom(:wedge) { |*p, **kp, &b| Wedge.new(*p, **kp, &b).tap { |t| @types << t } }
45
+ attr_complex_adder_to_custom(:dynamics) { |*p, **kp, &b| Dynamics.new(*p, **kp, &b).tap { |t| @types << t } }
46
+ attr_complex_adder_to_custom(:pedal) { |*p, **kp, &b| Pedal.new(*p, **kp, &b).tap { |t| @types << t } }
47
+ attr_complex_adder_to_custom(:bracket) { |*p, **kp, &b| Bracket.new(*p, **kp, &b).tap { |t| @types << t } }
48
+ attr_complex_adder_to_custom(:dashes) { |*p, **kp, &b| Dashes.new(*p, **kp, &b).tap { |t| @types << t } }
49
+ attr_complex_adder_to_custom(:words) { |*p, **kp, &b| Words.new(*p, **kp, &b).tap { |t| @types << t } }
50
+ attr_complex_adder_to_custom(:octave_shift) { |*p, **kp, &b| OctaveShift.new(*p, **kp, &b).tap { |t| @types << t } }
51
+
52
+ def _to_xml(io, indent:, tabs:)
53
+ io.puts "#{tabs}<direction#{ decode_bool_or_string_attribute(@placement, 'placement') }>"
54
+
55
+ @types.each do |type|
56
+ type.to_xml(io, indent: indent + 1)
57
+ end
58
+
59
+ io.puts "#{tabs}\t<offset sound=\"no\">#{@offset.to_f.round(2)}</offset>" if @offset
60
+ io.puts "#{tabs}\t<voice>#{@voice.to_i}</voice>" if @voice
61
+ io.puts "#{tabs}\t<staff>#{@staff.to_i}</staff>" if @staff
62
+
63
+ io.puts "#{tabs}</direction>"
64
+ end
65
+
66
+ private
67
+
68
+ def direction_type_to_xml(io, indent:); end
69
+ end
70
+
71
+ class DirectionType
72
+ extend Musa::Extension::AttributeBuilder
73
+ include Musa::Extension::With
74
+
75
+ include Helper::ToXML
76
+
77
+ def initialize(*_rest, **_krest, &block)
78
+ with &block if block_given?
79
+ end
80
+
81
+ def _to_xml(io, indent:, tabs:)
82
+ io.puts "#{tabs}<direction-type>"
83
+ _direction_type_to_xml(io, indent: indent + 1, tabs: tabs + "\t")
84
+ io.puts "#{tabs}</direction-type>"
85
+ end
86
+ end
87
+
88
+ private_constant :DirectionType
89
+
90
+ class Metronome < DirectionType
91
+ include Helper
92
+
93
+ # TODO complete Metronome complexity!
94
+
95
+ def initialize(beat_unit:, # quarter / eighth / ...
96
+ beat_unit_dots: nil, # number
97
+ per_minute:, #string
98
+ &block)
99
+
100
+ @beat_unit = beat_unit
101
+ @beat_unit_dots = beat_unit_dots
102
+ @per_minute = per_minute
103
+
104
+ super
105
+ end
106
+
107
+ attr_simple_builder :beat_unit
108
+ attr_simple_builder :beat_unit_dots
109
+ attr_simple_builder :per_minute
110
+
111
+ def _direction_type_to_xml(io, indent:, tabs:)
112
+ io.puts "#{tabs}<metronome>"
113
+
114
+ io.puts "#{tabs}\t<beat-unit>#{@beat_unit}</beat-unit>"
115
+ @beat_unit_dots&.times do
116
+ io.puts "#{tabs}\t<beat-unit-dot />"
117
+ end
118
+ io.puts "#{tabs}\t<per-minute>#{@per_minute}</per-minute>"
119
+
120
+ io.puts "#{tabs}</metronome>"
121
+ end
122
+ end
123
+
124
+ class Wedge < DirectionType
125
+ include Helper
126
+
127
+ def initialize(type, # crescendo / diminuendo / stop / continue
128
+ niente: nil, # true
129
+ &block)
130
+ @type = type
131
+ @niente = niente
132
+
133
+ super
134
+ end
135
+
136
+ attr_simple_builder :type
137
+ attr_simple_builder :niente
138
+
139
+ def _direction_type_to_xml(io, indent:, tabs:)
140
+ io.puts "#{tabs}<wedge type=\"#{@type}\"#{ decode_bool_or_string_attribute(@niente, 'niente', 'yes') }/>"
141
+ end
142
+ end
143
+
144
+ class Dynamics < DirectionType
145
+ def initialize(value, # pp / ppp / ... or array of
146
+ &block)
147
+ @dynamics = value.arrayfy
148
+ super
149
+ end
150
+
151
+ attr_simple_builder :dynamics
152
+
153
+ def _direction_type_to_xml(io, indent:, tabs:)
154
+ io.puts "#{tabs}<dynamics>"
155
+
156
+ @dynamics.each do |dynamics|
157
+ io.puts "#{tabs}\t<#{dynamics} />"
158
+ end
159
+
160
+ io.puts "#{tabs}</dynamics>"
161
+ end
162
+ end
163
+
164
+ class Pedal < DirectionType
165
+ include Helper
166
+
167
+ def initialize(type, # start / stop / change / continue
168
+ line: nil, # true
169
+ &block)
170
+
171
+ @type = type
172
+ @line = line
173
+
174
+ super
175
+ end
176
+
177
+ attr_simple_builder :type
178
+ attr_simple_builder :line
179
+
180
+ def _direction_type_to_xml(io, indent:, tabs:)
181
+ io.puts "#{tabs}<pedal type=\"#{@type}\"#{ decode_bool_or_string_attribute(@line, 'line', 'yes', 'no') }/>"
182
+ end
183
+ end
184
+
185
+ class Bracket < DirectionType
186
+ include Helper
187
+
188
+ def initialize(type, # start / stop / continue
189
+ line_end:, # up / down / both / arrow / none
190
+ line_type: nil, # solid / dashed / dotted / wavy
191
+ &block)
192
+
193
+ @type = type
194
+ @line_end = line_end
195
+ @line_type = line_type
196
+
197
+ super
198
+ end
199
+
200
+ attr_simple_builder :type
201
+ attr_simple_builder :line_type
202
+ attr_simple_builder :line_end
203
+
204
+ def _direction_type_to_xml(io, indent:, tabs:)
205
+ io.puts "#{tabs}<bracket type=\"#{@type}\" line_end=\"#{@line_end}\"#{ decode_bool_or_string_attribute(@line_type, 'line_type') }/>"
206
+ end
207
+ end
208
+
209
+ class Dashes < DirectionType
210
+ def initialize(type, # start / stop / continue
211
+ &block)
212
+
213
+ @type = type
214
+
215
+ super
216
+ end
217
+
218
+ attr_simple_builder :type
219
+
220
+ def _direction_type_to_xml(io, indent:, tabs:)
221
+ io.puts "#{tabs}<dashes type=\"#{@type}\" />"
222
+ end
223
+ end
224
+
225
+ class Words < DirectionType
226
+ def initialize(value, # string | Array of string
227
+ &block)
228
+
229
+ @words = value.arrayfy
230
+
231
+ super
232
+ end
233
+
234
+ attr_simple_builder :words
235
+
236
+ def _direction_type_to_xml(io, indent:, tabs:)
237
+ @words.each do |words|
238
+ io.puts "#{tabs}<words>#{words}</words>"
239
+ end
240
+ end
241
+ end
242
+
243
+ class OctaveShift < DirectionType
244
+ include Helper
245
+
246
+ def initialize(type, # up / down / stop / continue
247
+ size: nil, # number
248
+ &block)
249
+
250
+ @type = type
251
+ @size = size
252
+
253
+ super
254
+ end
255
+
256
+ attr_simple_builder :type
257
+ attr_simple_builder :size
258
+
259
+ def _direction_type_to_xml(io, indent:, tabs:)
260
+ io.puts "#{tabs}<octave-shift type=\"#{@type}\"#{ decode_bool_or_string_attribute(@size&.to_i, 'size') }/>"
261
+ end
262
+ end
263
+
264
+ class AccordionRegistration < DirectionType
265
+ include Helper::NotImplemented
266
+ end
267
+
268
+ class Coda < DirectionType
269
+ include Helper::NotImplemented
270
+ end
271
+
272
+ class Damp < DirectionType
273
+ include Helper::NotImplemented
274
+ end
275
+
276
+ class DampAll < DirectionType
277
+ include Helper::NotImplemented
278
+ end
279
+
280
+ class EyeGlasses < DirectionType
281
+ include Helper::NotImplemented
282
+ end
283
+
284
+ class HarpPedals < DirectionType
285
+ include Helper::NotImplemented
286
+ end
287
+
288
+ class Image < DirectionType
289
+ include Helper::NotImplemented
290
+ end
291
+
292
+ class OtherDirection < DirectionType
293
+ include Helper::NotImplemented
294
+ end
295
+
296
+ class Percussion < DirectionType
297
+ include Helper::NotImplemented
298
+ end
299
+
300
+ class PrincipalVoice < DirectionType
301
+ include Helper::NotImplemented
302
+ end
303
+
304
+ class Rehearsal < DirectionType
305
+ include Helper::NotImplemented
306
+ end
307
+
308
+ class Scordatura < DirectionType
309
+ include Helper::NotImplemented
310
+ end
311
+
312
+ class Segno < DirectionType
313
+ include Helper::NotImplemented
314
+ end
315
+
316
+ class StringMute < DirectionType
317
+ include Helper::NotImplemented
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end