Search code examples
javajfugue

Define diminished chord as a roman numeral with JFugue


So I want to have a diminished seven chord, as it is the diatonic in major mode and often used in place of the major seven in minor mode. This site says that diminished chords can be defined by using dim after the chord name, but this only works with explicit letter names as far as I can tell. Is there any way to get it to apply to roman numerals?

The following program:

ChordProgression cp = new ChordProgression("vii");
cp.setKey("C");
System.out.println(cp.getChords()[0].toHumanReadableString());
cp = new ChordProgression("vii*");
System.out.println(cp.getChords()[0].toHumanReadableString());
cp = new ChordProgression("viidim");
System.out.println(cp.getChords()[0].toHumanReadableString());

Outputs:

B4MIN
C4MIN
C4DIM

The output should be B4DIM.


Solution

  • To produce a diminished chord from ChordProgression, use 'o' or 'd' at the end of the Roman numerals.

    ChordProgression cp = new ChordProgression("viid").setKey("C");
    System.out.println(cp);
    

    This code produces B4DIM.