Learn R Programming

musicMCT (version 0.1.2)

readSCL: Import a Scala (.scl) file as a scale

Description

This function allows you to import scales that have been defined in the Scala tuning format (*.scl) into R to analyze with the functions of musicMCT. Scales can be defined in .scl files in different ways, some of which may lack the precision that computations in musicMCT normally assume. If you import a scale that seems to have less regularity than you expected (i.e. it's on 0 hyperplanes even though it seems to be very regular), try increasing your rounding tolerance (i.e. lower the value of rounder arguments in the functions you apply to the imported scale).

Usage

readSCL(filename, scaleonly = TRUE, edo = 12)

Value

A numeric vector with the scale's pitches if scaleonly=TRUE; else a list in which the scale's pitches are the first entry, the length of the scale is the second, and the size of the period is the third.

Arguments

filename

String with the path to the file to be imported

scaleonly

Boolean: should readSCL return only a vector of pitches, not additional information from the file? Defaults to TRUE

edo

Number of unit steps in an octave. Defaults to 12.

Examples

Run this code
# We'll read a sample .scl file that comes with the `musicMCT` package.
demo_filepath <- system.file("extdata", "sample_pentachord.scl", package="musicMCT")
fun_pentachord <- readSCL(demo_filepath)
sim(fun_pentachord)
brightnessgraph(fun_pentachord)

Run the code above in your browser using DataLab