CLASS vlt.music.tone¶
TONE - create a new musical tone object
OBJ = TONE (INPUT)
Input can be the following:
An integer, where 0 denotes C4 (middle C).
1 denotes C4#, 2 denotes D4, etc.
-1 denotes B3, -2 denotes A3#, etc.
A character string of 2 or 3 characters,
where the first character (A-G) indicates the
letter of the tone, the second character is the
number of the tone, and the optional third
character is a sharp '#' or flat 'b'.
Superclasses¶
none
Properties¶
Property | Description |
---|---|
value |
Methods¶
Method | Description |
---|---|
char | return the character description of a tone |
char2num | convert a character description of a tone into a tone number |
major | return the tones that make up the natural major scale of a tone (Ionian mode) |
minor | return the tones that make up the natural minor scale of a tone |
num2char | return a character description of a music tone |
scale | return a scale generated with a certain array of tone intervals |
tone | create a new musical tone object |
Methods help¶
char - return the character description of a tone
C = CHAR(TONE_OBJ)
Return the character notation of a tone object.
Example:
tone_obj = vlt.music.tone(0);
c = tone_obj.char % will be 'C4'
char2num - convert a character description of a tone into a tone number
N = CHAR2NUM(INPUT)
Given a character input of a note (e.g., 'A3#', 'C4', 'G2b'), returns the
tone number N.
The character input should consist of a letter describing the note ('A'-'G'),
an integer describing the level of the note (0, 1, 9), and a trailing character
of '#' (sharp) or 'b' (flat) if necessary.
The output N is a tone number, which is a signed integer. 'C4' is 0, and each tone is an
integer step up or down. For example, 'B3' is -1, 'A3#' is -2, 'C4#' is 1, etc.
major - return the tones that make up the natural major scale of a tone (Ionian mode)
T = MAJOR(TONE_OBJ)
Return an array of tone objects that correspond to the major
scale of a tone. This is also known as the Ionian mode.
Example:
a = tone('A3'); % tone is A3
m = a.major();
m.char() % print the tones
minor - return the tones that make up the natural minor scale of a tone
T = MINOR(TONE_OBJ)
Return an array of tone objects that correspond to the natural minor
scale of a tone. (Aeolian mode.)
Example:
a = tone('A3'); % tone is A3
m = a.minor();
m.char() % print the tones
num2char - return a character description of a music tone
C = NUM2CHAR(NUM)
Return the character description of a musical tone with number NUM.
0 is middle C ('C4'), -1 is 'B3', -2 is 'A3#', etc.
The character array will always bs 2-3 characters long. The first character
is the letter, the second character is a digit specifying the level 0..9, and
the third character (if necessary) will be a sharp.
scale - return a scale generated with a certain array of tone intervals
S = SCALE(TONE_OBJ, INTERVALS)
Returns an array of tone objects that correspond to the specified intervals.
Example:
c = tone('C4'); % middle C
m = c.scale([0 2 2 1 2 2 2 1]); % natural major scale
m.char()
tone - create a new musical tone object
OBJ = TONE (INPUT)
Input can be the following:
An integer, where 0 denotes C4 (middle C).
1 denotes C4#, 2 denotes D4, etc.
-1 denotes B3, -2 denotes A3#, etc.
A character string of 2 or 3 characters,
where the first character (A-G) indicates the
letter of the tone, the second character is the
number of the tone, and the optional third
character is a sharp '#' or flat 'b'.
Documentation for vlt.music.tone/tone
doc vlt.music.tone