ABC Interface

muspy.read_abc(path: Union[str, pathlib.Path], number: Optional[int] = None, resolution=24) → List[muspy.music.Music][source]

Return an ABC file into Music object(s) using music21 backend.

Parameters:
  • path (str or Path) – Path to the ABC file to read.
  • number (int) – Reference number of a specific tune to read (i.e., the ‘X:’ field).
  • resolution (int, optional) – Time steps per quarter note. Defaults to muspy.DEFAULT_RESOLUTION.
Returns:

Converted Music object(s).

Return type:

list of muspy.Music

muspy.write_abc(path: Union[str, pathlib.Path], music: Music)[source]

Write a Music object to a ABC file.

Parameters:
  • path (str or Path) – Path to write the ABC file.
  • music (muspy.Music) – Music object to write.