vmf-converter

A music21 converter for the VMF file format.

Contents:

vmf_converter package

Converter utilities for the vector music format (VMF).

Subpackages

vmf_converter.core package

Submodules
vmf_converter.core.articulation_converter module
class vmf_converter.core.articulation_converter.ArticulationConverter[source]

Converts between music21 and VMF articulations

classmethod articulation_to_vmf(articulation)[source]

Converts and articulation to a vmf articulation

Parameters:articulation – The music21 articulation
Returns:The vmf encoding
classmethod vmf_to_articulation(vmf)[source]

Converts a vmf encoding to an articulation

Parameters:vmf – The vmf value
Returns:An articulation object.
vmf_converter.core.dynamic_converter module
class vmf_converter.core.dynamic_converter.DynamicConverter[source]

Converts between velocities and VMF dynamics.

classmethod velocity_to_vmf(velocity)[source]

Converts a midi velocity to a VMF dynamic symbol.

Parameters:velocity – The midi velocity.
Returns:A value representing a dynamic in VMF.
classmethod vmf_to_velocity(vmf_value)[source]

Converts a VMF dynamic value to a velocity.

Parameters:vmf_value – The dynamic value in VMF format.
Returns:The corresponding MIDI velocity value.
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.

Submodules

vmf_converter.vmf_converter module