ABC Interface

muspy.read_abc(path, number=None, resolution=24)[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, optional) – Reference number of a specific tune to read (i.e., the ‘X:’ field). Defaults to read all tunes.

  • resolution (int, default: muspy.DEFAULT_RESOLUTION (24)) – Time steps per quarter note.

Returns:

Converted Music object(s).

Return type:

list of muspy.Music

muspy.write_abc(path, music, **kwargs)[source]

Write a Music object to an ABC file.

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

  • music (muspy.Music) – Music object to write.