vmf_converter.core.vmf_converter_core module

Main logic for parsing a VMF file.

vmf_converter.core.vmf_converter_core.convert_score_to_vmf(score)[source]

Converts a MIDI file to an vmf file.

Parameters:score – The music21 score to convert to VMF.
Returns:A dictionary containing the VMF data structure.
vmf_converter.core.vmf_converter_core.convert_voices_to_parts(score, id_map)[source]

Removes polyphonic voices and replaces them with part representations of its voices.

Parameters:
  • score – The music21 score to scan.
  • id_map – A mapping of music21 ids to vmf part ids.
vmf_converter.core.vmf_converter_core.find_number_of_notes_in_tick(tick)[source]

Finds the number of notes in a tick.

Parameters:tick – The tick to evaluate.
Returns:An integer representing the number of notes.
vmf_converter.core.vmf_converter_core.read_vmf_file(vmf_score)[source]

Reads VMF to Score Stream.

Parameters:vmf_score – The path of the VMF file to read.
Returns:A music21 score instance containing the music in the VMF file.
vmf_converter.core.vmf_converter_core.read_vmf_string(vmf_string)[source]

Reads VMF data from a string to a Score Stream.

Parameters:vmf_string – The contents of the VMF file as a string.
Returns:A music21 score instance containing the music in the VMF file.
vmf_converter.core.vmf_converter_core.scan_score_durations(score)[source]

Scans the entire score for rhythmic analysis. This scan determines the smallest note value necessary to accurately encode the score in vmf.

Parameters:score – The input score stream to analyze.
Returns:An integer denoting the smallest fraction of a quarter note

necessary to accurately encode the score in vmf.

vmf_converter.core.vmf_converter_core.scan_score_for_largest_chord(score)[source]

Scans the entire score for the largest chord. This determines how many notes entries should be available in a tick.

Parameters:score – The music21 score to scan.
Returns:An integer denoting the size of the largest chord.
vmf_converter.core.vmf_converter_core.scan_score_for_number_of_voices(score)[source]

Scans the entire score to determine how many voices there are.

Parameters:score – The music21 score to scan.
Returns:The number of parts in the score.