Skip to content

Commit

Permalink
enhanced decompile options
Browse files Browse the repository at this point in the history
- added more info to the decompile config window
- added config options for dotted/tripletted notes and/or rests
- preventing exceptions if decompile options have been changed manually in the config file with corrupted numbers
- using a combobox for the max target ticks instead of a text field
- fixed a small bug in the decompiler's duration strategy
- #58
  • Loading branch information
truj committed Apr 9, 2020
1 parent 178219b commit 02a127c
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 297 deletions.
Binary file renamed midica-0.1586204296.jar → midica-0.1586462747.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/org/midica/Midica.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Midica {
public static final int VERSION_MAJOR = 0;

/** Minor version number. This is intended to be incremented automatically by precommit.pl. */
public static final int VERSION_MINOR = 1586204296;
public static final int VERSION_MINOR = 1586462747;

/** Full version string. */
public static final String VERSION = VERSION_MAJOR + "." + VERSION_MINOR;
Expand Down
50 changes: 33 additions & 17 deletions src/org/midica/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,19 @@ public class Config {
public static final String DC_MUST_ADD_QUALITY_SCORE = "dc_must_add_quality_score";
public static final String DC_MUST_ADD_STATISTICS = "dc_must_add_statistics";
public static final String DC_LENGTH_STRATEGY = "dc_length_strategy";
public static final String DC_MAX_TARGET_TICKS_ON = "dc_max_target_ticks_on";
public static final String DC_NEXT_NOTE_ON_TOLERANCE = "dc_next_note_on_tolerance";
public static final String DC_MIN_DURATION_TO_KEEP = "dc_min_duration_to_keep";
public static final String DC_DURATION_TICK_TOLERANCE = "dc_duration_tick_tolerance";
public static final String DC_DURATION_RATIO_TOLERANCE = "dc_duration_ratio_tolerance";
public static final String DC_MIN_DURATION_TO_KEEP = "dc_min_duration_to_keep";
public static final String DC_NEXT_NOTE_ON_TOLERANCE = "dc_next_note_on_tolerance";
public static final String DC_MAX_TARGET_TICKS_ON = "dc_max_target_ticks_on";
public static final String DC_USE_PRE_DEFINED_CHORDS = "dc_use_pre_defined_chords";
public static final String DC_CHORD_NOTE_ON_TOLERANCE = "dc_chord_note_on_tolerance";
public static final String DC_CHORD_NOTE_OFF_TOLERANCE = "dc_chord_note_off_tolerance";
public static final String DC_CHORD_VELOCITY_TOLERANCE = "dc_chord_velocity_tolerance";
public static final String DC_USE_DOTTED_NOTES = "dc_use_dotted_notes";
public static final String DC_USE_DOTTED_RESTS = "dc_use_dotted_rests";
public static final String DC_USE_TRIPLETTED_NOTES = "dc_use_tripletted_notes";
public static final String DC_USE_TRIPLETTED_RESTS = "dc_use_tripletted_rests";
public static final String DC_ORPHANED_SYLLABLES = "dc_orphaned_syllables";
public static final String DC_KARAOKE_ONE_CHANNEL = "dc_karaoke_one_channel";
public static final String DC_EXTRA_GLOBALS_STR = "dc_extra_globals_str";
Expand Down Expand Up @@ -310,15 +314,19 @@ public static HashMap<String, String> getDefaultDecompileConfig() {
dcDefaults.put( DC_MUST_ADD_QUALITY_SCORE, "" + MidicaPLExporter.DEFAULT_MUST_ADD_QUALITY_SCORE );
dcDefaults.put( DC_MUST_ADD_STATISTICS, "" + MidicaPLExporter.DEFAULT_MUST_ADD_STATISTICS );
dcDefaults.put( DC_LENGTH_STRATEGY, "" + MidicaPLExporter.DEFAULT_LENGTH_STRATEGY );
dcDefaults.put( DC_MAX_TARGET_TICKS_ON, "" + MidicaPLExporter.DEFAULT_MAX_TARGET_TICKS_ON );
dcDefaults.put( DC_NEXT_NOTE_ON_TOLERANCE, "" + MidicaPLExporter.DEFAULT_NEXT_NOTE_ON_TOLERANCE );
dcDefaults.put( DC_MIN_DURATION_TO_KEEP, "" + MidicaPLExporter.DEFAULT_MIN_DURATION_TO_KEEP );
dcDefaults.put( DC_DURATION_TICK_TOLERANCE, "" + MidicaPLExporter.DEFAULT_DURATION_TICK_TOLERANCE );
dcDefaults.put( DC_DURATION_RATIO_TOLERANCE, "" + MidicaPLExporter.DEFAULT_DURATION_RATIO_TOLERANCE );
dcDefaults.put( DC_MIN_DURATION_TO_KEEP, "" + MidicaPLExporter.DEFAULT_MIN_DURATION_TO_KEEP );
dcDefaults.put( DC_NEXT_NOTE_ON_TOLERANCE, "" + MidicaPLExporter.DEFAULT_NEXT_NOTE_ON_TOLERANCE );
dcDefaults.put( DC_MAX_TARGET_TICKS_ON, "" + MidicaPLExporter.DEFAULT_MAX_TARGET_TICKS_ON );
dcDefaults.put( DC_USE_PRE_DEFINED_CHORDS, "" + MidicaPLExporter.DEFAULT_USE_PRE_DEFINED_CHORDS );
dcDefaults.put( DC_CHORD_NOTE_ON_TOLERANCE, "" + MidicaPLExporter.DEFAULT_CHORD_NOTE_ON_TOLERANCE );
dcDefaults.put( DC_CHORD_NOTE_OFF_TOLERANCE, "" + MidicaPLExporter.DEFAULT_CHORD_NOTE_OFF_TOLERANCE );
dcDefaults.put( DC_CHORD_VELOCITY_TOLERANCE, "" + MidicaPLExporter.DEFAULT_CHORD_VELOCITY_TOLERANCE );
dcDefaults.put( DC_USE_DOTTED_NOTES, "" + MidicaPLExporter.DEFAULT_USE_DOTTED_NOTES );
dcDefaults.put( DC_USE_DOTTED_RESTS, "" + MidicaPLExporter.DEFAULT_USE_DOTTED_RESTS );
dcDefaults.put( DC_USE_TRIPLETTED_NOTES, "" + MidicaPLExporter.DEFAULT_USE_TRIPLETTED_NOTES );
dcDefaults.put( DC_USE_TRIPLETTED_RESTS, "" + MidicaPLExporter.DEFAULT_USE_TRIPLETTED_RESTS );
dcDefaults.put( DC_ORPHANED_SYLLABLES, "" + MidicaPLExporter.DEFAULT_ORPHANED_SYLLABLES );
dcDefaults.put( DC_KARAOKE_ONE_CHANNEL, "" + MidicaPLExporter.DEFAULT_KARAOKE_ONE_CHANNEL );
dcDefaults.put( DC_EXTRA_GLOBALS_STR, MidicaPLExporter.DEFAULT_EXTRA_GLOBALS_STR );
Expand Down Expand Up @@ -693,28 +701,36 @@ private static void restoreDefaultKeyBindings() {
addDefaultKeyBinding( Dict.KEY_DC_TAB_CHORDS, KeyEvent.VK_NUMPAD3, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_CHORDS, KeyEvent.VK_3, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_CHORDS, KeyEvent.VK_NUMPAD3, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_4, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_NUMPAD4, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_4, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_NUMPAD4, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_5, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_NUMPAD5, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_5, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_NUMPAD5, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_NOTE_REST, KeyEvent.VK_4, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_NOTE_REST, KeyEvent.VK_NUMPAD4, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_NOTE_REST, KeyEvent.VK_4, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_NOTE_REST, KeyEvent.VK_NUMPAD4, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_5, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_NUMPAD5, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_5, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_KARAOKE, KeyEvent.VK_NUMPAD5, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_6, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_NUMPAD6, 0 );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_6, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TAB_SLICES, KeyEvent.VK_NUMPAD6, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_ADD_TICK_COMMENTS, KeyEvent.VK_T, 0 );
addDefaultKeyBinding( Dict.KEY_DC_ADD_CONFIG, KeyEvent.VK_C, 0 );
addDefaultKeyBinding( Dict.KEY_DC_ADD_SCORE, KeyEvent.VK_Q, 0 );
addDefaultKeyBinding( Dict.KEY_DC_ADD_STATISTICS, KeyEvent.VK_S, 0 );
addDefaultKeyBinding( Dict.KEY_DC_NOTE_LENGTH_STRATEGY, KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MAX_TARGET_TICKS_ON, KeyEvent.VK_L, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_NEXT_ON, KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MIN_DUR_TO_KEEP, KeyEvent.VK_K, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_DUR_TICK, KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_DUR_RATIO, KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MIN_DUR_TO_KEEP, KeyEvent.VK_K, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_TOL_NEXT_ON, KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_MAX_TARGET_TICKS_ON, KeyEvent.VK_L, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_PREDEFINED, KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_NOTE_ON, KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_NOTE_OFF, KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_CRD_VELOCITY, KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_USE_DOT_NOTES, KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_USE_DOT_RESTS, KeyEvent.VK_D, InputEvent.ALT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_USE_TRIP_NOTES, KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_USE_TRIP_RESTS, KeyEvent.VK_T, InputEvent.ALT_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_KAR_ORPHANED, KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_KAR_ONE_CH, KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK );
addDefaultKeyBinding( Dict.KEY_DC_FLD_GLOB_SINGLE, KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK );
Expand Down
Loading

0 comments on commit 02a127c

Please sign in to comment.