et_scale_table: Create Equal-Tempered Scale Table

View source: R/cps_functions.R

et_scale_tableR Documentation

Create Equal-Tempered Scale Table

Description

Creates a scale table for equal divisions of a specified period.

Usage

et_scale_table(
  note_names = c("C", "C#|Db", "D", "D#|Eb", "E", "F", "F#|Gb", "G", "G#|Ab", "A",
    "A#|Bb", "B"),
  period = 2
)

Arguments

note_names

a character vector with the names of the notes in the scale. The default is the names of the standard 12 equal divisions of the octave.

period

The period - default is 2, for an octave

Value

a data.table with six columns:

  • note_name: the note name (character)

  • ratio: the ratio that defines the note, as a number between 1 and period

  • ratio_frac: the ratio as a vulgar fraction (character). The ratios for most EDOs are irrational, so this is an approximation.

  • ratio_cents: the ratio in cents (hundredths of a semitone)

  • interval_cents: interval between this note and the previous note

  • degree: scale degree from zero to (number of notes) - 1

Examples


print(vanilla <- et_scale_table()) # default is 12EDO, of course

# 19-EDO
print(edo19 <- et_scale_table(edo19_names))
# 31-EDO
print(edo31 <- et_scale_table(edo31_names))

# equal-tempered Bohlen-Pierce
print(bohlen_pierce_et <- et_scale_table(bohlen_pierce_et_names, period = 3))

AlgoCompSynth/eikosany documentation built on Nov. 25, 2024, 5:22 p.m.