Module xScale

Methods for working with notes & harmonic scales

Functions

restrict_to_scale (note_value, scale_idx_or_name, scale_key) [Static] Restrict notes to a specific scale and key
get_shifted_keys (scale, key) Shift the keys
get_scale_by_name (name) [Static] Get a specific scale by its name TODO use SCALE_NAMES for faster lookup
get_scale_index_by_name (name) [Static] Get a specific scale by its name TODO use SCALE_NAMES for faster lookup
get_scales_with_count (count) [Static] Get scales with a specific number of keys
get_selected_scale () [Static] Get currently active scale mode for the selected instrument
get_selected_key () [Static] Get currently active scale key for the selected instrument


Functions

restrict_to_scale (note_value, scale_idx_or_name, scale_key)
[Static] Restrict notes to a specific scale and key

Parameters:

  • note_value (0-119), notes outside this range are returned as-is
  • scale_idx_or_name (int/string), the scale to apply (xScale.SCALES)
  • scale_key ] (int), 1=C, 2=C#, 3=D, ... (default is C)
get_shifted_keys (scale, key)
Shift the keys

Parameters:

  • scale (table), one of xScale.SCALES
  • key (int), 1=C, 2=C#, 3=D, ...
get_scale_by_name (name)
[Static] Get a specific scale by its name TODO use SCALE_NAMES for faster lookup

Parameters:

  • name (string)

Returns:

    table (one of xScale.SCALES) or nil
get_scale_index_by_name (name)
[Static] Get a specific scale by its name TODO use SCALE_NAMES for faster lookup

Parameters:

  • name (string)

Returns:

    table (one of xScale.SCALES) or nil
get_scales_with_count (count)
[Static] Get scales with a specific number of keys

Parameters:

  • count (number)

Returns:

    table of xScale.SCALES or nil
get_selected_scale ()
[Static] Get currently active scale mode for the selected instrument

Returns:

    string
get_selected_key ()
[Static] Get currently active scale key for the selected instrument

Returns:

    number/int
generated by LDoc 1.4.2