Class: Stretto::MusicElements::ControllerChange
- Inherits:
-
MusicElement
- Object
- MusicElement
- Stretto::MusicElements::ControllerChange
- Defined in:
- lib/stretto/music_elements/controller_change.rb
Overview
Represents a MIDI controller event.
MIDI specification defines about 100 controller events, that are used by the instruments or synthesizer to perform a range of effects and control settings.
JFugue defines the most common ones (See Variables::CONTROLLER_VARIABLES), and provides a shortcut for mixed (coarse and fine values) controllers.
The syntax for a controller change is X_controller_=value, where controller is the number of the controller event, and value is the value that is going to be set.
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from MusicElement
Attributes included from Node
Instance Method Summary collapse
-
#initialize(string_or_options, pattern = nil) ⇒ ControllerChange
constructor
A new instance of ControllerChange.
Methods inherited from MusicElement
#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #to_s
Constructor Details
#initialize(string_or_options, pattern = nil) ⇒ ControllerChange
Returns a new instance of ControllerChange.
20 21 22 23 24 25 26 27 28 |
# File 'lib/stretto/music_elements/controller_change.rb', line 20 def initialize(, pattern = nil) token = case when String then Stretto::Parser.parse_controller_change!() else end super(token[:text_value], pattern) @original_controller = token[:controller] @original_value = token[:value] end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
18 19 20 |
# File 'lib/stretto/music_elements/controller_change.rb', line 18 def controller @controller end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
18 19 20 |
# File 'lib/stretto/music_elements/controller_change.rb', line 18 def value @value end |