RomanNumeral
tonal-roman-numeral
is a collection of functions to query about tonal keys.
This is part of tonal music theory library.
Example
// es6// es5const RomanNumeral =
Example
RomanNumeral // => ["I", "II", "III", "IV", "V", "VI", "VII"]RomanNumeral // => { name: 'ii', type: '7', num: 2, major: false }RomanNumeral // => "II"RomanNumeral // => "ii"
- RomanNumeral
.props()
⇒Object
.names([isMajor])
⇒Array.<String>
.name(name)
⇒string
.type(name)
⇒string
.decimal(name)
⇒number
.fromDegree(degree, [isMajor])
⇒string
RomanNumeral.props()
⇒ Object
Get properties of a roman numeral string
Kind: static method of RomanNumeral
Returns: Object
- - the roman numeral properties
Type | Description |
---|---|
string |
the roman numeral string (can have type, like: Imaj7) |
Example
// => { name: "VII", type: "b5", num: 7, major: true }
RomanNumeral.names([isMajor])
⇒ Array.<String>
Get roman numeral names
Kind: static method of RomanNumeral
Param | Type | Default |
---|---|---|
[isMajor] | boolean |
true |
Example
// => ["I", "II", "III", "IV", "V", "VI", "VII"] // => ["i", "ii", "iii", "iv", "v", "vi", "vii"]
RomanNumeral.name(name)
⇒ string
Get roman numeral name of a string or null if not valid roman numeral
Kind: static method of RomanNumeral
Param | Type |
---|---|
name | string |
Example
// => 'II // => 'iii' // => null (mixed case not allowed)
RomanNumeral.type(name)
⇒ string
Get type of a roman numeral
Kind: static method of RomanNumeral
Param | Type |
---|---|
name | string |
Example
// => 'maj7'
RomanNumeral.decimal(name)
⇒ number
Get roman numeral number in decimal integer (it accepts numbers from 1 to 7)
Kind: static method of RomanNumeral
Param | Type | Description |
---|---|---|
name | string | number |
roman numeral name (with optional type) |
Example
// => 4 // => 4 // => null
RomanNumeral.fromDegree(degree, [isMajor])
⇒ string
Get a roman numeral from a degree number
Kind: static method of RomanNumeral
Returns: string
- the roman numeral
Param | Type | Default |
---|---|---|
degree | number |
|
[isMajor] | boolean |
true |
Example
// => "II" // => "ii"