Source code for iMaT.src.cli.menu_entries

"""
Module: cli.menu_entries.py
===========================

This module provides functionalities to construct the entries for various menus used within the command-line interface (CLI) of the Interactive Music Analysis Tool (I-MaT).

This module is responsible for constructing the menu entries for different sections of the command line interface (CLI)
of the Interactive Music Analysis Tool (I-MaT). The menus are used to navigate through the CLI, and the functions
in this module return the entries for each menu in a structured format.

Functions
---------
- `mainmenu_environment_settings_entries`: Returns the menu entries for the main environment settings menu.
- `mainmenu_single_musical_piece_entries`: Returns the menu entries for the single musical piece menu.
- `mainmenu_tokenization_entries`: Returns the menu entries for the tokenization menu.
- `start_menu_entries`: Returns the menu entries for the start menu.
- `submenu_single_musical_piece_basic_functions_entries`: Returns the menu entries for the basic functions submenu.
- `submenu_single_musical_piece_pattern_search_entries`: Returns the menu entries for the pattern search submenu.
- `submenu_single_musical_piece_statistical_analysis_page1_entries`: Returns the menu entries for the first page of the statistical analysis submenu.
- `submenu_single_musical_piece_statistical_analysis_page2_entries`: Returns the menu entries for the second page of the statistical analysis submenu.
- `submenu_single_musical_piece_visualizations_entries`: Returns the menu entries for the visualizations submenu.
- `submenu_tokenization_calculations_entries`: Returns the menu entries for the calculations submenu in tokenization.
- `submenu_tokenization_refine_data_entries`: Returns the menu entries for the refine data submenu in tokenization.

Each function returns a dictionary representing the menu entries for a specific menu. The dictionary includes the
menu text to be displayed, the function to be executed when the menu entry is selected, and other relevant information.

These functions allow for easy modification of the menu structure and contents, providing flexibility in the design
and functionality of the CLI. The module aids in ensuring that the command-line interface remains user-friendly
and intuitive, providing clear navigation and straightforward access to the tool's functionalities.
"""
from iMaT.src.analysis.functions import analysis_advanced_calculate_activity_rate, \
    analysis_advanced_compare_pitches_and_pitch_classes_per_duration, analysis_ambitus, \
    analysis_number_of_intervals_per_type, analysis_number_of_intervals_per_type_with_direction, \
    analysis_number_of_notes, analysis_number_of_pitch_classes_per_metrical_position, \
    analysis_number_of_pitch_classes_per_offset, analysis_number_of_pitch_classes_per_tone_duration, \
    analysis_number_of_pitches_per_metrical_position, analysis_number_of_pitches_per_offset, \
    analysis_number_of_pitches_per_tone_duration, analysis_number_of_rests, analysis_number_of_rests_per_rest_duration, \
    analysis_number_of_sound_events_per_metrical_position, analysis_number_of_sound_events_per_pitch, \
    analysis_number_of_sound_events_per_pitch_class, analysis_number_of_sound_events_per_tone_duration
from iMaT.src.analysis.main import analysis_workflow_single_musical_piece
from iMaT.src.conversion.main import convert_multiple_files_filetype
from iMaT.src.m21_environment.main import display_environment_file, set_user_preferences
from iMaT.src.pattern_search.functions import pattern_search_only_rhythm, \
    pattern_search_with_transposition_with_rhythm, \
    pattern_search_with_transposition_without_rhythm, \
    pattern_search_without_transposition_with_rhythm, pattern_search_without_transposition_without_rhythm
from iMaT.src.pattern_search.main import pattern_search_workflow_single_musical_piece
from iMaT.src.visualizations.main import generic_display_workflow
from iMaT.src.score_selection.main import score_selection
from iMaT.src.tokenization.main import tokenization_tokenize_folder_midi_files
from iMaT.src.tokenization.refine_results.absolute_duration import \
    corpus_tokenization_refine_data_absolute_duration
from iMaT.src.tokenization.refine_results.calculate_pitch_intervals import \
    tokenization_calculate_pitch_intervals
from iMaT.src.tokenization.refine_results.remove_prefixes import \
    corpus_tokenization_refine_data_remove_prefixes
from iMaT.src.tokenization.refine_results.tokens_to_txt import tokenization_export_csv_columns_to_txt_file
from iMaT.src.utils.misc import change_part_names, show_metadata, show_part_names
from iMaT.src.visualizations.m21_integrated import play_midi_score, show_chord_connections, show_chord_scale_system, \
    show_figured_bass, show_key_analysis, show_musescore, show_pianoroll, show_voice_progression, show_volume_change


[docs]def start_menu_entries(): """ Entry point for the program, allowing navigation through various functionalities. Level: Root This function defines the top level menu of the application. It provides options to either analyze a single sheet music file, convert multiple music files, tokenize multiple music files, or update the software paths and preferences. """ return { "menu_displayed_text": [ "LOCATION: Start Menu", "Please make a selection from the options below by entering the entry index number:", "Which menu item should be executed? (<No. of menu item>): ", ["Menu item", "<Explanation>"], ], "menu_entries": [ ["PROG: Analysis of one sheet music file", mainmenu_single_musical_piece_entries, "<Analysis of a single piece of music>"], ["CONV: Conversion of multiple music files", convert_multiple_files_filetype, "<Conversion of multiple music files within one folder>"], ["TOKE: Tokenisation of multiple music files", mainmenu_tokenization_entries, "<Tokenisation of multiple music files within one folder>"], ["CONF: Update Software Paths and Preferences", mainmenu_environment_settings_entries, "<Update or redefine paths to essential software and user preferences>"], ] }