Skip to main content

alphaTab.model.Tuning

This public class represents a predefined string tuning.

 class Tuning

Propertiesโ€‹

isStandardโ€‹

Gets or sets whether this is the standard tuning for this number of strings.

isStandard: boolean;

nameโ€‹

Gets or sets the name of the tuning.

name: string;

noteNamesโ€‹

Deprecated

Use SpelledPitch for the written name of a pitch.

The flat spelled note names of the 12 pitch classes.

static readonly noteNames: string[];

pitchesโ€‹

Gets or sets the written pitches of the strings, starting with the highest string. Changing the returned array does not change the tuning, assign a new array instead.

pitches: SpelledPitch[];

tuningsโ€‹

Gets or sets the MIDI values of the strings, starting with the highest string. The values are taken from pitches : setting them spells the strings with flats, changing the returned array does not change the tuning.

tunings: number[];

Methodsโ€‹

findTuningโ€‹

Tries to find a known tuning by a given list of tuning values.

static findTuning(strings: number[]): Tuning | null
ParameterSummary
stringsAll

The values defining the tuning.

Returnsโ€‹

The known tuning.

finishโ€‹

Tries to detect the name and standard flag of the tuning from a known tuning list based on the string values.

finish(): void

getDefaultTuningForโ€‹

Gets the default tuning for the given string count.

static getDefaultTuningFor(stringCount: number): Tuning | null
ParameterSummary
stringCountAll

The string count.

Returnsโ€‹

The tuning for the given string count or null if the string count is not defined.

getPresetsForโ€‹

Gets a list of all tuning presets for a given stirng count.

static getPresetsFor(stringCount: number): Tuning[]
ParameterSummary
stringCountAll

The string count.

Returnsโ€‹

The list of known tunings for the given string count or an empty list if the string count is not defined.

getTextForTuningโ€‹

Deprecated

Use toNameString or toString for the written name of a pitch.

Gets the flat spelled name of the given tuning value, optionally with octave.

static getTextForTuning(tuning: number, includeOctave: boolean): string
ParameterSummary
tuningAll

(no description)

includeOctaveAll

(no description)

getTextPartsForTuningโ€‹

Deprecated

Use SpelledPitch for the written name of a pitch.

Gets the flat spelled name and the octave of the given tuning value.

static getTextPartsForTuning(tuning: number, octaveShift?: number): string[]
ParameterSummary
tuningAll

(no description)

octaveShiftAll

(no description)

initializeโ€‹

(no description)

static initialize(): void

resetโ€‹

(no description)

reset(): void