Class: Stretto::MusicElements::PolyphonicPressure
- Inherits:
-
MusicElement
- Object
- MusicElement
- Stretto::MusicElements::PolyphonicPressure
- Defined in:
- lib/stretto/music_elements/polyphonic_pressure.rb
Overview
Polyphonic pressure is similar to channel pressure (see ChannelPressure) but it is applied to only a note. A polyphonic pressure token is specified by the notation *key,value, where key is the value for the pitch (0 to 127) and value is the applied pressure (0 to 127)
Constant Summary collapse
- MAX_PITCH_VALUE =
127
- MAX_VALUE =
127
Instance Attribute Summary collapse
-
#pitch ⇒ Object
Returns the value of attribute pitch.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from MusicElement
Attributes included from Node
Instance Method Summary collapse
-
#initialize(string_or_options, pattern = nil) ⇒ PolyphonicPressure
constructor
A new instance of PolyphonicPressure.
Methods inherited from MusicElement
#build_music_string, #duration, #end_of_tie?, #start_of_tie?, #to_s
Constructor Details
#initialize(string_or_options, pattern = nil) ⇒ PolyphonicPressure
Returns a new instance of PolyphonicPressure.
17 18 19 20 21 22 23 24 25 |
# File 'lib/stretto/music_elements/polyphonic_pressure.rb', line 17 def initialize(, pattern = nil) token = case when String then Stretto::Parser.parse_polyphonic_pressure!() else end super(token[:text_value], pattern) @original_pitch = token[:pitch] @original_value = token[:value] end |
Instance Attribute Details
#pitch ⇒ Object
Returns the value of attribute pitch.
15 16 17 |
# File 'lib/stretto/music_elements/polyphonic_pressure.rb', line 15 def pitch @pitch end |
#value ⇒ Object
Returns the value of attribute value.
15 16 17 |
# File 'lib/stretto/music_elements/polyphonic_pressure.rb', line 15 def value @value end |