module MTK::Lang::Intensities

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).

@note 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.

@see Core::Intensity @see Events::Note

Constants

INTENSITIES

All “psuedo constants” defined in this module

INTENSITY_NAMES

The names of all “psuedo constants” defined in this module @see MTK::Core::Intensity::NAMES

Public Class Methods

define_intensity(name, value, description, percentage_intensity) click to toggle source

@private @!macro [attach] define_intensity

$3: $4% intensity
@!attribute [r]
@return [MTK::Core::Interval] intensity of $4%
# File lib/mtk/lang/intensities.rb, line 27
def self.define_intensity name, value, description, percentage_intensity
  define_constant name, value
end