Class: Stretto::MusicElements::PolyphonicPressure

Inherits:
MusicElement show all
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

Attributes inherited from MusicElement

#original_string, #pattern

Attributes included from Node

#next, #prev

Instance Method Summary collapse

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(string_or_options, pattern = nil)
  token = case string_or_options
    when String then Stretto::Parser.parse_polyphonic_pressure!(string_or_options)
    else string_or_options
  end
  super(token[:text_value], pattern)
  @original_pitch = token[:pitch]
  @original_value = token[:value]
end

Instance Attribute Details

#pitchObject

Returns the value of attribute pitch.



15
16
17
# File 'lib/stretto/music_elements/polyphonic_pressure.rb', line 15

def pitch
  @pitch
end

#valueObject

Returns the value of attribute value.



15
16
17
# File 'lib/stretto/music_elements/polyphonic_pressure.rb', line 15

def value
  @value
end