Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
tonal-roman-numeral
Advanced tools
tonal-roman-numeral
is a collection of functions to query about tonal keys.
This is part of tonal music theory library.
Example
// es6
import * as RomanNumeral from "tonal-roman-numeral"
// es5
const RomanNumeral = require("tonal-roman-numeral")
Example
RomanNumeral.names() // => ["I", "II", "III", "IV", "V", "VI", "VII"]
RomanNumeral.props('ii7') // => { name: 'ii', type: '7', num: 2, major: false }
RomanNumeral.degree(2) // => "II"
RomanNumeral.degree(2, false) // => "ii"
.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
props("VIIb5") // => { 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
names() // => ["I", "II", "III", "IV", "V", "VI", "VII"]
names(false) // => ["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
name('IIb7') // => 'II
name('iii') // => 'iii'
name('Ii') // => 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
type('Imaj7') // => '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
decimal('IVmaj7') // => 4
decimal(4) // => 4
decimal(10) // => 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
fromDegree(2) // => "II"
fromDegree(2, false) // => "ii"
FAQs
Work with roman numeral representation of degrees
The npm package tonal-roman-numeral receives a total of 699 weekly downloads. As such, tonal-roman-numeral popularity was classified as not popular.
We found that tonal-roman-numeral demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.