2

I'm doing a project with JFugue 5.0, I've tried 4.0 but 5.0 seems smoother than his previous brother. Anyway, I have the complete guide to JFugue v4 and these are the Strings used to refer to the differents percussion instruments

Now, when I try to run my code I get this error:

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: JFugue NoteSubparser: Could not find 'HIGH_TOM' in dictionary.

And this is my custom Rhythm Map I use:

kitPercusion = new HashMap<>();
    kitPercusion.put('O', "[ACOUSTIC_BASS_DRUM]i");
    kitPercusion.put('S', "[ACOUSTIC_SNARE]i");
    kitPercusion.put('`', "[CLOSED_HI_HAT]s Rs");
    kitPercusion.put('^', "[OPEN_HI_HAT]i");
    kitPercusion.put('R', "[RIDE_CYMBAL_1]s Rs");
    kitPercusion.put('C', "[CRASH_CYMBAL_1]s Rs");
    kitPercusion.put('T', "[HIGH_TOM]s Rs");
    kitPercusion.put('-', "[HI_MID_TOM]s Rs");
    kitPercusion.put('_', "[LOW_FLOOR_TOM]s Rs");
    kitPercusion.put('~', "[COWBELL]i");
    kitPercusion.put('.', "Ri");

In the official web examples I've seen that the names have been "simplified" like "guitar", "piano" and so on.

Is there a way to get the dictionary with the valid instrument Strings?

EDIT: I have tried this, but it prints an empty Map

    Player player = new Player();
    StaccatoParser sp = player.getStaccatoParser();
    StaccatoParserContext spc = new StaccatoParserContext(sp);
    System.out.println(spc.getDictionary());

1 Answers1

1

The names of the percussion instruments are held in the static String[] Note.PERCUSSION_NAMES.

HI_TOM is what you're looking for. In JFugue 5, all of the percussion instruments formerly named HIGH_X or LOW_X have been simplified to HI_X or LO_X.

(You might also be interested in instrument names, which are different from percussion names. Percussion names are simply alternate names for note values intended for use when those notes are played in the 10th channel (V9), which MIDI reserves for percussion instruments (this is the reason why your MIDI piano has percussion symbols over several of the notes); instrument names are for actual instrument patches. You can find those in MidiDictionary.INSTRUMENT_BYTE_TO_STRING and MidiDictionary.INSTRUMENT_STRING_TO_BYTE.)

David Koelle
  • 20,726
  • 23
  • 93
  • 130