Module: MTK::Lang::Intensities
- Extended by:
- PseudoConstants
- Defined in:
- lib/mtk/lang/intensities.rb
Overview
Including this module shadows Ruby’s built-in p() method. If you include this module, you can access the built-in p() method via Kernel.p()
Defines intensity constants using standard dynamic symbols.
These can be thought of like constants, but in order to distinguish ‘f’ (forte) from the PitchClass ‘F’ it was necessary to use lower-case names and therefore define them as “pseudo constant” methods. The methods are available either through the module (MTK::Intensities::f) or via mixin (include MTK::Intensities; f)
These values are intensities in the range 0.125 - 1.0 (in increments of 1/8), so they can be easily scaled (unlike MIDI velocities).
It is also possible to retrieve values in increments of 1/24 by using the ‘+’ and ‘-’ suffix when looking up values via the [] method.
Constant Summary collapse
- INTENSITIES =
The values of all “psuedo constants” defined in this module
[ppp, pp, p, mp, mf, o, ff, fff].freeze
- INTENSITY_NAMES =
The names of all “psuedo constants” defined in this module
MTK::Core::Intensity::NAMES
Instance Attribute Summary collapse
-
#ff ⇒ MTK::Core::Intensity[0.875]
readonly
fortissimo.
-
#fff ⇒ MTK::Core::Intensity[1.0]
readonly
fortississimo.
-
#mf ⇒ MTK::Core::Intensity[0.625]
readonly
mezzo-forte.
-
#mp ⇒ MTK::Core::Intensity[0.5]
readonly
mezzo-piano.
-
#o ⇒ MTK::Core::Intensity[0.75]
readonly
forte.
-
#p ⇒ MTK::Core::Intensity[0.375]
readonly
piano.
-
#pp ⇒ MTK::Core::Intensity[0.25]
readonly
pianissimo.
-
#ppp ⇒ MTK::Core::Intensity[0.125]
readonly
Intensity value for ppp.
Method Summary
Methods included from PseudoConstants
Instance Attribute Details
#ff ⇒ MTK::Core::Intensity[0.875] (readonly)
fortissimo
48 |
# File 'lib/mtk/lang/intensities.rb', line 48 define_constant 'ff', MTK::Core::Intensity[0.875] |
#fff ⇒ MTK::Core::Intensity[1.0] (readonly)
fortississimo
51 |
# File 'lib/mtk/lang/intensities.rb', line 51 define_constant 'fff', MTK::Core::Intensity[1.0] |
#mf ⇒ MTK::Core::Intensity[0.625] (readonly)
mezzo-forte
42 |
# File 'lib/mtk/lang/intensities.rb', line 42 define_constant 'mf', MTK::Core::Intensity[0.625] |
#mp ⇒ MTK::Core::Intensity[0.5] (readonly)
mezzo-piano
39 |
# File 'lib/mtk/lang/intensities.rb', line 39 define_constant 'mp', MTK::Core::Intensity[0.5] |
#o ⇒ MTK::Core::Intensity[0.75] (readonly)
forte
45 |
# File 'lib/mtk/lang/intensities.rb', line 45 define_constant 'o', MTK::Core::Intensity[0.75] |
#p ⇒ MTK::Core::Intensity[0.375] (readonly)
Including this module shadows Ruby’s built-in p() method. If you include this module, you can access the built-in p() method via Kernel.p()
piano
36 |
# File 'lib/mtk/lang/intensities.rb', line 36 define_constant 'p', MTK::Core::Intensity[0.375] |
#pp ⇒ MTK::Core::Intensity[0.25] (readonly)
pianissimo
31 |
# File 'lib/mtk/lang/intensities.rb', line 31 define_constant 'pp', MTK::Core::Intensity[0.25] |
#ppp ⇒ MTK::Core::Intensity[0.125] (readonly)
Returns intensity value for ppp.
28 |
# File 'lib/mtk/lang/intensities.rb', line 28 define_constant 'ppp', MTK::Core::Intensity[0.125] |