lib/mehegan.js
function (key, n) {
  var int;
  var numeral;

  try {
    int = key.getInterval(n);
  } catch (err) {
    try {
      int = key.getInterval(n.clean());
    } catch (err2) {
      int = key.getInterval(n.toggleAccidental());
    }
  }

  // Although dim7, for example, is a valid interval, we don't want a bbVII in our symbol
  if (!interval.isPerfect(int.number) && int.quality === 'dim') {
    int = interval.parse((int.number - 1).toString());
  }

  numeral = romanNumeral[int.number];

  if (int.quality === 'm' || int.quality === 'dim') numeral = 'b' + numeral;
  if (int.quality === 'aug') numeral = '#' + numeral;

  return numeral;
}
function (key, n) {
  var int;
  var numeral;

  try {
    int = key.getInterval(n);
  } catch (err) {
    try {
      int = key.getInterval(n.clean());
    } catch (err2) {
      int = key.getInterval(n.toggleAccidental());
    }
  }

  // Although dim7, for example, is a valid interval, we don't want a bbVII in our symbol
  if (!interval.isPerfect(int.number) && int.quality === 'dim') {
    int = interval.parse((int.number - 1).toString());
  }

  numeral = romanNumeral[int.number];

  if (int.quality === 'm' || int.quality === 'dim') numeral = 'b' + numeral;
  if (int.quality === 'aug') numeral = '#' + numeral;

  return numeral;
}
function ( key , n ) { var int ; var numeral ; try { int = key . getInterval ( n ) ; } catch ( err ) { try { int = key . getInterval ( n . clean ( ) ) ; } catch ( err2 ) { int = key . getInterval ( n . toggleAccidental ( ) ) ; } } // Although dim7, for example, is a valid interval, we don't want a bbVII in our symbol if ( ! interval . isPerfect ( int . number ) && int . quality === 'dim' ) { int = interval . parse ( ( int . number - 1 ) . toString ( ) ) ; } numeral = romanNumeral [ int . number ] ; if ( int . quality === 'm' || int . quality === 'dim' ) numeral = 'b' + numeral ; if ( int . quality === 'aug' ) numeral = '#' + numeral ; return numeral ; }
Given a key and a note, return a roman numeral representing the note
Given a key and a note return a roman numeral representing the note