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() Also be aware you might shadow existing variable names, like f.
Defines intensity constants using standard dynamic symbols.
These can be thought of like constants, but in order to support the lower case names, it was necessary to define them as “pseudo constant” methods. Like constants, these methods are available either through the module (MTK::Lang::Intensities::f) or via mixin (include MTK::Lang::Intensities; f). They are listed under the “Instance Attribute Summary” of this page.
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).
Constant Summary collapse
- INTENSITIES =
All “psuedo constants” defined in this module
[ppp, pp, p, mp, mf, f, ff, fff].freeze
- INTENSITY_NAMES =
The names of all “psuedo constants” defined in this module
MTK::Core::Intensity::NAMES
Instance Attribute Summary collapse
-
#f ⇒ MTK::Core::Interval
readonly
forte: 75% intensity.
-
#ff ⇒ MTK::Core::Interval
readonly
fortissimo: 87.5% intensity.
-
#fff ⇒ MTK::Core::Interval
readonly
fortississimo: 100% intensity.
-
#mf ⇒ MTK::Core::Interval
readonly
mezzo-forte: 62.5% intensity.
-
#mp ⇒ MTK::Core::Interval
readonly
mezzo-piano: 50% intensity.
-
#p ⇒ MTK::Core::Interval
readonly
piano: 37.5% intensity.
-
#pp ⇒ MTK::Core::Interval
readonly
pianissimo: 25% intensity.
-
#ppp ⇒ MTK::Core::Interval
readonly
pianississimo: 12.5% intensity.
Method Summary
Methods included from PseudoConstants
Instance Attribute Details
#f ⇒ MTK::Core::Interval (readonly)
forte: 75% intensity
44 |
# File 'lib/mtk/lang/intensities.rb', line 44 define_intensity 'f', MTK::Core::Intensity[0.75], 'forte', 75 |
#ff ⇒ MTK::Core::Interval (readonly)
fortissimo: 87.5% intensity
46 |
# File 'lib/mtk/lang/intensities.rb', line 46 define_intensity 'ff', MTK::Core::Intensity[0.875], 'fortissimo', '87.5' |
#fff ⇒ MTK::Core::Interval (readonly)
fortississimo: 100% intensity
48 |
# File 'lib/mtk/lang/intensities.rb', line 48 define_intensity 'fff', MTK::Core::Intensity[1.0], 'fortississimo', 100 |
#mf ⇒ MTK::Core::Interval (readonly)
mezzo-forte: 62.5% intensity
42 |
# File 'lib/mtk/lang/intensities.rb', line 42 define_intensity 'mf', MTK::Core::Intensity[0.625], 'mezzo-forte', '62.5' |
#mp ⇒ MTK::Core::Interval (readonly)
mezzo-piano: 50% intensity
40 |
# File 'lib/mtk/lang/intensities.rb', line 40 define_intensity 'mp', MTK::Core::Intensity[0.5], 'mezzo-piano', 50 |
#p ⇒ MTK::Core::Interval (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: 37.5% intensity
38 |
# File 'lib/mtk/lang/intensities.rb', line 38 define_intensity 'p', MTK::Core::Intensity[0.375], 'piano', '37.5' |
#pp ⇒ MTK::Core::Interval (readonly)
pianissimo: 25% intensity
34 |
# File 'lib/mtk/lang/intensities.rb', line 34 define_intensity 'pp', MTK::Core::Intensity[0.25], 'pianissimo', 25 |
#ppp ⇒ MTK::Core::Interval (readonly)
pianississimo: 12.5% intensity
32 |
# File 'lib/mtk/lang/intensities.rb', line 32 define_intensity 'ppp', MTK::Core::Intensity[0.125], 'pianississimo', '12.5' |